<?php 
	$header_file=APPPATH.'views/include/header.php';
	require($header_file);
	$sidenav_file=APPPATH.'views/include/sidenav.php';
	require($sidenav_file);	?>
  
    <!-- BEGIN: Content-->
    <div class="app-content content">
      <div class="content-overlay"></div>
      <div class="content-wrapper">
        <div class="content-header row">
          <div class="content-header-left col-md-12 col-12 mb-2 breadcrumb-new">
            <h3 class="content-header-title mb-0 d-inline-block">Add Issue </h3>
            <div class="row breadcrumbs-top d-inline-block">
              <div class="breadcrumb-wrapper col-12">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="#">Home</a>
                  </li>
                  <li class="breadcrumb-item"><a href="#">Product Request</a>
                  </li>
                  <li class="breadcrumb-item active">Add Issue 
                  </li>
                </ol>
              </div>
            </div>
          </div>
          
        </div>
        <div class="content-body"><!-- Basic form layout section start -->
<section id="basic-form-layouts">

	<div class="row justify-content-md-center">
		<div class="col-md-12">
		    <form class="form" autocomplete="off" action="<?php echo site_url('ProductRequest/add_product_OutletIssue');?>" method="post" enctype="multipart/form-data">
			<div class="card">
				<div class="card-content collapse show">
					<div class="card-body">
					<?php 	foreach($prd_req as $pr) ?>
							<div class="row justify-content-md-left">
							<div class="col-md-2">
								<div class="form-group">
									<label>RO.NO</label>
									<input type="text" name="order_no" id="order_no" class="form-control" value="<?php echo $pr->pr_req_no; ?>" readonly />
								</div>
							</div>
							<div class="col-md-2">
								<div class="form-group">
									<label>RO DATE</label>
									<input type="text" name="order_date"  id="order_date" class="form-control" readonly="readonly" value="<?php echo $pr->request_date; ?>"/>
								</div>
							</div>
							<!--<div class="col-md-2">
								<div class="form-group">
									<label>Issue NO</label>
									<input type="text" name="issue_no" id="issue_no" class="form-control" value="<?php //echo $iss->issue_no; ?>" readonly />
								</div>
							</div>-->
							<div class="col-md-2">
								<div class="form-group">
									<label>Issue DATE</label>
									<?php $cur_date = date("d-m-Y"); ?>
										<input class="form-control" type="text" name="issue_date"  id="issue_date" value="<?php echo $cur_date; ?>" readonly >
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label>Department</label>
									<?php 
									$bname=$pr->branchname;
									$q1 = $this->db->query("SELECT * from user where branch_name='$bname'");
										$req_res = $q1->result();
										foreach($req_res as $req_row)
									?>
									<input type="text" name="dept"  id="dept" class="form-control" readonly="readonly" value="<?php echo $req_row->username; ?>"/>
								<input type="hidden" name="outlet_branch"  id="outlet_branch" class="form-control" readonly="readonly" value="<?php echo $pr->branchname; ?>"/>
								<input type="hidden" name="outlet_branch_id"  id="outlet_branch_id" class="form-control" readonly="readonly" value="<?php echo $req_row->branch_id; ?>"/>
								
								<?php  $req_id=$pr->request_id; ?>
								<input name="req_id" id="req_id" type="hidden" class="textbox" value="<?php echo $req_id ?>">
								<input type="hidden" name="branchname" id="branchname" class="form-control" value="<?php echo $_SESSION['branch_name']?>"/>
								<input type="hidden" name="branch_id" id="branch_id" class="form-control" value="<?php echo $_SESSION['branch_id']?>"/>

								<input type="hidden" name="user_name" id="user_name" class="form-control" value="<?php echo $_SESSION['full_name']?>"/>
								<input type="hidden" name="uname" id="uname" class="form-control" value="<?php echo $_SESSION['username']?>"/>

									
								</div>
							</div>
							<div class="col-md-3">
								<div class="form-body">
									<div class="form-group">
										<label for="eventInput1">Vehicle</label>
										<select class="form-control select2" id="vehicle_id" name="vehicle_id"  required>
    										<option value="">Select</option>
    										<?php foreach($vehicle as $row1)
    											{ 
    											?>
    											<option value="<?php echo $row1->vehicle_id; ?>"><?php echo $row1->vehicle_name; ?></option>
    											<?php	 
    											}
    										?>
    									</select>
    									<input type="hidden" class="form-control num"  name="vehicle_name" id="vehicle_name" >
										
										
									</div>
								</div>
							</div>
						</div>
			</div>
			</div>
			</div>
			
				<div class="row">			
								
						<?php
					
					$count = 1;
					foreach($prd_req_item as $pritem){
					?>
					<div class="col-md-5">
						<div class="card" style="height: 79px!important;">
						
						<div class="card-content collapse show">
							<div class="card-body">
									
								<?php
									if($pritem->required_qty == $pritem->recieved_qty) {
								?>
								<div class="row">
										<div class="col-md-9">
											<div class="form-group">
												<input class="form-control product_details" type="text" name="item_name[]" id="item_name <?php echo $count; ?>" value="<?php echo $pritem->item_name; ?>" disabled />
											</div>
										</div>
										<div class="col-md-3">
											<div class="form-group">
												<input class="form-control product_details quantity" type="text" name="quantity[]"  id="quantity<?php echo $count; ?>" value="<?php echo $pritem->required_qty; ?>" disabled />
											</div>
										</div>
										<!--<div class="col-md-3">
											<div class="form-group">
												<label>RO Qty</label>-->
												<!--<input class="form-control product_details" type="text" name="remarks[]"  id="remarks<?php //echo $count; ?>" value="<?php //echo $row1['remarks']; ?>" disabled />
											</div>
										</div>-->
									</div>
									<?php
									} else {
									?>	
									<div class="row">
										<div class="col-md-9">
											<div class="form-group">
												<input class="form-control product_details" type="text" name="item_name[]" id="item_name <?php echo $count; ?>" value="<?php echo $pritem->item_name; ?>" readonly />
											</div>
										</div>
										<div class="col-md-3">
											<div class="form-group">
												<input class="form-control product_details " type="text" name="quantity[]"  id="quantity<?php echo $count; ?>" value="<?php echo $pritem->required_qty; ?>" readonly />
											</div>
										</div>
										<!--<div class="col-md-3">
											<div class="form-group">
												<label>RO Qty</label>-->
												<!--<input class="form-control product_details" type="text" name="remarks[]"  id="remarks<?php //echo $count; ?>" value="<?php //echo $row1['remarks']; ?>" disabled />
											</div>
										</div>-->
									</div>
									<?php
									}
								?>								
							</div>
						</div>
					</div>
					</div>	
					<div class="col-md-7">
						<div class="card">
						
						<div class="card-content collapse show">
							<div class="card-body">
								<?php
								
									if($pritem->required_qty == $pritem->recieved_qty) {
										?>
								
									
									<div class="row">
										<div class="col-md-3">
											<div class="form-group">
												<input class="item_id" type="hidden" name="req_item_id[]" id="req_item_id" value="<?php echo $pritem->request_item_id;?>" disabled>
												<input class="qty form-control" type="text" name="inward_quantity[]"  id="inward_quantity[]" value="<?php echo $pritem->required_qty; ?>" data-uk-tooltip="{pos:'bottom'}" title="Received Qty" disabled />
											</div>
										</div>
										<div class="col-md-1">
											<div class="form-group">
												<img src="<?php echo base_url(); ?>app-assets/images/right.png" alt="" class="img_main"/>
											</div>
										</div>
										<div class="col-md-1">
											<div class="form-group">
												<span>Issued</span>
											</div>
										</div>
									</div>
									<?php
									} else {
									?>
									<div class="row form-inline" style="margin-top: -17px!important;">
									    <lable  class="col-md-2">Price</lable>
									    <lable class="col-md-2">Qty</lable>
									    <lable class="col-md-1">Stock</lable>
									    <lable class="col-md-3">Issued Qty</lable>
									</div>
									<div class="row form-inline">
										<div class="form-group form-botton-group">
											<input class="item_id" type="hidden" name="req_item_id[]" id="req_item_id" value="<?php echo $pritem->request_item_id;?>">	
											<input class="item_id" type="hidden" name="item_id[]" id="item_id" value="<?php echo $pritem->recipe_id?>">
											<input class="item_id" type="hidden" name="uom[]" id="uom" value="<?php echo $pritem->uom?>">
											<input class="item_id" type="hidden" name="cat_id[]" id="cat_id" value="<?php echo $pritem->pr_cat_id?>">
											
											<input class="form-control price col-md-1" type="text" name="price[]"  id="price" value="<?php echo $pritem->price; ?>" data-uk-tooltip="{pos:'bottom'}" title="Price" />
											<input class="qty form-control col-md-1" type="text" name="inward_quantity[]"  id="inward_quantity"  placeholder="Qty"   data-uk-tooltip="{pos:'bottom'}" title=" Remaining Qty :  <?php echo $pritem->item_balance_qty; ?>"  />
											
											<input class="form-control tot_basic" type="hidden" name="tot_basic[]"  id="tot_basic" />
											<input class="form-control tax col-md-1" type="hidden" name="tax[]"  id="tax" value="<?php echo $pritem->tax; ?>" />
											<input class="form-control basic_tax " type="hidden" name="basic_tax[]"  id="basic_tax" value="<?php echo $pritem->tax_amount; ?>" />
											<input class="form-control tax_amt col-md-1" type="hidden" name="tax_amt[]" id="tax_amt" />
											<input class="form-control tot_price col-md-1" type="hidden" name="total_price[]"  id="total_price" />
											<input class="form-control stk col-md-1" type="text" name="stock[]" id="stock <?php echo $count; ?>" value="<?php echo $pritem->production_stock; ?>" data-uk-tooltip="{pos:'bottom'}" title="Present Stock" readonly/>
											<input class="grn_balance form-control col-md-1" type="text" name="received_qty[]"   id="received_qty" value="<?php echo $pritem->recieved_qty; ?>" data-uk-tooltip="{pos:'bottom'}" title="Issued Qty" readonly />
											<input class="grn_balance qty_pending" type="hidden" name="bal_item_qty[]"   id="bal_item_qty" value="<?php echo $pritem->item_balance_qty; ?>" />
											<input class="remarks form-control " type="text" name="remarks[]" id="remarks[]" placeholder="Remarks"/>
										</div>
									</div>
									<?php
									}
								?>				
							</div>
						</div>
					</div>	
				</div>
            <?php $count++; } ?>
		</div>		
        <input class="form-control" type="hidden" name="grand_total" id="grand_total" readonly />
				<br/>
				<div class="uk-grid" data-uk-grid-margin="">
					<div class="uk-width-medium-1-1" >
						<div class="md-card">
							<div class="md-card-content">
								<div class="row">
									<div class="col-md-12">
										<div class="form-group">
											<input type="submit" id="submit" class="btn btn-primary" onclick="return confirm('Are you sure you want to submit?')" value="Accept">
											
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</form>
			<br/>
			
			<?php
			$req_id = $pr->request_id;
			$q1 = $this->db->query("SELECT * FROM product_request P inner join product_request_item PI on P.request_id=PI.request_id where P.request_id='$req_id'");
			$count1 = 0;
			$count2 = 0;
			$status;
			//$store_status;
			$result3 = $q1->result();
			foreach($result3 as $row3)
			{
				$status = $row3->mclose_status;
				//$store_status = $row3->store_status;
				if(($row3->recieved_qty == $row3->receipt_qty))
				{	
					$count2++;	
				}
				$count1++;
			}
			
			if($count1 == $count2) {
			?>
		<!--	 <div class="col-lg-4 col-sm-4 col-12">-->
				<div class="form-group text-left">
					<button class="btn btn-lg btn-success font-medium-1 grid-form-dialog-btn mt-1">Close Manual</button>
					<p class="font-small-3 mt-1"></p>
					<div class="grid-form-dialog" title="Manual Request Close">
						<div class="container">
							<form action="" id="invoice_form_validate" class="uk-form-stacked"  method="post" autocomplete="off">
								<div class="form-group row">
									<label for="inputEmail3" class="col-sm-2 col-form-label">Enter Remarks</label>
									<div class="col-sm-10">
									<input name="request_id" id="request_id" type="hidden" class="textbox" value="<?php echo $pr->request_id; ?>" >
										<input type="text" class="form-control"name="req_remark" id="req_remark">
									</div>
								</div>
								
								<div class="form-group row">
									<div class="offset-sm-2 col-sm-10">
										<button type="button" class="btn btn-sm btn-warning uk-modal-close">Close</button>
										<input type="button" class="btn btn-sm btn-primary" value="Confirm" name="submit3" id="submit3">
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
		
			<?php 
			 } else if($status == 'Approved') { ?>
			 <div class="col-lg-4 col-sm-4 col-12">
				<div class="form-group text-center">
					<button class="btn btn-lg btn-success font-medium-1 grid-form-dialog-btn mt-1">Close Manual</button>
					<p class="font-small-3 mt-1"></p>
					<div class="grid-form-dialog" title="Manual Request Close">
						<div class="container">
							<form action="" id="invoice_form_validate" class="uk-form-stacked"  method="post" autocomplete="off">
								<div class="form-group row">
									<label for="inputEmail3" class="col-sm-2 col-form-label">Enter Remarks</label>
									<div class="col-sm-10">
									<input name="request_id" id="request_id" type="hidden" class="textbox" value="<?php echo $pr->request_id; ?>" >
										<input type="text" class="form-control"name="req_remark" id="req_remark">
									</div>
								</div>
								
								<div class="form-group row">
									<div class="offset-sm-2 col-sm-10">
										<button type="button" class="md-btn md-btn-flat uk-modal-close">Close</button>
										<input type="button" class="md-btn md-btn-flat md-btn-flat-primary" value="Confirm" name="submit3" id="submit3">
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<?php } ?>			
						

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

