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

$empId = mysql_real_escape_string($_POST['empId']);
$empFName = mysql_real_escape_string($_POST['empFName']);
$empLName = mysql_real_escape_string($_POST['empLName']);
$empContact = mysql_real_escape_string($_POST['empContact']);
//$empAge = mysql_real_escape_string($_POST['empAge']);
$empAge = isset($_REQUEST["date1"]) ? $_REQUEST["date1"] : "";
$empIdNo = mysql_real_escape_string($_POST['empIdNo']);
//$pob = mysql_real_escape_string($_POST['pob']);
$empSex = mysql_real_escape_string($_POST['empSex']);
$empMStatus = mysql_real_escape_string($_POST['empMStatus']);
$empPass = mysql_real_escape_string($_POST['empPass']);
$empCountry = mysql_real_escape_string($_POST['empCountry']);
$empPost = mysql_real_escape_string($_POST['empPost']);
$empRes = mysql_real_escape_string($_POST['empRes']);
$empAccNo = mysql_real_escape_string($_POST['empAccNo']);
$empBank = mysql_real_escape_string($_POST['empBank']);
$empBranch = mysql_real_escape_string($_POST['empBranch']);
$empDepend = mysql_real_escape_string($_POST['empDepend']);
$empPos = mysql_real_escape_string($_POST['empPos']);
$empSection = mysql_real_escape_string($_POST['empSection']);
//$empDateEmp = mysql_real_escape_string($_POST['empDateEmp']);
$empDateEmp = isset($_REQUEST["date2"]) ? $_REQUEST["date2"] : "";
$emergName = mysql_real_escape_string($_POST['emergName']);
$emergNo = mysql_real_escape_string($_POST['emergNo']);
$emergRelation = mysql_real_escape_string($_POST['emergRelation']);
//$education = mysql_real_escape_string($_POST['education']);
$empShoe = mysql_real_escape_string($_POST['empShoe']);
$empOverall = mysql_real_escape_string($_POST['empOverall']);
//$empEmployDate = mysql_real_escape_string($_POST['empEmployDate']);
$empEmployDate = isset($_REQUEST["date3"]) ? $_REQUEST["date3"] : "";
$empRate = mysql_real_escape_string($_POST['empRate']);
$firstWarning = mysql_real_escape_string($_POST['firstWarning']);
$writtenWarning = mysql_real_escape_string($_POST['writtenWarning']);
$finalWarning = mysql_real_escape_string($_POST['finalWarning']);
$performance = mysql_real_escape_string($_POST['performance']);

$query = "UPDATE nam_employees SET empFName='$empFName',empLName='$empLName',empContact='$empContact', empAge='$empAge', empIdNo = '$empIdNo', empSex = '$empSex', empMStatus = '$empMStatus', empCountry = '$empCountry', empPost = '$empPost', empAccNo = '$empAccNo', empBranch = '$empBranch', empDepend = '$empDepend', empPos = '$empPos', empSection = '$empSection', empDateEmp = '$empDateEmp', emergName='$emergName',emergNo='$emergNo',emergRelation='$emergRelation', empShoe = '$empShoe', empOverall = '$empOverall', empEmployDate = '$empEmployDate', empRate ='$empRate', firstWarning = '$firstWarning', writtenWarning = '$writtenWarning', finalWarning = '$finalWarning', empBank = '$empBank', performance= '$performance' WHERE empId='$empId'";
execsql($query);
//echo $query;
$return = mysql_real_escape_string($_POST['submitok']);
if ($return == "Save and New") {
//				
				header("Location: modfiyEmployee.php");
			} else {
				header("Location: searchAndDisplayE.php?id=$empId");
			}

//header('location: employeeMenu.php');

}

?>