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

include("../header.php");
//include("../include/db.php");
$date = mysql_real_escape_string($_GET['date']);
	if($date > 0){
		$d = date("d", strtotime($date));
		$m = date("m", strtotime($date));
		$y = date("Y", strtotime($date));
	}else{
		$d = date("d");
		$m = date("m");
		$y = date("Y");
	}
    	require_once('classes/tc_calendar.php');
        $q = "SELECT empId, empFName, empLName FROM employees ORDER BY empFName ASC";
        $result = execsql($q);
        $num = mysql_num_rows($result);
        $a = 0;
        $arrId = array();
        $arrName = array();
        while($a < $num) {
            $arrId[$a] = mysql_result($result, $a, "empId");
            $arrFName[$a] = mysql_result($result, $a, "empFName");
            $arrLName[$a] = mysql_result($result, $a, "empLName");
            $a++;
        }
?>
<link href="calendar.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../include/calendar.js"></script>
<script type="text/javascript">
<!--
function validate() {
	var ErrorString='';
		if(document.remarks.empId.value==''){
	    ErrorString+='Please select the employee\n';
		}
		if(document.remarks.vioType.value==''){
		    ErrorString+='Please give the type of violation\n';
		}
		if(document.remarks.vioDetails.value==''){
		    ErrorString+='Please give details of the violation\n';
		}
		if(document.remarks.warnings.value==''){
		    ErrorString+='Please select the warning\n';
		}
		

		if( ErrorString == '' ){
	    return true;
	     }else{
		alert(ErrorString);
		return false;
		}
	}

///---->
</script>
<form method="post" name="remarks" action="../HR/addMViolations.php">

<h3> Disciplinary Action</h3> <BR />
Employee: <select name="empId"><option value="">Choose Me</option>
    <?php
    for ($i = 0 ; $i < count($arrId) ; $i++) {

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

    ?>
    </select><br />
Violation Type 
<select name="vioType">
	<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><br />

Violation Details

<textarea name="vioDetails" rows="5" cols="50" id="vioDetails"></textarea><br />

Date of Incident: <?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();
	
	  ?><br />
Add Warnings? : <select name="warnings">
<option value=""></option>
<option value="Comment">Comment</option>
<option value="firstWarning">Verbal Warning</option>
<option value="writtenWarning">Written Warning</option>
<option value="finalWarning">Final Warning</option>
</select>

<br />
<input type="submit" name="submitok" value="Save and New" onclick="return validate();" />
<input type="submit" name="submitok" value="Save and Close" onclick="return validate();" />
<input type="reset" value="Reset Form" /></form>

<?php
    include("../footer.html");
    }
?>