		<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>Payment type *</h5>
                        <input type="hidden" class="form-control" name="broker_id" id="broker_id" value="<?php echo $details['broker_id'] ?>" required >
                            <select  class="form-control" name="payment_type" id="payment_type" >
                                <option value="1" >Cash</option>
                                <option value="2" >Cheque</option>
                                </select>
                        </div>
                         <div class="form-group">
                        <h5>Recipt No / Cheque No </h5>
                            <input type="text" class="form-control" name="manual_ref_no" id="manual_ref_no" value="" >
                        </div>
                        
                         <div class="form-group">
                        <h5>Payment Amount *</h5>
                            <input type="number" class="form-control" name="payment_amount" id="payment_amount" value="" required >
                        </div>
                    </div>
                    <div class="col-md-5 pull-right">
                        
                          <div class="form-group">
                        <h5>Remarks </h5>
                        <textarea id="remarks" name="remarks" rows="4" class="form-control" ></textarea>
                        </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 broker_id=$('#broker_id').val();
var payment_type=$('#payment_type').val();
var manual_ref_no=$('#manual_ref_no').val();	
var payment_amount=$('#payment_amount').val();
var remarks=$('#remarks').val();
	$.post( "<?php echo base_url('broker/save_broker_payment'); ?>", {type:type,broker_id:broker_id,payment_type:payment_type,manual_ref_no:manual_ref_no,payment_amount:payment_amount,remarks:remarks})
	  .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','Payment has been updated successfully!');
		  location.reload(true);
	  }
	  if(obj.type=='A'){
		displayNotice('page','Payment has been added successfully!')  ;
		  location.reload(true);
	  }		
	}
	  

	  });
return false;
}
    </script>