load->model('Reports_model', 'report_model'); } public function status_post() { $bat = $this->post('bname'); $br = $this->post('brname'); $u = $this->post('univ'); $getStatus = $this->report_model->status($bat,$br,$u); //print_r($getStatus); if ($getStatus) { $getStatus['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records found!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function mstatus_post() { $bat = $this->post('bname'); $br = $this->post('brname'); $u = $this->post('univ'); $getStatus = $this->report_model->mstatus($bat,$br,$u); //print_r($getStatus); if ($getStatus) { $getStatus['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records found!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function cert_status_post() { $bat = $this->post('bname'); $br = $this->post('brname'); $u = $this->post('univ'); $getStatus = $this->report_model->certificate_status($bat,$br,$u); //print_r($getStatus); if ($getStatus) { $getStatus['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records found!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function markcert_status_post() { $bat = $this->post('bname'); $br = $this->post('brname'); $u = $this->post('univ'); $from = $this->post('from'); $to = $this->post('to'); $getStatus = $this->report_model->mark_cert_status($bat,$br,$u,$from,$to); //print_r($getStatus); if ($getStatus) { $getStatus['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records found!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function expense_post() { $from = $this->post('from'); $to = $this->post('to'); $getStatus = $this->report_model->expense($from,$to); //print_r($getStatus); if ($getStatus) { $getStatus['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records found!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function batch_post() { $getStatus = $this->report_model->batch(); //print_r($getStatus); if ($getStatus) { $getStatus['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records found!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } }