<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
	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
?>


<h2 align=center><i>Admin view Duty Time</i></h2>

<h3 align=center>Search for user detail</h3>
<?php 
echo "<center><a href=adminaccount.php>Back&nbsp;Menu</a></center>";

echo"
<form action='http://www.wauhaha.com/karaoke/searchingbooking2.php' method='post'>
<table border='2' cellspacing='0' cellpadding='5' bordercolorlight='tan' align=center>
<tr>
	<td>Search by:</td>
	<td><select name='searchBy'>
	<option value='Username'>Username</option>
	<option value='Name'>Name</option>
	</select>
	</td>
	<td rowspan='2'><input type='submit' name='search' value='Search'>&nbsp;&nbsp;&nbsp;&nbsp;
	
	</td>
</tr>
<tr>
	<td>Keywords:</td>
	<td><input type='text' name='keywords'></td>
</tr>
</table>

</form>";

?>

<?php
echo "<center><h4><b><u>Duty Management</u></b></h4></center>";

$result2 = mysql_query("SELECT * FROM staff ORDER BY Username");

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>Username</th>
	<th>Name</th>
	<th colspan=2>Function</th>
 </tr>";
 
 while($row2 = mysql_fetch_array($result2)){
  $username=$row2['Username'];
  
  echo"<tr align='center' border=1>";
	
  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/adminarrangeduty.php?username=$username />Arrange</a></td>";
  echo "<td border=1><a href=http://www.wauhaha.com/karaoke/adminviewduty.php?username=$username />view</a></td>";
  
  echo "</tr>";
 
  }
  echo "</table>";

mysql_close($login);
?>
</body>
</html>