my_parent_controller(); $this->notification = new SubscriptionNotif(); $this->load->model('User_subscription_model'); } /** * Get notifications */ public function get_notifications() { $result=$this->notification->getNotifications(); return output_to_json($this, $result); } /** * Update notification by id */ public function update_notification() { $id = $this->input->post('id'); $user_id = $this->input->post('user_id'); $this->notification->setNotificationCookie($user_id); $data = array( 'seen_by' => $this->data["logged_in"]["user_id"], 'status' => 1 ); $result = $this->notification->updateNotification($id, $data); return output_to_json($this, $result); } }