Bannip73

controller

Nov 24th, 2020
543
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getListsKaryawan()
  2.     {
  3.         $start = $this->input->post('start');
  4.         $limit = $this->input->post('length');
  5.         $columns = $this->input->post('columns');
  6.        
  7.         $filters = null;
  8.         if (!empty($_POST['search']['value'])) {
  9.             $filters = trim($_POST['search']['value']);
  10.         }
  11.        
  12.         $list = $this->mpengaduan->get_data_karyawan($id = null, $offset = null, $limit = null, $order = null, $filters = null);
  13.         $data = array();
  14.         $no = $start;
  15.         foreach ($list as $value) {
  16.             $id = $value->id;
  17.        
  18.             $no++;
  19.            
  20.             $row = array();
  21.             $row[] = $no . '.';
  22.             $row[] = $value->nipbaru;
  23.             $row[] = $value->nama;
  24.             $row[] = $value->jabatan;
  25.             $row[] = $value->nama_unitkerja;
  26.             $row[] = $value->eselon;
  27.             $row[] = $value->golongan;
  28.             $row[] = $value->unor;
  29.             $row[] = $value->unker;
  30.             $data[] = $row;
  31.         }
  32.  
  33.         $output = array(
  34.             "draw" => $_POST['draw'],
  35.             "recordsTotal" => $this->mpengaduan->get_data_cnt_karyawan(),
  36.             "recordsFiltered" => $this->mpengaduan->get_data_cnt_karyawan($filters),
  37.             "data" => $data,
  38.         );
  39.         // print_r($this->mpengaduan->get_data_cnt_karyawan());exit;
  40.         echo json_encode($output);
  41.     }
RAW Paste Data