<?php 
date_default_timezone_set("Asia/Manila"); 
	$date = date("Y-m-d H:i:s");
	$date1 = date("Y-m-d");
include('../dist/includes/dbcon.php');

	$cash = $_POST['cash'];
	
	$query2=mysqli_query($con,"select * from category where cat_name='$cat'")or die(mysqli_error($con));
		$count=mysqli_num_rows($query2);

		if ($cash < 0)
		{
			echo "<script type='text/javascript'>alert('CASH INTERED NOT ALLOWED!');</script>";
			echo "<script>document.location='startupcash.php'</script>";  
		}
		else
		{			
			mysqli_query($con,"INSERT INTO startupcash(date,cash) VALUES('$date','$cash')")or die(mysqli_error($con));
mysqli_query($con,"update pettycash set ii=ii+ '$cash' where date='$date1'")or die(mysqli_error());
			echo "<script type='text/javascript'>alert('Successfully added START UP CASH!');</script>";
					  echo "<script>document.location='startupcash.php'</script>";  
		}
?>