<html>
<head>
<title>Edit Stock</title>
</head>
<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>
<center><h1>Admin View Purchase Order Details</h1></center>

<?PHP

$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
mysql_selectDB("wauhaha_karaoke",$login);
$SupID=$_GET['SupID'];
echo "<center><a href=addstock.php?SupID=$SupID><img src=back.jpg width=60 height=60></a></center><br>";
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$start_from = ($page-1) * 5; 
$result = mysql_query("SELECT * FROM porder order by ProID ASC LIMIT $start_from,5");

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 ID</th>
						<th>Supplier Name</th>
						<th>ProDuct Name</th>
						<th>ProDuct Quantity</th>
						<th>Purchase Date</th>
				";
						

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

  echo"<tr align='center' border=1>";
	
  echo "<td border=1>".$row2['ProID']."</td>";
  echo "<td border=1>".$row2['SupName']."</td>";
  echo "<td border=1>".$row2['ProName']."</td>";
  echo "<td border=1>".$row2['ProQuan']."</td>";
  echo "<td border=1>".$row2['Date']."</td>";
 
	


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

$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='viewpo.php?page=".$i."'>&nbsp;" .$i. "&nbsp;</a>"; 
}; 
echo "</center>";
  echo "</table>";

mysql_close($login);

?>