diff --git a/app/Config/Acl.php b/app/Config/Acl.php index 9e04a90a..81a3c08e 100644 --- a/app/Config/Acl.php +++ b/app/Config/Acl.php @@ -18,6 +18,7 @@ class Acl '#^/swagger#' => ['roles' => [ADMIN_ROLE_ID]], '#^/getEmployeeActiveOrInactivePolicy#' => ['roles' => [ADMIN_ROLE_ID, HEAD_ROLE_ID]], '#^/test/testingquerys#' => ['roles' => [ADMIN_ROLE_ID, HEAD_ROLE_ID]], + '#^/test/viewrfq#' => ['roles' => [ADMIN_ROLE_ID, HEAD_ROLE_ID]], '#^/fedeploy#' => ['roles' => [ADMIN_ROLE_ID]], '#^/visitOffBoardCheck#' => ['roles' => [ADMIN_ROLE_ID]], '#^/logs#' => ['roles' => [ADMIN_ROLE_ID]], diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index a187e819..1d1763d3 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1673,10 +1673,16 @@ class EmployeeRestController extends AdminController { try { - $client = $this->clientModel->where('md5(id)', $this->request->getGet('client_id'))->first(); + $client_id = $this->request->getGet('client_id'); + if (is_string($client_id) && preg_match('/^[a-f0-9]{32}$/i', $client_id)) { + $client = $this->clientModel->where('MD5(id)', $client_id)->first(); + }else{ + $client = $this->clientModel->where('id', $client_id)->first(); + } + if (!empty($client)) { $client['client_logo'] = base_url() . 'public/uploads/logo/' . $client['client_logo']; - $clientPolicy = $this->clientPolicyModel->where('md5(client_id)', $this->request->getGet('client_id')) + $clientPolicy = $this->clientPolicyModel->where('client_id', $client['id']) ->where('client_branch_id', $this->request->getGet('client_branch_id'))->findAll(); return $this->respond(['status' => 'success', 'code' => 200, 'data' => ['client' => $client, 'client_policy' => $clientPolicy]], 200); } else {