<body style="background-color: #ffffff;background-image:url(rail.jpg);background-repeat: repeat-y">	
<h2 align=center><i>Staff view Food Transaction</i></h2>
<?php 
$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
mysql_selectDB("wauhaha_karaoke",$login);
$StaffID = $_GET['StaffID'];

include('link3.php');
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$start_from = ($page-1) * 5; 
$result = mysql_query("SELECT * FROM sstock order by SNum DESC LIMIT $start_from,5");
echo "<center><a href='kit_staffaccount.php?StaffID=$StaffID'>Back</a></center>";
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>Product</th>	
						<th>Price</th>
						<th>Quantity</th>
 						<th>Total</th>
					
						<th>Date</th>
					
						<th>Time</th>
				";
		
						

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

  echo"<tr align='center' border=1>";
	
  echo "<td border=1>".$row2['ProName']."</td>";
  echo "<td border=1 width=70>RM".$row2['ProPrice']."</td>";
  echo "<td border=1>".$row2['Quan']."</td>";
  echo "<td border=1 width=70>RM".$row2['Total']."</td>";

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

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


	


  
  echo "</tr>";
 
  }
  $sql = mysql_query("select COUNT(*) From stocktran");  

$row=mysql_fetch_array($sql);
$total_records = $row[0];
$total_pages = ceil($total_records / 5);
echo "<center>";
for ($i=1; $i<=$total_pages; $i++) { 
	echo "<a href='viewfoodt.php?page=".$i."'>&nbsp;" .$i. "&nbsp;</a>"; 
}; 
echo "</center>";
  echo "</table>";

mysql_close($login);
?>