<?php
   
require APPPATH . 'libraries/REST_Controller.php';
     
class Notification extends REST_Controller {
    
     
    public function __construct() {
       parent::__construct();
       $this->load->model('common');
       
    }
       
    // User methods
	public function index_get($id = 0)
	{
        $data = $this->common->readdatacollection('Notification');
        
        $this->response($data, REST_Controller::HTTP_OK);
	}
      
    
    public function create_post()
    {
        $input = $this->input->post();
        $input['createdDate'] = date('d-m-Y h:i:s A');
        $input['isActive'] = true;
        $input['friends'] = array();
        $this->common->addnewdatamodel('Notification', $input);
     
        $this->response($input, REST_Controller::HTTP_OK);
    } 
     
    
    public function update_post($id)
    {
        $input = $this->input->post();
        $this->common->updatedatamodel('Notification', $id, $input);
     
        $this->response($input, REST_Controller::HTTP_OK);
    }
     
    
    public function remove_delete($id)
    {
        $this->common->deletedatamodel('Notification', $id);
       
        $this->response(['User deleted successfully.'], REST_Controller::HTTP_OK);
    }
    	
}