<?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 remark\n';
		}
		if(document.remarks.vioDetails.value==''){
		    ErrorString+='Please give details\n';
		}
		

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

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

<h3> Add Employee Remarks</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 />
Remark Type 
<select name="vioType">
	<option value="Work Performance">Work Performance</option>
	<option value="Social Performance">Social Performance</option>
	<option value="Presence">Presence</option>
	<option value="General Remarks">General Remarks</option>
	<option value="Other">Other</option>
</select><br />

Details

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

Date: <?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 />

<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");
    }
?>