You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
<?php if ( !defined('BASEPATH')) exit('No direct script access allowed');
|
|
use app\core\notification\Notification as SubscriptionNotif;
|
|
class Notification extends MY_Controller {
|
|
|
|
protected $notification;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->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);
|
|
}
|
|
}
|