<?php 
	include("../include/session.php");
    if(!$session->isAdmin() && !$session->isRadstoneReceptionUser()){
		header("Location: ../Store/productionMenu.php");
    }
    else {
    		$d = date("d");
	$m = date("m");
	$y = date("Y");
		require_once('classes/tc_calendar.php');
        include("../reportHeader.php");
//        include("../../include/db.php");
    	$q = "SELECT empId, empFName, empLName FROM employees ORDER BY empFName ASC";
	$arrId = array();
	$arrName = array();
	$result = execsql($q);
	$num = mysql_num_rows($result);
	$b = 0;
	while($b < $num){
		$arrId[$b] = mysql_result($result, $b, "empId");
		$arrName[$b] = mysql_result($result, $b, "empFName") ." ". mysql_result($result, $b, "empLName");
		$b++;
	}
?>

<link href="calendar.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../include/calendar.js"></script>

<script language="javascript" src="calendar.js"></script>

     <h3>Violation Searches</h3>
     
      <table> 
	<form action="typeSearch.php" method="post"><tr><td id="row1">Search Via Violation Type: </td>
	<td><select name="vioType">
	<option value="All">All</option>
	<option value="Dishonesty">Dishonesty</option>
    <option value="Breach of Procedure">Breach of Procedure</option>
    <option value="Unauthorised Possession">Unauthorised Possession</option>
    <option value="Insubordination">Insubordination</option>
    <option value="Negligence">Negligence</option>
    <option value="Sleeping on Duty">Sleeping on Duty</option>
    <option value="Under the Influence">Under the Influence</option>
    <option value="Absenteeism/Punctuality">Absenteeism/Punctuality</option>
    <option value="Disclosing Confidential Information">Disclosing Confidential Information</option>
    <option value="Abusive Language">Abusive Language</option>
    <option value="Assault/Fighting">Assault/Fighting</option>
    <option value="Sexual Harassment">Sexual Harassment</option>
    <option value="Competing with the Employer's Interests">Competing wiht the Employer's Interests</option>
    <option value="Fraud">Fraud</option>
    <option value="Unauthorised use of property">Unauthorised use of property</option>
    <option value="Absenteeism">Absenteeism</option>
    <option value="Other">Other</option> 
</select></td>
	
	<td><input type="submit" name="submitok" value="   OK   " /></td></tr></form><br />
	
	<form action="vioDate.php" method="post">
	<tr><td>
	Search By Date:</td><td> <?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></tr>
	  <tr><td>to</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>
      
      <form action="vioEmp.php" method="post">
      <tr>
		<td id="row1">Employee Name:</td>
		<td><select name="name">
			<option value="">Choose Me</option>
			<?php
			for ($i = 0 ; $i < count($arrId) ; $i++) {

				echo "<option value=". "\"". $arrId[$i]. "\"" .">" . $arrName[$i] . "</option>";
			}

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