<?php 
session_start();
$id=$_SESSION['id'];
include('../dist/includes/dbcon.php');
date_default_timezone_set("Asia/Manila"); 
	$date = date("Y-m-d");
	$name = $_POST['name'];
	$aa = $_POST['aa'];
	$bb = $_POST['bb'];
	$cc = $_POST['cc'];
	$dd = $_POST['dd'];
	$ee = $_POST['ee'];
	$ff = $_POST['ff'];
	$gg = $_POST['gg'];
	$hh = $_POST['hh'];
	$ii = $_POST['ii'];
	$a1=$aa * 1000;
	$a2=$bb * 500;
	$a3=$cc * 200;
	$a4=$dd * 100;
	$a5=$ee * 50;
	$a6=$ff * 20;
	$a7=$gg * 10;
	$a8=$hh * 5;
	$a9=$ii * 1;
	
	$total=$a1 + $a2 + $a3 +$a4 +$a5 + $a6 + $a7 + $a8 + $a9;

			mysqli_query($con,"INSERT INTO remit(name,amount,aa,bb,cc,dd,ee,ff,gg,hh,ii,date,user_id) VALUES('$name','$total','$aa','$bb','$cc','$dd','$ee','$ff','$gg','$hh','$ii','$date','$id')")or die(mysqli_error($con));

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