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 } } /* * get university based student registration details for dash board * created by kms * */ public function getUniversityRegisteredStudent_post(){ $data = $this->post('data'); $getRegisteredDetails = $this->dashboard_model->get_univ_registered_student($data); if ($getRegisteredDetails) { $getRegisteredDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getRegisteredDetails, 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 } } /* * get Admission and Lead summary details for dash board * created by Tamilarasan * */ public function getleadCountToday_post(){ $branchId = $this->post('branchId'); $getleadCountToday = $this->dashboard_model->leadCountDay($branchId); if ($getleadCountToday) { $getleadCountToday['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getleadCountToday, 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 getleadCountMonth_post(){ $branchId = $this->post('branchId'); $getleadCountMonth = $this->dashboard_model->leadCountMonth( $branchId); if ($getleadCountMonth) { $getleadCountMonth['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getleadCountMonth, 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 getleadCountDayClosed_post(){ $branchId = $this->post('branchId'); $getleadCountDayClosed = $this->dashboard_model->leadCountDayClosed($branchId); if ($getleadCountDayClosed) { $getleadCountDayClosed['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getleadCountDayClosed, 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 getleadCountMonthClosed_post(){ $branchId = $this->post('branchId'); $getleadCountMonthClosed = $this->dashboard_model->leadCountMonthClosed( $branchId); if ($getleadCountMonthClosed) { $getleadCountMonthClosed['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getleadCountMonthClosed, 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 getadmimssionMonth_post(){ $data = $this->post('data'); $getadmimssionMonth = $this->dashboard_model->admissionCountMonth(); if ($getadmimssionMonth) { $getadmimssionMonth['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getadmimssionMonth, 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 getadmimssionYear_post(){ $data = $this->post('data'); $getadmimssionYear = $this->dashboard_model->admissionCountYear(); if ($getadmimssionYear) { $getadmimssionYear['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getadmimssionYear, 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 getfupToday_post(){ $data = $this->post('data'); $getfupToday = $this->dashboard_model->followupsCountToday(); if ($getfupToday) { $getfupToday['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getfupToday, 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 getfupMonth_post(){ $data = $this->post('data'); $getfupMonth = $this->dashboard_model->followupsCountMonth(); if ($getfupMonth) { $getfupMonth['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getfupMonth, 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 leadToday_post(){ $branchId = $this->post('branchId'); $requestedBy = $this->post('requestedBy'); $leadToday = $this->dashboard_model->leadToday($branchId,$requestedBy); if ($leadToday) { $leadToday['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($leadToday, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function leadMonth_post(){ $branchId = $this->post('branchId'); $requestedBy = $this->post('requestedBy'); $leadMonth = $this->dashboard_model->leadMonth($branchId,$requestedBy); if ($leadMonth) { $leadMonth['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($leadMonth, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function leadTodayClosed_post(){ $branchId = $this->post('branchId'); $requestedBy = $this->post('requestedBy'); $leadTodayClosed = $this->dashboard_model->leadTodayClosed($branchId,$requestedBy); if ($leadTodayClosed) { $leadTodayClosed['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($leadTodayClosed, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function leadMonthClosed_post(){ $branchId = $this->post('branchId'); $requestedBy = $this->post('requestedBy'); $leadMonthClosed = $this->dashboard_model->leadMonthClosed($branchId,$requestedBy); if ($leadMonthClosed) { $leadMonthClosed['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($leadMonthClosed, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function admissionMonth_post(){ $year = $this->post('year'); $month = $this->post('month'); $admissionMonth = $this->dashboard_model->admissionMonth($year,$month); if ($admissionMonth) { $admissionMonth['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($admissionMonth, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function admissionYear_post(){ $fyear = $this->post('fyear'); $univ = $this->post('univ'); $branchId = $this->post('branchId'); $admissionYear = $this->dashboard_model->admissionYear( $fyear, $univ, $branchId); if ($admissionYear) { $admissionYear['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($admissionYear, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function feeOutstanding_post(){ $branchId = $this->post('branchId'); $univ = $this->post('univ'); $feeOutstanding = $this->dashboard_model->feeOutstanding($branchId, $univ); if ($feeOutstanding) { $feeOutstanding['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($feeOutstanding, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function followupsToday_post(){ $branchId = $this->post('branchId'); $requestedBy = $this->post('requestedBy'); $followupsToday = $this->dashboard_model->followupsToday( $branchId, $requestedBy); if ($followupsToday) { $followupsToday['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($followupsToday, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function followupsPending_post(){ $branchId = $this->post('branchId'); $requestedBy = $this->post('requestedBy'); $followupsPending = $this->dashboard_model->followupsPending( $branchId, $requestedBy); if ($followupsPending) { $followupsPending['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($followupsPending, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function admissionBatch_post(){ $branchId = $this->post('branchId'); $univ = $this->post('univ'); $admissionBatch = $this->dashboard_model->admissionBatch($univ,$branchId); if ($admissionBatch) { $admissionBatch['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($admissionBatch, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } //To filters public function filterYear_post(){ $branch = $this->post('branchId'); $filterYear = $this->dashboard_model->getYear($branch); if ($filterYear) { $filterYear['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($filterYear, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records were found', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } }