<link href="<?php echo base_url();?>admin_assets/plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
  <div class="body-content">
            <div class="row">
                
                <div class="col-md-12">
                    <div class="card mb-4">
                        <div class="card-header">
                            <div class="d-flex justify-content-between align-items-center">
                            <h6 class="fs-17 font-weight-600 mb-0"><i class="fa fa-list"></i> 
                           
                            Advance Income Repayments</h6>
                            </div>
                        </div>
                        <div class="card-body">
                        	<table id="table_id" class="table display table-bordered table-striped table-hover basic">
                                        <thead>
                                            <tr>
                                            	<th>LoanID</th>
                                                <th>Name</th>
                                                <th>EMI Paid</th>
                                                <th>Balance Left</th>
                                                <th>TransDate</th>
                                                <th>Status</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        	<?php $i=1;foreach($trans as $u){?>
                                            <tr>
                                        <td>ADV100<?php echo $u->adv_id;?></td>
										<td> <?php echo $u->first_name.'<br/>'.$u->mobile;?><br/>
                                        PSM00<?php echo $u->id;?></td>
                                        <td><?php echo $u->tr_amt;?></td>
                                        <td><?php echo $u->adv_amt-$u->adv_paid;?></td>
                                        <td><?php echo date("d-m-Y",strtotime($u->tr_date));?></td>
                                        <td><?php echo $u->adv_status;?></td>
                                       
                                            </tr>
                                            <?php $i++;}?>
                                        </tbody>
                                    </table>
                        </div>
                     </div>
                </div> 
            </div>
                         
                    </div><!--/.body content-->
                </div><!--/.main content-->
                
                
                
<div class="modal fade" id="depo_modal" role="dialog">

<div class="modal-dialog modal-lg">

  <div class="modal-content">

    <div class="modal-header">

      <h5 class="modal-title text-warning">Advance Income Request</h5>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <div class="modal-body depo_div row">

    </div>

  </div>

</div>

</div>

                <footer class="footer-content">
                    <div class="footer-text d-flex align-items-center justify-content-between">
                        <div class="copy">© 2019 CRM</div>
                    </div>
                </footer><!--/.footer content-->
                <div class="overlay"></div>
            </div><!--/.wrapper-->
        </div>
        <!--Global script(used by all pages)-->
        <script src="<?php echo base_url();?>admin_assets/dist/js/popper.min.js"></script>
        <script>
             $('#table_id').DataTable({

dom: 'Bfrtip',
pageLength: 25,
// lengthMenu: [0, 5, 10, 20, 50, 100, 200, 500],

buttons: [
    'copy', 'csv', 'excel', 'pdf', 'print'
]

});
		$(document).ready(function(){
			$(".view_depo").click(function(e){e.preventDefault();
						var id=$(this).attr("id");
						$(".depo_div").html('<h5>Fetching Details...</h5>');
						$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/ajax_adv_view',
							 data: {id:id},
							 success: function(res){
								 	$(".depo_div").html(res);
								}
							 });
					});
			});
		</script>
        <script src="<?php echo base_url();?>admin_assets/plugins/bootstrap/js/bootstrap.min.js"></script>
        <script src="<?php echo base_url();?>admin_assets/plugins/metisMenu/metisMenu.min.js"></script>
        <script src="<?php echo base_url();?>admin_assets/plugins/perfect-scrollbar/dist/perfect-scrollbar.min.js"></script>
        <!-- Third Party Scripts(used by this page)-->
        <script src="<?php echo base_url();?>admin_assets/dist/js/sidebar.js"></script>
    </body>

</html>