Location: PHPKode > scripts > Create Your Own Directory > cms/admin/cntrevlist.php
<?php
include "authheader.php";
?>
<!-- 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>
<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" ?>
<table border=0 width=790 height=100%  cellpadding=0 cellspacing=0 align=center>
<tr><td align=center>
</td></tr>
<!-- content row -->
<tr bgcolor=#efefff><td align=right>
</td></tr>
<tr height=95%><td class=maintext valign=top>
<script language=javascript>
function search()
{
document.sform.ser.value="search";
}
</script>
<?php
      $serstr=$_POST['ser'];
      $sstr=$_POST['searchtx'];
      $start = $_GET['start'];
	$sub = $_POST['sub'];
	$ref = $_POST['ref'];
	if($sno=="")
		$sno=0;
	if($start == "")
		$start = 0;
	$title = $_POST['title'];
      $tid=$_POST['tid'];
	$authname = $_POST['authname'];
	$cstatus=$_POST['cstatus'];
?>
<div align=center style="color: green;">
	<form name=sform method=post>
	<table border=0><tr>
		
	<td><select name=title >
		<?php
			echo "<option value=%%>ALL</option>";
			$str="select contents as aaa from cnt order by contents";
			$res2 = mysql_query($str,$link);
			while ($line = mysql_fetch_array($res2, MYSQL_ASSOC))
			{
				$aau = $line['aaa'];
                        $arr=split('####',$aau);
                          
				if($title==$arr[0])
				{
					echo "<option value=\"$arr[0]\" selected>$arr[0]</option>";
				}
				else
				{
					echo "<option value=\"$arr[0]\" >$arr[0]</option>";
				
				}

			}
			echo "</select>";
		?>
	</td>
<td><select name=authname>
		<?php
			echo "<option value=%%>ALL</option>";
			$str1="select distinct(UserName) as bbb from user order by UserName";
			$res2 = mysql_query($str1,$link);
			while ($line = mysql_fetch_array($res2, MYSQL_ASSOC))
			{
				$aau = $line['bbb'];
				if($authname==$aau)
				{
					echo "<option value=\"$aau\" selected>$aau</option>";
				}
				else
				{
					echo "<option value=\"$aau\" >$aau</option>";
				
				}
			}
			echo "</select>";
		?>
	</td>
	<td align=center ><select name=cstatus>
		  <?php
			echo"<option value=%%>ALL</option>";
			if($cstatus == "REV"){
			  	$revd = "selected";
			}else if($cstatus == "TBR"){
			  $tbr = "selected";
			}
			echo "<option value=TBR $tbr>TBR</option>";
			echo "<option value=REV $revd>REV</option>";
			echo "</select>";
		  ?>
		  <input type=hidden name=sub value=yes>
		   <input type=hidden name=tid value=$tid>

		  <input type=hidden name=start value=0>
		  <input type=hidden name=ref value=1>
       
      
		 <input type=submit value=go>
		 <input type=submit value=Refresh onclick=reset()>				
       </td></tr>
       <tr><td align=right colspan=3>
             Search&nbsp;<input type=text name=searchtx value="search string" ></input> <input type=submit value=search onclick=search()>
             <input type=hidden name=ser >
       </td></tr>

	</table>
	</form>

<?php
	
      if($serstr=="search")
      {
      $str="select tid, cntid,contents,UserName,usrid,UserId, tid,adddate,status
	from cnt left join (select  UserName,UserId from user)D on (cnt.usrid=D.UserId) 
	where contents like '%$sstr%'	order by adddate desc limit $start,20";
      }
	else if($sub=="yes")
      {
	$str = "select tid, cntid,contents,UserName,usrid,UserId, tid,adddate,status
	from cnt left join (select  UserName,UserId from user)D on (cnt.usrid=D.UserId) 
	where contents like '$title%' && UserName like '$authname' && status like '$cstatus' order by adddate desc limit $start,20";
      }else
      {
	$str="select tid, cntid,contents,UserName,usrid,UserId, tid,adddate,status
	from cnt left join (select  UserName,UserId from user)D on (cnt.usrid=D.UserId) 
	order by adddate desc limit $start,20";
      }
	//echo"$str";
	$result = mysql_query($str,$link);
	echo "<table border=0 cellpadding=2 style=\"font-size: 14px; color: #000000;\" width=100% align=center border=0 bgcolor=#b0e2ff>";
	echo "<tr align=center><td>S.no</td><td>Id</td><td width=10>Title</td><td>Date</td><td>Name</td><td>&nbsp;</td><td>&nbsp; </td><td>&nbsp; </td><tr>";
	$sno = $sno+$start;
	while ($line = @mysql_fetch_array($result, MYSQL_ASSOC))
	{	
		if($sno%2 == 0)
			$col = "#fffafa";
		else
			$col = "#f0ffff";
 		$tid=$line['tid'];
		$cntid = $line['cntid'];
		$name = $line['UserName'];
		$contents = $line['contents'];
		$adddate = $line['adddate'];
		$status = $line['status'];
		$type = $line['type'];
		$arr=split('####',$contents);
            $title=$arr[0];
		echo "<tr align=center style='font-size:12px; color:#453377;' bgcolor=$col><td> $sno </td><td> $id </td><td width=500> $title </td>
			<td> $adddate </td><td> $name </td>
			<td><a href=\"cntrev.php?tid=$tid&cntid=$cntid&sub=yes\"><img src=../image/write.gif border=0></a> </td>
			<td> <a style=\"color:red;\" href=\"delcnt.php?id=$cntid&sub=delcnt\"><img src=../image/Trash.gif border=0></a> </td></tr>\n";

	$sno = $sno+1;
	}
	echo "</table>";
?>
</td></tr>
<tr><td style="font-size: 14px; padding: 10px;" valign=top align=right>
<?php
$start1=$start+20;
$start2=$start-20;
  if($sno > 20)
{
echo "<a href=cntrevlist.php?char=$char&start=$start2> &lt;&lt;Prev</a>";
}
echo"	&nbsp; &nbsp; &nbsp"; 
if($sno == ($start+20)){
echo"<a href=cntrevlist.php?sub=$yes&start=$start1> Next&gt;&gt;</a>";
}
?>
</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 -->

Return current item: Create Your Own Directory