Advertisement
jamboljack

Read Notifikasi

Sep 13th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. // Update Read Notifikasi
  2.     public function readnotifikasi_post()
  3.     {
  4.         $username      = trim($this->post('username'));
  5.         $notifikasi_id = trim($this->post('notifikasi_id'));
  6.  
  7.         if ($username == '') {
  8.             $response = [
  9.                 'resp_error' => true,
  10.                 'resp_msg'   => 'Username Kosong.',
  11.             ];
  12.         } elseif ($notifikasi_id == '') {
  13.             $response = [
  14.                 'resp_error' => true,
  15.                 'resp_msg'   => 'Notifikasi ID Kosong.',
  16.             ];
  17.         } else {
  18.             $dataNotif = array(
  19.                 'notifikasi_status' => 2,
  20.             );
  21.  
  22.             $this->db->where('notifikasi_id', $notifikasi_id);
  23.             $this->db->update('bpmppt_notifikasi', $dataNotif);
  24.  
  25.             $response = [
  26.                 'resp_error' => false,
  27.                 'resp_msg'   => '',
  28.             ];
  29.         }
  30.  
  31.         $this->response($response, 200);
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement