Advertisement
jamboljack

Daftar Kategori SIMPEL

Jan 27th, 2019
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. public function listkategori_post()
  2.     {
  3.         $username = trim($this->post('username'));
  4.  
  5.         if ($username == '') {
  6.             $response = [
  7.                 'resp_error' => true,
  8.                 'resp_msg'   => 'Username kosong.',
  9.             ];
  10.         } else {
  11.             $this->db->select('*');
  12.             $this->db->from('lemlit_skim');
  13.             $this->db->where('skim_active', 'Active');
  14.             $this->db->order_by('skim_id', 'asc');
  15.             $listKategori = $this->db->get()->result();
  16.             foreach ($listKategori as $r) {
  17.                 $response['items'][] = [
  18.                     'resp_error'  => false,
  19.                     'resp_msg'    => 'success',
  20.                     'skim_id'     => $r->skim_id,
  21.                     'skim_name'   => $r->skim_name,
  22.                     'skim_budget' => $r->skim_budget,
  23.                 ];
  24.             }
  25.         }
  26.  
  27.         $this->response($response, 200);
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement