
<?php 
   include ('../include/formValidations.php');
require_once ('../include/tc_calendar.php');


$table_name1 = $_SESSION['db_prefix']."_employee";
$table_name2 = $_SESSION['db_prefix']."_time_record";

$record_query = "SELECT $table_name2.emp_id, emp_no, emp_first_name, emp_last_name, time_keeping  FROM $table_name1, $table_name2  WHERE $table_name1.emp_id = $table_name2.emp_id AND (status='N' OR status='U') AND checked='0' AND $table_name2.date = '".$_SESSION['record_date']."'  ORDER BY emp_no";

$record_result = execsql($record_query);
$record_num = mysql_num_rows($record_result);
if ($record_num==0) {
	$employee="No employees to be entered anymore";
	$emp_id = "";
	$emp_no = "";
	$time_keeping = "";
	
}
else {
	$message="";
    $emp_id = mysql_result($record_result, 0, "emp_id");
	$emp_no = mysql_result($record_result, 0, "emp_no");
    $employee = mysql_result($record_result, 0, "emp_first_name")." ".mysql_result($record_result, 0, "emp_last_name");
	$time_keeping = mysql_result($record_result, 0, "time_keeping");
}

?>





<script type="text/javascript" src="../css/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />

<script language="javascript" type="text/javascript" >
<!--
function confirmRefresh() {
var okToRefresh = confirm("Do you really want to cancel this entry?");
var url='hr_main.php?date='
if (okToRefresh)
	{
			window.location=url;
	}
}
// -->
</script>
<script language="JavaScript">
var needToConfirm = true;
  window.onbeforeunload = confirmExit;
   function confirmExit()
  {
    if (needToConfirm)
      return "You did not finish the wizard./nIf you leave now your data will not be saved.";
  }
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
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>

<link rel="stylesheet" href="../window/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="../window/dhtmlwindow.js"></script>
<link rel="stylesheet" href="../window/modal.css" type="text/css" />
<script type="text/javascript" src="../window/modal.js"></script>
<link href="../css/navigation.css" rel="stylesheet" type="text/css" />
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<div class="wizard_page_middle_frame">
<form id="feedbackform" method="get"  >
<div class="wizard_frame">
          <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="42" align="center"><label class="label_large">Clock-in recording for: <?php echo date("l, d-m-Y", strtotime($_SESSION['record_date']))?></label></td>
            </tr>
            <tr>
              <td align="center"><label class="label_std">Time recording for:</label></td>
            </tr>
            <tr>
              <td align="center"><label class="label_large"><b><?php echo $employee."  (".$emp_no.")" ?>&nbsp;&nbsp;</b></label></td>
            </tr>
          </table>
        </div>
       
          <div class="wizard_frame">
          <table width="496" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td align="center"><img src="../images/absent_btn.png" width="90" height="30" <?php if ($emp_id!="") { ?> style="cursor:pointer" onclick="editwindow=dhtmlmodal.open('editBox', 'iframe', 'set_absent.php?emp_id=<?php echo $emp_id ?>&time_keeping=<?php echo $time_keeping ?>', 'Set absent', 'width=450px,height=250px,center=1,resize=0,scrolling=0')
needToConfirm = false;
editwindow.onclose=function(){return window}; return false"  <?php } ?> /></td>
              <td align="center"><img src="../images/present_btn.png" width="90" height="30" <?php if ($emp_id!="") { ?> style="cursor:pointer" onclick="editwindow=dhtmlmodal.open('editBox', 'iframe', 'set_late.php?emp_id=<?php echo $emp_id ?>', 'Set presence', 'width=500px,height=275px,center=1,resize=0,scrolling=0')
needToConfirm = false;
editwindow.onclose=function(){return window}; return false" <?php } ?>/></td>
            </tr>
            <tr>
              <td colspan="2" align="center"><label class="label_std">Select the required option</label></td>
            </tr>
          </table>
          </div>
<div class="wizard_spacer_frame" style="height:115px;"></div>          
            <div class="wizard_frame">
              <table width="645" height="50" align="center" id="table_button_bar">
                <tr>
                  <td width="117">&nbsp;</td>
                  <td width="115">&nbsp;</td>
                  <td width="99"><span class="wizard">
                    <input name="s" type="hidden" id="s" value="3" />
                    <input name="p" type="hidden" id="p" value="3" />
                  </span></td>
                  <td width="125" align="right"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onclick="needToConfirm = false; cancel_confirmation(1, '../hr_module/hr_main.php?date=0');" value="Cancel" /></td>
                  <td width="110" align="right"><input type="button" name="next_button" class="imagebutton" value="Finish" onclick="needToConfirm = false; ;MM_goToURL('parent','hr_main.php?date=');return document.MM_returnValue" /></td>
                </tr>
              </table>
              
              
  </form>
</div>
</div>


