<?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
$qry10 = "select * from vendor_master where vendor_id = '".$_REQUEST['vendor_id']."'";
$re10 = mysqli_query($conn,$qry10);
while($row=mysqli_fetch_array($re10))
{  
$vendor_name = $row['vendor_name'];
}?>

<?php
$queryE = "select * from new_vendorpo_01 where vendorpo_id  = '".$_REQUEST['vendorpo_id']."'";
$resultE = mysqli_query($conn,$queryE);
while($row=mysqli_fetch_array($resultE))
{  
$contact_person = $row['contact_person'];
$contact_no = $row['contact_no'];
$contact_email = $row['contact_email'];
$vendorpo_date = $row['vendorpo_date'];
$currency = $row['currency'];
$GST_type = $row['GST_type'];
$address = $row['address'];
$vendorpo_date = $row['vendorpo_date']; 
}?>
<?php 

$query3s = "select * from gst_type where invoice_type='$GST_type' ";
$result3s = mysqli_query($conn,$query3s);	
while($row=mysqli_fetch_array($result3s))
{
$invoice_type_name = $row['invoice_type_name'];
}

?>
<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='view_all_vendorpo.php'">BACK </button>


<div class="clearfix"></div>
</div>
</div>
</div>


<?php if($_REQUEST['total_balancqt']>'0'){?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Vendor PO Module
<?php if($_REQUEST['vendorpo_id']==''){?>
<a href="index.php" class="button btn btn-large btn-primary btn-madmin" style="float:right">Cancel</a>
<?php } ?>
</h3>
</div>
<form name="chkForm" id="chkForm" action="insert_material_inwards.php"  method="post" enctype="multipart/form-data" >
<input type="hidden" value="<?php echo $_REQUEST['vendor_id'];?>" name="vendor_id" />
<input type="hidden" value="<?php echo  $_REQUEST['vendorpo_no'];?>" name="vendorpo_no" />
<input type="hidden" value="<?php echo  $_REQUEST['call_follow_up_id'];?>" name="call_follow_up_id" />
<input type="hidden" value="<?php echo  $_REQUEST['vendorpo_id'];?>" name="vendorpo_id" />



<?php if($currentmonth>03) { ?>
<input type="hidden" name="f_year" value="<?php echo date("Y");?>-<?php echo date("y")+1;?>" />
<?php } else { ?>
<input type="hidden" name="f_year" value="<?php echo date("Y")-1;?>-<?php echo date("y");?>" />
<?php } ?>

<div class="panel-body">
<div class="row">
<div class="col-sm-3 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label><b>Vendor Name</b></label>
<input type="text" class="form-control" value="<?php echo $vendor_name?>" name="vendor_name"/>
</div>
</div>
</div>
<div class="col-sm-3 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label><b>Received Material Copy No.:</b></label>
<input class="form-control"  name="MRnumber" value="" required>


</div>
</div>
</div>
<div class="col-sm-3 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label><b>Date</b></label>
<input type="date" class="datepicker form-control" name="MRdate"  value="<?php echo $vendorpo_date?>">
</div>
</div>
</div>
<div class="col-sm-3 col-xs-12">
<div class="m-t-20">
<div class="form-group">
<label for="username"><strong>Currency</strong></label>
<select class="form-control" name="currency" required>
<?php if($currency!=''){?>
<option value="<?php echo $currency;?>"  selected="selected"><?php echo $currency;?></option>
<?php }else{?>
<option value=""  selected="selected">Select Currency</option>
<?php } ?>
<?php 
$querycu = "select * from currency_master where admin_quotation_status ='1'";
$resultcu = mysqli_query($conn,$querycu);	
while($row=mysqli_fetch_array($resultcu))
{
$currency = $row['currency'];
?>
<option value="<?php echo $currency?>"><?php echo $currency?></option>
<?php } ?>
</select>
</div>
</div>
</div>



<div class="clearfix"></div>


</div>
<table class="table table-striped table-bordered dt-responsive nowrap">
<tr>
<td>Product Name</td>
<td>Qty</td>
<td>Recieved Qty</td>
<td>Balance Qty </td>
</tr>
<?php
$i=1;  
$query2="select * from vendorpo_more_product_02 where vendorpo_id  = '".$_REQUEST['vendorpo_id']."' AND vendor_id = '".$_REQUEST['vendor_id']."' AND deleted !='YES'  and material_received_status='' ORDER BY  more_vproduct_id ASC";
$result=mysqli_query($conn,$query2);
$num_rows = mysqli_num_rows($result);
while($row=mysqli_fetch_array($result))

		{  

$product_name = $row['product_name'];
$more_vproduct_id  = $row['more_vproduct_id'];
$product_id = $row['product_id'];
$qty01 = $row['qty'];
$recieved_qty = $row['recieved_qty'];
$balance_qty = $row['balance_qty'];

if($balance_qty=='')
{
$qty = $qty01;
}else{
$qty = $balance_qty;
}

?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<input type="hidden" name="more_vproduct_id<? echo $more_vproduct_id?>" value="<? echo $more_vproduct_id?>">

<tr>
<td><? echo $product_name;?> <br /><? echo $itemdesc;?>
</td>
<td><input type="text" name="qty<? echo $more_vproduct_id?>" placeholder="Qty" class="form-control" value="<? echo $qty;?>"  id="qty<? echo $more_vproduct_id?>"  onKeyPress="OgKeyPress<? echo $more_vproduct_id;?>()" onKeyUp="OgKeyPress<? echo $more_vproduct_id;?>()"  required/>
</td>
<td><input id="recieved_qty<? echo $more_vproduct_id;?>" name="recieved_qty<? echo $more_vproduct_id;?>"  class="form-control"  onKeyPress="OgKeyPress<? echo $more_vproduct_id;?>()" onKeyUp="OgKeyPress<? echo $more_vproduct_id;?>()" placeholder="" step="0.00001"  inputmode="numeric" type="number"  value="<?php echo $recieved_qty?>"/></td>
<td><input type="text" id="balance_qty<? echo $more_vproduct_id;?>" name="balance_qty<? echo $more_vproduct_id;?>" value="<? echo $balance_qty;?>" class="form-control" readonly="readonly" placeholder="Balance Qty" /></td>
</tr>
<script>

$('#recieved_qty<? echo $more_vproduct_id;?>,#qty<? echo $more_vproduct_id;?>').on('input',function(){


    var qty<? echo $more_vproduct_id;?> = parseFloat($('#qty<? echo $more_vproduct_id;?>').val()) || 0;

	var recieved_qty<? echo $more_vproduct_id;?> = parseFloat($('#recieved_qty<? echo $more_vproduct_id;?>').val()) || 0;

    $('#balance_qty<? echo $more_vproduct_id;?>').val(qty<? echo $more_vproduct_id;?>-recieved_qty<? echo $more_vproduct_id;?>);   

	 

});</script>
<?php }?>
</table>
<div class="clearfix"></div>
<div class="row">
<div class="col-sm-12 col-xs-12">
<div class="m-t-20">
<input type="submit" name="Submit" class="btn waves-light" value="Save" style="float:right; background-color:#65bd77; color: #FFFFFF">
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>


<?php } ?>



<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">View All Product Received</h3>
</div>
<div class="panel-body">
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
<thead>
<tr>
<th>Sr.No.</th>
<th>Product Name</th>
<th>Material Recieved No</th>
<th>Date</th>
<th>Order Qty </th>
<th>Recieved Qty</th>
</tr>
</thead>
<tbody>
<?php $i=1;
$queryls = "select * from  matrial_recieved_activty where vendorpo_id='".$_REQUEST['vendorpo_id']."' ORDER BY product_name";
$resultls = mysqli_query($conn,$queryls);	
while($row=mysqli_fetch_array($resultls))
{

					
						$product_name = $row["product_name"];
						$MRnumber = $row["MRnumber"];
						$vendor_name = $row["vendor_name"];
						$MRdate = $row["MRdate"];
						$recieved_qty = $row["recieved_qty"];
						$order_qty = $row['order_qty'];
						
?>

<tr>
<td><?php echo $i?></td>
<td><?php echo $product_name?></td>
<td><?php echo $MRnumber?></td>
<td><?php echo $MRdate?> </td>
<td><?php echo $order_qty?></td>
<td><?php echo $recieved_qty?></td>
</tr>
<?php  $i++;}?>
</tbody>
</table>

</div>
</div>
</div>
</div>






</div>
</div>
<footer class="footer"> &copy; <?php echo $company_namecnp ?></footer>
</div>
<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>