<?php include 'connection.php';
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }
	function randomPassword() {
    $alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    $pass = array(); //remember to declare $pass as an array
    $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
    for ($i = 0; $i < 5; $i++) {
        $n = rand(0, $alphaLength);
        $pass[] = $alphabet[$n];
    }
    return implode($pass); //turn the array into a string
}
$unique_id = randomPassword();

?>

<?php

$consignor_name= $_POST['consignor_name'];
$consignor_gstno= $_POST['consignor_gstno'];
$consignor_address= $_POST['consignor_address'];
$consignee_name= $_POST['consignee_name'];
$consignee_gstno= $_POST['consignee_gstno'];
$consignee_address = $_POST['consignee_address'];
$challan_from= $_POST['challan_from'];
$challan_to= $_POST['challan_to'];
$vehicle_no= $_POST['vehicle_no'];
$articles_no= $_POST['articles_no'];
$description= $_POST['description'];
$actual_weight= $_POST['actual_weight'];
$charge_weight= $_POST['charge_weight'];
$to_pay= $_POST['to_pay'];
$paid= $_POST['paid'];
$transportation= $_POST['transportation'];
$loaded= $_POST['loaded'];
$container_no= $_POST['container_no'];
$seal_no= $_POST['seal_no'];
$destination= $_POST['destination'];
$shipping_agent= $_POST['shipping_agent'];
$booking_no= $_POST['booking_no'];
$in_time= $_POST['in_time'];
$in_date= $_POST['in_date'];
$out_time= $_POST['out_time'];
$out_date= $_POST['out_date'];
$receiver_sign= $_POST['receiver_sign'];
$delivery_at= $_POST['delivery_at'];

		
$query14 = "insert into challan2 (consignor_name,consignor_gstno,consignor_address,consignee_name,consignee_gstno,consignee_address,challan_from,challan_to,vehicle_no,articles_no,description,actual_weight,charge_weight,to_pay,paid,transportation,loaded,container_no,seal_no,destination,shipping_agent,booking_no,in_time,in_date,out_time,out_date,receiver_sign,delivery_at) values ('$consignor_name','$consignor_gstno','$consignor_address','$consignee_name', '$consignee_gstno','$consignee_address','$challan_from','$challan_to','$vehicle_no','$articles_no','$description','$actual_weight','$charge_weight','$to_pay','$paid','$transportation','$loaded','$container_no','$seal_no','$destination','$shipping_agent','$booking_no','$in_time','$in_date','$out_time','$out_date','$receiver_sign','$delivery_at')";
$r14=mysql_query($query14,$conn);


// echo $qryauto;
// exit();
?> 

<script>
javascript:window.location.href="challan_form2.php";
</script>
