diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 54bc4aa..cbaac1b 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -421,7 +421,7 @@ class ClientController extends BaseController foreach ($groupedData as $key => $value) { $created_by = $this->session->get('is_staff_logged_in'); - // $branch_id = $this->session->get('logged_in_staff_branch_id'); + $business_id = $this->session->get('logged_in_staff_business_id'); // $business= $this->BranchModel->select('*') // ->join('business' , 'branches.business_id = business.business_id', 'left') // ->where('branches.branch_id ',$branch_id) @@ -433,8 +433,8 @@ class ClientController extends BaseController "email" => $value['email'], "mobile_no" => $value['mobile_no'], "created_by" => $created_by, + "business_id" => $business_id, ]; - // print_r($insertData);die; $client = $this->ClientModel->insert($insertData); if($client){ @@ -465,7 +465,6 @@ class ClientController extends BaseController } else { echo "No file uploaded."; } - return ; } } diff --git a/app/Controllers/StaffController.php b/app/Controllers/StaffController.php index 70646f8..a6e31ba 100644 --- a/app/Controllers/StaffController.php +++ b/app/Controllers/StaffController.php @@ -190,6 +190,8 @@ class StaffController extends BaseController public function client_list() { if(!$this->session->has('is_staff_logged_in')){ return redirect()->to(base_url().'staff'); } + $business_id = $this->session->get('logged_in_staff_business_id'); + $data['clientListForList'] = $this->ClientModel->where('business_id',$business_id)->findAll(); $data['clientList'] = $this->ClientModel->select('client.*, service_group.business_id') ->join('client_branch', 'client_branch.client_id = client.client_id') ->join('client_docs', 'client_docs.client_branch_id = client_branch.id') @@ -200,7 +202,6 @@ class StaffController extends BaseController ->get() ->getRow(); $data['business_list'] = $this->BusinessModel->findAll(); - $business_id = $this->session->get('logged_in_staff_business_id'); $business_id_check = 0; foreach ($data['clientList'] as $index => $value) { foreach (json_decode($value['business_id']) as $key => $values) { diff --git a/app/Views/client_list.php b/app/Views/client_list.php index 99e642b..e8c0383 100644 --- a/app/Views/client_list.php +++ b/app/Views/client_list.php @@ -13,7 +13,7 @@