Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function data_list()
- {
- $List = $this->users_model->get_datatables();
- $data = array();
- $no = $_POST['start'];
- foreach ($List as $r) {
- $no++;
- $row = array();
- $link = site_url('panel/users/editdata/' . $r->user_username);
- $akses = site_url('panel/users/listakses/' . $r->user_username);
- if (($r->user_level == 'Pemroses') || ($r->user_level == 'Ka. Bidang') || ($r->user_level == 'Front Office') || ($r->user_level == 'Ka. Seksi') || ($r->user_level == 'Bendahara')) {
- $kantor = '<a href="' . $akses . '" title="Hak Akses"><i class="fa fa-list"></i></a>';
- } else {
- $kantor = '';
- }
- $row[] = ' <a href="' . $link . '" title="Edit Data"><i class="icon-pencil"></i></a> ' . $kantor.
- '<a onclick="hapusData('. $r->user_username . ')" title="Delete Data">
- <i class="icon-close"></i>
- </a>';
- $row[] = $no;
- $row[] = trim($r->user_username);
- $row[] = strtoupper(trim($r->user_name));
- $row[] = $r->user_email;
- $row[] = $r->no_telepon;
- $row[] = $r->user_level;
- if ($r->user_status == 'Active') {
- $row[] = '<span class="label label-success">Active</span>';
- } else {
- $row[] = '<span class="label label-danger">Non Active</span>';
- }
- $data[] = $row;
- }
- $output = array(
- "draw" => $_POST['draw'],
- "recordsTotal" => $this->users_model->count_all(),
- "recordsFiltered" => $this->users_model->count_filtered(),
- "data" => $data,
- );
- echo json_encode($output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement