<?php include 'header1f.php';

$query2job = "select * from check_month";
$resultjob = mysql_query($query2job,$conn);
while($rowmonth=mysql_fetch_array($resultjob))

{
$check_month = $rowmonth['check_month'];
 }


?> <div class="content-page">
    <div class="content">
      <div class="container">
	  <div class="row">
          <div class="col-sm-12">
            <div class="page-header-title">
            <button type="button" class="btn btn-dark waves-effect waves-light" onclick="location.href='make_challan_master.php'">BACK </button>
              <div class="clearfix"></div>
            </div>
          </div>
        </div>
	  <?php include('sahavas_dropdown_function.php');?>
 
 <?php depat_check($department_name,$designation);?>

<?php $short_form = $_REQUEST['short_form']; ?>
<?php
$query2 = "select * from customer_master where customer_id = '".$_REQUEST['customer_id']."'";
$result2 = mysql_query($query2,$conn);	
while($row = mysql_fetch_array($result2))
{
$address_exp = $row['billing_address'];
$city_exp = $row['bcity'];
$customer_name = $row['customer_name'];
}
?>	
<?php

$query2t = "select * from transport_master where trans_inv_no = '".$_REQUEST['trans_inv_no']."'";
$result2t = mysql_query($query2t,$conn);	
$rowcount=mysql_num_rows($result);				
if($rowcount!='0'){
while($row = mysql_fetch_array($result2t))
{
$short_form = $row['short_form'];
}
}else {
$str = $_REQUEST['trans_inv_no'];
				$resultset = explode("/",$str);
				
			$short_form = current($resultset);
				
		}		?>
				
	  <?php
date_default_timezone_set('Asia/Calcutta');
$today = date("Y-m-d");
$time = date("h:i A"); 
$currentyear = date("Y");
$currentmonth = date("m");

if($currentmonth>$check_month) { 
$cuyear = date("y");
$cuyear1 = date("y")+1;

} else { 
$cuyear = date("y")-1;
$cuyear1 =  date("y");
 } 
$f_year = "$cuyear"."-"."$cuyear1";



   $query1 = "select * from challan_no where auto_challan_no!='' and f_year='$f_year' order by challan_id ";
$result1 = mysql_query($query1,$conn);
 $num_rows2a = mysql_num_rows($result1);
if($num_rows2a =='0') { 
$auto_challan_no1 = 0;
 $challan_no1=$auto_enquiry_no1+1;
$challan_no= sprintf("%03d", $challan_no1);
} else {
while($row=mysql_fetch_array($result1))
{
$auto_challan_no1 = $row['auto_challan_no'];
$challan_no1=$auto_challan_no1+1;
$challan_no= sprintf("%03d", $challan_no1);
}
} 

//$challan_no01 = "AR/".$challan_no."/".$f_year;

$challan_no01 = $challan_no."/".$f_year;

?>

	<form name="deptdetail" id="deptdetail" action="insert_direct_challan_master.php" method="post" enctype="multipart/form-data">
			<input  type="hidden" name="customer_id" value="<?php echo $_REQUEST['customer_id'];?>" />
			<input  type="hidden" name="main_id" value="<?php echo $_REQUEST['main_id'];?>" />
			<input  type="hidden" name="trans_inv_no" value="<?php echo $_REQUEST['trans_inv_no'];?>" />
			<input  type="hidden" name="auto_challan_no" value="<?php echo $challan_no;?>" />
