<?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
}

	date_default_timezone_set('Asia/Calcutta');
$today = date("d/m/y");
$today1 = date("d-m-Y");
$today2 = date("Y-m-d");
$received_time = date("Y-m-d H:i:s");

$currentyear = date("Y");
$currentmonth = date("m");

if($currentmonth>03) { 
$cuyear = date("Y");
$cuyear1 = date("y")+1;
} 
else { 
$cuyear = date("Y")-1;
$cuyear1 =  date("y");
} 
$f_year = "$cuyear"."-"."$cuyear1";


$unique_id = randomPassword();	

$querylogin = "select * from  mst_users where user_name = '". $_SESSION["LOGIN_NAME"]."' AND password = '".$_SESSION["EMPLOYEE_PASSWORD"]."'";
$resultlogin = mysqli_query($conn,$querylogin);
while($row=mysqli_fetch_array($resultlogin))
{
$user_name = $row['user_name'];
$user_id09 = $row['user_id'];
$login_type = $row['login_type'];

}	
?>



<?php
$delivery_challan_no=$_POST['delivery_challan_no'];
$delivery_challan_date=$_POST['delivery_challan_date'];











date_default_timezone_set('Asia/Calcutta');

$today = date("Y-m-d");

$time = date("Y-m-d H:i:s");

$currentyear = date("Y");

$currentmonth = date("m");



if($currentmonth>03) { 

$cuyear = date("Y");

$cuyear1 = date("y")+1;

} 

else { 

$cuyear = date("Y")-1;

$cuyear1 =  date("y");

} 

$f_year = "$cuyear"."-"."$cuyear1";
$bal_weight01=$_POST['bal_weight'];
$close_weight=$_POST['close_weight'];
$bal_weight=$bal_weight01-$close_weight;
 $query1_PO = "update cust_inward_more_row_02 set bal_weight='$bal_weight',close_weight='$close_weight'  where customer_id = '".$_REQUEST['customer_id']."' and cust_more_row_id = '".$_REQUEST['cust_more_row_id']."'" ;
//echo $query1;
$r1PO=mysqli_query($conn,$query1_PO);
?>


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

