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


$today2 = date("Y-m-d");
 $future_date = date('Y-m-d', strtotime("+1 day"));

$queryls = "select * from work_order_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);
$WORK_ORDER_NO="$cont_seriesa"."-"."$f_year";


$customer_po_id=$_REQUEST['customer_po_id'];
$customer_id=$_REQUEST['customer_id'];

$qry3z = "select * from customer_PO where  customer_po_id='$customer_po_id' and customer_id='$customer_id'";
$re3z= mysqli_query($conn,$qry3z);
while($row=mysqli_fetch_array($re3z))
		{  
		$customer_po_id = $row['customer_po_id'];
		
		
$po_number=$row['po_number'];
$po_date=$row['po_date'];
$version_no=$row['version_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='delete_cust_po.php?customer_po_id=<?php echo $_REQUEST['customer_po_id']?>'">Back </button>
             
              <div class="clearfix"></div>
            </div>
          </div>
        </div>
         <form name="chkForm" id="chkForm" action="insert_customer_po.php"  method="post" enctype="multipart/form-data">
		 <input type="hidden" name="customer_id" value="<?php echo $_REQUEST['customer_id']?>" />
		 
		 
		 		 <input type="hidden" name="customer_po_id" value="<?php echo $_REQUEST['customer_po_id']?>" />


		<main>
		<div class="row">
                        <div class="col-sm-12">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title"> Customers PO : Work Order No <?php echo $WORK_ORDER_NO;?><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>PO No </label>
														
														<input type="text" name="po_number" value="<?php echo $po_number;?>" class="form-control" />
</div></div>    

                                                    <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Date</label>
														
														<input type="date" name="po_date" value="<?php echo $po_date; ?>" class="form-control" />
</div></div>                                                              <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label> Version No </label>
														
														<input type="text" name="version_no" value="<?php echo $version_no;?>" class="form-control" />
</div></div>  

   <div class="col-sm-3 col-xs-12"><div class="form-group">
                                                        <label>Date</label>
														
														<input type="date" name="version_date" value="<?php echo $version_date;?>" class="form-control" />
</div></div>  


 <div class="col-sm-3 col-xs-12"><div class="form-group">
<label><b>PO Copy</b></label>
<input type="hidden" class="form-control" name="PO_copy" value="<?php echo $cpo_attachment?>" />
<?php if($cpo_attachment!=''){?> <br />
<a href="cpo_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>Product Category</b></label>
   <select name="product_id" class="form-control select2">
<option value="" selected>Select Product</option>
<?php 
$qry97 = "select * from finish_product_master";
$re97 = mysqli_query($conn,$qry97);
while($row=mysqli_fetch_array($re97))
{
$product_id = $row['product_id'];
$item_code = $row['item_code'];
$description = $row['description'];
$bar_size = $row['bar_size'];
$material_name = $row['material_name'];

?>
<option value="<?php echo $product_id?>" ><?php echo $item_code?>&nbsp; <?php echo $description; ?>, size <?php echo $bar_size?> <?php echo $material_name;?></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>
<th>Sr.No.</th>
<td>Item code </td>
<td>Description</td>
<td>HSN Code</td>
<td>Qty</td>

<td>Basic Rate </td>
<td>Start Date</td>
<td>End Rate</td>
</tr>

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


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

		{  
$product_id = $row['product_id'];
$item_code = $row['item_code'];
$description = $row['description'];

$cust_po_more_product_id  = $row['cust_po_more_product_id'];
$qty = $row['qty'];
$rate = $row['rate'];
$start_date = $row['start_date'];
$end_date = $row['end_date'];
$HSN_code = $row['HSN_code'];
$sr_no=$row['sr_no'];



?>

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

<td><a href="delete_cust_po_more_product.php?cust_po_more_product_id=<?php echo $cust_po_more_product_id?>&&customer_po_id=<?php echo $_REQUEST['customer_po_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="sr_no<? echo $cust_po_more_product_id?>" value="<? echo $sr_no?>">
</td>
<td>
    <input type="text" class="form-control" name="item_code<? echo $cust_po_more_product_id?>" value="<? echo $item_code?>">
</td>

<td><textarea  class="form-control" name="description<? echo $cust_po_more_product_id?>" placeholder="DESCRIPTION"><? echo $description;?></textarea>
</td>
<td> 

<select name="HSN_code<? echo $cust_po_more_product_id?>" class="form-control" required>
<option value="<?php echo $HSN_code;?>" selected><?php echo $HSN_code?></option>
<?php 
$qry97 = "select * from HSN_code_master where product='finish'";
$re97 = mysqli_query($conn,$qry97);
while($row=mysqli_fetch_array($re97))
{
$HSN_code01 = $row['HSN_code'];

?><option value="<?php echo $HSN_code01?>"><?php echo $HSN_code01 ?></option>

<?php } ?>
</select></td>

<td>
    <input type="text" class="form-control" name="qty<? echo $cust_po_more_product_id?>" value="<? echo $qty?>">
</td>
<td>
    <input type="text" class="form-control" name="rate<? echo $cust_po_more_product_id?>" value="<? echo $rate?>">
</td>
<td>
    <input type="date" class="form-control" name="start_date<? echo $cust_po_more_product_id?>" value="<? echo $start_date?>">
</td>


<td>
    <input type="date" class="form-control" name="end_date<? echo $cust_po_more_product_id?>" value="<? echo $end_date?>">
</td>

</tr>


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