From 42ff83697ce60c5d06586141d650eaf3811478f3 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 7 Feb 2026 12:40:26 +0530 Subject: [PATCH 1/8] FIX_ISSUE --- app/Controllers/EmployeeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 17bd959..4bed615 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -507,7 +507,7 @@ class EmployeeController extends AdminController // dd($data['fileList']);die(); - if ($_SERVER('REQUEST_METHOD') == "GET") { + if ($_SERVER['REQUEST_METHOD'] == "GET") { $this->loadLayout('import_export', $data); } } From 4190471741e63d161d400e8e3edf6544e3bc4413 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 7 Feb 2026 14:29:17 +0530 Subject: [PATCH 2/8] FIX_ISSUE --- app/Controllers/EmployeeController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 4bed615..130869b 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -183,6 +183,7 @@ class EmployeeController extends AdminController { if(empty($post_data)){ $post_data = $this->request->getPost(); + $post_data = array_merge($post_data, $this->request->getFiles()); } // $empDataServiceController = new EmpDataServiceController(); @@ -385,7 +386,7 @@ class EmployeeController extends AdminController $client_id = $post_data['client_id'] ?? null; $policy_id = $post_data['policy_id'] ?? null; $branch_id = $post_data['client_branch_id'] ?? null; - $action = $post_data['file_action'] ?? null; + $action = "enrollment"; $enrollment_open_date = $post_data['enrollment_open_date'] ?? null; $enrollment_close_date = $post_data['enrollment_close_date'] ?? null; $status = 'inprogress'; From b0f41725a835efc41118e5ec3da7aa3354896691 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 7 Feb 2026 15:30:03 +0530 Subject: [PATCH 3/8] FIX_ISSUE --- app/Controllers/EmployeeController.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 130869b..0f40f94 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -180,10 +180,13 @@ class EmployeeController extends AdminController //handles employee & dependent bulk upload with events like inception,addition,deletion, correction and SI enhancements public function employeesUplodWithEvents($post_data = []) - { + { if(empty($post_data)){ $post_data = $this->request->getPost(); $post_data = array_merge($post_data, $this->request->getFiles()); + $is_post_request = true; + }else{ + $is_post_request = false; } // $empDataServiceController = new EmpDataServiceController(); @@ -340,7 +343,7 @@ class EmployeeController extends AdminController $avatar = isset($post_data['emplist']) ? $post_data['emplist'] : $this->request->getFile('emplist'); if (!$avatar) { $this->myLogger->logme("error", 'File not found'); - if (!empty($post_data)) { + if (!$is_post_request) { return ['status' => false, 'message' => 'File not found']; } else { return $this->respond(['dataStatus' => false, 'code' => 400, 'message' => 'File not found'], 400); @@ -356,7 +359,7 @@ class EmployeeController extends AdminController $this->myLogger->logme("error", 'File move successful'); } else { $this->myLogger->logme("error", 'File move failed'); - if (!empty($post_data)) { + if (!$is_post_request) { return ['status' => false, 'message' => 'File move failed']; } else { return $this->respond(['dataStatus' => false, 'code' => 500, 'message' => 'File move failed'], 500); @@ -364,7 +367,7 @@ class EmployeeController extends AdminController } } else { $this->myLogger->logme("error", 'Upload failed Invalid file'); - if (!empty($post_data)) { + if (!$is_post_request) { return ['status' => false, 'message' => 'Invalid file']; } else { return $this->respond(['dataStatus' => false, 'code' => 404, 'message' => 'Invalid file'], 404); @@ -406,7 +409,7 @@ class EmployeeController extends AdminController $this->myLogger->logme("error", '{file_id} is less than 1MB, validating on the fly', ['file_id' => $file_id]); //endof validation process if (isset($result['error_summary']) && count($result['error_summary'])) { - if(!empty($post_data)){ + if(!$is_post_request){ return ['status' => false, 'message' => 'file rejected with errors', 'file_id' => $file_id]; }else{ return $this->respond(['dataStatus' => false, 'code' => 404, 'message' => 'file rejected with errors'], 200); @@ -419,7 +422,7 @@ class EmployeeController extends AdminController $this->myLogger->logme("error", '{file_id} is greather than 1MB, validating with job queue', ['file_id' => $file_id]); } - if (!empty($post_data)) { + if (!$is_post_request) { return ['status' => true, 'message' => 'File upload successs, Data validation is in-progress', 'file_id' => $file_id]; } else { return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => 'file upload success'], 200); From 22d81a605c2a802b3a60237d8ae36d590dda0a3d Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Mon, 9 Feb 2026 09:25:34 +0530 Subject: [PATCH 4/8] FIX_HR_LOGIN_ISSUE --- app/Helpers/JWTToken.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Helpers/JWTToken.php b/app/Helpers/JWTToken.php index d110444..f7b32ba 100755 --- a/app/Helpers/JWTToken.php +++ b/app/Helpers/JWTToken.php @@ -31,16 +31,16 @@ class JWTToken try{ $token = JWT::encode($request_data ,$secret_Key,'HS512'); $id = $request_data['id']; - $data["token_time_out"] = time() + getenv('TOKENTIMEOUT'); + $update["token_time_out"] = time() + getenv('TOKENTIMEOUT'); if(isset($data['emp_code'])){ $model = new EmployeeModel(); - $model->update($id, $data); + $model->update($id, $update); }else{ $models = new LevelContactModel(); $id = $request_data['pre_hr_id']; - $models->update($id, $data); + $models->update($id, $update); } From d50a3f9f5bb7ddb889a1c04b21576d0315b13be7 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 9 Feb 2026 14:22:44 +0530 Subject: [PATCH 5/8] FIX_SECURITY1 --- app/Filters/Cors.php | 2 +- app/Views/layout/header.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Filters/Cors.php b/app/Filters/Cors.php index bb8d5b8..c9ea212 100644 --- a/app/Filters/Cors.php +++ b/app/Filters/Cors.php @@ -38,7 +38,7 @@ class Cors implements FilterInterface * * @var string */ - protected string $allowedMethods = 'GET,POST,PUT,PATCH,DELETE,OPTIONS'; + protected string $allowedMethods = 'GET,POST,OPTIONS'; /** * HTTP headers allowed in CORS requests diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 586695f..7bd6b71 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -51,7 +51,7 @@ - + @@ -59,7 +59,7 @@ - + From a4031ab0e5e786eb5a5f36d0d452113957c3559e Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 10 Feb 2026 09:30:11 +0530 Subject: [PATCH 6/8] FIX_EMPLOYEE_UPLOAD --- app/Views/employee_upload.php | 2 +- app/Views/file_list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Views/employee_upload.php b/app/Views/employee_upload.php index 98bb2c9..3e75dd8 100755 --- a/app/Views/employee_upload.php +++ b/app/Views/employee_upload.php @@ -38,7 +38,7 @@ option:disabled {

