<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../jscript/tablesort.js"></script>
<script language="javascript" src="../jscript/calendar.js"></script> 

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

$emp_id = $_GET['emp_id'];	
	

$table_name2 = $_SESSION['db_prefix']."_warnings";
$warning_query = "SELECT warning_id, warning, offence, emp_id, warning_date, exp_date, warning_text FROM $table_name2 WHERE emp_id = '".$emp_id."' AND warning_date >= '".$start."' AND warning_date <= '".$end."' ";

$warning_result = mySQL_query($warning_query);
$warning_num = mysql_num_rows($warning_result);

$table_name = $_SESSION['db_prefix']."_employee";
$employee_query = "SELECT emp_first_name, emp_last_name, department  FROM $table_name WHERE emp_id = '".$emp_id."' ";
$employee_result = mySQL_query($employee_query);
$employee_name = mysql_result($employee_result, 0, "emp_first_name")." ".mysql_result($employee_result, 0, "emp_last_name");


?>

</head>
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />
<body>

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

if ($permission_num==1) {
	include ("../navigation/hr_sidebar.php");
?>

<div class="main_frame">
  <table id="tableMain" > <!--begin of tableMain-->
    <tr>
      <td width="700" height="125" valign="top" ><div class="page_head_frame">
        
        <table width="690" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><label class="label_page_head">Issued warnings to <?php echo $employee_name ?> </label></td>
            <td width="171" align="right">&nbsp;</td>
          </tr>
        </table>
      </div>
        <br />
<br />
<br />
<br />
  <?php
$page='warnings_individual_list.php';
$reference_name='emp_id';
$reference=$emp_id;
include('../include/period_select_block.php');
?>
</td> <!--center of tableMain-->
</tr>
<tr>
<td> <!--center of tableMain-->
<div class="scroll_frame_long">
<table width="680" id="table_list" class="sortable-onload-0r rowstyle-alt no-arrow "  >
  <tr>
    <th class="sortable-date-dmy">date</th>
    <th class="sortable-text">warning</th>
    <th class="sortable-text">offence </th>
    <th class="sortable-date-dmy">warning text</th>
    <th class="sortable-date-dmy">exp_date</th>
    </tr>
<?php 


$i=0;
while ($i<$warning_num) {
	$a =  mysql_result($warning_result, $i, "warning_id");
	$a0 = mysql_result($warning_result, $i, "warning_date");
	
	$a2 = mysql_result($warning_result, $i, "warning");
	$a3 = mysql_result($warning_result, $i, "offence");
	$a4 = mysql_result($warning_result, $i, "exp_date");
	$a5 = substr(mysql_result($warning_result, $i, "warning_text"), 0, 150);
	
	
	?>
    
  
  
  <tr>
    <td width="57" align="left" valign="top"><?php echo date("d-m-Y", strtotime($a0 )) ?></td>
    <td width="90" align="left" valign="top"><?php echo $a2 ?></td>
    <td width="84" align="left" valign="top"><a href="warning_details.php?warning_id=<?php echo $a ?>" onMouseover="ddrivetip('Click to display and print warning', 170)"; onMouseout="hideddrivetip()"> <?php echo $a3 ?>  </a></td>
    <td width="457" align="left" valign="top"><?php echo $a5 ?></td>
    <td width="98" align="left" valign="top"><?php echo date("d-m-Y", strtotime($a4 )) ?></td>
    </tr>
  <?php
  $i++;
}
?>

</table>
<div align="left"><label class="label_end">end of list</label></div>
</div></td>
</tr>
</table>  <!--end of tableMain-->
  
</div>
</body>
<?php } else {
$_SESSION['denied_return'] = "hr_module/main.php";	
include ("../navigation/hr_sidebar.php");?>
	<body onload="accessdenied(); return false">
	</body>
<?php }
?>
<?php include ('../navigation/side_bar.php'); ?>
</html>