Advertisement
jamboljack

Profil SIMPEL

Jan 26th, 2019
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1. public function profil_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_users');
  13.             $this->db->where('user_username', $username);
  14.             $dataProfil = $this->db->get()->row();
  15.  
  16.             $response = [
  17.                 'resp_error' => false,
  18.                 'username'   => $dataProfil->user_username,
  19.                 'nama'       => $dataProfil->user_name,
  20.                 'level'      => $dataProfil->user_level,
  21.                 'device_id'  => $dataProfil->device_id,
  22.             ];
  23.         }
  24.  
  25.         $this->response($response, 200);
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement