	<?php
	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
	
	$StaffID=$_GET['StaffID'];
	
$result2 = mysql_query("select * from staff where StaffID='$StaffID'");
$row2=mysql_fetch_array($result2);
$user= $row2['Username'];

echo "<table border='0' align=center>
<tr>
	<td><a href='http://www.wauhaha.com/karaoke/staffviewmem.php?StaffID=$StaffID'><img src=member_button.jpg width=110 height=110 border=0/><br/><h4 align='center'>Member</h4></a></td>
	<td><a href='http://www.wauhaha.com/karaoke/staffviewsalary.php?StaffID=$StaffID'><img src=money_button.jpg width=110 height=110 border=0/><br/><h4 align='center'>Salary</h4></a></td>
	<td><a href='http://www.wauhaha.com/karaoke/staffviewduty.php?StaffID=$StaffID'><img src=duty_button.jpg width=110 height=110 border=0/><br/><h4 align='center '>Duty Time</h4></a></td>
	<td><a href='room1.php?StaffID=$StaffID' target=_window><img src=room_button.jpg width=110 height=110 border=0/><br/><h4 align='center'>Room</h4></a></td>
	<td><a href='credit1.php?StaffID=$StaffID'.php><img src=Money.jpg width=110 height=110 border=0/><br/><h4 align='center'>Credit</h4></a></td>
	<td><a href='vleave.php?Username=$user' target=_window><img src=leave_button.jpg width=110 height=110 border=0/><br/><h4 align='center '>Leave</h4></a></td>
</tr>
</table>";
?>
<body style="background-color: #ffffff;background-image:url(rail.jpg);background-repeat: repeat-y">

<h2 align=center><i>Staff view Member</i></h2>


<?php 
echo "<center><a href=staffaccount.php?StaffID=$StaffID><img src=back.jpg width=40 height=40></a></a></center>";
?>


<?php
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$start_from = ($page-1) * 5; 
$result2 = mysql_query("SELECT * FROM regmember ORDER BY MemID ASC LIMIT $start_from,5");
$sql = mysql_query("select COUNT(*) From regmember");  

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

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>Credit</th>
						<th>Password</th>
						<th>Name</th>
						<th>Gender</th>
						<th>BYear</th>
						<th>BMonth</th>
						<th>BDay</th>
						<th>Address1</th>
						<th>Postcode</th>
						<th>IC</th>
						<th>Email</th>
						<th>Phone</th>
						<th>HPhone</th>
						<th>Occupation</th>
						<th>Function</th>
						</tr>";


while($row2 = mysql_fetch_array($result2)){
  $MemID=$row2['MemID'];
  
  echo"<tr align='center' border=1>";
	
  echo "<td border=1>".$row2['Username']."</td>";
  echo "<td border=1>".$row2['Credit']."</td>";
  echo "<td border=1>".$row2['Password']."</td>";
  echo "<td border=1>".$row2['Name']."</td>";
  echo "<td border=1>".$row2['Gender']."</td>";
  echo "<td border=1>".$row2['BYear']."</td>";
  echo "<td border=1>".$row2['BMonth']."</td>";
  echo "<td border=1>".$row2['BDay']."</td>";
  echo "<td border=1>".$row2['Address1']."</td>";
  echo "<td border=1>".$row2['Postcode']."</td>";
  echo "<td border=1>".$row2['IC']."</td>";
  echo "<td border=1>".$row2['Email']."</td>";
  echo "<td border=1>".$row2['Phone']."</td>";
  echo "<td border=1>".$row2['HPhone']."</td>";
  echo "<td border=1>".$row2['Occupation']."</td>";
  echo "<td border=1><a href=http://www.wauhaha.com/karaoke/staffaddcredit.php?MemID=$MemID target=_window /><img src=add.jpg width=20 height=20></a></td>";
  
  echo "</tr>";
 
  }
  echo "</table>";

mysql_close($login);
?>
