<?php
 include 'connection.php';
date_default_timezone_set('Asia/Calcutta');
$today = date("Y-m-d");
$time = date("h:i A"); 
$currentyear = date("Y");
  $first_name=$_POST['name'];
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();
$user_id=$user_account['user_id'];
$quotation_id=$_REQUEST['quotation_id'];
$customer_id=$_REQUEST['customer_id'];
?> 
<? 
$customer_id=$_POST['customer_id'];
$billing_address=$_POST['billing_address'];
$state=$_POST['state'];
$bill_city=$_POST['city'];
$state_code=$_POST['state_code'];
$billing_GST_no=$_POST['billing_GST_no'];
$billing_PAN_no=$_POST['billing_PAN_no'];
$pincode=$_POST['pincode'];
$customer_name = $_POST['customer_name'];
$country = $_POST['country'];
$location=$_POST['location'];

$billing_contact_person=$_POST['billing_contact_person'];
$tel_no=$_POST['tel_no'];
$cell_no=$_POST['cell_no'];
$email_id=$_POST['email_id'];



$website=$_POST['website'];
$nature_of_company=$_POST['nature_of_company'];
$cust_category=$_POST['cust_category'];
$application=$_POST['application'];
$reference = $_POST['reference'];

$same_as_billing = $_POST['same_as_billing'];
$shipping_address = $_POST['shipping_address'];
$buyer_name=$_POST['buyer_name'];
$buyer_state=$_POST['buyer_state'];
$buyer_state_code=$_POST['buyer_state_code'];
$buyer_GST_no = $_POST['buyer_GST_no'];
$buyer_PAN_no=$_POST['buyer_PAN_no'];
$buyer_address = $_POST['buyer_address'];

$vendor_code = $_POST['vendor_code'];


$qrycall = "update mst_customer set customer_name='$customer_name',billing_address='$billing_address',location='$location',state='$state',pincode='$pincode',billing_GST_no='$billing_GST_no',billing_PAN_no='$billing_PAN_no',billing_contact_person='$billing_contact_person',tel_no='$tel_no',cell_no='$cell_no',email_id='$email_id',website='$website',country='$country',state_code='$state_code',shipping_address='$shipping_address',buyer_name='$buyer_name',buyer_state='$buyer_state',buyer_state_code='$buyer_state_code',buyer_GST_no='$buyer_GST_no',buyer_PAN_no='$buyer_PAN_no',buyer_address='$buyer_address',vendor_code='$vendor_code' where customer_id = '".$_REQUEST['customer_id']."'";
$rcall=mysqli_query($conn,$qrycall);

//$c_id = $_REQUEST['customer_id'];



//exit();


?>

<script>
javascript:window.location.href="view_details.php?customer_id=<?php echo $_REQUEST['customer_id']?>";
</script>