</section>
<!-- // Basic form layout section end -->
        </div>
      </div>
    </div>
    <?php //require('include/theme_customizer.php');?>

   <?php 
  $footer_file=APPPATH.'views/include/footer.php';
	require($footer_file);
	?>
<script>
	/*$(window).load(function(){
		$(".qty").each( function(){ $(this).on( {'change': function() {
			var uname = $('#username').val();
			var outlet = $('#dept').val();
			//alert(uname);
			//alert(outlet);
			if((uname == 'Savories Kitchen' && outlet == 'counter') || (uname == 'CK_CW3' && outlet == 'cw3-counter'))
			{
				//alert('success');
			}
			else
			{
				var q1 = $(this).parent().find('.qty').val();
				var q2 = $(this).parent().find('.qty_pending').val();
				var tot_price = $(this).parent().find('.tot_price').val();
				var tot = $("#grand_total").val();
				var tot_amt = 0;
				//alert($(this).parent().find('.qty').val()); 
				if(parseFloat(q1) <= parseFloat(q2)){
					//alert("sucess");
				}
				else{
					alert("You cant enter more than RO balance quantity");
					tot_amt = parseFloat(tot) - parseFloat(tot_price);
					$(this).parent().find('.qty').val('0');
					$(this).parent().find('.tot_basic').val('0');
					$(this).parent().find('.tax_amt').val('0');
					$(this).parent().find('.tot_price').val('0');
					$("#grand_total").val(tot_amt.toFixed(2));
				}
			}
		}
		})
		})
	});*/
	
	//calculation
	$('.qty').each(function() { $(this).on( {'keyup': function() {
	    
	    var outlet_branch = $("#outlet_branch").val();
	    var qty = $("#qty").val();
		var tax = $("#tax").val();
		var price = $("#price").val();
			
		var qty = $(this).parent().find('.qty').val();
		var price = $(this).parent().find('.price').val();
		var tax = $(this).parent().find('.tax').val();
		
		var q1 = $(this).parent().find('.qty').val();
		var q2 = $(this).parent().find('.stk').val();
		if(parseFloat(q1) <= parseFloat(q2)){
			if(outlet_branch=='NB'){
        		var basic_amt = (parseFloat(price)*parseFloat(qty)).toFixed(2);
        		var tax_amt = ((parseFloat(basic_amt) * parseFloat(tax))/100).toFixed(2);
        		var tot = (parseFloat(basic_amt) + parseFloat(tax_amt)).toFixed(2);
        		$(this).parent().find('.tot_basic').val(basic_amt);
        		$(this).parent().find('.tax_amt').val(tax_amt);
        		$(this).parent().find('.tot_price').val(tot);
    		}else{
    		    var basic_amt = (parseFloat(price)*parseFloat(qty)).toFixed(2);
    		    $(this).parent().find('.tot_basic').val(basic_amt);
        		$(this).parent().find('.tax_amt').val(0);
        		$(this).parent().find('.tot_price').val(basic_amt);
    		}
		}
		else{
			alert("You cant enter more than the Present Stock");
			$(this).parent().find('.qty').val('0');
			$(this).parent().find('.tot_basic').val('0');
			$(this).parent().find('.tax_amt').val('0');
			$(this).parent().find('.tot_price').val('0');
		}
		
		
			/*var tax1 = parseFloat(tax)/100;
		var tax2 = tax1+1;
		var basicamt = parseFloat(price)/tax2;
		var taxamt2 = (parseFloat(price)-parseFloat(basicamt)).toFixed(2);
		var taxamt=(parseFloat(qty) *parseFloat(taxamt2)).toFixed(2);
		var basic_amount=(parseFloat(qty) *parseFloat(basicamt)).toFixed(2);
		var basic = parseFloat(qty) * parseFloat(price);
		var tot_basic = (parseFloat(qty) * parseFloat(price)).toFixed(2);*/
		/*var basic_tax = $(this).parent().find('.basic_tax').val();
		//alert(basic_tax);
		var tot_basic = (parseFloat(qty) * parseFloat(price)).toFixed(2);
		//var tot_tax = ((parseFloat(tot_basic) * parseFloat(tax))/100).toFixed(2);
		var tot_tax = (parseFloat(basic_tax) * parseFloat(qty)).toFixed(2);
		var total_price = (parseFloat(tot_basic) + parseFloat(tot_tax)).toFixed(2);*/
		//alert(total_price);
		//alert(tax);
		//alert(basic_amt);
		//	alert(tax_amt);
		//		alert(tot);
		
		
	
	}
	})
	})
	
	
	$('.price').each(function() { $(this).on( {'keyup': function() {
	    
	    var qty = $("#qty").val();
			var tax = $("#tax").val();
			var price = $("#price").val();
		var outlet_branch = $("#outlet_branch").val();	
		var qty = $(this).parent().find('.qty').val();
		var price = $(this).parent().find('.price').val();
		var tax = $(this).parent().find('.tax').val();
		if(outlet_branch=='NB'){
    		var basic_amt = (parseFloat(price)*parseFloat(qty)).toFixed(2);
    		var tax_amt = ((parseFloat(basic_amt) * parseFloat(tax))/100).toFixed(2);
    		var tot = (parseFloat(basic_amt) + parseFloat(tax_amt)).toFixed(2);
    		$(this).parent().find('.tot_basic').val(basic_amt);
    		$(this).parent().find('.tax_amt').val(tax_amt);
    		$(this).parent().find('.tot_price').val(tot);
    	}
		else{
		     var basic_amt = (parseFloat(price)*parseFloat(qty)).toFixed(2);
		    $(this).parent().find('.tot_basic').val(basic_amt);
    		$(this).parent().find('.tax_amt').val(0);
    		$(this).parent().find('.tot_price').val(basic_amt);
		}
		/*
		var tax1 = parseFloat(tax)/100;
		var tax2 = tax1+1;
		var basicamt = parseFloat(price)/tax2;
		var taxamt2 = (parseFloat(price)-parseFloat(basicamt)).toFixed(2);
		var taxamt=(parseFloat(qty) *parseFloat(taxamt2)).toFixed(2);
		var basic_amount=(parseFloat(qty) *parseFloat(basicamt)).toFixed(2);
		var basic = parseFloat(qty) * parseFloat(price);*/
		
		
		/*var basic_tax = $(this).parent().find('.basic_tax').val();
		//alert(basic_tax);
		var tot_basic = (parseFloat(qty) * parseFloat(price)).toFixed(2);
		//var tot_tax = ((parseFloat(tot_basic) * parseFloat(tax))/100).toFixed(2);
		var tot_tax = (parseFloat(basic_tax) * parseFloat(qty)).toFixed(2);
		var total_price = (parseFloat(tot_basic) + parseFloat(tot_tax)).toFixed(2);*/
		//alert(total_price);
		
		
	
	}
	})
	})
	/*$('#submit').click(function() {
		var sum = 0;
		$('.tot_price').each(function() {
			sum += Number($(this).val());
		});
		$('#grand_total').val(sum.toFixed());
	});*/
	
	$('.qty').keyup(function() {
		var sum = 0;
		$('.tot_price').each(function() {
			sum += Number($(this).val());
		});
		$('#grand_total').val(sum.toFixed());
	});
