<?php
   
require APPPATH . 'libraries/REST_Controller.php';
     
class Timeclock extends REST_Controller {
    
	
    public function __construct() {
       parent::__construct();
       $this->load->model('common');
    }
       
	public function index_get($id = 0)
	{
        $data = $this->common->readdatacollection('Timeclock');
        
        $this->response($data, REST_Controller::HTTP_OK);
	}
      
    
    public function create_post()
    {
        $input = $this->input->post();
        
        $this->common->addnewdatamodel('Timeclock', $input);
     
        $this->response($input, REST_Controller::HTTP_OK);
    } 
     
    
    public function update_post($id)
    {
        $input = $this->input->post();
        $this->common->updatedatamodel('Timeclock', $id, $input);
     
        $this->response($input, REST_Controller::HTTP_OK);
    }
     
    
    public function remove_delete($id)
    {
        $this->common->deletedatamodel('Timeclock', $id);
       
        $this->response(['Time clock deleted successfully.'], REST_Controller::HTTP_OK);
    }
    	
}