diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 069fc22..ad6403e 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -3436,21 +3436,15 @@ class EmployeeRestController extends AdminController if (!empty($client_short_name)) { log_message('error', 'STEP 3: Looking up client with short_name: ' . $client_short_name); - // $client_data = $this->clientModel - // ->where('is_active', 1) - // ->where('short_name', $client_short_name) - // ->first(); + $client_data = $this->clientModel + ->where('is_active', 1) + ->where('short_name', $client_short_name) + ->first(); - $sql = "SELECT * FROM clients WHERE is_active = 1 AND short_name = ? LIMIT 1"; - $client_data = db_connect()->query($sql, [$client_short_name])->getRowArray(); + // $sql = "SELECT * FROM clients WHERE is_active = 1 AND short_name = ? LIMIT 1"; + // $client_data = db_connect()->query($sql, [$client_short_name])->getRowArray(); - - log_message('error', 'STEP 3: Looking up client with short_name: ' . db_connect()->getLastQuery()); - log_message('error', 'STEP 3: Looking up client with short_name: ' . var_dump($client_data) ); - log_message('error', 'STEP 3: Looking up client with short_name: ' . is_array($client_data) && count($client_data)); - log_message('error', 'STEP 3: Looking up client with short_name: ' . json_encode($client_data)); - - if (is_array($client_data) && count($client_data)) { + if (!empty($client_data)) { $clientId = $client_data['id']; log_message('error', 'STEP 4: Found client ID: ' . $clientId); } else {