diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 6f8f0a81..1040c97e 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -4803,7 +4803,14 @@ class EmployeeRestController extends AdminController $data = $this->getDataFromHrFileUploadTable($search_data); $table = "hr_file_upload"; }else{ - $client_data = $this->clientModel->where('MD5(id)', $search_data['client_id'])->first(); + + if (is_string($search_data['client_id']) && preg_match('/^[a-f0-9]{32}$/i', $search_data['client_id'])) { + $client_data = $this->clientModel->where('MD5(id)', $search_data['client_id'])->first(); + $search_data['client_id'] = $client_data['id']; + } else { + $client_data = $this->clientModel->where('id', $search_data['client_id'])->first(); + } + if($client_data['hr_file_processed_by'] == 1){ $data = $this->getDataFromHrFilesTable($search_data); $table = "files";