<html>

<body style="background-color: #ffffff;background-image:url(rail.jpg);background-repeat: repeat-y">
<center>
<table>
	<tr>	
		<td><a href="http://www.wauhaha.com/karaoke/adminaccount.php"><img src=admin.gif width=140 height=140 border=0/><br/></a></td>
		<td><a href="http://www.wauhaha.com/karaoke/adminviewmem.php"><img src=member.gif width=140 height=140 border=0/><br/></a></td>
		<td><a href="http://www.wauhaha.com/karaoke/adminviewstaff.php"><img src=staff.gif width=140 height=140 border=0/><br/></a></td>
		<td><a href="http://www.wauhaha.com/karaoke/dutytime.php"><img src=duty.gif width=140 height=140 border=0/><br/></a></td>
		<td><a href="http://www.wauhaha.com/karaoke/salary.php"><img src=salary.gif width=140 height=140 border=0/><br/></a></td>
		<td><a href=adminhistory.php><img src=leave.gif width=140 height=140 border=0/><br/></a></td>
		<td><a href=adminhistory.php><img src=job.gif width=140 height=140 border=0/><br/></a></td>
		<td><a href=adminhistory.php><img src=advertisement.gif width=140 height=140 border=0/><br/></a></td>
		<td><a href="http://www.wauhaha.com/karaoke/room.php"><img src=room.gif width=140 height=140 border=0/><br/></a></td>
		
	</tr>
</table>
</center>
<?php

	
	$searchBy=$_POST["searchBy"];
	$keyword=$_POST["keywords"];
	
	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);	
	$SupID=$_GET['SupID'];
	?>
<html>
<head>
<title>
Admin search view
</title>
</head>
<body >



<h2 align=center><i>Searching result</i></h2>
<?php 
	echo "<center><a href=http://www.wauhaha.com/karaoke/viewtrans.php ><img src=back.jpg width=40 height=40></a>&nbsp;</center>";
?>
<?php


$query=mysql_query("select * from stocktran where $searchBy  like '%$keyword%'  ");
			if(mysql_num_rows($query)==0){
				echo "<center>No results<br></center>";die();
			}
			else{
			echo "<table border=1 align=center style ='font-family:Arial, Helvetica, sans-serif;font-size:1em' color='blue' bordercolorlight='tan' cellspacing=0 cellpadding=4>
 <tr bgcolor=lightblue ><th>Tran ID</th>	
 						<th>Sup Name</th>
						<th>ProID</th>
						<th>ProName</th>
					
						<th>ProAddQuan</th>
				
						<th>ProPrice</th>
						<th>ProTPrice</th>
						<th>Date</th>
						<th>Edit Date</th>
						<th colspan=2>Funtion</th>";
						

while($row2 = mysql_fetch_array($query)){
  $TID=$row2['TID'];
  echo"<tr align='center' border=1>";
	
  echo "<td border=1>".$row2['TID']."</td>";
  echo "<td border=1>".$row2['SupName']."</td>";
  echo "<td border=1>".$row2['ProID']."</td>";
  echo "<td border=1>".$row2['ProName']."</td>";

  echo "<td border=1>".$row2['ProAddQuan']."</td>";

  echo "<td border=1>".$row2['ProPrice']."</td>";
  echo "<td border=1>".$row2['ProTPrice']."</td>";
  echo "<td border=1>".$row2['Date']."</td>";
  echo "<td border=1>".$row2['EditDate']."</td>";
  echo "<td border=1><a href=http://www.wauhaha.com/karaoke/editran.php?TID=$TID /><img src=edit.jpg width=20 height=20></a></td>";
  echo "<td border=1><a href=http://www.wauhaha.com/karaoke/deltran.php?TID=$TID /><img src=delete.png width=20 height=20></a></td>";


  
  echo "</tr>";
 
  }
  echo "</table>";
}
mysql_close($login);

?>
</body>
</html>