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

<?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 checked='1' AND (status='P' or status='L') AND status_2='' 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="page_middle_frame">
<form id="feedbackform" method="get"  >
<table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
    <tr>
        <td width="525" >
        <div class="wizard_frame">
          <table width="464" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="39" align="center"><label class="label_large">Clock-out recording for: <?php echo date("l, d-m-Y", strtotime($_SESSION['out_date']))?></label></td>
            </tr>
            <tr>
              <td align="center">Clock-out recording for:</td>
            </tr>
            <tr>
              <td align="center"><font size="4"><b><?php echo $employee ?>&nbsp;&nbsp;(<?php echo $emp_no ?>)</b></font></td>
            </tr>
          </table>
        </div>
       <br /><br /><br />
          <div class="wizard_frame">&nbsp;&nbsp;&nbsp;&nbsp;
          <table width="428" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td align="center">&nbsp;</td>
              <td align="center"><img src="../images/early_btn.png" width="90" height="30" <?php if ($emp_id!="") { ?>style="cursor:pointer" onclick="editwindow=dhtmlmodal.open('editBox', 'iframe', 'set_early.php?emp_id=<?php echo $emp_id ?>', 'Set early clock-out', 'width=350px,height=180px,center=1,resize=0,scrolling=0')
needToConfirm = false;
editwindow.onclose=function(){return window}; return false" <?php } ?>/></td>
              <td align="center"><img src="../images/out_btn.png" width="90" height="30" <?php if ($emp_id!="") { ?>style="cursor:pointer" onclick="needToConfirm = false;MM_goToURL('parent','save_time_out_recording.php?emp_id=<?php echo $emp_id ?>&status_out=P&time_keeping=<?php echo $time_keeping ?>');return document.MM_returnValue" <?php } ?> /></td>
            </tr>
            <tr>
              <td colspan="3" align="center">Select the required option</td>
            </tr>
          </table>
          </div>
          <br />
<br />
<br />
<br />

<div class="wizard_frame"></div>          </td>
    </tr>
          <tr>
            <td>
            <div class="wizard_frame">
              <table width="675" 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>
              </div></td>
          </tr>
        </table>
  </table>
  </form>
</div>



