SHARE
TWEET

dataTableController

Novinaldi Jun 30th, 2020 1,065 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function ambildata()
  2.     {
  3.         if ($this->input->is_ajax_request() == true) {
  4.             $this->load->model('admin/member/Modelmember', 'member');
  5.             $list = $this->member->get_datatables();
  6.             $data = array();
  7.             $no = $_POST['start'];
  8.             foreach ($list as $field) {
  9.                
  10.                 $no++;
  11.                 $row = array();
  12.                
  13.                 $row[] = $no;
  14.                 $row[] ='';
  15.                 $data[] = $row;
  16.             }
  17.  
  18.             $output = array(
  19.                 "draw" => $_POST['draw'],
  20.                 "recordsTotal" => $this->member->count_all(),
  21.                 "recordsFiltered" => $this->member->count_filtered(),
  22.                 "data" => $data,
  23.             );
  24.             //output dalam format JSON
  25.             echo json_encode($output);
  26.         } else {
  27.             exit('Maaf data tidak bisa ditampilkan');
  28.         }
  29.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top