<?php
session_start();
include 'dbc.php';
date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;


$userid=$_SESSION["userid"];
$username=$_SESSION["username"];
$acc_name_dr=$_POST["acc_name_dr"];
$size = count($_POST['sale_qty']);

$i = 0;
			while ($i < $size) {
	$sale_qty= $_POST['sale_qty'][$i];
	
	$id = $_POST['id'][$i];
	$bname = $_POST['bname'][$i];
	$city = $_POST['city'][$i];
	$date = $_POST['date'][$i];
	
	
	$chequeno= $_POST['chequeno'][$i];
	$bankname= $_POST['bankname'][$i];
	
if($sale_qty > 0)
{
	
	
 
$sql = "Insert into cashrec (id,date,month_name,ven_name,username,user_id,netamount,venid,wh_tax,whamount,chequeno,bankname,remarks,city) values (null,'$date','$month_name','$bname','$username','$userid','$sale_qty','$acc_name_dr','$wh_tax','$whamount','$chequeno','$bankname','No','$city')";
$conn->query($sql);
	//echo $date;
	}
	++$i;

// do the update and print out some info just to provide some visual feedback



} 
header("location:Receipt_Dashboard.php");

?>
