Advertisement
jamboljack

Provinsi Pemohon

Nov 22nd, 2018
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. // List Provinsi Pemohon All
  2.     public function provinsi_post()
  3.     {
  4.         $username = trim($this->post('username'));
  5.  
  6.         if ($username == '') {
  7.             $response = [
  8.                 'resp_error' => true,
  9.                 'resp_msg'   => 'Username kosong.',
  10.             ];
  11.         } else {
  12.             $listProvinsi = $this->db->get('bpmppt_provinsi')->result();
  13.             foreach ($listProvinsi as $r) {
  14.                 $response[] = array(
  15.                     'resp_error'    => false,
  16.                     'provinsi_id'   => $r->provinsi_id,
  17.                     'provinsi_nama' => strtoupper(trim($r->provinsi_nama)),
  18.                 );
  19.             }
  20.         }
  21.  
  22.         $this->response($response, 200);
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement