diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 5ed7d6d8..007d80c1 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -16,7 +16,7 @@ $routes->get('/login', 'LoginController::index');///auth/google $routes->get('/logout', 'LoginController::logout'); $routes->get('/oauth2callback', 'LoginController::receiveGoogleOAuthResponse'); $routes->get('/auth/google', 'LoginController::initiateGoogleOAuth'); -$routes->get('/update-policy', 'ClientController::checkPolicyEndDateUpdateClientPolicyStatusExpired'); +$routes->get('/update-emp-policy-status', 'ClientController::updateEmpAndPolicyStatus'); $routes->group("/user", ["filter" => "authMVC"], function($routes){ diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 7fe814d8..7a2b274e 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -109,7 +109,7 @@ class ClientController extends AdminController } - public function checkPolicyEndDateUpdateClientPolicyStatusExpired(){ + public function updateEmpAndPolicyStatus(){ $return = $this->clientPolicyModel->updateStatus(); $this->myLogger->logme('error', 'Client Policy Status Update Count: {data}', ['data' => $return['client']]); diff --git a/app/Helpers/excel_import_export_helper.php b/app/Helpers/excel_import_export_helper.php index 0c415da5..ffb72f4c 100644 --- a/app/Helpers/excel_import_export_helper.php +++ b/app/Helpers/excel_import_export_helper.php @@ -419,6 +419,19 @@ if (!function_exists('remove_underscore_capitalize_first_letter')) { } if (!function_exists('formatDateOrReturn')) { + + /** + * Formats a given value as a date or returns the original value if it's not a valid date. + * + * This function checks if the provided value is a valid date. If it is, it formats + * the date as 'd-M-Y' (day-month-year) format and returns it. If the value is not + * a valid date, it returns the original value unchanged. + * + * @param mixed $value The value to be formatted as a date or returned unchanged. + * @return string|mixed The formatted date if the value is a valid date, otherwise the original value. + */ + + function formatDateOrReturn($value) { // Check if the value is a valid date diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index 7a1c92aa..27da989b 100644 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -244,7 +244,7 @@ $(document).ready(function() {
diff --git a/app/Views/employee_upload.php b/app/Views/employee_upload.php index 16e5d66d..f068f4cc 100644 --- a/app/Views/employee_upload.php +++ b/app/Views/employee_upload.php @@ -297,8 +297,8 @@ function fetchFileError(file_id) { var file_error_html = ""; for (var key in file_error_data['error_summary']) { - console.log(key); - var err_id = key; + // console.log(key); + var err_id = parseInt(key); var err_count = file_error_data['error_summary'][key]; switch (err_id) { case 1: @@ -345,21 +345,26 @@ function fetchFileError(file_id) { file_error_html += ""; break; } - file_error_html += (err_id == 1 ? - "Mandatory values missing " + - err_count + "" : (err_id == 2 ? - "Values not in expected format " + - err_count + "" : (err_id == 3 ? - "Field contains not allowed values " + - err_count + "" : (err_id == 4 ? - "Rule Conflict " + - err_count + "" : (err_id == 5 ? "" + - file_error_data['error_data'] + "" : (err_id == - 6 ? - "" + file_error_data['error_data'] + - "" : "")))))); + + // console.log('file_error_html_1', file_error_html) + + // file_error_html += (err_id == 1 ? + // "Mandatory values missing " + + // err_count + "" : (err_id == 2 ? + // "Values not in expected format " + + // err_count + "" : (err_id == 3 ? + // "Field contains not allowed values " + + // err_count + "" : (err_id == 4 ? + // "Rule Conflict " + + // err_count + "" : (err_id == 5 ? "" + + // file_error_data['error_data'] + "" : (err_id == + // 6 ? + // "" + file_error_data['error_data'] + + // "" : "")))))); file_error_html += '