<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/addstock.php?SupID=$SupID ><img src=back.jpg width=40 height=40></a>&nbsp;</center>";
?>
<?php


$query=mysql_query("select * from stock where $searchBy  like '%$keyword%'  ");
			if(mysql_num_rows($query)==0){
				echo "<center>No results<br><a href=http://www.wauhaha.com/karaoke/addstock.php>Back to my menu</a></center>";die();
			}
			else{
			echo "<table border=3 align=center style ='font-family:Arial, Helvetica, sans-serif;font-size:1em' color='blue' bordercolorlight='tan' cellspacing=0 cellpadding=4>
 <tr bgcolor=lightblue ><th align=center>Product ID</th>
						<th align=center>Product Name</th>
						
						<th align=center>Product Remain Quantity</th>
						<th colspan=3 align=center>Function</th>
						</tr>";
						
while($row2=mysql_fetch_array($query)){	
$ProID = $row2['ProID'];				
echo "					<tr>
							<td align=center> ".$row2['ProID']."</td>
							<td align=center>".$row2['ProName']."</td>
							<td align=center>".$row2['ProRQuan']."</td>
							
							<td><a href='addstock1.php?ProID=$ProID ' ><img src=add1.jpg width=30 height=30></td>
							<td><a href='editstock.php?ProID=$ProID' ><img src=edit.jpg width=30 height=30></td>
							<td><a href='deletestock.php?ProID=$ProID '><img src=delete.png width=30 height=30></td>
					
							
							
							
							
							
						</tr>";




}
}	?>
</body>
</html>