<?php 
include "config.php";
session_start();
$user=$_SESSION['log'];
$ticket = $_POST['ticketedit'];
$vehicleno = $_POST['vehiclenoedit'];
$customer = $_POST['customeredit'];
$vehiclename= $_POST['vehiclenameedit'];
$product = $_POST['productedit'];
$salestype = $_POST['salestypeedit'];
$estqty = $_POST['estquantityedit'];
$tripno = $_POST['tripnoedit'];
$remark = $_POST['remarkedit'];
$date = $_POST['dateedit'];
$time = $_POST['timeedit'];
$weight = $_POST['weightedit'];
//$credit = $_POST['credit'];




echo $vehicleno;

//foreach ($productcode as $id => $value ){
    $inssql="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(),'','')";
$sql = "update  first_transaction  set editby='$user',edittime=CURTIME(),editdate=CURDATE(),status='deleted',financialyear='' where ticket = '$ticket'";
echo $sql;
 $go = mysqli_query($connect,$sql);
 $goins = mysqli_query($connect,$inssql);
// }
 header('Location:firsttransaction.php');

?>