<!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" />
  
<link rel="stylesheet" type="text/css" href="popup.css" />
<script language="JavaScript" src="gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<?php

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


$time_id = $_GET['time_id'];





$table_name = $_SESSION['db_prefix']."_time_record";
$time_query = "SELECT * FROM $table_name WHERE time_id ='".$time_id."' ";
$time_result = mySQL_query($time_query);
$emp_name = mysql_result($time_result, 0, "emp_id");
$edit_date = mysql_result($time_result, 0, "date");

$reason = mysql_result($time_result, 0, "reason");
$reason2 = mysql_result($time_result, 0, "reason2");




 $table_name = $_SESSION['db_prefix']."_list_late";
    $reason_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
	$arrId1 = array ();
	$arrName1 = array ();
	$reason_result = execsql($reason_query);
	if ($reason_result!="") {
	$reason_num = mysql_num_rows($reason_result);
	$b=0;
	while ($b < $reason_num) {
		$arrId1[$b] = mysql_result($reason_result, $b, "item_name");
		$arrName1[$b] = mysql_result($reason_result, $b, "item_name");
		$b++;
	}
	}
	
  $table_name = $_SESSION['db_prefix']."_list_early";
    $reason2_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
	$arrId2 = array ();
	$arrName2 = array ();
	$reason2_result = execsql($reason2_query);
	if ($reason2_result!="") {
	$reason2_num = mysql_num_rows($reason2_result);
	$a = 0;
	while ($a < $reason2_num) {
		$arrId2[$a] = mysql_result($reason2_result, $a, "item_name");
		$arrName2[$a] = mysql_result($reason2_result, $a, "item_name");
		$a++;
	}
	}
?>
<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_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]+"'");
}
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>

 
<link href="../css/popup.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
label.label_std {	margin-left:5px;
    line-height:20px;
	padding-top:6px;
    color:#000;
    text-shadow:1px 1px 1px #fff;
    font:bold 12px Arial;
}
select.select50 {    background:#FFEAEA;
    border: 1px solid #ddd;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 1px;
    outline: none;
    padding: 2px;
    width:50px;
	height:24px;
	color:#000;
}
select.select80 {background:#FFEAEA;
    border: 1px solid #ddd;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 1px;
    outline: none;
    padding: 2px;
    width:80px;
	height:24px;
	color:#000;
}

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;
}

-->
</style>
</head>
<form action="../hr_module/edit_timekeeping.php" method="get" name="form1" target="_top" id="form1">
<body onload="document.getElementById(;MM_callJS('document.getElementById(\'quantityText\').focus();')"editText").focus();">
<table width="290" border="0" align="center" cellpadding="0" cellspacing="0" class="list2">
  <tr>
    <td width="290" align="center"><p><label class="label_std">Edit the value and click "Edit"<br />
If you don't want to change, click "cancel"</label>
        <br />
        </p>
      <table width="500" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><label class="label_std">reason 1:&nbsp;&nbsp;</label>
            <select name="reason_select" id="reason_select" class="select160221"  >
              <option value="Paid leave">Paid leave</option>
              <option value="Unpaid leave">Unpaid leave</option>
              <option value="Sick leave">Sick leave</option>
              <option value="<?php echo $reason ?>" selected="selected"><?php echo $reason ?></option>
              <?php
        	for ($j = 0; $j < count($arrId1); $j++) {
    		echo "<option value=" . "\"" . $arrId1[$j] . "\"" . ">" . $arrName1[$j] . "</option>";
	}
?>
          </select></td>
          <td><label class="label_std">reason 2:</label>
            <select name="reason2_select" id="reason2_select" class="select16021"  >
              <option value="" selected="selected"></option>
              <option value="<?php echo $reason2 ?>" selected="selected"><?php echo $reason2 ?></option>
              <?php
        	for ($j = 0; $j < count($arrId2); $j++) {
    		echo "<option value=" . "\"" . $arrId2[$j] . "\"" . ">" . $arrName2[$j] . "</option>";
	}
?>
          </select></td>
        </tr>
      </table>
      <p>
        
  <input name="edit" type="hidden" id="edit" value="3"  />
        <input name="time_id" type="hidden" id="time_id" value="<?php echo $time_id ?>" />
        
        <input name="edit_date" type="hidden" id="edit_date" value="<?php echo $edit_date ?>" />
        <br />
    </p></td>
  </tr>
  <tr>
    <td align="center">
      <input name="input" type="submit" value="Edit" class="imagebutton"  />
      <input name="button" type="button" class="imagebutton" id="button" onclick="MM_goToURL('parent','../hr_module/edit_timekeeping.php?edit_date=<?php echo $edit_date ?>&edit=0');return document.MM_returnValue"  value="Cancel" /></form>
    </td>
  </tr>
</table>

<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("ProductSelect","req","Please select a product.");
  frmvalidator.addValidation("QuantityText","req","Please enter the quantity.");
    
    
    
   


  
</script>
</body>
</html>