<?php
include ("../include/session.php");
if (!$session->logged_in) {
	header("Location: ../../main.php");
} else {
	include ("../header.php");
//	include ("../include/db.php");
	

	
	
	$query = "SELECT empID, empFName, empLName, empAge, empSex, empDateEmp, EmpIDNo FROM nam_employees ORDER BY EmpLName Asc ";
	$result = mySQL_query($query) or die ("Error in query:   $Query . * ". mySQL_error());
	$i = 0;
	$num = mysql_num_rows($result);
	
?>
<style type="text/css">
<!--
.style5 {font-size: x-small}
.style6 {font-size: small;
	font-family: Arial, Helvetica, sans-serif;
}
.style6 {font-size: small}
-->
</style>



<script type="text/JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
<div class="headerbox">Employee list</div>
<div class="menubox">
  <div align="right"><a href="employeeSizeList.php"><img src="../../Images/Size_list_btn.png" alt="." width="110" height="25" border="0" /></a><br />
  
        </a>
		<?php if($session->isAdmin() || $session->isRadstoneReceptionUser()) { ?>
		 <a href="employeeBankList.php"><img src="../../Images/Bank_list_btn.png" alt="." width="110" height="25" border="0" /></a>        <?php }
		 else { ?>
		 <a href="#"><img src="../../Images/Bank_list_btn.png" alt="." width="110" height="25" border="0" onclick="MM_popupMsg('Not allowed.')" /></a> <?php } ?>
		 <br />
        </a>
		<?php if($session->isAdmin() || $session->isRadstoneReceptionUser()) { ?>
		 <a href="employeeRate.php"><img src="../../Images/Rates_list_btn.png" alt="." width="110" height="25" border="0" /></a>        <?php }
		 else { ?>
		 <a href="#"><img src="../../Images/Rates_list_btn.png" alt="." width="110" height="25" border="0" onclick="MM_popupMsg('Not allowed.')" /></a> <?php } ?>
		
		
		</a></span></div>
      
      <div align="right"><input name="image" type ="image" onclick="JavaScript:printPreviewDiv('top-bar');" src="../../Images/print_btn.png" alt="Click  to print" align="right" width="75" height="25" border ="0" /><a href="searchAndDisplay.php"><img src="../../Images/employees_back_btn.png" alt="." width="110" height="25" border="0" /> <?php } ?></a></div>
</div>
      <div class="subheaderbox">Employees  list  as per : <?php echo date("d-m-Y");
?><br />
        Number in list: <?php echo $num;?></div><br /><br /><br /><br /><br /><br />
		

      <table id="test1" cellpadding="2" cellspacing="0" border="0" class="rowstyle-alt colstyle-alt no-arrow" >
	<thead>
		<tr>
		    <th class="sortable-text">Name</th>
			<th class="sortable-numeric">ID Number</th>
			<th class="sortable-date-ymd">D.o.b.</th>
			<th class="sortable-text">Sex</th>
			<th class="sortable-date-ymd">Employment date</th>
		</tr>
	</thead>
	<tbody>
	<?php 
	while ($i < $num) {
	    $b0 = mysql_result($result, $i, "empID");
		$b1 = mysql_result($result, $i, "empLName");
	    $b2 = mysql_result($result, $i, "empFName");
	    $b3 = mysql_result($result, $i, "empIDNo");
	    $b4 = mysql_result($result, $i, "empAge");
		$b5 = mysql_result($result, $i, "empSex");
		$b6 = mysql_result($result, $i, "empDateEmp");
	?>
	
		<tr class=>
		  <td><a href="searchAndDisplayE.php?id=<?php echo $b0?>"><?php echo $b1. ", " .$b2 ?></a>
		  <td><?php echo $b3?></td>
		  <td><?php echo $b4?></td>
		  <td><?php echo $b5?></td>
		  <td><?php echo $b6?></td>
		</tr>
		
	<?php 
	$i++;
	}
	?>
	</tbody>
</table>



  <?php  
	include("../footer.php");
 ?>
  <br />


	