<?php
	include('includes/config.php');
	
$exp_name = $_POST['exp_name'];
$exp_type = $_POST['exp_type'];
$quantity = $_POST['quantity'];
$cost = $_POST['cost'];
$date = $_POST['date'];
//for history log
$action = $_POST['action'];
$user = $_POST['user'];
$pc_date = $_POST['pc_date'];
$pc_time = $_POST['pc_time'];
	
		SESSION_START();

		$expenses = $_POST['id'];
		
		mysql_query("UPDATE expenses SET exp_name ='$exp_name',
									exp_type ='$exp_type',
									quantity = '$quantity',
									cost ='$cost',
									date ='$date' WHERE exp_id = '$expenses'") or die(mysql_error());  
		
echo "success";
mysql_query("INSERT INTO history (`data`,`actions`,`date`,`user`)
			VALUES('$exp_name', 'modified expense', '$pc_date $pc_time', '$user')")or die(mysql_error());	
//for log

		
?>