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

<head>

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

$warning_id = $_GET['warning_id'];

$table_name = $_SESSION['db_prefix']."_warnings";
$warning_query = "SELECT  *  FROM $table_name WHERE warning_id = '".$warning_id."' ";
$warning_result = $con->query($warning_query);
$row = mysqli_fetch_assoc($warning_result);
$w0 = $row["emp_id"];
$w1 = $row["warning"];
$w2 = $row["offence"];
$w3 = $row["warning_date"];
$w4 = $row["exp_date"];
$w5 = $row["warning_text"];
$w6 = $row["issued_by"];
$w7 = $row["additional_notes"];
	
$table_name2 = $_SESSION['db_prefix']."_employee";
$employee_query = "SELECT emp_first_name, emp_last_name FROM $table_name2 WHERE emp_id ='".$w0."' ";
$employee_result = $con->query($employee_query);
$row = mysqli_fetch_assoc($employee_result);
$a0 = $row['emp_first_name'];
$a1 = $row['emp_last_name'];	


?>

<script type="text/javascript">
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
</script>

<body>
<?php

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

if ($permission_num==1) {
	include ("../navigation/hr_sidebar.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">Warning </label><label class="label_page_head_2"><?php echo $a0." ".$a1 ?></label></td>
            </tr>
        </table>
      </div>
        <br />

<br />
<div class="page_middle_frame">
<div class="page_inside_frame">
<div align="left">Employee details</div>
  <table width="650" id="table_details_display">
    <tr>
      <td width="151" height="25">Employee name:</td>
      <td width="646"><b><?php echo $a0." ". $a1?></b></td>
      </tr>
    </table>
</div>

<div class="page_inside_frame">
<div align="left">Warning</div>
  <table width="650" id="table_details_display">
    <tr>
      <td width="148" height="25">Date</td>
      <td width="143"><b><?php echo date("d-m-Y", strtotime($w3))?></b></td>
      <td width="83">expiry date:</td>
      <td width="413"><b><?php echo date("d-m-Y", strtotime($w4 ))?></b></td>
      </tr>
    <tr>
      <td height="25">Warning type:</td>
      <td colspan="3"><b><?php echo $w1 ?></b></td>
      </tr>
    <tr>
      <td height="25">Offence:</td>
      <td colspan="3"><b><?php echo $w2?></b></td>
      </tr>
    <tr>
      <td height="25" valign="top">Warning:</td>
      <td colspan="3" valign="top"><b><?php echo $w5?></b></td>
    </tr>
    <tr>
      <td height="25" valign="top">Additional notes:</td>
      <td colspan="3" valign="top"><?php echo $w7 ?></td>
    </tr>
    </table>
</div>

<div class="page_inside_frame">
  <div align="left">Warning given</div>
  <table width="650" id="table_details_display">
    <tr>
      <td width="126" height="25">Warning given by:</td>
      <td width="527"><b><?php echo $w6?></b></td>
      </tr>
  </table>
</div>

<div class="page_inside_frame" align="right">
<a href="print_warning_details.php?warning_id=<?php echo $warning_id ?>" target="_blank"><input name="print_button" type="button" class="imagebutton" value="Print warning" ></a>
</div>
  
</div>
</div>
</body>
<?php } else {
$_SESSION['denied_return'] = "hr_module/employee_list.php";	
include ("../navigation/hr_sidebar.php");?>
	<body onload="accessdenied(); return false">
	</body>
<?php }
?>
<?php include ('../navigation/side_bar.php'); ?>

</html>