<?php
include ("connect.php");

	$staffID = $_POST["staffID"];
	$staffName = $_POST["staffName"];
	$staffAddress = $_POST["staffAddress"];
	$staffPhone = $_POST["staffPhone"];
	$staffEmail = $_POST["staffEmail"];
	$staffDOB = $_POST["staffDOB"];
	$staffIC = $_POST["staffIC"];
	$staffSex = $_POST["staffSex"];
	$staffRace = $_POST["staffRace"];
	$staffMarital = $_POST["staffMarital"];
	$staffJobTitle = $_POST["staffJobTitle"];
	$staffCategory = $_POST["staffCategory"];
	$staffDateJoin = $_POST["staffDateJoin"];
	$staffSalary = $_POST["staffSalary"];
	$staffBank = $_POST["staffBank"];
	$staffAccount = $_POST["staffAccount"];
	$staffEPF = $_POST["staffEPF"];
	$staffSocso = $_POST["staffSocso"];
	$staffPCB = $_POST["staffPCB"];
	$staffPassword = $_POST["staffPassword"];
	$staffstatus = $_POST["staffstatus"];
	$staffPayLeave = $_POST["staffPayLeave"];
	$leaveBalance = $_POST["staffPayLeave"];
	$staffHour = 8;
	
	$result = mysql_query("INSERT INTO staff(staffID, staffName, staffAddress, staffPhone, staffEmail, staffDOB, staffIC, staffSex, staffRace, staffMarital, staffJobTitle, staffCategory, staffDateJoin, staffSalary, staffBank, staffAccount, staffEPF, staffSocso, staffPassword, staffstatus, staffPCB, staffPayLeave, staffHour, leaveBalance)
	VALUES
	('$staffID', '$staffName', '$staffAddress', '$staffPhone', '$staffEmail', '$staffDOB', '$staffIC', '$staffSex', '$staffRace', '$staffMarital', '$staffJobTitle', '$staffCategory', '$staffDateJoin', '$staffSalary', '$staffBank', '$staffAccount', '$staffEPF', '$staffSocso', '$staffPassword', '$staffstatus', '$staffPCB', '$staffPayLeave', '$staffHour', '$leaveBalance')");
	
	$db = mysql_close();
	echo "<script language='javascript'>alert('New Employee Insert Success.')</script>";
	echo "<script language='javascript'>window.location='stafflist.php'</script>"; 
?>