<?php 
session_start();
$id=$_SESSION['id'];
include('../dist/includes/dbcon.php');
date_default_timezone_set("Asia/Manila"); 
	$date = date("Y-m-d");
	$exname = $_POST['exname'];
	$amount = $_POST['amount'];
	
	//$query2=mysqli_query($con,"select * from category where cat_name='$cat'")or die(mysqli_error($con));
		//$count=mysqli_num_rows($query2);

				
			mysqli_query($con,"INSERT INTO expenses(name,amount,date,user_id) VALUES('$exname','$amount','$date','$id')")or die(mysqli_error($con));

			//echo "<script type='text/javascript'>alert('Successfully added Expenses!');</script>";
					  echo "<script>document.location='expenses.php'</script>";  
		
?>