EVOLUTION-NINJA
Edit File: loans_list.php
<?php $this->load->view('includes/header');?> <section class="content-header"> <h1>Loans list </h1> </section> <!--- section 1 --> <section class="content"> <div class="row" style="padding-left:20px; padding-top:25px;"> <div style="margin-left:20px;padding-right:20px;"> <table class="table table-striped table-hover booking_table" style=""> <thead> <tr class="default" > <th class="col-xs-1">Project</th> <th class="col-xs-">Site</th> <th class="col-xs-3">Customer Details</th> <th class="col-xs-1">Executive</th> <th class="col-xs-3">Agreement due date</th> <th class="col-xs-4">Agreement executed on</th> <th></th> </tr> </thead> <tbody id="table_body"> </tbody> </table> </div> </div> </section> <!--- section 2 --> <style type="text/css"> .content-wrapper, .right-side { min-height:900px !important; } a { color: inherit; } </style> <script type="text/javascript"> $(document).ready(function(){ var datatable; var tbody = $('#table_body'); datatable = $('.table').DataTable({ "scrollY": 350, "scrollX": true, }); LoansList(); function LoansList() { tbody.empty(); var table_row = []; $.ajax({ type : 'get', url : '<?php echo site_url("get-loans-list")?>', success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { var slno = 1; var index = 1; $.each(response.booking_list,function(idx,vx){ var row = []; row.push(vx.project_name); row.push(vx.site_number); var customer = ''; customer +='<p>Name: '+vx.customer_name+'</p>'; customer +='<p>Email: '+vx.customer_email+'</p>'; customer +='<p>Mobile: '+jQuery.parseJSON(vx.customer_mobile)+'</p>'; customer +='<p>Address: '+vx.address+'</p>'; row.push(customer); row.push(vx.reference); row.push(vx.agreement_due_date); row.push(vx.agreement_executed_on); row.push('<a class="" href="<?php echo site_url("add-loan-details")?>/'+vx.booking_id+'""><span class="glyphicon glyphicon-edit"></span></a>'); table_row.push(row); slno++; index ++; }); datatable.clear(); datatable.rows.add(table_row).draw(); datatable.draw(); } } }); } }); </script> <?php $this->load->view('includes/footer');?>