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

<head>

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


<?php 
	
	$s = $_GET['s'];
	$p = $_GET['p'];
	$error = $_SESSION['error'];
	$_SESSION['p']=$p;
	$_SESSION['s']=$s;
	
	
	if (isset($_GET['prev_button']) )
	   {
		 $_SESSION['p']= $_SESSION['p']-1;
	   }
		 
	if (isset($_GET['next_button']) )
	  {
		$_SESSION['p']=$_SESSION['p']+1;
	  }
	
		
	
	if ($s==1) {
		 
	$_SESSION['emp_id'] = $_GET['employee_select'];
	$table_name = $_SESSION['db_prefix']."_employee";
	$emp_query = "SELECT emp_first_name, emp_last_name FROM $table_name WHERE emp_id = '".$_SESSION['emp_id']."' ";
	$emp_result = $con->query($emp_query);
	$row = mysqli_fetch_assoc($emp_result);
	$_SESSION['employee_name'] = $row['emp_first_name']." ".$row['emp_last_name'];
			 
	$_SESSION['warning_date'] = $_GET['warning_date'];
	
	if ($_SESSION['warning']=="Final warning") {
	    		$_SESSION['exp_date'] = (date("Y-m-d", strtotime($_SESSION['warning_date'])) . "+12 month");
				$_SESSION['period'] = '(12 months)';
		}
		else {
				$_SESSION['exp_date'] = (date("Y-m-d", strtotime($_SESSION['warning_date'])) . "+6 month");
				$_SESSION['period'] = '(6 months)';
		}
	
	}
		
	if($s==2) {
		 $_SESSION['warning'] = $_GET['warning_radio_group'];
		 $_SESSION['offence'] = $_GET['offence_select'];};
	
	if($s==3) {
	 $_SESSION['warning_text'] = $_GET['warning_text'];
	 $_SESSION['exp_date'] = $_GET['exp_date'];	
	 $_SESSION['issued_by'] = $_GET['issued_select'];
	 $_SESSION['additional_text'] = $_GET['additional_text'];
	 
	};
	
		
	?>
<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<link rel="stylesheet" href="../window/dhtmlwindow.css" type="text/css" />
<link rel="stylesheet" href="../window/modal.css" type="text/css" />

<!--jscript-->
<script type="text/javascript" src="../window/dhtmlwindow.js"></script>
<script type="text/javascript" src="../window/modal.js"></script>
<script type="text/javascript" src="../jscript/jquery.1.4.2.js"></script>
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/confirm_exit.js"  type="text/javascript"></script>    
<script language="JavaScript" src="../jscript/show_hide_layers.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>      



<div class="main_frame">

<div class="page_head_frame">
  <label class="label_page_head">Warning</label></div>
      <table align="left">
      <tr>
      <td>
     <div class="wizard_paging_frame"> 
      <table align="left">
      <tr>
      <td>
      <?php if ($_SESSION['p']==1) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;1</div></div>
      <div class="active_step_label">
        Select employee</div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;1</div></div>
      <div class="de_active_step_label">
      Select employee</div>
      <?php } ?>
      
      </td>
      <td>
      <?php if ($_SESSION['p']==2) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;2</div></div>
      <div class="active_step_label">
      Select warning</div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;2</div></div>
      <div class="de_active_step_label">
      Select warning</div>
      <?php } ?>
     </td>
      <td>
      <?php if ($_SESSION['p']==3) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;3</div></div>
      <div class="active_step_label">
      Warning</div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;3</div></div>
      <div class="de_active_step_label">
      Warning</div>
      <?php } ?>
      </td>
      <td>
      <?php if ($_SESSION['p']==4) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;4</div></div>
      <div class="active_step_label">
      Finish</div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;4</div></div>
      <div class="de_active_step_label">
      Finish</div>
      <?php } ?>
       </td>
      </tr>
      </table>
      </div>
      </td>
      </tr>
      <tr>
      <td><?php 
	if ($_SESSION['p']==1) { include("warningWiz1.php"); }
	if ($_SESSION['p']==2) { include("warningWiz2.php"); }
	if ($_SESSION['p']==3) { include("warningWiz3.php"); }
	if ($_SESSION['p']==4) { include("warningWiz5.php"); }
    ?></td>
    </tr>
    </table>
  
</div>

<?php include ('../navigation/side_bar.php'); ?>

</body>
</html>