<?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;
$v_no=$_POST["v_no"];
$userid=$_SESSION["userid"];


$size = count($_POST['sale_qty']);
$i = 0;
while ($i < $size) {
$id= $_POST['id'][$i];
$sale_qty= $_POST['sale_qty'][$i];
	$item_name = $_POST['item_name'][$i];
	$complain = $_POST['complain'][$i];
	$amount = $_POST['amount'][$i];
	$rply = $_POST['rply'][$i];
	$status = $_POST['status'][$i];
	$cdate = $_POST['cdate'][$i];
	 

	$sql = "update complain_details set 
 amount='$amount',complain='$sale_qty',rply='$rply',status='$status',cdate='$cdate' where id='$id'";
$conn->query($sql);

	++$i;

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


} 

//$sql11 = "Insert into expense_voucher (id,date,tr_no,acc_name_dr,discription,amount,user_id,v_type) values (null,'$today','$v_no','$acc_name_dr','$disc','$ledger_amount','$userid','$v_type')";
//mysql_query($sql11) or die("Error : " . mysql_error());



echo "Record Update";
//echo"<td> <a href ='open_customers.php?areaname=$party_area'>Click to Main Dashboard</a>";
echo"<td> <a href ='Open_Complains.php'>Back</a>";
?>