-
diff --git a/app/Views/file_list.php b/app/Views/file_list.php index 9886ae9..d21d371 100755 --- a/app/Views/file_list.php +++ b/app/Views/file_list.php @@ -179,7 +179,7 @@ enctype="multipart/form-data"> - + From c76998bd9e2a566cb1d50b0aec73a995f8436ff8 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 10 Feb 2026 10:18:55 +0530 Subject: [PATCH 7/8] CHANE_EMP_POLICY_STATUS AS_ENROLED_TO_UNDER_PROCESS --- app/Controllers/EmployeeRestController.php | 2 +- app/Models/EmployeePolicyModel.php | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index ad822a1..800b172 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -687,7 +687,7 @@ class EmployeeRestController extends AdminController public function getEmployeeAndDependenceByClientId() { try { - $empData = $this->employeePolicyModel->getEmployeePolicy( client_id:$this->request->getGet('client_id'),policy_id: $this->request->getGet('client_policy_id'),status:0,branch_id:$this->request->getGet('client_branch_id')); + $empData = $this->employeePolicyModel->getEmployeePolicy( client_id:$this->request->getGet('client_id'),policy_id: $this->request->getGet('client_policy_id'),status:0,branch_id:$this->request->getGet('client_branch_id'), status_type: 'hr'); if ($empData) { return $this->respond(['status' => 'success', 'code' => 200, 'data' => $empData], 200); diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 72b8ba9..92c2905 100755 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -82,10 +82,19 @@ class EmployeePolicyModel extends Model } // ---------------------------------------------------------------------------------------------------------- - public function getEmployeePolicy($client_id = 0, $policy_id = 0, $status = [], $branch_id = 0, $emp_code = "", $emp_name = "") + public function getEmployeePolicy($client_id = 0, $policy_id = 0, $status = [], $branch_id = 0, $emp_code = "", $emp_name = "", $status_type = "") { // dd($status); + $status_query = "employee_polices.status"; // Default fallback + + if ($status_type == "hr") { + $status_query = "CASE + WHEN employee_polices.status = 'enrolled' THEN 'under process' + ELSE employee_polices.status + END as status"; + } + $result = $this->select([ 'employee_polices.*', 'policy_type.policy_type as policy_name', @@ -147,8 +156,8 @@ class EmployeePolicyModel extends Model THEN "Newly Added" ELSE NULL END) AS newly_added', - - ]) + $status_query + ], false) ->join('employees emp', 'employee_polices.employee_id = emp.id') ->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy ->join('policies pm', 'cp.policy_id = pm.id', 'left') //pm - policy master From c76f2ff4532b33ac012b671a0adcfe2089146d99 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 10 Feb 2026 11:15:36 +0530 Subject: [PATCH 8/8] FIX_ISSUE_DROPDOW_CLICK --- app/Views/employee_list.php | 43 ++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/app/Views/employee_list.php b/app/Views/employee_list.php index 3a779fb..f31b298 100755 --- a/app/Views/employee_list.php +++ b/app/Views/employee_list.php @@ -302,14 +302,51 @@ function init() { function handleItemClick(e, item) { e.preventDefault(); - // Execute the stored onclick handler const onclickAttr = item.getAttribute('data-onclick'); if (onclickAttr) { - eval(onclickAttr); + // Regex to separate function name from the inside of the parentheses + // Example: myFunc(this, '123') -> match[1]="myFunc", match[2]="this, '123'" + const match = onclickAttr.match(/^(\w+)\((.*)\)$/); + + if (match) { + const funcName = match[1]; + const argsRaw = match[2]; + + if (typeof window[funcName] === 'function') { + // Parse the arguments string into a real array + const args = argsRaw.split(',').map(arg => { + let cleaned = arg.trim(); + + // 1. Handle the 'this' keyword + if (cleaned === 'this') return item; + + // 2. Handle 'event' keyword + if (cleaned === 'event') return e; + + // 3. Handle strings (remove single or double quotes) + if ((cleaned.startsWith("'") && cleaned.endsWith("'")) || + (cleaned.startsWith('"') && cleaned.endsWith('"'))) { + return cleaned.substring(1, cleaned.length - 1); + } + + // 4. Handle numbers + if (!isNaN(cleaned) && cleaned !== "") { + return Number(cleaned); + } + + return cleaned; + }); + + // Execute function: + // .apply(item, args) sets the 'this' inside the function to the clicked element + window[funcName].apply(item, args); + } + } } + // Handle standard navigation if it's a link const href = item.getAttribute('href'); - if (href && href !== '#') { + if (href && href !== '#' && !href.includes('javascript:void(0)')) { window.location.href = href; }