Advertisement
jamboljack

Read Notifikasi SIMPEL

Jan 27th, 2019
367
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 readnotifikasi_post()
  2.     {
  3.         $username      = trim($this->post('username'));
  4.         $notifikasi_id = trim($this->post('notifikasi_id'));
  5.  
  6.         if ($username == '') {
  7.             $response = [
  8.                 'resp_error' => true,
  9.                 'resp_msg'   => 'Username Kosong.',
  10.             ];
  11.         } elseif ($notifikasi_id == '') {
  12.             $response = [
  13.                 'resp_error' => true,
  14.                 'resp_msg'   => 'ID Notifikasi Kosong.',
  15.             ];
  16.         } else {
  17.             $dataNotif = array(
  18.                 'notifikasi_status' => 2,
  19.             );
  20.  
  21.             $this->db->where('notifikasi_id', $notifikasi_id);
  22.             $this->db->update('lemlit_notifikasi', $dataNotif);
  23.  
  24.             $response = [
  25.                 'resp_error' => false,
  26.                 'resp_msg'   => 'Notifikasi Terbaca',
  27.             ];
  28.         }
  29.  
  30.         $this->response($response, 200);
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement