CHANGE_SHARE_DOCS_CLIENT_LIST_CLIENT_BRANCH_LISTISSUE : AADHAVAN

This commit is contained in:
aadhavan valli 2024-07-09 10:28:21 +05:30
parent a70ff36cc6
commit 22ae8a7db4
3 changed files with 11 additions and 15 deletions

View File

@ -262,12 +262,8 @@ class ClientController extends BaseController
public function client_branch_list()
{
// if(!$this->session->has('is_staff_logged_in')){ return redirect()->to(base_url().'staff'); }
$data['clientBranchList'] = $this->ClientBranchModel->select('client_branch.*, client.name as client_name, service_group.business_id')
$data['clientBranchList'] = $this->ClientBranchModel->select('client_branch.*, client.name as client_name')
->join('client', 'client.client_id = client_branch.client_id', 'left')
->join('client_docs', 'client_docs.client_branch_id = client_branch.id')
->join('template', 'template.template_id = client_docs.template_id')
->join('service_group', 'service_group.service_group_id = template.service_group_id') // ->where('client.branch_id',$this->session->get('logged_in_staff_branch_id'))
// ->groupBy('client_branch.client_id')
->findAll();
$data['client_list'] = $this->ClientModel->select('client_id, name')->where('is_active', 1)->findAll();
$staffdata = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow();

View File

@ -341,11 +341,11 @@ class MasterController extends BaseController
$business_id_check = 0;
}
$docStatusByClientId = [];
// Fetch all doc_status entries and group them by client_docs_id
$data['clientdata'] = $this->ClientBranchModel->select('client.name as client_name , client_branch.name as client_branch_name , client_branch.id as client_branch_id')
->join('client', 'client_branch.client_id = client.client_id', 'left')
// ->where('client.business_id',$this->session->get('logged_in_staff_business_id'))
->findAll();
$data['clientdata'] = $this->ClientModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
->join('client_branch', 'client.client_id = client_branch.client_id', 'left')
->findAll();
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
foreach ($data['serviceGroupData'] as $key => $value) {
$check_its_okay = 0;
@ -395,10 +395,10 @@ class MasterController extends BaseController
}
$docStatusByClientId = [];
// Fetch all doc_status entries and group them by client_docs_id
$data['clientdata'] = $this->ClientBranchModel->select('client.name as client_name , client_branch.name as client_branch_name , client_branch.id as client_branch_id')
->join('client', 'client_branch.client_id = client.client_id', 'left')
// ->where('client.business_id',$this->session->get('logged_in_staff_business_id'))
->findAll();
$data['clientdata'] = $this->ClientModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
->join('client_branch', 'client.client_id = client_branch.client_id', 'left')
->findAll();
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
foreach ($data['serviceGroupData'] as $key => $value) {
$check_its_okay = 0;

View File

@ -192,7 +192,7 @@
<select class="select2-dropdown form-control" name="client_branch_id" id="client_branch_id" required>
<option value="">Select Client</option>
<?php foreach ($clientdata as $key => $Value) { ?>
<option value="<?php echo $Value['client_branch_id']; ?>" ><?php echo $Value['client_name']; ?> - <?php echo $Value['client_branch_name']; ?></option>
<option value="<?php echo $Value['client_branch_id']; ?>" ><?php echo $Value['name']; if(!empty($Value['client_branch_name'])){ ?> - <?php echo $Value['client_branch_name']; } ?></option>
<?php } ?>
</select>
</div>