diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index ea65bca..fdf55ca 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -133,15 +133,19 @@ class ClientController extends AdminController $field = $this->request->getPost('field'); $value = $this->request->getPost('value'); - if($value == '') - return $this->response->setJSON(['isDuplicate' => false]); + // print_rr($value); die; + if($value == '') return $this->response->setJSON(['isDuplicate' => false]); // Load the database if not already loaded $db = db_connect(); // Perform the query $builder = $db->table($table); - $isDuplicate = $builder->where($field, $value)->where('is_active', 1)->countAllResults() > 0; + if(is_array($value)){ + $isDuplicate = $builder->where($value)->where('is_active', 1)->countAllResults() > 0; + }else{ + $isDuplicate = $builder->where($field, $value)->where('is_active', 1)->countAllResults() > 0; + } // Return the result return $this->response->setJSON(['isDuplicate' => $isDuplicate]); diff --git a/app/Views/employee_data_list.php b/app/Views/employee_data_list.php index 292827e..c3f2c24 100755 --- a/app/Views/employee_data_list.php +++ b/app/Views/employee_data_list.php @@ -348,14 +348,14 @@ + onkeyup="validateInput(this, 'employees', 'email_corporate')" required>