<?php  $this->load->view('master/common/header2.php',$data);
$base_name = $data['base_name'];

  $queryd11 = $this->db->query("SELECT * FROM customer_payment where payid='$payid'");
  $rowd11 = $queryd11->row(); 
                                             
?>
<link href="<?php echo base_url();?>assets/libs/select2/select2.min.css" rel="stylesheet" type="text/css" />
<script src="<?php echo base_url();?>assets/libs/select2/select2.min.js"></script>

<style>
    .bg-ss:nth-child(2n)
    {
        background-color:white;
    }
    
    .form-group {
    margin: 2px 0;
}

.card{
    margin-bottom:3px;
}


.form-control
{
    height:28px;
}


.btnp
{
    margin-left:10px;
   margin-top:2px;
}
</style>
    <div class="content">
        
        <!-- Start Content-->
        <div class="container-fluid">
            
            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box">
                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item">Admin</li>
                                <li class="breadcrumb-item">Print</li>
                            </ol>
                        </div>
                        <h4 class="page-title text-uppercase"><?= $page;?></h4>
                    </div>
                </div>
            </div>     
            <!-- end page title --> 

            <div class="row">
                <div class="col-md-12 col-xl-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-sm-12">
                                
                                
                                   
                  <style>
   .table1 td, .table1 th {
    padding: .75rem;
    vertical-align: top;
    /* border-top: 1px solid #e9ecef; */
}
                  </style>      
                              
     
					  
				
                
               
                    
          <div class="row">                
              
            <div class="col-md-4" >   
             <img src="<?= base_url('uploads/website/logo/'.$data['logo']);?>" alt="" ><br>
                <?php
             echo $data['contact_address'].'<br>';
            echo  $data['contact_email'].'<br>';
          echo $data['contact_phone'].'<br>';
      
                
                ?>
			</div>		        
				   <div class="col-md-8" >      
					          <table id="key-table" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
					                   <tr>
                                            <td>Name : <?= $customers['cust_name']?></td>
                                         
                                            <td>Mobile : <?= $customers['cust_phone']?></td>
        								</tr>    
        								<tr>
        								  <td colspan='2'> Address : <?= $customers['cust_address']?></td>  
        								  
        								</tr>
        								<tr>
                                            <td>PayID : <?= $payid?></td>
                                            <td>Pay Date : <?= date('d-m-Y',strtotime($rowd11->addon))?></td>
                                           
        								</tr>
        								
					        </table>
					    </div>
           </div>
      
      <div class="row order_list mt-3" >
                <div class="ord col-md-12 col-xl-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-sm-12 table-responsive">
							    <table id="key-table" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
                                    <thead>
                                        <tr>
                                            <th>S.no.</th>
            								<th>Description</th>
            							    <th>Amount</th>
            					
                                        </tr>
                                        
                                        
                                        
                                    </thead>


                                        <tbody>
                                        
					
								        <tr>
                                            <td>1</td>
                                            <td>Bill No- <?php echo $rowd11->bill_no;?></td>
                                            <td><?php echo number_format($rowd11->pre_amt,2);?></td>
        								</tr>
        								 <tr>
                                           
                                            <td colspan="2" class="text-right">Paid</td>
                                            <td><?php echo number_format($rowd11->paid,2);?></td>
        								</tr>
        								<tr>
                                           
                                            <td colspan="2" class="text-right">Dues</td>
                                            <td><?php echo number_format($rowd11->dues,2);?></td>
        								</tr>
							
							
							
							</tbody>
							</table>
							</div>
					    </div>
					</div>
				</div>
			
			</div>     
       
           
           
           
                                
                              
					        </div>
					    </div> 
				
					</div>
				</div>
				<!-- /.col-md-6 -->
			</div>
			
			
			
			
	
			<!-- /.row -->
		</div>
		<!-- /.container-fluid -->
	</div>
	<!-- /.content -->
</div>
<!-- /.content-wrapper -->

<script>
    function updstock(id)
    {
        bill_no=$('#bill_no_'+id).val();
        due=$('#due_'+id).val();
        bill_date=$('#bill_date_'+id).val();
        name=$('#name_'+id).val();
        user_id=$('#user_id_'+id).val();
       
        
        $('#name').val(name);
        $('#bill_no').val(bill_no);
        $('#bill_date').val(bill_date);
        $('#due').val(due);
        $('#user_id').val(user_id);
        
        
    }
</script>


<script>
 function collect()
  {
      
    
     paid=parseFloat($('#paid').val());
      due=  parseFloat($('#due').val());
        
      if(paid>due)
      {
            $('#success').css('display','none');
          $('#danger').css('display','block');
           $('#danger1').html('Invalid Enter Amount');
      }
      else
      {
        due=parseFloat($('#due').val());
        paid=parseFloat($('#paid').val());
        ndue=due-paid;
        $('#ndue').val(ndue)
         $('#danger').css('display','none');
      }
      
            
    
  }
</script>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Collection</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
       <form action="<?php echo base_url().'master/Staff/payment'?>" method="post">    
      <div class="modal-body">
  <div class="row"> 
  
   <div class="alert alert-success col-12 msg" id="success" role="alert" style="display:none;">
  <i class="fa fa-check-circle" aria-hidden="true"></i> <b>Success !! </b> <b id="success1"></b>
</div>

<div class="alert alert-danger col-12 msg" id="danger" role="alert" style="display:none;">
 <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <b>Error !! </b>  <b id="danger1"></b>
</div>                
           
      
           
 <div class="col-md-6">
  <div class="form-group mb-2">
    <label>Staff Name</label>
    <input type="text" readonly id="name" class="form-control"  >
    <input type="hidden" readonly id="user_id" name="user_id"  class="form-control"  >
  </div>
  </div>
  <div class="col-md-6">
   <div class="form-group mb-2">
    <label>Bill No</label>
    <input type="text" readonly id="bill_no" name="bill_no" class="form-control"  >
  </div>
   </div>
  <div class="col-md-6">
   <div class="form-group mb-2">
    <label>PayId</label>
    <input type="text" readonly id="payid" name="payid" value="<?php echo rand(111111,999999)?>"  class="form-control"  >
  </div>
   </div>
  <div class="col-md-6">
   <div class="form-group mb-2">
    <label>Pre Due</label>
    <input type="text" readonly id="due" name="due" class="form-control"  >
  </div>
   </div>
  <div class="col-md-6">
   <div class="form-group mb-2">
    <label>Paid</label>
    <input type="number" onkeyup="collect()" name="paid" id="paid" required class="form-control"  >
  </div>
</div> 


<div class="col-md-6">
   <div class="form-group mb-2">
    <label>New Dues</label>
    <input type="number" readonly id="ndue" required class="form-control"  >
  </div>
</div> 
 
  <div class="col-md-12">
       <div class="form-group mt-4">
   <center> <button type="submit" class="btn btn-primary"  >Collect Now</button></center>
      
      
  </div> 
  </div> 
   
    </div>  
      </div>
     </form>  
    </div>
  </div>
</div>




<?php $this->load->view('master/common/footer2.php'); ?>
<script src="<?php echo base_url();?>assets/js/pages/form-advanced.init.js"></script>











