<?php
   
require APPPATH . 'libraries/REST_Controller.php';
     
class Lawfirms extends REST_Controller {
    
	
    // Product methods

    public function index_get($id = 0)
	{
        $data = $this->common->readdatacollection('LawFirms');
        
        $this->response($data, REST_Controller::HTTP_OK);
	}
      
    
    public function create_post()
    {
        $input = $this->input->post();
        $input['createdAt'] = date('d-m-Y h:i:s A');
        
        $this->common->addnewdatamodel('LawFirms', $input);
     
        $this->response($input, REST_Controller::HTTP_OK);
    } 
     
    
    public function update_post($id)
    {
        $input = $this->input->post();
        
        $this->common->updatedatamodel('LawFirms', $id, $input);
     
        $this->response($input, REST_Controller::HTTP_OK);
    }
     
    
    public function remove_delete($id)
    {
        $this->common->deletedatamodel('LawFirms', $id);
       
        $this->response(['Law Firm deleted successfully.'], REST_Controller::HTTP_OK);
    }
    	
}