<?php
include('includes/config.php');
	
	$type = $_POST['type'];
	$first_name = $_POST['first_name'];
	$last_name = $_POST['last_name'];
	$middle_initial = $_POST['middle_initial'];
	$gender = $_POST ['gender'];
	$street = $_POST['street'];
	$city = $_POST['city'];
	$province = $_POST['province'];
	$birthdate = $_POST['birthdate'];
	$status = $_POST['status'];
	$philhealth = $_POST['philhealth'];
	$sss = $_POST['sss'];
	$position = $_POST['position'];
	$email = $_POST['email'];
	$contact = $_POST['contact'];
	$contact_per = $_POST['contact_per'];
	$sitecity = $_POST['sitecity'];
	$sitestreet = $_POST['sitestreet'];
	$siteprovince = $_POST['siteprovince'];
	$skills = $_POST['skills'];
	$transact_from = $_POST['transact_from'];
	$transact_to = $_POST['transact_to'];	
	$license_num = $_POST['license_num'];
	$ranking = $_POST['ranking'];	
	//for history log
	$user = $_POST['user'];
	$pc_date = $_POST['date'];
	$pc_time = $_POST['time'];		
mysql_query("INSERT INTO employees (`first_name`, 
			`last_name`, `middle_initial`, 
			`gender`, `street`, `city`, 
			`province`, `birthdate`, 
			`status`, `philhealth`, `sss`, 
			`position`, `email`,
			`contact`, `contact_per`,
			`sitestreet`, `sitecity`, 
			`siteprovince`, `skills`, 
			`type`,
			`transact_from`, `transact_to`,`license_num`, `ranking`) 
			VALUES('$first_name', '$last_name',
			'$middle_initial', '$gender', 
			'$street', '$city', '$province', 
			'$birthdate', '$status', 
			'$philhealth', '$sss',
			'$position', '$email', '$contact', 
			'$contact_per',
			'$sitecity', '$sitestreet',
			'$siteprovince','$skills',
			'$type','$transact_from', '$transact_to','$license_num', '$ranking')
			")
			or die(mysql_error());
echo "success";

//for history log
mysql_query("INSERT INTO history (`data`,`actions`,`date`,`user`)
			VALUES('$first_name $last_name', 'added employee', '$pc_date $pc_time', '$user')")or die(mysql_error());	
			

			?>
