<?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']);
$vioType = mysql_real_escape_string($_POST['vioType']);
$vioDetails = mysql_real_escape_string($_POST['vioDetails']);
$vioDate = isset($_REQUEST["date1"]) ? $_REQUEST["date1"] : "";
//$warnings = mysql_real_escape_string($_POST['warnings']);


$query = "INSERT INTO nam_minorviolations (empId, vioType, vioDetails, vioDate, orientation) VALUES ('".$empId."', '".$vioType."', '".$vioDetails."','".$vioDate."', 'Positive')";
execsql($query);
//echo $query;

$return = mysql_real_escape_string($_POST['submitok']);
if ($return == "Save and New") {
				$cat = mysql_real_escape_string($_POST['cat']);
				header("Location: ../remarks.php?date=$vioDate");
			} else {
				header("Location: ../searchAndDisplayE.php?empId=$empId");
			}
}
?>
