<?php
include("../include/session.php");
if(!$session->isAdmin() && !$session->isRadstoneReceptionUser()){
	header("Location: ../HR/employeeMenu.php");
}else{

	require_once('classes/tc_calendar.php');
	include("../header.php");
	$d = date("d");
	$m = date("m");
	$y = date("Y");

	$q = "SELECT empId, empFName, empLName FROM employees ORDER BY empFName;";
	$r = execsql($q);
	$n = mysql_num_rows($r);
	$i = 0;
	while($i < $n){
		$emp[mysql_result($r, $i, "empId")] = mysql_result($r, $i, "empFName") . " " . mysql_result($r, $i, "empLName");
		$i++;
	}

	?>
<link
	href="calendar.css" rel="stylesheet" type="text/css" />
<script
	language="javascript" src="../include/calendar.js"></script>
<table>
	<h3>Select Dates for a Late Commers search</h3>

	<form action="lateByDates.php" method="post">
	<tr>
		<td><select name="empId">
			<option value="">All Employees</option>
			<?php 
				foreach($emp as $key => $value){
					echo "<option value=\"$key\">$value</option>";	
				}
			?>
		</select></td>
	</tr>
	<tr>
		<td colspan="1" id="row1">Start Date</td>
		<td colspan="1"><?php
		$myCalendar = new tc_calendar("date1", true);
		$myCalendar->setIcon("../img/iconCalendar.gif");
		$myCalendar->setDate($d, $m, $y);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2000, 2030);
	 // $myCalendar->dateAllow('2008-05-13', '2010-03-01', false);
		//$myCalendar->setHeight(350);
		//$myCalendar->autoSubmit(true, "form1");
		$myCalendar->writeScript();?></td>
		<td>to</td>

		<tr>
			<td colspan="1">End Date</td>
			<td><?php
			$myCalendar = new tc_calendar("date2", true);
			$myCalendar->setIcon("../img/iconCalendar.gif");
			$myCalendar->setDate($d, $m, $y);
			$myCalendar->setPath("./");
			$myCalendar->setYearInterval(1970, 2030);
			//$myCalendar->dateAllow('2009-02-20', "", false);
			$myCalendar->writeScript();

			?></td>
			<td><input type="submit" name="submitok" value="   OK   " /></td>
		</tr>
	
	</form>
</table>
			<?php
			include("../footer.html");
}
	
	
	?>