<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><h2>View Credit Transaction</h2>
</center>
	<?php

	
	$searchBy=$_POST["searchBy"];
	$keyword=$_POST["keywords"];
	
	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);	
	
	?>
<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/dutytime.php>Back</a></center>";
?>
<?php

$query=mysql_query("select * from staff where $searchBy  like '%$keyword%'  ");
			if(mysql_num_rows($query)==0){
				echo "<center>No results<br><a href=http://www.wauhaha.com/karaoke/salary.php>Back to my menu</a></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>Staff ID</th>
						<th>Username</th>
						<th>Name</th>
						<th colspan=2>Function</th>
						</tr>";


while($row2 = mysql_fetch_array($query)){
  $StaffID=$row2['StaffID'];
  
  echo"<tr align='center'>";
	
  echo "<td border=1>".$row2['StaffID']."</td>";
  echo "<td border=1>".$row2['Username']."</td>";
  echo "<td border=1>".$row2['Name']."</td>";
  echo "<td border=1><a href=http://www.wauhaha.com/karaoke/adminarrangedt1.php?StaffID=$StaffID />Arrange</a></td>";
  echo "<td border=1><a href=http://www.wauhaha.com/karaoke/adminviewdt.php?StaffID=$StaffID />View</a></td>";
  
  echo "</tr>";
 
  }
  echo "</table>";
	}
		
?>
</body>
</html>