</script>
<script>
	/*$(window).load(function(){
		$(".qty").each( function(){ $(this).on( {'change': function() { 
			var q1 = $(this).parent().find('.qty').val();
			var q2 = $(this).parent().find('.stk').val();
			var tot_price = $(this).parent().find('.tot_price').val();
			var tot = $("#grand_total").val();
			var tot_amt = 0;
			if(parseFloat(q1) <= parseFloat(q2)){
				//alert("sucess");
			}
			else{
				alert("You cant enter more than the Present Stock");
				tot_amt = parseFloat(tot) - parseFloat(tot_price);
				$(this).parent().find('.qty').val('0');
				$(this).parent().find('.tot_basic').val('0');
				$(this).parent().find('.tax_amt').val('0');
				$(this).parent().find('.tot_price').val('0');
				$("#grand_total").val(tot_amt.toFixed(2));
			}
		}
		})
		})
	});*/
</script>
<script>
	/*$(window).load(function(){
		$(".qty").each( function(){ $(this).on( {'change': function() { 
			var q1 = $(this).parent().find('.qty').val();
			var tot_price = $(this).parent().find('.tot_price').val();
			var tot = $("#grand_total").val();
			var tot_amt = 0;
			if(parseFloat(tot) < 49000)
			{
				//alert("success");
			}
			else
			{
				alert("Bill amount is greater than 49000");
				tot_amt = parseFloat(tot) - parseFloat(tot_price);
				//$('#inward_quantity').focus();
				$(this).parent().find('.qty').val('0');
				$(this).parent().find('.tot_basic').val('0');
				$(this).parent().find('.tax_amt').val('0');
				$(this).parent().find('.tot_price').val('0');
				$("#grand_total").val(tot_amt.toFixed(2));
			}
		}
		})
		})
	});*/
