load->model('Dashboard_model', 'dashboard_model'); } public function getTotalUsers_post() { $data = $this->post('data'); $totalUsers = $this->dashboard_model->get_total_users( $data );// Check if the employee exist if ($totalUsers) { $totalUsers['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($totalUsers, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function getTotalStudent_post() { $data = $this->post('data'); $totalStudents = $this->dashboard_model->get_total_students( $data );// Check if the employee exist if ($totalStudents) { $totalStudents['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($totalStudents, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function getTotalEmployee_post() { $data = $this->post('data'); $totalEmployee = $this->dashboard_model->get_total_employee( $data );// Check if the employee exist if ($totalEmployee) { $totalEmployee['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($totalEmployee, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } }