<?php include 'header.php';?>
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

 
</style>
<?php 
$customer_inward_id=$_REQUEST['customer_inward_id'];
$customer_id=$_REQUEST['customer_id'];

$qry3z = "select * from cust_raw_inward where  customer_inward_id='$customer_inward_id' and customer_id='$customer_id'";
$re3z= mysqli_query($conn,$qry3z);
while($row=mysqli_fetch_array($re3z))
		{  
		$customer_inward_id = $row['customer_inward_id'];
		
		
$challan_no=$row['challan_no'];
$challan_date=$row['challan_date'];
$vehicle_lr_no=$row['vehicle_lr_no'];
$version_date=$row['version_date'];
$cpo_attachment = $row['cpo_attachment'];

		}

?>

  <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='customer_po.php'">Back </button>
             
              <div class="clearfix"></div>
            </div>
          </div>
        </div>
         <form name="chkForm" id="chkForm" action="insert_cust_raw_inward.php"  method="post" enctype="multipart/form-data">
		 <input type="hidden" name="customer_id" value="<?php echo $_REQUEST['customer_id']?>" />
		 
		 
		 		 <input type="hidden" name="customer_inward_id" value="<?php echo $_REQUEST['customer_inward_id']?>" />

	<?php
	
	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";

	
	 $queryls = "select * from GRN_series where auto_no!='' and year='$f_year'  ORDER BY auto_id";
//echo $queryls;
$resultls = mysqli_query($conn,$queryls);    
 while($row=mysqli_fetch_array($resultls))
                                                    {
                                                    $auto_no = $row['auto_no'];
													 $company_name = $row['company_name'];
                                                    }
    
                                                     
$auto_no_new=$auto_no+1;
$cont_seriesa= sprintf("%04d", $auto_no_new);
$invoice_no1="$cont_seriesa"."-"."$f_year";

?>		<main>
		<div class="row">
                        <div class="col-sm-12">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title"> Customers Challan : GRN No . <?php echo $invoice_no1;?> <br /><span style="color:#FF0000"><strong><?php echo $_REQUEST['massage']?></strong></span></h3></div>
									
									
									
									
                                <div class="panel-body">
                                    <div class="row">
                                      
									  
													
													
                                                    <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Customer Name </label>
   <select name="customer_name" class="form-control">
<option value="" selected>Select Customer</option>
<?php 
$qry97 = "select * from mst_customer where customer_id='".$_REQUEST['customer_id']."'";
$re97 = mysqli_query($conn,$qry97);
while($row=mysqli_fetch_array($re97))
{
$customer_name = $row['customer_name'];
?>
<option value="<?php echo $customer_name?>" selected="selected"><?php echo $customer_name?></option>
<?php }?>
</select>	
                                                    </div>
													</div>
													
										              
                                                    <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Material Recived Challan No </label>
														
														<input type="text" name="challan_no" value="<?php echo $challan_no;?>" class="form-control" />
</div></div>    

                                                    <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Recived Date</label>
														
														<input type="date" name="challan_date" value="<?php echo $challan_date; ?>" class="form-control" />
</div></div>    
 <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Vehicle/LR No  </label>
														
														<input type="text" name="vehicle_lr_no" value="<?php echo $vehicle_lr_no;?>" class="form-control" />
</div></div>    
                       
					   
					   
					                                     
 <div class="col-sm-3 col-xs-12"><div class="form-group">
<label><b>Challan Copy</b></label>
<input type="hidden" class="form-control" name="PO_copy" value="<?php echo $cpo_attachment?>" />
<?php if($cpo_attachment!=''){?> <br />
<a href="rmpo_copy/<?php echo $cpo_attachment?>" target="_blank"><b><?php echo $cpo_attachment?></b></a>
<?php }else{?>
<input type="file" class="form-control" name="PO_copy"><?php } ?>
</div></div>  

<div class="clearfix"></div>
<div class="col-sm-6 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label><b>Raw Material </b></label>
   <select name="row_id" class="form-control select2">
<option value="" selected>Select Raw Product</option>
<?php 
$qry97 = "select * from rowmaterial_master";
$re97 = mysqli_query($conn,$qry97);
while($row=mysqli_fetch_array($re97))
{
$row_id = $row['row_id'];
$bar_size = $row['bar_size'];
$material_name = $row['material_name'];

?>
<option value="<?php echo $row_id?>" >  <?php echo $material_name;?> BAR - <?php echo $bar_size?> </option>
<?php }?>
</select>	
 
</div></div></div><div class="col-sm-6 col-xs-12">
<div class="m-t-20">
<div class="form-group"><br /><input type="submit" name="PRO_ADD" value="ADD" class="btn btn-sm btn-primary add-more"   id="prod_check"/>

</div></div></div>      <table class="table table-striped table-bordered dt-responsive nowrap">

<tr>
<td>#</td>
<td>Raw Material Name </td>
<td>Bar Size  </td>

<td>Description</td>
<td>Heat No.</td>
<td>Bar Qty</td>

<td>Weight</td>
<td>Rate</td>
<td>Total</td>
</tr>

<?php
if($_REQUEST['customer_inward_id']!=''){


$query2="select * from cust_inward_more_row_02 where customer_inward_id = '".$_REQUEST['customer_inward_id']."' AND customer_id = '".$_REQUEST['customer_id']."' AND deleted !='YES' ORDER BY  cust_more_row_id ASC";
$result=mysqli_query($conn,$query2);
while($row=mysqli_fetch_array($result))

		{  
$row_id = $row['row_id'];
$bar_size = $row['bar_size'];
$material_name = $row['material_name'];
$description = $row['description'];

$cust_more_row_id  = $row['cust_more_row_id'];
$qty = $row['qty'];
$weight = $row['weight'];
$rate=$row['rate'];
$heat_no=$row['heat_no'];


?>

<tr>
    <input type="hidden" name="cust_more_row_id<?PHP echo $cust_more_row_id?>" value="<?PHP echo $cust_more_row_id?>">

<td><a href="delete_cust_row_more_product.php?cust_more_row_id=<?php echo $cust_more_row_id?>&&customer_inward_id=<?php echo $_REQUEST['customer_inward_id'];?>&&customer_id=<?php echo $_REQUEST['customer_id'];?>" class="btn waves-light" style="float:right; background-color:#65bd77; color: #FFFFFF">Del</a></td>


<td>
    <input type="text" class="form-control" name="material_name<?PHP echo $cust_more_row_id?>" value="<?PHP echo $material_name?>">
</td>


<td>
    <input type="text" class="form-control" name="bar_size<?PHP echo $cust_more_row_id?>" value="<?PHP echo $bar_size?>">
</td>

<td><textarea  class="form-control" name="description<?PHP echo $cust_more_row_id?>" placeholder="DESCRIPTION"><?PHP echo $description;?></textarea>
</td>
<td>
    <input type="text" class="form-control" name="heat_no<?PHP echo $cust_more_row_id?>" value="<?PHP echo $heat_no?>">
</td>
<td>
    <input type="text" class="form-control" name="qty<?PHP echo $cust_more_row_id?>" value="<?PHP echo $qty?>">
</td>




<td>
    <input type="text" class="form-control" id="weight<?PHP echo $cust_more_row_id?>"  name="weight<?PHP echo $cust_more_row_id?>" value="<?PHP echo $weight?>">
</td>


<?PHP /*?><td>
    <input type="text" class="form-control" name="qty<?PHPecho $cust_more_row_id?>" value="<?PHPecho $qty?>">
</td>
<?php */?><td>
    <input type="text" class="form-control" id="rate<?PHP echo $cust_more_row_id?>" name="rate<?PHP echo $cust_more_row_id?>" value="<?PHP echo $rate?>">
</td>
<td>
<?php $total=$weight*$rate;?>
    <input type="text" class="form-control" id="total<?PHP echo $cust_more_row_id?>" name="total<?PHP echo $cust_more_row_id?>" value="<?PHP echo $total?>">


</td>
</tr>
<script>
$('#rate<?PHP echo $cust_more_row_id;?>,#weight<?PHP echo $cust_more_row_id;?>').on('input',function(){
    var weight<?PHP echo $cust_more_row_id;?> = parseFloat($('#weight<?PHP echo $cust_more_row_id;?>').val()) || 0;
	var rate<?PHP echo $cust_more_row_id;?> = parseFloat($('#rate<?PHP echo $cust_more_row_id;?>').val()) || 0;
    $('#total<?PHP echo $cust_more_row_id;?>').val(rate<?PHP echo $cust_more_row_id;?> * weight<?PHP echo $cust_more_row_id;?>);   
	 
});</script>

             
                 <?php } 
				 
				 }
				 ?>                               <div class="col-sm-12 col-xs-12">
                    </div></table>                       
                                            <div class="m-t-20">
                                                    <div class="form-group">
                                                        <div>
													<input name="Submit"  type="submit" value="Save"  onclick="validate()" class="btn  btn-primary"/>
													
							
                                                        </div>
                                                    </div>
                                               
                                            </div>
                                        </div>
                                        
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
        </main>
        </form>
		
		
		
        
      </div>
    </div>
<script  src="./script.js"></script>
 <script src="vendors/bower_components/jquery/dist/jquery.min.js"></script>
        <script src="vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="vendors/bower_components/moment/min/moment-with-locales.min.js"></script>
        <script src="vendors/bower_components/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
        <script src="vendors/bower_components/switchery/dist/switchery.min.js"></script>
        <script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
        <script src="vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
        
        <!-- Bootstrap Tagsinput JavaScript -->
        <script src="vendors/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
        
        <!-- Bootstrap Touchspin JavaScript -->
        <script src="vendors/bower_components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js"></script>
        
        <!-- Multiselect JavaScript -->
        <script src="vendors/bower_components/multiselect/js/jquery.multi-select.js"></script>
        
         
        <!-- Bootstrap Switch JavaScript -->
        <script src="vendors/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
        
        <!-- Bootstrap Datetimepicker JavaScript -->
        <script type="text/javascript" src="vendors/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>

        
        <!-- Form Advance Init JavaScript -->
        <script src="dist/js/form-advance-data.js"></script>
        
        <!-- Slimscroll JavaScript -->
        <script src="dist/js/jquery.slimscroll.js"></script>
    
        <!-- Fancy Dropdown JS -->
        <script src="dist/js/dropdown-bootstrap-extended.js"></script>
        
        <!-- Owl JavaScript -->
        <script src="vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>
    
        <!-- Init JavaScript -->
        <script src="dist/js/init.js"></script>   <script src="assets/js/bootstrap.min.js"></script>
	<!-- Select2 JavaScript -->
		<script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
		
		<!-- Bootstrap Select JavaScript -->
		<script src="vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/modernizr.min.js"></script>
<script src="assets/js/detect.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/waves.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/jquery.nicescroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="assets/js/app.js"></script>
</body>
<!-- Mirrored from themesdesign.in/xadmino/form-elements.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Feb 2021 12:05:08 GMT -->
</html>