</script>
<script>
	$('#submit3').click(function() {
		var formData = $('form#invoice_form_validate').serialize();
		var remarks = $('#req_remark').val();
		//alert(remarks);
		if(remarks == '')
		{
			alert("Please Enter Remarks");
			return false;
		}
		else
		{
			$.ajax({
				type: "POST",
				url: '<?php echo base_url();?>index.php/ProductRequest/pr_request_remark_update',
				data: formData,
				success: function(dataz) {
					var dataa = $.trim(dataz); 
					var dataArr = dataa.split('|'); 
					var data = dataArr[0]; 
					var data2 = dataArr[1];
					//alert(data);
					//alert(data2);
					if(data == "success")
					{
						$('.request_updation_success').html( 'Inward Updated Successfully' );
						$('.request_updation_success').css( "display","block" );
					}
					else if(data == "greater")
					{			
						$('.request_updation_error').html('greater!!!' );
						$('.request_updation_error').css( "display","block" );
						$('.request_updation_success').css( "display","none" );
					}
					else
					{
						$('.request_updation_error').html( 'Failed' );
						$('.request_updation_error').css( "display","block" );
						$('.request_updation_success').css( "display","none" );					
					}
					setTimeout(function() {
						window.location.href = "pr_req_closed_list.php?page_id=pr-issue-closed-list";
						window.location.href = '<?php echo site_url('ProductRequest/issueClosedList');?>';
					}, 200);
				}
			});
		}
	});
