<?php
include ("connect.php");
	$slipID = $_POST["slipID"];
	$month = $_POST["month"];
	$startdate = $_POST["startdate"];
	$enddate = $_POST["enddate"];
	$workingday = $_POST["workingday"];
	$name = $_POST["name"];
	$basicsalary = $_POST["basicsalary"];
	$epfrate1 = $_POST["epfe"];
	$epfrate2 = $_POST["epfc"];
	$socso1 = $_POST["socsoe"];
	$socso2 = $_POST["socsoc"];
	$pcb = $_POST["pcb"];
	$grosspay = $_POST["grosspay"];
	$allowance1 = $_POST["allowance1"];
	$allowance2 = $_POST["allowance2"];
	$allowance3 = $_POST["allowance3"];
	$staffNoPayHour = $_POST["staffNoPayHour"];
	$leaveRM = $_POST["leaveRM"];
	$netpay = $_POST["netpay"];
if($_POST["cancel"] == "cancel")
{
	echo "<script language='javascript'>window.location='salarylist.php'</script>";
}else{	
	$result = mysql_query("INSERT INTO salaryslip(slipNo, month, startdate, enddate, workingday, name, basicsalary, epfrate1, epfrate2, socso1, socso2, pcb, grosspay, allowance1, allowance2, allowance3, staffNoPayHour, leaveRM, netpay)
	VALUES
	('$slipID', '$month', '$startdate', '$enddate', '$workingday', '$name', '$basicsalary', '$epfrate1', '$epfrate2', '$socso1', '$socso2', '$pcb', '$grosspay', '$allowance1', '$allowance2', '$allowance3', '$staffNoPayHour', '$leaveRM', '$netpay')";
	
	
	$db = mysql_close();
	echo "<script language='javascript'>alert('Salary Slip $slipID is create.')</script>";
	echo "<script language='javascript'>window.location='printsalary.php?slipID=".$slipID."'</script>";
	}
?>