Advertisement
jamboljack

Logout SIMPEL

Feb 7th, 2019
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. // Logout
  2.     public function logout_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.             $data = array(
  13.                 'device_id' => '',
  14.             );
  15.  
  16.             $this->db->where('user_username', $username);
  17.             $this->db->update('lemlit_users', $data);
  18.  
  19.             $response = [
  20.                 'resp_error' => false,
  21.                 'resp_msg'   => 'Device ID Updated.',
  22.             ];
  23.         }
  24.  
  25.         $this->response($response, 200);
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement