Location: PHPKode > scripts > Create Your Own Directory > cms/admin/index.php
<?php
include "authheader.php";

if($block != true)
{
?>

<!-- Welcome to the scripts database of HIOX INDIA      -->
<!-- This tool is developed and a copyright             -->
<!-- product of HIOX INDIA.				        -->
<!-- For more information visit http://www.hscripts.com -->

<html>
<head>

<script language="javascript">
function row(checkBox){
    var bgColor = checkBox.checked ? "#ced0c0" : "";
    var el = checkBox.parentNode;
    while(el.tagName.toLowerCase() != "tr"){
        el = el.parentNode;
    }
    el.style.backgroundColor = bgColor;
}

function ckbox() {
  var abc = document.getElementById('ckt');
  var aa = document.getElementById('check');
    for (var i =0; i < aa.elements.length; i++)
    {
      if (abc.checked)
	aa.elements[i].checked = true;
      else{
	aa.elements[i].checked = false;
	}	
      row(aa.elements[i]);
    }	
}

</script>

<style>
.ta{background-color: ffff44;}
.rad{color:red; font-weight:bold; background-color: ffff44;}
.head{font-size: 17px; color: white; font-family: verdana, arial, san-serif;}
.links{font-size: 13px; color: white; font-family: verdana, arial, san-serif; text-decoration:none;}
.maintext{font-size: 13px; color: #fefefe; font-family: verdana, arial, san-serif; padding:20px;}
</style>
</head>
<body style="margin: 0px;">
<?php include "heade.php" ?>
<br>
<table align=center border=0 bgcolor=#f8f8ff  width=80%>
<tr><td align=center>

<div align=center style="color: 000000">
<table width=100%>


<?php
	$rev = $_POST['rev'];
	$start = $_GET['start'];
	if($start == "")
		$start = 0;
	$id = $_GET['id'];
	if($id == "")
		$id = $_POST['id'];;

	if($id != "" && $rev == "true")
	{
		$name = $_POST['nam'];
		$com = $_POST['com'];
		$url1 = $_POST['url'];
		$email = $_POST['email'];
		$sub = $_POST['submit'];

		if($sub == "submit"){
			mysql_query("update comments set name='$name', review='$com', email='$email',url='$url1', status='yes' where id like '$id'", $link);
			echo "The review has been updated.";
		}
		else if($sub == "delete"){
			mysql_query("delete from comments where id like '$id'", $link);
			echo "The review has been deleted.";
		}
		
	}
	else if($id != "")
	{
		$res2 = mysql_query("select * from comments where id like '$id'", $link);
		if($line = mysql_fetch_array($res2, MYSQL_ASSOC))
		{
			$name = $line['name'];
			$com = $line['review'];
			$url = $line['url'];
			$email = $line['email'];

			echo "<table align=center bgcolor=white cellpadding=0 cellspacing=0>";
			echo "<form name=de action=index.php method=post>";
			echo "<tr><td>Name</td><td><input type=text name=nam value=$name size=40></input></td></tr>";
			echo "<tr><td>Email</td><td><input type=text name=email value=$email size=40></input></td></tr>";
			echo "<tr><td>URL</td><td><input type=text name=url value=$url size=45></input></td></tr>";
			echo "<tr><td>Comment</td><td><textarea name=com rows=5 cols=45>$com</textarea></td></tr>";
			echo "<tr><td> </td><td> <br> </td></tr>";
			echo "<tr><td> </td><td> 
			<input name=id type=hidden value=$id>
			<input name=rev type=hidden value=\"true\">
			<input name=submit type=submit value=submit>
			<input name=submit type=submit value=delete> </td></tr>";
			echo "</form>";
		}
	}
	else
	{
		$next = $start+10;
		$prev = $start-10;
		if($prev < 10)
			$prev=0;
		
	/*Delete using Check box*/
	
		$ddee = $_GET['del'];
		$chec = $_GET['mybox'];
			
		if($ddee == 'dele'){  
		  foreach ($chec as $i => $value2){
		  if (isset($delstr))
			  $delstr =  $delstr.","."'"."$value2" ."'";
		  else
			  $delstr =  "'"."$value2" ."'";
		  }
		$rese = mysql_query("delete from comments where id IN($delstr)",$link);
		}

	/*End of delete function */

		echo "<a href=?start=$prev>&lt;&lt;PREV</a>   Showing $start to $next <a href=?start=$next>NEXT&gt;&gt;</a><br>";
		$res2 = mysql_query("select * from comments where status like 'no' order by dat limit $start,10", $link);
		echo "<table bgcolor=#efefef width=100% border=0
		style=\"color: 343434;\"  align=center>";
		echo "<tr align=center bgcolor=#b0e2ff style=\"color: #000000;\">
                    <form id=chh method=GET action='index.php'> <td align=center>
                    <input id=ckt type=checkbox onClick='ckbox()'>
                    </form></td>";
                echo "<td>NAME</td><td>Message</td><td> URL </td><td> </td></tr>";
		
		$xx=0;
		$d=0;

		while($line = mysql_fetch_array($res2, MYSQL_ASSOC))
		{
			$id = $line['id'];
			$name = $line['name'];
			$com = $line['review'];
			$url = $line['url'];
			$len = strlen($url);
			if($len > 30)
			{
				$url1 = substr($url,$len-30,$len);
				$url1 = ".......".$url1;
			}
			else{
				$url1 = $url;
			}
			
			echo "<tr align=center bgcolor=#FFFFFF>";
			echo "<form id=check name=check method=GET action='index.php'><td align=center>
			<input id=xxx type=checkbox name=mybox[$d] value=$id  onclick=row(this)></td>"; 
			echo "<td>$name</td><td>$com</td>
			<td><a target=_blank  href=$url style=\"text-decoration: none; color: 0000ff;\"> $url1 </td>
			<td><b><a href=\"?id=$id\" style=\"text-decoration: none; color: green;\">review</a></b></td></tr>";
			$xx++;
			$d++;
		}
		
		echo "<tr align=left><td valign=top colspan=5>
                <input type=hidden name=del value=dele>
                <input type=submit value=delete style='background-color:#eeeeff; color:blue;hover:white;
                cursor:pointer; border:0px; font-size: 13px; font-family: arial, verdana, san-serif;'></td></tr></form>";
		
	}
	echo "</table>";
?>
</table>
</div>
</td></tr>
<!-- content row -->

<tr><td width=100% align=right>
a product by &copy; <a href="http://www.hscripts.com" 
style="font-size: 14px; color: 347777; text-decoration:none;">hscripts.com</a> 
&nbsp; &nbsp; &nbsp; &nbsp;
</td></tr>
</table>
<!-- main table -->

</td></tr>
</table>
<tr><td height=20 bgcolor=white>
</td></tr></table>

</body>
</html>

<!-- Welcome to the scripts database of HIOX INDIA      -->
<!-- This tool is developed and a copyright             -->
<!-- product of HIOX INDIA.				        -->
<!-- For more information visit http://www.hscripts.com -->


<?php
}
?>
Return current item: Create Your Own Directory