<?php 
include "config.php";
session_start();
$user=$_SESSION['log'];
$ticket = $_POST['ticketadd'];
$vehicleno = $_POST['vehicleadd'];
$customer = $_POST['customeradd'];
$vehiclename= $_POST['vehiclenameadd'];
$product = $_POST['productadd'];
$salestype = $_POST['salestypeadd'];
$estqty = $_POST['estquantityadd'];
$tripno = $_POST['tripnoadd'];
$remark = $_POST['remarkadd'];
$date = $_POST['datefrst'];
$time = $_POST['timefrst'];
$weight = $_POST['weightadd'];
//$credit = $_POST['credit'];




echo $vehicleno;

//foreach ($productcode as $id => $value ){
$sql = "insert into first_transaction (ticket,vehicleno,customer,salestype,vehiclename,product,weight,estimatedqty,tripsheet,remark,date,time,editby,edittime,editdate,status,financialyear) values('$ticket','$vehicleno','$customer','$salestype','$vehiclename','$product','$weight','$estqty','$tripno','$remark','$date','$time','$user',CURTIME(),CURDATE(),'','')";
echo $sql;
 $go = mysqli_query($connect,$sql);
 $update = "update ticket set firsttrans='1' where ticket ='$ticket'";
 $goup = mysqli_query($connect,$update);
// }
 header('Location:firsttransaction.php');

?>