		<style type="text/css">
			body .modal {
	    /* new custom width */
	    width: 750px;
	    /* must be half of the width, minus scrollbar on the left (30px) */
	    margin-left: -375px;
			}
			</style>
            <form role="form" class="form-horizontal" id="create_customer_form" action="#" method="post">
<input type="hidden" value="<?php echo $type;?>" name="type" id="type"/>

<form role="form" class="form-horizontal" id="create_customer_form" action="#">

<div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title"><?php echo $pageName ?></h4>
            <font style="color:#333;">Please fill in the information below. The field labels marked with * are required input fields.</font>
            </div>
    
            
            <div class="modal-body">
            <div id="error"></div>
                <div class="row">
                <div class="col-md-12">
                    <div class="col-md-5">
                            <input type="hidden" value="<?php echo $details['product_id']; ?>" name="product_id" id="product_id" readonly />
                            <input type="hidden" value="<?php echo $details['fr_p_id']; ?>" name="free_issue_id" id="free_issue_id" readonly />
                            <input type="hidden" class="form-control" name="price_type" id="price_type" value="1"readonly>
                          
                          
                        <div class="form-group">
                        <h5>Cost</h5>
                            <input type="number" class="form-control" name="cost" id="cost" value="<?php echo $details['product_cost']; ?>" min="0" required>
                       </div>  
                             
                        <div class="form-group">
                        <h5>Start Qty</h5>
                            <input type="number" class="form-control" name="start_qty" id="start_qty" value="<?php echo $details['start_req_qty']; ?>" min="0"  required>
                       </div>
                        <div class="form-group">
                        <h5>End Qty</h5>
                            <input type="number" class="form-control" name="end_qty" id="end_qty" value="<?php echo $details['end_req_qty']; ?>" min="0"  required>
                       </div>
                            
                            <div class="form-group">
                            <h5>Free Qty</h5>
                            <input type="number" class="form-control" name="free_qty" id="free_qty" value="<?php echo $details['free_qty']; ?>" min="0"  required>
                       </div> 
                       
                  
                   
                      
                    </div>
                </div>
                
                </div> <!--col-md-12-->
            </div>
            <div class="modal-footer">
            <input type="submit" name="add_category" value="<?php echo $btnText; ?>" class="btn btn-primary">
            </div>
</form>
		<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY VALIDATION -->
		<script src="<?php echo asset_url(); ?>js/form-validation-create_customer.js"></script>
		<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY  VALIDATION-->
                        
		<script>
			jQuery(document).ready(function() {
				FormValidator.init();
				//$(".search-select").select2();
				//$('#route_id').select2();
			//	$('#country_id').select2();
			});
		</script>
        
<script type="text/javascript">
function insertCustomerData(){
var type=$('#type').val();
var price_type=$('#price_type').val();
var product_id=$('#product_id').val();
var cost=$('#cost').val();	
var start_qty=$('#start_qty').val();
var end_qty=$('#end_qty').val();
var free_qty=$('#free_qty').val();
var free_issue_id=$('#free_issue_id').val();


	$.post( "<?php echo base_url('free_issue_process/update_free_product'); ?>", {type:type,price_type:price_type,product_id:product_id,cost:cost,start_qty:start_qty,end_qty:end_qty,free_qty:free_qty,free_issue_id:free_issue_id})
	  .done(function( data ) {
	  var obj = jQuery.parseJSON(data);
	 if (obj.status==0) 
	{
		$('div#error').html('<div class="alert alert-block alert-danger fade in"><button type="button" class="close" data-dismiss="alert">×</button><h4 class="alert-heading"><i class="fa fa-times-circle"></i> Error!</h4>'+obj.validation+'</div>');
		$('body').modalmanager('removeLoading');
		$('body').attr('class','');
	} else {
	   //loadGrid();
	  /**/
	  $('div#ajax-modal').modal('hide');
	  // load customer data
	  if(obj.type=='E'){
		 displayNotice('page','Batch has been updated successfully!');
		  location.reload(true);
	  }
	  if(obj.type=='A'){
		displayNotice('page','Batch has been added successfully!')  ;
		  location.reload(true);
	  }		
	}
	  

	  });
return false;
}

$(document).ready(function() {
  $(window).keydown(function(event){
    if(event.keyCode == 13) {
      event.preventDefault();
      return false;
    }
  });
});
    </script>