		<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">
                    <div class="form-group">
                        <h5>Product Code *</h5>
                        <?php //print_r($details); ?>
                            <input type="text" class="form-control" name="p_code" id="p_code" value="<?php echo $details['product_code']; ?>" readonly>
                       </div>
                       <div class="form-group">
                        <h5>Product Name *</h5>
                            <input type="text" class="form-control" name="p_name" id="p_name" value="<?php echo $details['product_name']; ?>" readonly>
                        </div>
                        <div class="form-group">
                        <h5>Cost *</h5>
                            <input type="hidden" value="<?php echo $batch_id;?>" name="batch_id" id="batch_id" readonly />
                            <input type="hidden" value="<?php echo $details['product_id']; ?>" name="product_id" id="product_id" readonly />
                            <input type="text" class="form-control" name="cost" id="cost" value="<?php echo $details['product_cost']; ?>" readonly>
                        </div>
                        <div class="form-group">
                        <h5>Batch Code</h5>
                            <input type="text" class="form-control" name="batch_code" id="batch_code" value="<?php echo $details['batch_ref_number']; ?>" readonly>
                        </div>
                    </div>
                    <div class="col-md-5 pull-right">
                        <div class="form-group" style="display: none;">
                        <h5>Distribution Cash Price</h5>
                            <input type="number" class="form-control" name="dcc" id="dcc" value="<?php echo $details['product_price']; ?>">
                       </div>
                       <div class="form-group" style="display: none;">
                        <h5>Distribution Credit Price</h5>
                            <input type="number" class="form-control" name="dcp" id="dcp" value="<?php echo $details['wholesale_price']; ?>">
                       </div>
                       <div class="form-group" style="display: none;">
                        <h5>Distribution Wholesale Price</h5>
                            <input type="number" class="form-control" name="dwp" id="dwp" value="<?php echo $details['credit_salling_price']; ?>">
                       </div>
                       <div class="form-group" >
                        <h5>Retail Cash Price</h5>
                            <input type="number" class="form-control" name="rcc" id="rcc" value="<?php echo $details['retail_cash']; ?>">
                       </div>
                       <div class="form-group" style="display: none;">
                        <h5>Retail Credit Price</h5>
                            <input type="number" class="form-control" name="rcp" id="rcp" value="<?php echo $details['retail_credit']; ?>">
                       </div>
                       <div class="form-group" >
                        <h5>Retail Wholesale Price</h5>
                            <input type="number" class="form-control" name="rwp" id="rwp" value="<?php echo $details['retail_wholesale']; ?>">
                       </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 batch_id=$('#batch_id').val();
var product_id=$('#product_id').val();
var cost=$('#cost').val();	
var batch_code=$('#batch_code').val();
var dcc=$('#dcc').val();
var dcp=$('#dcp').val();
var dwp=$('#dwp').val();	
var rcc=$('#rcc').val();
var rcp=$('#rcp').val();
var rwp=$('#rwp').val();
	$.post( "<?php echo base_url('batch_process/update_batch_product'); ?>", {type:type,batch_id:batch_id,product_id:product_id,cost:cost,batch_code:batch_code,dcc:dcc,dcp:dcp,dwp:dwp,rcc:rcc,rcp:rcp,rwp:rwp })
	  .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;
}
    </script>