<input type="hidden" name="f_year" value="<?php echo $f_year;?>">
			<input  type="hidden" name="inv_type" value="<?php echo $_REQUEST['inv_type'];?>" />

			<input  type="hidden" name="challan_no01" value="<?php echo $challan_no01;?>" />

                    <div class="row">
                        <div class="col-sm-12">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title">Make Bill for Challan: <?php echo $challan_no01?> </h3></div>
                                <div class="panel-body">
                                    <div class="row">
                                                    <?php if($_REQUEST['inv_type']=='EXP'){?> <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Consignor Name</label>
                                                          <input type="text" name="consignor"  value="<? echo $customer_name?>" readonly="readonly" class="form-control">
												<? if($sub_party_name!='') { ?>
												<b style="font-weight:bold; padding-top:5px;">3 Party Name </b>: <? echo $sub_party_name;?>
												<? } ?> 
                                                    </div>
													</div>
													
												
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Address</label>
                                                         <textarea name="consignor_address" class="form-control" required><? echo $address_exp?></textarea>
                                                    </div>
													</div>  <?php } ?>
													
													
													<?php if($_REQUEST['inv_type']=='IMP'){?> <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Consignor Name</label>
                                                          <input type="text" name="consignor"  value="<? echo $customer_name?>" readonly="readonly" class="form-control">
												<? if($sub_party_name!='') { ?>
												<b style="font-weight:bold; padding-top:5px;">3 Party Name </b>: <? echo $sub_party_name;?>
												<? } ?> 
                                                    </div>
													</div>
													
												
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Address</label>
                                                         <textarea name="consignor_address" class="form-control" required><? echo $address_exp?></textarea>
                                                    </div>
													</div>  <?php } ?>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Consignee Name</label>
                                                           <input class="form-control" id="consignee" name="consignee" value="<?php echo $_REQUEST['consignee']?>" readonly="readonly" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Address</label>
                                                     <textarea name="consignee_addess" class="form-control" required><? echo $address_exp?></textarea>
                                                    </div>
													</div>
													
													
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Bill Date</label>
                                                        <input type="text" class="datepicker1 form-control"  name="date" value="<?php echo $_REQUEST['trans_inv_date']?>"  readonly="readonly" >
                                                    </div>
													</div>
													
														<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Challan No</label>
														<input type="text" name="challan_no_book"  class="form-control" />
														
                                                    </div></div>
												
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Delivery  Date</label>
                                                        <input type="text" class="datepicker1 form-control"  name="delivery_date"  >
                                                    </div>
													</div>
													
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Consignee GST No.</label>
                                             <input class="form-control" name="consignee_gst_no" type="text" id="consignee_gst_no"  required><div id="disp1">
                                                    </div>
													</div></div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>From</label>
                                           <input class="form-control" name="from_consignor" type="text" id="from_consignor"  required><div id="disp1">  </div>
													</div></div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>To</label>
                                                         <input class="form-control" name="to_consignor" id="to_consignor" type="text">
                                                    </div>
													</div>
													
                                                     <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Vehicle No</label>
                                                       <input class="form-control" name="vehicle_no" id="vehicle_no" type="text">
                                                    </div>
													</div>
													
													 <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Nos of Pkgs</label>
                                                      <input class="form-control" name="no_of_pkgs" id="no_of_pkgs" type="number" > 
		<input class="form-control" name="type_pkgs" id="type_pkgs" type="text" placeholder="Type of PKG"> 
                                                    </div>
													</div>
                                                    
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Actual Weight</label>
                                                <input class="form-control" name="actual_weight" id="actual_weight" type="text" >
                                                    </div>
													</div>
                                        
										<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Charged Weight</label>
                                              <input class="form-control" name="charged_weight" id="charged_weight" type="text" >
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Topay Freight</label>
                                             <input class="form-control" name="topay_freight" id="topay_freight" type="text" >
                                                    </div>
													</div>
													
														<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Paid Freight</label>
                                            <input class="form-control" name="paid_freight" id="paid_freight" type="text" >
                                                    </div>
													</div>
													
													
														<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Seal No</label>
                                           <input class="form-control" name="seal_no" id="seal_no" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Destinations</label>
                                           <input class="form-control" name="destinations" id="articles_no" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Shipping Agent</label>
                                          <input class="form-control" name="shipping_agent" id="shipping_agent" type="text">
                                                    </div>
													</div>
													
														<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Booking No</label>
                                        <input class="form-control" name="booking_no" id="booking_no" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Receiver Signature With Seal</label>
                                      <input class="form-control" name="receiver_signature_with_seal" id="receiver_signature_with_seal" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Delivery at</label>
                                     <input class="form-control" name="delivery_at" id="delivery_at" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Freight</label>
                                    <input class="form-control" name="freight" id="freight" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Transportations Service</label>
                                  <input class="form-control" name="transportations_service" id="transportations_service" type="text">
                                                    </div>
													</div>
													
														<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Description</label>
                                 <textarea class="form-control" rows="4" style="resize:vertical;" name="description" id="description" maxlength="250" required></textarea>
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Loaded Export / Import / Local</label>
                                <input class="form-control" name="loaded_export_import" id="loaded_export_import" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Total Container Nos</label>
                              <input class="form-control" name="total_container_no" id="total_container_no" type="text">
                                                    </div>
													</div>
													
														<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Container No</label>
                             <input class="form-control" name="container_no" id="container_no" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Container Type</label>
                            <input class="form-control" name="container_type" id="container_type" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Container Type</label>
                            <input class="form-control" name="container_type" id="container_type" type="text">
                                                    </div>
													</div>
													
														<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>B/E No</label>
                           <input class="form-control" name="b_e_no" id="b_e_no" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>B/E Date</label>
                           <input class="form-control datepicker1" name="b_e_date" id="b_e_date" type="date">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>SB No</label>
                          <input class="form-control" name="sb_no" id="sb_no" type="text">
                                                    </div>
													</div>
													
														<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>SB No</label>
                         <input class="form-control datepicker1" name="sb_date" id="sb_date" type="date">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>In Time</label>
                        <input class="form-control" name="in_time" id="in_time" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Out  Time</label>
                         <input class="form-control" name="out_time" id="out_time" type="text">
                                                    </div>
													</div>
													
													<div class="col-sm-12 col-xs-12">
                                           
                                            <div class="m-t-20">
                                                    <div class="form-group">
                                                        <div>
                                                          <input class="btn btn-primary " type="submit" name="Submit" value="NEXT" >
						
															
                                                           
                                                        </div>
                                                    </div>
                                               
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
					  </div>
                    </div>
					
					</form>
        
        
      </div>
    </div>
   	<?php include 'footer1a.php';?>
