<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../index.html'; </script>";
 return;
}
include("../opendb.php");
include("../test.php");
$manualcsh=$_REQUEST['manualcsh'];
$i=0;
foreach($manualcsh as $a)
{
 $manualcsh[$i]=$a; 
 $i++;
}
$systmcsh=$_REQUEST['systmcsh'];
$i=0;
foreach($systmcsh as $a)
{
 $systmcsh[$i]=$a; 
 $i++;
}
$variance=$_REQUEST['variance'];
$i=0;
foreach($variance as $a)
{
 $variance[$i]=$a; 
 $i++;
}
$brnchinsign=$_REQUEST['brnchinsign'];
$i=0;
foreach($brnchinsign as $a)
{
 $brnchinsign[$i]=$a; 
 $i++;
}
$brnchaccntsign=$_REQUEST['brnchaccntsign'];
$i=0;
foreach($brnchaccntsign as $a)
{
 $brnchaccntsign[$i]=$a; 
 $i++;
}
$twothsndcount=$_REQUEST['twothsndcount'];
$i=0;
foreach($twothsndcount as $a)
{
 $twothsndcount[$i]=$a; 
 $i++;
}
$fivehndrdcount=$_REQUEST['fivehndrdcount'];
$i=0;
foreach($fivehndrdcount as $a)
{
 $fivehndrdcount[$i]=$a; 
 $i++;
}
$twohndrdcount=$_REQUEST['twohndrdcount'];
$i=0;
foreach($twohndrdcount as $a)
{
 $twohndrdcount[$i]=$a; 
 $i++;
}
$hndrdcount=$_REQUEST['hndrdcount'];
$i=0;
foreach($hndrdcount as $a)
{
 $hndrdcount[$i]=$a; 
 $i++;
}
$fiftycount=$_REQUEST['fiftycount'];
$i=0;
foreach($fiftycount as $a)
{
 $fiftycount[$i]=$a; 
 $i++;
}
$twentycount=$_REQUEST['twentycount'];
$i=0;
foreach($twentycount as $a)
{
 $twentycount[$i]=$a; 
 $i++;
}
$tencount=$_REQUEST['tencount'];
$i=0;
foreach($tencount as $a)
{
 $tencount[$i]=$a; 
 $i++;
}
$coincount=$_REQUEST['coincount'];
$i=0;
foreach($coincount as $a)
{
 $coincount[$i]=$a; 
 $i++;
}
$total=$_REQUEST['total'];
$i=0;
foreach($total as $a)
{
 $total[$i]=$a; 
 $i++;
}
$shrtexcs=$_REQUEST['shrtexcs'];
$i=0;
foreach($shrtexcs as $a)
{
 $shrtexcs[$i]=$a; 
 $i++;
}
$remarks=$_REQUEST['remarks'];
$i=0;
foreach($remarks as $a)
{
 $remarks[$i]=$a; 
 $i++;
}

$rwid=$_REQUEST['rwid'];
$i=0;
foreach($rwid as $a)
{
 $rwid[$i]=$a; 
 $i++;
}
for($j=0;$j<$i;$j++)
{
    $sql2="update  dailycash set phycashbal='$manualcsh[$j]',variange='$variance[$j]',brinchrsign='$brnchinsign[$j]',braccsign='$brnchaccntsign[$j]',curr_2000='$twothsndcount[$j]',curr_500='$fivehndrdcount[$j]',curr_200='$twohndrdcount[$j]',curr_100='$hndrdcount[$j]',curr_50='$fiftycount[$j]',curr_20='$twentycount[$j]',curr_10='$tencount[$j]',coins='$coincount[$j]',curr_total='$total[$j]',short_excess='$shrtexcs[$j]',remarks='$remarks[$j]' where id='$rwid[$j]'";
    echo $sql2;
    echo "<br>";
        mysqli_query($db,$sql2) or die("Err del3".mysqli_error($db));        
}
print "<script>alert('Data has been updated'); </script>";
print "<script>document.location='cashbal.php'</script>";
?>
