<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 Room Transaction</i></h2>

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

<form action='http://www.wauhaha.com/karaoke_online/searchingbooking.php' method='post'>
<table border='1' 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>
	<option value='IC'>IC</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
 

if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$start_from = ($page-1) * 10; 
$result2 = mysql_query("SELECT * FROM roomtrans ORDER BY date DESC LIMIT $start_from,10");
$sql = mysql_query("select COUNT(*) From roomtrans");  


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>Name</th>
						<th>IC</th>
						<th>Contact</th>
						<th>RoomType</th>
						<th>Package1</th>
						<th>People1</th>
						<th>Price1</th>
					
						<th>Package2</th>
						<th>People2</th>
						<th>Price2</th>
				
				
						<th>Total</th>
						<th>Date</th>
						<th>Time</th>
						<th>Book Time</th>
						<th>Hours</th>
						
						</tr>";


while($row2 = mysql_fetch_array($result2)){

  
  echo"<tr align='center' border=1>";
	

  echo "<td border=1>".$row2['Name']."</td>";
  echo "<td border=1>".$row2['IC']."</td>";
  echo "<td border=1>".$row2['Contact']."</td>";
  echo "<td border=1>".$row2['roomtype']."</td>";
  echo "<td border=1>".$row2['package1']."</td>";
  echo "<td border=1>".$row2['people1']."</td>";
  echo "<td border=1>Rm".$row2['price1']."</td>";
  
  echo "<td border=1>".$row2['package2']."</td>";
  echo "<td border=1>".$row2['people2']."</td>";
  echo "<td border=1>Rm".$row2['price2']."</td>";


  echo "<td border=1>Rm".$row2['Total']."</td>";
  echo "<td border=1>".$row2['date']."</td>";
  echo "<td border=1>".$row2['time']."</td>";
  echo "<td border=1>".$row2['booktime']."</td>";
  echo "<td border=1>".$row2['hours']."</td>";

  
  echo "</tr>";
 
  }
  echo "</table>";


?>
	</body>
</html>	