</script>
<script>
	$(window).on('beforeunload', function () {
         //$("input[type=submit], input[type=button]").prop("disabled", "disabled");
		 $("input[type=submit]").prop("disabled", "disabled");
		 $("#submit").css("background-color","#dcdcdc");
    });
    
    $(document).ready(function() {
  $(window).keydown(function(event){
    if(event.keyCode == 13) {
      event.preventDefault();
      return false;
    }
  });
});
</script>
<script>
	/*$('#submit3').click(function() {
		var req_remark = $('#req_remark').val();
		var req_id = $('#request_id').val();
		if(req_remark == '')
		{
			alert("Please Enter Remarks");
			return false;
		}
		else
		{
			$.ajax({
				type: "POST",
				dataType:'json',
				data : { req_id : req_id, req_remark : req_remark },
				url: "<?php echo base_url();?>index.php/MaterialRequest/requestRmkissUpdate",
				success: function(dataz) { 
					setTimeout(function() {
						window.location = '<?php echo site_url('MaterialRequest/issuePendingList');?>';
					}, 200);
				}
			});
		}
	});*/
	$('#vehicle_id').change(function(){
			var vehicle_id = $('#vehicle_id').val();
			$.ajax({
				type :'POST',
				dataType:'json',
				data : { vehicle_id : vehicle_id },
				url :'<?php echo base_url();?>index.php/Issues/vehicle_fetch',
				success:function(res){
					$("#vehicle_name").val(res.vehicle_name);
				}
			});
		});
</script>

  </body>
  <!-- END: Body-->

<!-- Mirrored from pixinvent.com/modern-admin-clean-bootstrap-4-dashboard-html-template/html/ltr/vertical-modern-menu-template/form-layout-basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Apr 2020 09:38:02 GMT -->
</html>