
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<!--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" /> 

<?php
include ("../navigation/header.php");

$table_name = $_SESSION['db_prefix']."_permissions";
$view_query = "SELECT access_id  FROM  $table_name  WHERE access_id ='". $_SESSION['access_id']."' AND page_name = 'HR-wages' ";
$view_result = mySQL_query($view_query);
$view_num = mysql_num_rows($view_result);
if ($view_num!=0) {
	$view='yes';
}
else {
$view='no';
}

?>

</head>

<?php 
$today = date("Y-m-d");	
$table_name2 = $_SESSION['db_prefix']."_employee";
$employee_query = "SELECT emp_id, emp_first_name, emp_last_name, id_number, position, rate, pay_unit, pay_period, leave_days FROM $table_name2 WHERE end_employ_date > '".$today."' AND premature_end_date > '".$today."'  AND emp_group='E'";
$employee_result = mySQL_query($employee_query);
$employee_num = mysql_num_rows($employee_result);	

?>


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

	if ($permission_num==1) {
		include ("../navigation/hr_sidebar.php");
		$current_page = "wages_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 - Wages</label></td>
            <td width="171" align="right">&nbsp;</td>
          </tr>
        </table>
      </div>
<div class="page_middle_frame"  style="width:700px;">       
        <div class="tab_button_holder_frame">
      <a href="employee_list.php"><div class="<?php if ($current_page =='employee_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Employees</div></div></a>
      <a href="contract_list.php"><div class="<?php if ($current_page =='contract_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Contracts</div></div></a>
      <a href="address_list.php"><div class="<?php if ($current_page =='address_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Addresses</div></div></a>
      <a href="contact_list.php"><div class="<?php if ($current_page =='contact_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Contacts</div></div></a>
      <a href="bank_list.php"><div class="<?php if ($current_page =='bank_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Banking</div></div></a>
      <a href="sizes_list.php"><div class="<?php if ($current_page =='sizes_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Sizes</div></div></a>
      <a href="wages_list.php"><div class="<?php if ($current_page =='wages_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Salaries</div></div></a>
      <a href="emergency_list.php"><div class="<?php if ($current_page =='emergency_list.php') {echo 'tab_button_active'; } else { echo 'tab_button'; }?>"><div align="center">Emergency</div></div></a>
      </div>

<?php if ($view=='yes') { ?>       
<div class="tab_middle_frame">
<!--jscript-->
<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": [[ 0, "asc" ]],
					"aoColumns": [
								{"bSortable": true},
                             	{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true},
                             	{"bSortable": true},
								{"bSortable": true}
								 ]
				} );
			} );
		</script>
<table width="680" id="scroll_table" class="data_display" >
 <thead>
  <tr>
    <th>Name</th>
    <th>Id number</th>
    <th>Position</th>
    <th>Rate</span></th>
    <th>Per</span></th>
    <th>Pay period</th>
    <th>Leave days</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, "position");
	$a4 = mysql_result($employee_result, $i, "pay_period");
	$a5 = mysql_result($employee_result, $i, "rate");
	
	$a7 = mysql_result($employee_result, $i, "pay_unit");
	$a8 = mysql_result($employee_result, $i, "leave_days");
	?>
    
  
  <tr>
    <td width="177" align="left"><a href="employee_details.php?emp_id=<?php echo $a?>"><?php echo $a0." ".$a1 ?></td>
    <td width="101" align="left"><?php echo $a2 ?></td>
    <td width="101" align="left"><?php echo $a3?></td>
    <td width="56" align="right"><?php echo number_format($a5 , 2, '.', ',') ?></td>
    <td width="56" align="left"><?php echo $a7 ?></td>
    <td width="77" align="left"><?php echo $a4 ?></td>
    <td width="80" align="left"><?php echo $a8 ?></td>
    </tr>
  <?php
  $i++;
}
?>
</table>
</div>
<?php }
else {
	?>
<div class="tab_middle_frame"> 
  <div class="lay_out_frame_small" style="border:hidden;"><div align="left"><img src="../images/exclamation_mark_green_small.png" width="20" height="32"></div></div>
  <div class="lay_out_frame_small" style="border:hidden;">
<br />
This page is not for viewing available to you.<br />
<br />
If you think you should be able to view this page, contact the system administrator.
</div>
</div>
<?php } ?>   
</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>