<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../css/scroll_table.css" />
<link rel="stylesheet" type="text/css" href="../css/tab.css" />
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />

<?php
include('../include/session.php');
$today = date("Y-m-d");


$table_name2 = $_SESSION['db_prefix']."_employee";
$employee_query = "SELECT emp_id, emp_no, emp_first_name, emp_last_name, id_number, birth_date, employ_date,  gender, time_keeping, time_zone FROM $table_name2 WHERE end_employ_date > '".$today."' AND premature_end_date > '".$today."' AND emp_group='M'";
$employee_result = mySQL_query($employee_query);
$employee_num = mysql_num_rows($employee_result);	


?>

</head>

<body>
<?php 
include ("../navigation/header.php");
$page_name = "HR-management";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/hr_sidebar.php");
	include ('../include/tooltip.php');
	$current_page = "employee_m_list.php" 
	?>
<div class="main_frame">
<div class="page_head_frame">
          <table width="809" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><label class="label_page_head">Employees</label></td>
              <td width="171" align="right">&nbsp;</td>
            </tr>
          </table>
        </div>
        
<div class="page_middle_frame">       
        <div class="tab_button_holder_frame">
      <a href="employee_m_list.php"><div class="<?php if ($current_page =='employee_m_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Employees</div></div></a>
      <a href="contract_m_list.php"><div class="<?php if ($current_page =='contract_m_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Contracts</div></div></a>
      <a href="address_m_list.php"><div class="<?php if ($current_page =='address_m_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Addresses</div></div></a>
      <a href="contact_m_list.php"><div class="<?php if ($current_page =='contact_m_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Contacts</div></div></a>
      <a href="bank_m_list.php"><div class="<?php if ($current_page =='bank_m_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Banking</div></div></a>
      <a href="sizes_m_list.php"><div class="<?php if ($current_page =='sizes_m_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Sizes</div></div></a>
      <a href="wages_m_list.php"><div class="<?php if ($current_page =='wages_m_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Salaries</div></div></a>
      <a href="emergency_m_list.php"><div class="<?php if ($current_page =='emergency_m_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Emergency</div></div></a>
      </div>

        
        <div class="tab_middle_frame">
        <!--jscript-->
<script language="JavaScript" src="../jscript/go_to_url.js"  type="text/javascript"></script> 
<script type="text/javascript" language="javascript" src="../jscript/jquery.dataTables.js"></script>

		<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('#scroll_table').dataTable( {
					"sScrollY": "500px",
					"bPaginate": false,
					"bScrollCollapse": true,
					"aaSorting": [[ 1, "asc" ]],
					"aoColumns": [
                             	{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true},
								{"iDataSort": 8},
								{"iDataSort": 9},
								{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true},
								{"bVisible": false},
								{"bVisible": false}
								 ]
				} );
			} );
		</script>
          <table width="683" id="scroll_table" class="data_display"  >
            <thead>
            <tr>
              <th>no</th>
              <th>Name</th>
              <th>Id number</th>
              <th>Date of birth</th>
              <th>Employment date</th>
              <th>Gender</th>
              <th>Time keeping</th>
              <th>Time zone</th>
              <th>&nbsp;</th>
              <th>&nbsp;</th>
            </tr>
          </thead>
            <?php 
$i=0;
while ($i<$employee_num) {
	$a =  mysql_result($employee_result, $i, "emp_id");
	$a0 = mysql_result($employee_result, $i, "emp_first_name");
	$a1 = mysql_result($employee_result, $i, "emp_last_name");
	$a2 = mysql_result($employee_result, $i, "id_number");
	$a3 = mysql_result($employee_result, $i, "birth_date");
	$a4 = mysql_result($employee_result, $i, "employ_date");
	$a6 = mysql_result($employee_result, $i, "gender");
	$a7 = mysql_result($employee_result, $i, "time_keeping");
	$a8 = mysql_result($employee_result, $i, "time_zone");
	$a9 = mysql_result($employee_result, $i, "emp_no");
	?>
            <tr>
              <td width="26" align="left"><?php echo $a9 ?>&nbsp;</td>
              <td width="139" align="left"><a href="employee_details.php?emp_id=<?php echo $a?>" onMouseover="ddrivetip(' Click for employee details.', 150)"; onMouseout="hideddrivetip()"><?php echo $a0." ".$a1 ?></a></td>
              <td width="71" align="left"><?php echo $a2 ?></td>
              <td width="86" align="left"><?php echo date("d-m-Y", strtotime($a3))?></td>
              <td width="101" align="left"><?php echo date("d-m-Y", strtotime($a4)) ?></td>
              <td width="70" align="left"><?php echo $a6 ?></td>
              <td width="58" align="left"><?php echo $a7 ?></td>
              <td width="42" align="left"><?php echo $a8 ?></td>
              <td width="23" align="left"><?php echo $a3 ?>&nbsp;</td>
              <td width="23" align="left"><?php echo $a4 ?>&nbsp;</td>
            </tr>
            <?php
  $i++;
}
?>
          </table>
          
</div>
<div class="page_inside_frame">
<a href="print_employee_list.php" title="Manase employee list print" target="_blank"><input name="print_button" type="button" class="imagebutton" value="Print list"></a>
</div>     
</div>  
</div>

<?php } else {
$_SESSION['denied_return'] = "hr_module/hr_main.php?date=";	
include ("../navigation/hr_sidebar.php");?>
<body onload="accessdenied(); return false">
</body>
<?php }
?>
<?php include ('../navigation/side_bar.php'); ?>


</body>
</html>