<?php
	include('includes/config.php');
	
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$middle_initial = $_POST['middle_initial'];
$username = $_POST['username'];
$password = md5($_POST['password']);
$user = $_POST['id'];
//for history log
$action = $_POST['action'];
$pc_date = $_POST['pc_date'];
$pc_time = $_POST['pc_time'];
$user = $_SESSION['user_name'];

mysql_query("UPDATE users SET first_name ='$first_name',
		last_name ='$last_name', 
		middle_initial ='$middle_initial', 
		username='$username', password='$password' 
		WHERE user_id ='$user'") or die(mysql_error());  
		
echo "success";
mysql_query("INSERT INTO history (`data`,`actions`,`date`,`user`)
			VALUES('$username', 'modified user', '$pc_date $pc_time', '$user')")or die(mysql_error());	
//for log		
?>