<?
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");


$dfrom=$_REQUEST['dfrom'];
$dto=$_REQUEST['dto'];
$tp1=$_REQUEST['tp1'];
$k=0;
$inslno=$_REQUEST['inslno'];
foreach($inslno as $a)
{
 $inslno[$k]=$a;
 $k++;
}


$k=0;
$invno=$_REQUEST['invno'];

foreach($invno as $a)
{
 $invno[$k]=$a;
 $k++;
}


$k=0;
$td2=$_REQUEST['td2'];
foreach($td2 as $a)
{
 $td2[$k]=$a;
 $k++;
}

$k=0;
$tm2=$_REQUEST['tm2'];
foreach($tm2 as $a)
{
 $tm2[$k]=$a;
 $k++;
}

$k=0;
$ty2=$_REQUEST['ty2'];
foreach($ty2 as $a)
{
 $ty2[$k]=$a;
 $k++;
}

$k=0;
$desc1=$_REQUEST['desc1'];
foreach($desc1 as $a)
{
 $desc1[$k]=$a;
 $k++;
}

$k=0;
$th2=$_REQUEST['th2'];
foreach($th2 as $a)
{
 $th2[$k]=$a;
 $k++;
}

$k=0;
$tmin2=$_REQUEST['tmin2'];
foreach($tmin2 as $a)
{
 $tmin2[$k]=$a;
 $k++;
}

$k=0;
$ottype1=$_REQUEST['ottype1'];
foreach($ottype1 as $a)
{
 $ottype1[$k]=$a;
 $k++;
}



date_default_timezone_set("Asia/Kolkata");
$logdt=date("Y-m-d H:i:s");
for($j=0;$j<$k;$j++)
{
    
/*print 'chasis'.$chno[$j];

print '<br> inv'.$invno[$j];


print '<br> reg '.$regno[$j];

*/
$outdt1=$ty2[$j].'-'.$tm2[$j].'-'.$td2[$j];  
$outtime1=$th2[$j].':'.$tmin2[$j];
$sql="update vehinout set outdate='$outdt1',outtime='$outtime1',outttype='$ottype1[$j]',remarks='$desc1[$j]',upddate='$logdt' where slno='$inslno[$j]'  and brcode='$brcode'";

//print $sql;
mysqli_query($db,$sql) or die(mysqli_error($db));
}



?>
<script>
    document.location='vehinout.php'
    </script>




<link rel="stylesheet" href="../style.css" type="text/css" />
<style>
	tr{background-color:white}
	th{background-color:steelblue;color:white}
</style>
<center>



<?

if(isset($_POST['cls']))
{

}
?>
