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


<?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) {
		if ($_SESSION['error']==0) { 
		      $_SESSION['first_choice'] = $_GET['first_choice'];
		}
		 if ($_SESSION['first_choice'] == 'clock_in') { ?> <script language="javascript" type="text/javascript">window.location="timeWiz0.php"; </script> <?php }
		 if ($_SESSION['first_choice'] == 'clock_out') { ?> <script language="javascript" type="text/javascript">window.location="timeOutWiz0.php"; </script> <?php } 
		 if ($_SESSION['first_choice'] == 'overtime') { ?> <script language="javascript" type="text/javascript">window.location="overtimeWiz0.php"; </script> <?php } 
		 
	}
		
	if($s==2) {
		$today=date("Y-m-d");
	    $record_date = $_GET['date1'];
		//$y=substr($record_date, 0, 4);
//		$m=substr($record_date, 5, 2);
//		$d=substr($record_date, 8, 2);
//		
//		if  (($y == '0000') OR ($m == '00') OR ($d == '00')) {
//			 	$_SESSION['error']=1;
//				$_SESSION['p']=1;
//				?>
//    			<script language="javascript" type="text/javascript">
//       			 <!--
//				needToConfirm = false;
//	 			//window.location="timeRecordingWizbase.php?s=1&p=2";
//        		-->
//     			</script>
//     	<?php	
//       	}
//		else{
//			$continue='true';
//		}
		
		if  ($record_date>=$today) {
			 	$_SESSION['error']=2;
				$_SESSION['p']=1;
				?>
    			<script language="javascript" type="text/javascript">
       			 <!--
				needToConfirm = false;
	 			window.location="timeRecordingWizbase.php?s=1&p=2";
        		-->
     			</script>
     	<?php	
       	}
		else{
			$continue='true';
		}
			
			
		if ($continue=='true') {	
			
		 if ($_SESSION['first_choice'] == 'forgot_in') { ?> <script language="javascript" type="text/javascript">window.location="add_timeWiz0.php?record_date=<?php echo $record_date ?>"; </script> <?php } 
		 if ($_SESSION['first_choice'] == 'forgot_out') { ?> <script language="javascript" type="text/javascript">window.location="add_timeOutWiz0.php?record_date=<?php echo $record_date ?>"; </script> <?php } 
		}
		 
		
    	
	};
	
	if($s==3) {
	 
	 
	};
	
	if($s==4) {
	 
	}
	
	?>

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

<body>
<div class="main_frame">

<div class="page_head_frame">
  <label class="label_page_head">Time recording</label></div>
 

      
      <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 class="active_step_label"><br /><br /><br />
        Select </div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;1</div>
      <div class="de_active_step_label"><br /><br /><br />
        Select</div>
      <?php } ?>
      </td> 
      <td>
      <?php if ($_SESSION['p']==2) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;2</div>
      <div class="active_step_label"><br /><br /><br />
        Select date </div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;2</div>
      <div class="de_active_step_label"><br /><br /><br />
        Select date</div>
      <?php } ?>
      </td>        
      </tr>
      </table>
      </div>
      </td>
      </tr>
      <tr>
      <td><?php 
	if ($_SESSION['p']==1) { include("timeRecordingWiz1.php"); }
	if ($_SESSION['p']==2) { include("timeRecordingWiz2.php"); }
	
    ?></td>
    
    </td>
  </tr>
</table>

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