<?php
include("../include/session.php");
if(!$session->isRadstoneReceptionUser() && !$session->isAdmin()){
	header("Location: ../HR/employeeMenu.php");
}else{
	include("../include/db.php");
$empId = $_POST['empId'];
$hours = $_POST['hours'];
$bonus = $_POST['bonus'];
$minutes = $_POST['minutes'];
$details = mysql_real_escape_string($_POST['details']);
$date = isset($_REQUEST["date1"]) ? $_REQUEST["date1"] : "";



$hours = $hours + $minutes;

//echo $empId, $hours, $bonus, $details, $date;

$q = "INSERT INTO overtime (empId, hours, bonus, details, date) VALUES ('".$empId."', '".$hours."', '".$bonus."', '".$details."', '".$date."')";
execsql($q);
$return = mysql_real_escape_string($_POST['submitok']);
if ($return == "Save and New") {
				$cat = mysql_real_escape_string($_POST['cat']);
				header("Location: overtime.php?date=$date");
			} else {
				header("Location: employeeMenu.php");
			}
}

?>