<?php
	include('includes/config.php');
	
$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'];
$control = $_POST['control'];
$position = $_POST['position'];
$email = $_POST['email'];
$contact = $_POST['contact'];
$contact_per = $_POST['contact_per'];
$skills = $_POST['skills'];
$ranking = $_POST['ranking'];
//for history log
$pc_time = $_POST['pc_time'];
$pc_date = $_POST['pc_date'];
SESSION_START();
$user = $_SESSION['user_name'];


		$employee = $_POST['id'];
		
		
		mysql_query("UPDATE employees SET first_name ='$first_name', 
									last_name ='$last_name',
									middle_initial ='$middle_initial',
									gender = '$gender',
									street ='$street',
									city ='$city',
									province='$province',
									birthdate='$birthdate',
									status='$status',
									philhealth='$philhealth',
									sss='$sss',
									position='$position',
									email='$email',
									contact='$contact',
									contact_per='$contact_per',
									skills='$skills',
									ranking='$ranking' 
									WHERE emp_id ='$employee'") or die(mysql_error());  
		
echo "success";
		
mysql_query("INSERT INTO history (`data`,`actions`,`date`,`user`)
			VALUES('$first_name $last_name', 'modified employee', '$pc_date $pc_time', '$user')")or die(mysql_error());	
//for log
?>