<!--Notice: (c)2013 This page is part of the management program for Tlhomeso Timbers, Gaborone, 
and developed by Customized Software (Pty) Ltd, Gaborone, Botswana. 
Customized Software holds the copyright on the source code on this and all other pages in the 
management program. For more info contact Customized Software on email: info@bwcustomized.com-->


<script language="JavaScript" src="gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<?php

include('../include/session.php');	
include('../include/formValidations.php');

 $table_name = $_SESSION['db_prefix']."_list_absent";
    $position_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
	$arrId2 = array ();
	$arrName2 = array ();
	$position_result = execsql($position_query);
	if ($position_result!="") {
	$position_num = mysql_num_rows($position_result);
	$b = 0;
	while ($b < $position_num) {
		$arrId2[$b] = mysql_result($position_result, $b, "item_name");
		$arrName2[$b] = mysql_result($position_result, $b, "item_name");
		$b++;
	}
	}

$emp_id = $_GET['emp_id'];
$time_keeping = $_GET['time_keeping'];


?>
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<!--form validation-->

<script type="text/javascript">
function stopRKey(evt) {
  var evt = (evt) ? evt : ((event) ? event : null);
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  if ((evt.keyCode == 13) && (node.type=="text"))  {return false;}
}
document.onkeypress = stopRKey;
</script> 

<script type="text/javascript">
<!--
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>

<style>
 select.select160{
    background:#FFF;
    border: 1px solid #ddd;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 1px;
    outline: none;
    padding: 2px;
    width:160px;
	height:24px;
	color:#000;
}

label.label_std{
	margin-left:5px;
    line-height:20px;
	padding-top:6px;
    color:#000;
    text-shadow:1px 1px 1px #fff;
    font:bold 12px Arial;
}

input.imagebutton{
	background-color:#CCC;
    width: 75px;
    height: 24px;
	border:solid;
	border-width:1px;
	border-color:#000;
	cursor:pointer;
	color:#000;
	font:bold 12px Arial;
}
</style>

<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>
<form action="save_time_recording.php" method="get" name="form1" target="_top" id="form1">

<table width="339" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="42" align="center" valign="top"><img src="../images/unknown_btn.png" alt="" width="90" height="30" style="cursor:pointer"  onclick="needToConfirm = false;MM_goToURL('parent','save_time_recording.php?emp_id=<?php echo $emp_id ?>&status=U');return document.MM_returnValue" <?php if ($emp_id!="") {?> <?php } ?> /><br />
      <hr /></td>
  </tr>
  <tr>
    <td height="30" align="center"><img src="../images/sick_btn.png" alt="" width="90" height="30" style="cursor:pointer"  onclick="needToConfirm = false;MM_goToURL('parent','save_time_recording.php?emp_id=<?php echo $emp_id ?>&amp;status=S');return document.MM_returnValue" <?php if ($emp_id!="") {?> <?php } ?> /><br />
      <label class="label_std">(only with sick note)</label>
<br />
      <hr /></td>
  </tr>
  <tr>
    <td height="30" align="center"><label class="label_std">State reason for absentism and indicate with or without permission.</label></td>
    </tr>
  <tr>
    <td height="58" align="center"><p>
     <label class="label_std">Reason:&nbsp;</label>
     <select name="reason_select" class="select160"  >
        <option value="" selected="selected"></option>
        <option value="Paid leave">Paid leave</option>
        <option value="Unpaid leave">Unpaid leave</option>
        <option value="Sick leave">Sick leave</option>
        <?php
        	for ($j = 0; $j < count($arrId2); $j++) {
    		echo "<option value=" . "\"" . $arrId2[$j] . "\"" . ">" . $arrName2[$j] . "</option>";
	}
?>
      </select>
      <input name="status" type="hidden" id="status" value="A" />
      <input name="emp_id" type="hidden" id="emp_id" value="<?php echo $emp_id ?>"  />
      <input name="time_keeping" type="hidden" id="time_keeping" value="<?php echo $time_keeping ?>"  />
      <br />
      <input type="radio" name="permission_group" value="yes" id="permission_group_0" />
      <label class="label_std">with permission</label>
        
          <input type="radio" name="permission_group" value="no" id="permission_group_1" />
          <label class="label_std">no permission</label>
          
        <br />
      </p></td>
    </tr>
  <tr>
    <td align="center"><input type="image" src="../images/absent_btn.png"  alt="Submit" /></td>
    </tr>
</table>

 
</form>



<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("reason_select","req","Please select a reason.");
  frmvalidator.addValidation("permission_group","selone","Please select permission.");
</script>

</html>