<html>
<head>
<title>Daily Bookstore - Management System</title>
<!--include css file-->
<link href="bookstaff.css" rel="stylesheet" type="text/css"/>

<!--clock function-->
<script type="text/javascript">
function init ( )
{
  timeDisplay = document.createTextNode ( "" );
  document.getElementById("clock").appendChild ( timeDisplay );
}

function updateClock ( )
{
  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  // Choose either "AM" or "PM" as appropriate
  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  // Convert the hours component to 12-hour format if needed
  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  // Convert an hours component of "0" to "12"
  currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  // Compose the string for display
  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;

  // Update the time display
  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}

// -->
</script>
</head>
<body onload="updateClock(); setInterval('updateClock()', 1000 )">

<table border="0" width="100%">

<tr bgcolor="lightyellow" border="0">
<td colspan="2" rowspan="2"><h2><img src="Picture/Logo.gif"></h2></td>

<td align="center" height="50"><a href="home.php"><img src="Picture/toolbox.gif" width="35" height="35" alt="main menu"></a></td>
<td align="center" height="50"><a href="book.php"><img src="Picture/book.gif" width="35" height="35" alt="manage book"></a></td>
<?php
if(($_SESSION['staff_level']=='IT Staff')||($_SESSION['staff_level']=='IT Staff')){;
?>
<td align="center" height="50"><a href="leavemain.php"><img src="Picture/leave.gif" width="35" height="35" alt="laeve"></a></td>
<?php
}else{
echo "<td align='center' height='50'><a href='addleave.php'><img src='Picture/leave.gif' width='35' height='35' alt='laeve'></a></td>";
}
?>
<td align="center" height="50"><a href="event.php"><img src="Picture/event.gif" width="35" height="35" alt="manage event"></a></td>
<?php
if(($_SESSION['staff_level']=='IT Staff')||($_SESSION['staff_level']=='IT Staff')){;
?>
<td align="center" height="50"><a href="viewmessage.php"><img src="Picture/message.gif" width="35" height="35" alt="Customer Comment"></a></td>
<td align="center" height="50"><a href="memlist.php"><img src="Picture/member.gif" width="35" height="35" alt="manage member"></a></td>
<td align="center" height="50"><a href="stafflist.php"><img src="Picture/admin.gif" width="35" height="35" alt="admin control"></a></td>
<td align="center" height="50"><a href="customerinformation.php"><img src="Picture/list.gif" width="35" height="35" alt="customer control"></a></td>
<td align="center" height="50"><a href="supplierlist.php"><img src="Picture/supplier.gif" width="35" height="35" alt="supplier control"></a></td>
<td align="center" height="50"><a href="salarymain.php"><img src="Picture/salary.gif" width="35" height="35" alt="salary"></a></td>
<td align="center" height="50"><a href="bill.php"><img src="Picture/bill.gif" width="35" height="35" alt="manage bill"></a></td>
<?php
}else{
echo "<td colspan='7'><br/></td>";
}
?>
</tr>

<tr bgcolor="lightyellow" border="0">
<td width='100' align="center"><a href="home.php">Menu</td>
<td width='100' align="center"><a href="book.php">Book</td>
<?php
if(($_SESSION['staff_level']=='IT Staff')||($_SESSION['staff_level']=='IT Staff')){;
?>
<td width='100' align="center"><a href="leavemain.php">Leave</td>
<?php
}else{
echo "<td width='100' align='center'><a href='addleave.php'>Leave</td>";
}
?>
<td width='100' align="center"><a href="event.php">Event</td>
<?php
if(($_SESSION['staff_level']=='IT Staff')||($_SESSION['staff_level']=='IT Staff')){;
?>
<td width='100' align="center"><a href="viewmessage.php">Comment</td>
<td width='100' align="center"><a href="memlist.php">Member</td>
<td width='100' align="center"><a href="stafflist.php">Admin</td>
<td width='100' align="center"><a href="customerinformation.php">Customer</td>
<td width='100' align="center"><a href="supplierlist.php">Supplier</td>
<td width='100' align="center"><a href="salarymain.php">Salary</td>
<td width='100' align="center"><a href="bill.php">Bill</td>

<?php
}else{
echo "<td colspan='7'><br/></td>";
}
?>
</tr>

<tr>
<td colspan="13"><hr/></td>
</tr>

<tr>
<td align="left" colspan="7">Daily Bookstore - Management System</td>
<td align="right" colspan="6">Current Time:<span id="clock">&nbsp;</span> | You log in as:<span>
<?php
echo "<span style='color:black;font-weight:bold'>".$username."</span>";
?>
<a href="logout.php">(Logout)</a>
</td>
</tr>

<tr height="1pt">
<td colspan="13"><hr/></td>
</tr>

</table>
</body>
</html>