FEAT_HR_ACCESS_CONTROL_AND_LEVEL_CONTECT_SAVE_ISSUE_AND_OTHERS : RV
This commit is contained in:
parent
42dfdc5e76
commit
bb78dada40
@ -41,6 +41,7 @@ use App\Models\PolicyTransactionStatusModel;
|
||||
use App\Models\VehicleModel;
|
||||
use App\Models\LeadsModel;
|
||||
use App\Models\ClientApiModel;
|
||||
use App\Models\HRAccessControlModel;
|
||||
|
||||
use App\Controllers\EmpDataServiceController;
|
||||
use App\Controllers\GoogleDriveController;
|
||||
@ -88,6 +89,7 @@ class ClientController extends AdminController
|
||||
protected $leadsModel;
|
||||
protected $clientApi;
|
||||
protected $PTCOShareDetailsModel;
|
||||
protected $HRAccessControlModel;
|
||||
|
||||
|
||||
public function __construct()
|
||||
@ -125,6 +127,7 @@ class ClientController extends AdminController
|
||||
$this->leadsModel = new LeadsModel();
|
||||
$this->clientApi = new ClientApiModel();
|
||||
$this->PTCOShareDetailsModel = new PTCOShareDetailsModel();
|
||||
$this->HRAccessControlModel = new HRAccessControlModel();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
@ -674,7 +677,7 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
$data['insurerName'] = $this->insurerModel->getInsurerName($insurerId, $clientId);
|
||||
$data['depositdata'] = $this->clientPolicyModel->getdepositData($clientId, $insurerId, $cd_ac_pk);
|
||||
$data['depositdata'] = $this->clientPolicyModel->getdepositData($clientId, $insurerId, $cd_ac_pk, $subTypeOptions);
|
||||
$data['clientData'] = $this->clientPolicyModel->getClientById($clientId);
|
||||
$data['deposiamount'] = $this->clientPolicyModel->getDepositSummary($clientId, $insurerId, $cd_ac_pk);
|
||||
$data['cd_ac_pk'] = $cd_ac_pk;
|
||||
@ -1031,19 +1034,9 @@ class ClientController extends AdminController
|
||||
$insert = $this->clientBranchModel->insert($data);
|
||||
|
||||
if ($insert) {
|
||||
for ($i = 0; $i < count($this->request->getPost('name')); $i++) {
|
||||
// Prepare data to insert
|
||||
$data = [
|
||||
'contact_type' => 'client',
|
||||
'ref_id' => $insert,
|
||||
'created_by' => get_session_userid(),
|
||||
'name' => $this->request->getPost('name')[$i],
|
||||
'email' => $this->request->getPost('email')[$i],
|
||||
'mobile' => $this->request->getPost('mobile')[$i],
|
||||
'designation' => $this->request->getPost('designation')[$i]
|
||||
];
|
||||
$contacts = $this->levelContactModel->insert($data);
|
||||
}
|
||||
$level_contact_data = $this->request->getPost('level_contect_data');
|
||||
$level_contact_data = !empty($level_contact_data) ? json_decode($level_contact_data, true) : null;
|
||||
$this->saveLevelContacts($level_contact_data, $insert);
|
||||
}
|
||||
|
||||
if ($insert) {
|
||||
@ -1135,19 +1128,9 @@ class ClientController extends AdminController
|
||||
|
||||
if ($insert) {
|
||||
|
||||
$this->levelContactModel->where('ref_id', $id)->where('contact_type', 'client')->delete();
|
||||
for ($i = 0; $i < count($this->request->getPost('name')); $i++) {
|
||||
$data = [
|
||||
'contact_type' => 'client',
|
||||
'ref_id' => $id,
|
||||
'updated_by' => get_session_userid(),
|
||||
'name' => $this->request->getPost('name')[$i],
|
||||
'email' => $this->request->getPost('email')[$i],
|
||||
'mobile' => $this->request->getPost('mobile')[$i],
|
||||
'designation' => $this->request->getPost('designation')[$i]
|
||||
];
|
||||
$contacts = $this->levelContactModel->insert($data);
|
||||
}
|
||||
$level_contact_data = $this->request->getPost('level_contect_data');
|
||||
$level_contact_data = !empty($level_contact_data) ? json_decode($level_contact_data, true) : null;
|
||||
$this->saveLevelContacts($level_contact_data, $id);
|
||||
}
|
||||
|
||||
if ($insert) {
|
||||
@ -1161,7 +1144,8 @@ class ClientController extends AdminController
|
||||
'list_of_branch_units' => $list_of_branch_units,
|
||||
'total_count' => $total_count,
|
||||
'uncommonValues' => $uncommonValues,
|
||||
'message' => 'Client branch updated successfully'
|
||||
'message' => 'Client branch updated successfully',
|
||||
'response_data' => $this->request->getPost()
|
||||
|
||||
], 200);
|
||||
} else {
|
||||
@ -1169,6 +1153,24 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function saveLevelContacts($level_contact_data, $branch_id)
|
||||
{
|
||||
if (!empty($level_contact_data) && is_array($level_contact_data)) {
|
||||
foreach ($level_contact_data as $value) {
|
||||
if (!empty($value['id'])) {
|
||||
$id = $value['id'];
|
||||
unset($value['id']);
|
||||
$this->levelContactModel->update($id, $value);
|
||||
} else {
|
||||
unset($value['id']);
|
||||
$value['contact_type'] = "client";
|
||||
$value['ref_id'] = $branch_id ?? null;
|
||||
$this->levelContactModel->insert($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function createClientPolicy()
|
||||
@ -4869,7 +4871,7 @@ class ClientController extends AdminController
|
||||
// ---------- EMP SERVICE CONTROLLER --------------------------------------------------------------------------------
|
||||
|
||||
$employeeRestController = new EmployeeServiceController();
|
||||
// $employeeRestController->excelFileDataValidation(['file_id' => 823]);
|
||||
// $employeeRestController->excelFileDataValidation(['file_id' => 1629]); die;
|
||||
// $employeeRestController->employeesOnboardPreprocess(['file_id' => 726]);
|
||||
// $employeeRestController->employeesOnboardProcess(['file_id' => 835]);
|
||||
// $employeeRestController->employeesEnrollmentInsert(['file_id' => 836]);
|
||||
@ -4888,18 +4890,20 @@ class ClientController extends AdminController
|
||||
|
||||
// ----------EMP DATA SERVICE CONTROLLER--------------------------------------------------------------------------------
|
||||
|
||||
$batch_data = [
|
||||
'client_id' => 97,
|
||||
'client_policy_id' => 6174,
|
||||
'client_branch_id' => 73,
|
||||
'insurer_or_tpa' => "insurer",
|
||||
'event_type' => "deletion",
|
||||
'actions' => "export",
|
||||
'file_name' => "deletion_enhancement_test_file.xlsx",
|
||||
];
|
||||
|
||||
// $batch_data = [
|
||||
// 'client_id' => 29,
|
||||
// 'client_policy_id' => 17,
|
||||
// 'client_branch_id' => 15,
|
||||
// 'insurer_or_tpa' => "insurer",
|
||||
// 'event_type' => "deletion",
|
||||
// ];
|
||||
|
||||
// $batch_data = [
|
||||
// 'client_id' => 89,
|
||||
// 'client_policy_id' => 328,
|
||||
// 'client_branch_id' => 88,
|
||||
// 'client_policy_id' => 77,
|
||||
// 'client_branch_id' => 45,
|
||||
// 'insurer_or_tpa' => "insurer",
|
||||
// // 'insurer_or_tpa' => "tpa",
|
||||
// 'event_type' => "si_enhancement",
|
||||
@ -4920,11 +4924,12 @@ class ClientController extends AdminController
|
||||
// $EmpDataServiceController->sendMailForDownloadingECard($ids);
|
||||
|
||||
$EmpDataServiceController = new EmpDataServiceController();
|
||||
// $return = $EmpDataServiceController->generateExcelForDeletion($batch_data); dd($return); die;
|
||||
// $EmpDataServiceController->generateExcelForSIEnhancement($batch_data); die;
|
||||
// $EmpDataServiceController->importInceptionFileValidation(['file_id' => 1932]); die;
|
||||
// $EmpDataServiceController->importDeletionValidation(['file_id' => 304]); //for live
|
||||
// $EmpDataServiceController->importSIEnhancementUpdateEndorsementID(['file_id' => 1199]); //for live
|
||||
// $EmpDataServiceController->importSIEnhancementValidation(['file_id' => 1205]); //for live
|
||||
// $result = $EmpDataServiceController->importSIEnhancementValidation(['file_id' => 2496]); //for live
|
||||
// $EmpDataServiceController->importInceptionUpdateTPAandUHID(['file_id' => 214]); //for live
|
||||
|
||||
// $result = $this->employeePolicyModel->getDeletionEmployeeDataForExportExcel($batch_data);
|
||||
@ -5105,12 +5110,19 @@ class ClientController extends AdminController
|
||||
|
||||
|
||||
|
||||
// $param = "533454";
|
||||
// $param = 9715454901;
|
||||
// $type = 'emp_code';
|
||||
// $client_policy_id = 64;
|
||||
// $client_id = 51;
|
||||
// $client_id = 3927;
|
||||
|
||||
// $result = $this->getTheEmpDataForClaimSearchByMobile($param, $type, $client_policy_id, $client_id);
|
||||
// $result = $this->employeePolicyModel->getEmployeePolicy();
|
||||
// $result = $this->getHrAccessData($client_id);
|
||||
// $html = view('hr_access_controll', $result);
|
||||
// dd($html);
|
||||
|
||||
// $employeeRestController = new EmployeeRestController();
|
||||
// $result = $employeeRestController->getPreEmployeePolicyCount($param, $client_id);
|
||||
// dd($result);
|
||||
|
||||
}
|
||||
@ -5207,7 +5219,8 @@ class ClientController extends AdminController
|
||||
->where('employees.relationship', "Self")
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('client_policy.id', $param)
|
||||
->findAll();
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
$dataForClientAndInsurer = $this->clientPolicyModel
|
||||
->select("
|
||||
@ -5293,9 +5306,9 @@ class ClientController extends AdminController
|
||||
$query->where('employees.client_id', $client_id);
|
||||
}
|
||||
|
||||
// if (!empty($client_policy_id)) {
|
||||
// $query->where('employee_polices.client_policy_id', $client_policy_id);
|
||||
// }
|
||||
if (!empty($client_policy_id)) {
|
||||
$query->where('employee_polices.client_policy_id', $client_policy_id);
|
||||
}
|
||||
|
||||
$query->groupBy('employees.id')
|
||||
->orderBy('employees.id', 'DESC');
|
||||
@ -5316,7 +5329,7 @@ class ClientController extends AdminController
|
||||
|
||||
if(!empty($data) && count($data) > 0){
|
||||
|
||||
$memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], null, $client_id);
|
||||
$memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], $client_policy_id, $client_id);
|
||||
$acms_datas = $this->employeeModel->getAcmUsingClientID($data['client_id']);
|
||||
// if(!empty($acms_datas)){
|
||||
// $acms = $acms_datas;
|
||||
@ -6063,9 +6076,13 @@ class ClientController extends AdminController
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------
|
||||
|
||||
public function constructHrAccessData()
|
||||
public function viewHrAccessData()
|
||||
{
|
||||
$html = view('hr_access_controll');
|
||||
$client_id = $this->request->getGet('client_id');
|
||||
$data = $this->getHrAccessData($client_id);
|
||||
// $data = [];
|
||||
|
||||
$html = view('hr_access_controll', $data);
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'code' => 200,
|
||||
@ -6073,6 +6090,301 @@ class ClientController extends AdminController
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function getHrAccessData($client_id)
|
||||
{
|
||||
$hrAccessData = [];
|
||||
|
||||
$post_client_data = $this->clientModel->where('id', $client_id)->where('is_active', 1)->first();
|
||||
|
||||
$hrAccessData['post_hr_data'] = $this->clientBranchModel
|
||||
->select('lc.id as post_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail')
|
||||
->join('level_contacts lc', 'client_branch.id = lc.ref_id')
|
||||
->where('client_branch.is_active', 1)
|
||||
->where('lc.is_active', 1)
|
||||
->where('lc.contact_type', 'client')
|
||||
->where('client_branch.client_id', $client_id)
|
||||
->findAll();
|
||||
|
||||
$hrAccessData['post_policy_data'] = $this->clientPolicyModel
|
||||
->select('client_policy.id as client_policy_id, client_policy.policy_no as policy_no, policy_type.policy_type, client_policy.policy_status')
|
||||
->join('policy_type', 'client_policy.policy_type_id = policy_type.id')
|
||||
->where('client_policy.is_active', 1)
|
||||
->where('client_policy.client_id', $client_id)
|
||||
// ->orderBy('client_policy_id', 'desc')
|
||||
->orderBy('client_policy.policy_status', 'desc')
|
||||
->findAll();
|
||||
|
||||
$hrAccessData['post_cd_data'] = $this->CDMasterModel
|
||||
->select('cd_master.id as cd_master_pk, cd_master.cd_ac_no as cd_account_no, insurers.name as insurer_name, insurers.short_name as insurer_short_name')
|
||||
->join('insurers', 'cd_master.insurer_id = insurers.id')
|
||||
->where('cd_master.is_active', 1)
|
||||
->where('cd_master.client_id', $client_id)
|
||||
->findAll();
|
||||
|
||||
$hrAccessData['hr_access_table_data'] = $this->HRAccessControlModel
|
||||
->where('is_active', 1)
|
||||
->where('post_client_id', $client_id)
|
||||
->findAll();
|
||||
|
||||
try {
|
||||
log_message('error', 'Attempting to connect to preDB...');
|
||||
$db2 = \Config\Database::connect('preDB');
|
||||
log_message('error', 'Connection to preDB successful.');
|
||||
} catch (\Throwable $e) {
|
||||
log_message('error', 'DB connection to preDB failed: ' . $e->getMessage());
|
||||
|
||||
$hrAccessData['pre_hr_data'] = [];
|
||||
$hrAccessData['pre_policy_data'] = [];
|
||||
$combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id);
|
||||
return $combinedHrAccessData;
|
||||
}
|
||||
|
||||
$pre_client_data = $db2->table('clients')->where('is_active', 1)->where('short_name', $post_client_data['short_name'])->get()->getRowArray();
|
||||
|
||||
$hrAccessData['pre_hr_data'] = $db2->table('client_branch')
|
||||
->select('lc.id as pre_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail')
|
||||
->join('level_contacts lc', 'client_branch.id = lc.ref_id')
|
||||
->where('client_branch.is_active', 1)
|
||||
->where('lc.is_active', 1)
|
||||
->where('lc.contact_type', 'client')
|
||||
->where('client_branch.client_id', $pre_client_data['id'])
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
$hrAccessData['pre_policy_data'] = $db2->table('client_policy')
|
||||
->select('client_policy.id as client_policy_id, client_policy.policy_no as policy_no, policy_type.policy_type, client_policy.policy_status')
|
||||
->join('policy_type', 'client_policy.policy_type_id = policy_type.id')
|
||||
->where('client_policy.is_active', 1)
|
||||
->where('client_policy.client_id', $pre_client_data['id'])
|
||||
// ->orderBy('client_policy_id', 'desc')
|
||||
->orderBy('client_policy.policy_status', 'desc')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
// dd($hrAccessData);
|
||||
|
||||
$combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id);
|
||||
return $combinedHrAccessData;
|
||||
}
|
||||
|
||||
public function constructHrAccessData($data, $client_id)
|
||||
{
|
||||
// dd($data);
|
||||
$preHrs = $data['pre_hr_data'];
|
||||
$postHrs = $data['post_hr_data'];
|
||||
$hrAccessTableData = $data['hr_access_table_data'];
|
||||
$merged = [];
|
||||
|
||||
// Merge based on mobile and email
|
||||
foreach ($postHrs as $post) {
|
||||
$found = false;
|
||||
foreach ($preHrs as $index => $pre) {
|
||||
if ($post['hr_mobile'] === $pre['hr_mobile'] && $post['hr_mail'] === $pre['hr_mail']) {
|
||||
$merged[] = [
|
||||
'pre_hr_id' => $pre['pre_hr_id'],
|
||||
'post_hr_id' => $post['post_hr_id'],
|
||||
'hr_name' => $post['hr_name'],
|
||||
'hr_mobile' => $post['hr_mobile'],
|
||||
'hr_mail' => $post['hr_mail']
|
||||
];
|
||||
unset($preHrs[$index]); // remove matched pre_hr
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$merged[] = [
|
||||
'pre_hr_id' => null,
|
||||
'post_hr_id' => $post['post_hr_id'],
|
||||
'hr_name' => $post['hr_name'],
|
||||
'hr_mobile' => $post['hr_mobile'],
|
||||
'hr_mail' => $post['hr_mail']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Remaining preHrs (not matched)
|
||||
foreach ($preHrs as $pre) {
|
||||
$merged[] = [
|
||||
'pre_hr_id' => $pre['pre_hr_id'],
|
||||
'post_hr_id' => null,
|
||||
'hr_name' => $pre['hr_name'],
|
||||
'hr_mobile' => $pre['hr_mobile'],
|
||||
'hr_mail' => $pre['hr_mail']
|
||||
];
|
||||
}
|
||||
|
||||
// dd($merged);
|
||||
|
||||
$result = [];
|
||||
|
||||
if (empty($hrAccessTableData)) {
|
||||
|
||||
// No access data — fill result with hr data and other fields as null
|
||||
foreach ($merged as $hr) {
|
||||
$result[] = [
|
||||
'hr_access_table_pk' => null,
|
||||
'post_client_id' => $client_id ?? null,
|
||||
'pre_hr_id' => $hr['pre_hr_id'] ?? null,
|
||||
'post_hr_id' => $hr['post_hr_id'] ?? null,
|
||||
'allowed_pre_modules' => [],
|
||||
'allowed_post_modules' => [],
|
||||
'allowed_pre_policies' => [],
|
||||
'allowed_active_policies' => [],
|
||||
'allowed_cd' => [],
|
||||
'hr_name' => $hr['hr_name'] ?? null,
|
||||
'hr_mobile' => $hr['hr_mobile'] ?? null,
|
||||
'hr_mail' => $hr['hr_mail'] ?? null,
|
||||
];
|
||||
}
|
||||
|
||||
} else {
|
||||
foreach ($hrAccessTableData as $access) {
|
||||
foreach ($merged as $hr) {
|
||||
if ($hr['post_hr_id'] == $access['post_hr_id']) {
|
||||
|
||||
$allowed_modules = json_decode($access['allowed_modules'], true) ?? null;
|
||||
if ($allowed_modules == null) {
|
||||
$allowed_pre_modules = null;
|
||||
$allowed_post_modules = null;
|
||||
} else {
|
||||
$allowed_pre_modules = $allowed_modules['pre'] ?? [];
|
||||
$allowed_post_modules = $allowed_modules['post'] ?? [];
|
||||
}
|
||||
|
||||
$result[] = [
|
||||
'hr_access_table_pk' => $access['id'] ?? null,
|
||||
'post_client_id' => $access['post_client_id'] ?? null,
|
||||
'pre_hr_id' => $hr['pre_hr_id'] ?? null,
|
||||
'post_hr_id' => $hr['post_hr_id'] ?? null,
|
||||
'allowed_pre_modules' => $allowed_pre_modules,
|
||||
'allowed_post_modules' => $allowed_post_modules,
|
||||
'allowed_pre_policies' => json_decode($access['allowed_pre_policies'], true) ?? [],
|
||||
'allowed_active_policies' => json_decode($access['allowed_active_policies']) ?? [],
|
||||
'allowed_cd' => json_decode($access['allowed_cd'], true) ?? [],
|
||||
'hr_name' => $hr['hr_name'],
|
||||
'hr_mobile' => $hr['hr_mobile'],
|
||||
'hr_mail' => $hr['hr_mail']
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$resultData['hr_access_data'] = $result;
|
||||
$resultData['pre_policy_data'] = $data['pre_policy_data'];
|
||||
$resultData['post_policy_data'] = $data['post_policy_data'];
|
||||
$resultData['post_cd_data'] = $data['post_cd_data'];
|
||||
|
||||
// dd($resultData);
|
||||
|
||||
return $resultData;
|
||||
}
|
||||
|
||||
public function saveHrAccessData()
|
||||
{
|
||||
try {
|
||||
// Step 1: Fetch and decode the JSON data
|
||||
$client_id = $this->request->getPost('client_id');
|
||||
$jsonData = $this->request->getPost('json');
|
||||
$data = json_decode($jsonData, true);
|
||||
|
||||
if (!$data || !is_array($data)) {
|
||||
log_message('error', 'Invalid or empty JSON in saveHrAccessData: ' . $jsonData);
|
||||
return $this->respond([
|
||||
'status' => false,
|
||||
'code' => 400,
|
||||
'message' => 'Invalid JSON data provided.',
|
||||
], 400);
|
||||
}
|
||||
|
||||
$success = [];
|
||||
$errors = [];
|
||||
$skippedCount = 0;
|
||||
|
||||
// Step 2: Loop and insert/update
|
||||
foreach ($data as $index => $value) {
|
||||
try {
|
||||
// Decode allowed_modules and validate
|
||||
$allowed_modules = json_decode($value['allowed_modules'], true);
|
||||
if (empty($allowed_modules)) {
|
||||
$skippedCount++;
|
||||
continue; // Skip this record
|
||||
}
|
||||
|
||||
// Format allowed_modules: { pre: [1], post: [2,3,4] }
|
||||
$pre = in_array(1, $allowed_modules) ? [1] : [];
|
||||
$post = array_values(array_filter($allowed_modules, fn($v) => $v !== 1));
|
||||
$value['allowed_modules'] = json_encode(['pre' => $pre, 'post' => $post]);
|
||||
|
||||
// INSERT or UPDATE
|
||||
if (empty($value['pk']) || (int)$value['pk'] === 0) {
|
||||
unset($value['pk']); // Prevent insert error
|
||||
$insertedId = $this->HRAccessControlModel->insert($value);
|
||||
if ($insertedId === false) {
|
||||
throw new \Exception('Insert failed: ' . json_encode($this->HRAccessControlModel->errors()));
|
||||
}
|
||||
$success[] = "Inserted row at index {$index} with ID {$insertedId}.";
|
||||
} else {
|
||||
$update = $this->HRAccessControlModel->update($value['pk'], $value);
|
||||
if ($update === false) {
|
||||
throw new \Exception('Update failed for ID ' . $value['pk'] . ': ' . json_encode($this->HRAccessControlModel->errors()));
|
||||
}
|
||||
$success[] = "Updated row with ID {$value['pk']}.";
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
log_message('error', 'HRAccess Save Error at index ' . $index . ': ' . $e->getMessage());
|
||||
$errors[] = "Error at index {$index}: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// Step 3: If all rows were skipped (no allowed_modules)
|
||||
if (count($data) === $skippedCount) {
|
||||
return $this->respond([
|
||||
'status' => false,
|
||||
'code' => 422,
|
||||
'message' => 'Please select at least one module for any user.',
|
||||
], 422);
|
||||
}
|
||||
|
||||
// Step 4: Final response
|
||||
if (empty($errors)) {
|
||||
|
||||
$data = $this->getHrAccessData($client_id);
|
||||
$html = view('hr_access_controll', $data);
|
||||
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'code' => 200,
|
||||
'message' => 'All records processed successfully.',
|
||||
'details' => $success,
|
||||
'data' => $html,
|
||||
], 200);
|
||||
|
||||
} else {
|
||||
return $this->respond([
|
||||
'status' => false,
|
||||
'code' => 207,
|
||||
'message' => 'Some records failed to save.',
|
||||
'success' => $success,
|
||||
'errors' => $errors
|
||||
], 207);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
log_message('critical', 'Fatal error in saveHrAccessData: ' . $e->getMessage());
|
||||
return $this->respond([
|
||||
'status' => false,
|
||||
'code' => 500,
|
||||
'message' => 'Unexpected server error.',
|
||||
'error' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -541,7 +541,7 @@ class RestAuthenticationController extends AdminController
|
||||
try {
|
||||
// mobile number
|
||||
$otp_verification = isset($this->request->getJSON()->otp_verification) ? $this->request->getJSON()->otp_verification : null;
|
||||
$mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null;
|
||||
$mobile_number = isset($this->request->getJSON()->mobile_no) ? $this->request->getJSON()->mobile_no : null;
|
||||
// email id
|
||||
$otp = isset($this->request->getJSON()->otp) ? $this->request->getJSON()->otp : null;
|
||||
$email = isset($this->request->getJSON()->email) ? $this->request->getJSON()->email : null;
|
||||
@ -571,7 +571,7 @@ class RestAuthenticationController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
if(isset($this->request->getJSON()->mobile_number)){
|
||||
if(isset($this->request->getJSON()->mobile_no)){
|
||||
|
||||
$hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id')
|
||||
->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left')
|
||||
|
||||
@ -12,6 +12,7 @@ class HRAccessControlModel extends Model
|
||||
'id',
|
||||
'pre_hr_id',
|
||||
'post_hr_id',
|
||||
'post_client_id',
|
||||
'allowed_modules',
|
||||
'allowed_pre_policies',
|
||||
'allowed_active_policies',
|
||||
|
||||
@ -98,7 +98,7 @@ input:checked + .slider:before {
|
||||
<label for="short_name">Client Short Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="short_name"
|
||||
placeholder="Enter Short Name" value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" name="short_name" required>
|
||||
placeholder="Enter Short Name" value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" name="short_name" onkeyup="validateInput(this, 'clients', 'short_name', 'clientBtnSubmit')" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -137,7 +137,7 @@ input:checked + .slider:before {
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
id="clientBtnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
</div>
|
||||
|
||||
@ -163,6 +163,9 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<input type="hidden" name="branch_table_pk[]" id="branch_table_pk" >
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="first_name">Name<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Name"
|
||||
@ -178,12 +181,12 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Email"
|
||||
name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email" required>
|
||||
name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email" onkeyup="validateInput(this, 'level_contacts', 'email', 'branchBtnSubmit')" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Mobile"
|
||||
name="mobile[]" id="mobile" onchange="checkMobileNumber(this)"
|
||||
name="mobile[]" id="mobile" onkeyup="validateInput(this, 'level_contacts', 'mobile', 'branchBtnSubmit')"
|
||||
onkeypress="return onlyNumbers(event)" maxlength="10" minlength="10"
|
||||
data-parsley-type-message="Please enter a valid 10-digit mobile number."
|
||||
data-parsley-required-message="Please enter a valid 10-digit mobile number."
|
||||
@ -202,7 +205,7 @@
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
id="branchBtnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
</div>
|
||||
@ -347,6 +350,9 @@ $("#branch_form").submit(function(event) {
|
||||
var selectedValues = $("#selected").val();
|
||||
console.log(selectedValues, selectedValues);
|
||||
|
||||
let level_contect_data = getContactsData();
|
||||
console.log('level_contect_data', level_contect_data);
|
||||
|
||||
event.preventDefault();
|
||||
branch_PrimaryKey = $('#client_id_branch').val();
|
||||
|
||||
@ -370,11 +376,14 @@ $("#branch_form").submit(function(event) {
|
||||
var formData = new FormData($('#branch_form')[0]);
|
||||
|
||||
const jsonString = JSON.stringify(selectedValues);
|
||||
const level_contect_data_json_string = JSON.stringify(level_contect_data);
|
||||
console.log('jsonString', jsonString);
|
||||
console.log('level_contect_data_json_string', level_contect_data_json_string);
|
||||
|
||||
|
||||
// Append the JSON string to the FormData object
|
||||
formData.append('units', jsonString);
|
||||
formData.append('level_contect_data', level_contect_data_json_string);
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
@ -495,6 +504,8 @@ $('body').on('click', '.btnBranchEdit', function() {
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('branch response', res);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
@ -525,10 +536,25 @@ $('body').on('click', '.btnBranchEdit', function() {
|
||||
|
||||
appendOption(res.data.units)
|
||||
|
||||
$('#name').val(res.contact[0].name);
|
||||
$('#email').val(res.contact[0].email);
|
||||
$('#mobile').val(res.contact[0].mobile);
|
||||
$('#designation').val(res.contact[0].designation);
|
||||
// $('#branch_table_pk').val(res.contact[0].id);
|
||||
// $('#name').val(res.contact[0].name);
|
||||
// $('#email').val(res.contact[0].email);
|
||||
// $('#mobile').val(res.contact[0].mobile);
|
||||
// $('#designation').val(res.contact[0].designation);
|
||||
|
||||
if (res.contact && res.contact.length > 0 && res.contact[0]) {
|
||||
$('#branch_table_pk').val(res.contact[0].id || '');
|
||||
$('#name').val(res.contact[0].name || '');
|
||||
$('#email').val(res.contact[0].email || '');
|
||||
$('#mobile').val(res.contact[0].mobile || '');
|
||||
$('#designation').val(res.contact[0].designation || '');
|
||||
} else {
|
||||
$('#branch_table_pk').val('');
|
||||
$('#name').val('');
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#designation').val('');
|
||||
}
|
||||
|
||||
res.contact.shift();
|
||||
// console.log(res.contact.length)
|
||||
@ -579,6 +605,7 @@ function appendContactHtml(contact = false, reset = false) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<input type="hidden" name="branch_table_pk[]" id="${uniqueId}_branch_table_pk" value="${contact !== undefined && contact !== false ? contact.id : ''}">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
@ -591,11 +618,11 @@ function appendContactHtml(contact = false, reset = false) {
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.email : ''}" type="text" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" data-parsley-trigger="change" data-parsley-type="email" required>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.email : ''}" type="text" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" data-parsley-trigger="change" data-parsley-type="email" onkeyup="validateInput(this, 'level_contacts', 'email', 'branchBtnSubmit')" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" onchange="checkMobileNumber(this)" onkeypress = "return onlyNumbers(event)" maxlength="10" min="10" data-parsley-type-message="Please enter a valid 10-digit mobile number." data-parsley-required-message="Please enter a valid 10-digit mobile number." required>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" onkeyup="validateInput(this, 'level_contacts', 'mobile', 'branchBtnSubmit')" onkeypress = "return onlyNumbers(event)" maxlength="10" min="10" data-parsley-type-message="Please enter a valid 10-digit mobile number." data-parsley-required-message="Please enter a valid 10-digit mobile number." required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
@ -767,6 +794,51 @@ function checkMobileNumber(input) {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function validateInput(input, table, field, submitButId){
|
||||
|
||||
let value = $(input).val();
|
||||
let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
|
||||
|
||||
let message = "Value is duplicate!";
|
||||
if(label){
|
||||
message = label + " already exists!";
|
||||
}
|
||||
|
||||
checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
|
||||
if (isDuplicate) {
|
||||
toastr.warning(message, 'WARNING');
|
||||
// $(input).val('')
|
||||
$('#' + submitButId).prop('disabled', true);
|
||||
} else{
|
||||
$('#' + submitButId).prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function getContactsData() {
|
||||
const contacts = [];
|
||||
|
||||
const ids = $('input[name="branch_table_pk[]"]');
|
||||
const names = $('input[name="name[]"]');
|
||||
const mobiles = $('input[name="mobile[]"]');
|
||||
const emails = $('input[name="email[]"]');
|
||||
const designations = $('input[name="designation[]"]');
|
||||
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
contacts.push({
|
||||
id: $(ids[i]).val() || null,
|
||||
name: $(names[i]).val(),
|
||||
mobile: $(mobiles[i]).val(),
|
||||
email: $(emails[i]).val(),
|
||||
designation: $(designations[i]).val()
|
||||
});
|
||||
}
|
||||
|
||||
return contacts;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
@ -34,6 +34,226 @@ body {
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.user-card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 10px rgba(77, 77, 77, 0.3);
|
||||
margin-bottom: 12px;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.user-card:hover {
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
background: #d6d6d6;
|
||||
color: white;
|
||||
padding: 12px 18px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.card-header:hover {
|
||||
background: #b4bec5;
|
||||
}
|
||||
|
||||
|
||||
.user-info h5 {
|
||||
margin-bottom: 2px;
|
||||
font-size: 1.1em;
|
||||
color: #121212;
|
||||
}
|
||||
|
||||
.user-email {
|
||||
font-size: 0.85em;
|
||||
opacity: 0.9;
|
||||
margin: 0;
|
||||
color:rgb(56, 55, 55);
|
||||
}
|
||||
|
||||
.accordion-icon {
|
||||
font-size: 1.2em;
|
||||
transition: transform 0.3s ease;
|
||||
color: #121212;
|
||||
}
|
||||
|
||||
.accordion-icon.active {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.card-content {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.4s ease;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.card-content.active {
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.content-inner {
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.section {
|
||||
background: #d6dce1;
|
||||
border-radius: 6px;
|
||||
padding: 12px;
|
||||
border: 1px solid #e9ecef;
|
||||
margin-bottom: 12px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.section:hover {
|
||||
border-color: #667eea;
|
||||
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
color: #121212;
|
||||
font-size: 0.95em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.main-checkbox {
|
||||
margin-right: 8px;
|
||||
transform: scale(1.1);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.checkbox-group {
|
||||
margin-left: 24px;
|
||||
transition: all 0.3s ease;
|
||||
max-height: 225px;
|
||||
overflow-y: auto;
|
||||
padding-right: 8px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.checkbox-group::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.checkbox-group::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.checkbox-group::-webkit-scrollbar-thumb {
|
||||
background: #667eea;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.checkbox-group::-webkit-scrollbar-thumb:hover {
|
||||
background: #5a6fd8;
|
||||
}
|
||||
|
||||
.checkbox-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
transition: background 0.2s ease;
|
||||
/* margin-bottom: 3px; */
|
||||
margin-bottom: -7px;
|
||||
}
|
||||
|
||||
.checkbox-item:hover {
|
||||
background: rgba(102, 126, 234, 0.1);
|
||||
}
|
||||
|
||||
.checkbox-item input[type="checkbox"] {
|
||||
transform: scale(1.05);
|
||||
cursor: pointer;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.checkbox-item label {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
margin: 0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
opacity: 0;
|
||||
max-height: 0 !important;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.policy-number {
|
||||
font-family: monospace;
|
||||
font-size: 0.8em;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.submit-container {
|
||||
background: white;
|
||||
padding: 18px;
|
||||
border-radius: 8px;
|
||||
/* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
|
||||
margin-top: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* .btn-submit {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border: none;
|
||||
padding: 10px 30px;
|
||||
font-weight: 600;
|
||||
border-radius: 25px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.btn-submit:hover {
|
||||
background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
|
||||
} */
|
||||
|
||||
.output-container {
|
||||
background: #f8f9fa;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
padding: 15px;
|
||||
margin-top: 20px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.output-table {
|
||||
font-family: monospace;
|
||||
font-size: 0.85em;
|
||||
white-space: pre-wrap;
|
||||
background: white;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<div class="row" id="client_add">
|
||||
<div class="col-12">
|
||||
@ -88,6 +308,12 @@ body {
|
||||
<span class="d-none d-sm-inline-block">Policies</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#hr-access-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="hr_access_tab" onclick="appendHrAccessControllHtml(this)">
|
||||
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
|
||||
<span class="d-none d-sm-inline-block">HR Access Controll</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li class="nav-item">
|
||||
<a href="#api-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="api_tab">
|
||||
<span class="mdi mdi-api"></span>
|
||||
@ -102,6 +328,18 @@ body {
|
||||
</li> -->
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade" id="hr-access-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" id="hr_access_append_area">
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("client_api.php"); ?>
|
||||
<?php // include('client_others_tab.php'); ?>
|
||||
<?php include('notification.php'); ?>
|
||||
@ -117,39 +355,10 @@ body {
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
// $(document).ready(function(){
|
||||
// var tabid = localStorage.getItem('tabId');
|
||||
// console.log(tabid)
|
||||
// $('#'+tabid).click();
|
||||
// localStorage.removeItem('tabId')
|
||||
// })
|
||||
|
||||
let hrAccessControlHtmlAppended = false;
|
||||
|
||||
// $('#general_tab').click( function (){
|
||||
// localStorage.setItem('tabId', 'general_tab')
|
||||
// })
|
||||
|
||||
// $('#KYC-DOC-tab').click( function (){
|
||||
// localStorage.setItem('tabId', 'kyc_tab')
|
||||
// })
|
||||
// $('#RM_tab').click( function (){
|
||||
// localStorage.setItem('tabId', 'RM_tab')
|
||||
// })
|
||||
// $('#branch_tab').click( function (){
|
||||
// localStorage.setItem('tabId', 'branch_tab')
|
||||
// })
|
||||
// $('#policy_tab').click( function (){
|
||||
// localStorage.setItem('tabId', 'policy_tab')
|
||||
// })
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function client_kyc_docs() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
@ -236,13 +445,11 @@ body {
|
||||
client_relationship_manager();
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("policy_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_policies();
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("branch_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_branch_contact();
|
||||
@ -253,6 +460,372 @@ body {
|
||||
client_notification();
|
||||
});
|
||||
|
||||
function appendHrAccessControllHtml(input){
|
||||
console.log(input.id);
|
||||
let client_id = $('#general_PrimaryKey').val();
|
||||
console.log('client_id ', client_id);
|
||||
|
||||
let url = '<?= base_url('util/viewHrAccessData') ?>';
|
||||
let requestData = {client_id : client_id};
|
||||
|
||||
if(hrAccessControlHtmlAppended == false){
|
||||
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||
console.log('Data fetched successfully:', response);
|
||||
|
||||
if (response.status === true) {
|
||||
$('#hr_access_append_area').empty();
|
||||
$('#hr_access_append_area').append(response.data)
|
||||
hrAccessControlHtmlAppended = true;
|
||||
} else {
|
||||
console.log(response.message, 'WARNING');
|
||||
hrAccessControlHtmlAppended = false;
|
||||
}
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
hrAccessControlHtmlAppended = false;
|
||||
});
|
||||
}else{
|
||||
console.log('Already HTML appended');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function toggleAccordion(header) {
|
||||
const card = header.parentElement;
|
||||
const content = card.querySelector('.card-content');
|
||||
const icon = header.querySelector('.accordion-icon i');
|
||||
|
||||
// Close all other accordions
|
||||
document.querySelectorAll('.user-card').forEach(otherCard => {
|
||||
if (otherCard !== card) {
|
||||
const otherContent = otherCard.querySelector('.card-content');
|
||||
const otherIcon = otherCard.querySelector('.accordion-icon i');
|
||||
otherContent.classList.remove('active');
|
||||
otherIcon.classList.remove('fa-chevron-up');
|
||||
otherIcon.classList.add('fa-chevron-down');
|
||||
}
|
||||
});
|
||||
|
||||
// Toggle current accordion
|
||||
content.classList.toggle('active');
|
||||
if (content.classList.contains('active')) {
|
||||
icon.classList.remove('fa-chevron-down');
|
||||
icon.classList.add('fa-chevron-up');
|
||||
} else {
|
||||
icon.classList.remove('fa-chevron-up');
|
||||
icon.classList.add('fa-chevron-down');
|
||||
}
|
||||
}
|
||||
|
||||
function toggleSection(checkbox, sectionId) {
|
||||
const section = document.getElementById(sectionId);
|
||||
const checkboxes = section.querySelectorAll('input[type="checkbox"]');
|
||||
|
||||
if (checkbox.checked) {
|
||||
section.classList.remove('hidden');
|
||||
checkboxes.forEach(cb => {
|
||||
cb.disabled = false;
|
||||
});
|
||||
} else {
|
||||
section.classList.add('hidden');
|
||||
checkboxes.forEach(cb => {
|
||||
cb.checked = false;
|
||||
cb.disabled = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getCheckedValues(name) {
|
||||
const checkboxes = document.querySelectorAll(`input[name="${name}"]:checked`);
|
||||
return Array.from(checkboxes).map(cb => parseInt(cb.value));
|
||||
}
|
||||
|
||||
// function submitForm(event) {
|
||||
// event.preventDefault();
|
||||
|
||||
// const formData = new FormData(document.getElementById('insuranceForm'));
|
||||
// const users = [];
|
||||
|
||||
// // Process User 1
|
||||
// const user1 = {
|
||||
// pk: formData.get('user1_pk'),
|
||||
// pre_hr_id: formData.get('user1_pre_hr_id'),
|
||||
// post_hr_id: formData.get('user1_post_hr_id'),
|
||||
// allowed_modules: getCheckedValues('user1_modules'),
|
||||
// allowed_pre_policies: getCheckedValues('user1_pre_policies'),
|
||||
// allowed_active_policies: getCheckedValues('user1_active_policies'),
|
||||
// allowed_cd: getCheckedValues('user1_cd'),
|
||||
// allowed_claims: getCheckedValues('user1_claims')
|
||||
// };
|
||||
|
||||
// // Process User 2
|
||||
// const user2 = {
|
||||
// pk: formData.get('user2_pk'),
|
||||
// pre_hr_id: formData.get('user2_pre_hr_id'),
|
||||
// post_hr_id: formData.get('user2_post_hr_id'),
|
||||
// allowed_modules: getCheckedValues('user2_modules'),
|
||||
// allowed_pre_policies: getCheckedValues('user2_pre_policies'),
|
||||
// allowed_active_policies: getCheckedValues('user2_active_policies'),
|
||||
// allowed_cd: getCheckedValues('user2_cd'),
|
||||
// allowed_claims: getCheckedValues('user2_claims')
|
||||
// };
|
||||
|
||||
// users.push(user1, user2);
|
||||
|
||||
// // Generate JSON format
|
||||
// const jsonOutput = users.map(user => {
|
||||
// const modules = user.allowed_modules.length > 0 ? `[${user.allowed_modules.join(',')}]` : '[]';
|
||||
// const prePolicies = user.allowed_pre_policies.length > 0 ? `[${user.allowed_pre_policies.join(',')}]` : '[]';
|
||||
// const activePolicies = user.allowed_active_policies.length > 0 ? `[${user.allowed_active_policies.join(',')}]` : '[]';
|
||||
// const cdPolicies = user.allowed_cd.length > 0 ? `[${user.allowed_cd.join(',')}]` : '[]';
|
||||
// const claims = user.allowed_claims.length > 0 ? `[${user.allowed_claims.join(',')}]` : '[]';
|
||||
|
||||
// return {
|
||||
// pk: parseInt(user.pk) || 0,
|
||||
// pre_hr_id: user.pre_hr_id || "",
|
||||
// post_hr_id: user.post_hr_id || "",
|
||||
// allowed_modules: modules,
|
||||
// allowed_pre_policies: prePolicies,
|
||||
// allowed_active_policies: activePolicies,
|
||||
// allowed_cd: cdPolicies,
|
||||
// allowed_claims: claims
|
||||
// };
|
||||
// });
|
||||
|
||||
// const output = JSON.stringify(jsonOutput, null, 1);
|
||||
|
||||
// // Display the output (you can modify this part based on your needs)
|
||||
// console.log(output);
|
||||
|
||||
// // Optional: Display in a textarea or pre element
|
||||
// const outputElement = document.getElementById('output');
|
||||
// if (outputElement) {
|
||||
// outputElement.textContent = output;
|
||||
// }
|
||||
|
||||
// // Optional: Copy to clipboard
|
||||
// if (navigator.clipboard) {
|
||||
// navigator.clipboard.writeText(output).then(() => {
|
||||
// console.log('Output copied to clipboard');
|
||||
// }).catch(err => {
|
||||
// console.error('Failed to copy to clipboard:', err);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
function submitForm(event) {
|
||||
event.preventDefault();
|
||||
|
||||
let client_id = $('#general_PrimaryKey').val();
|
||||
const formData = new FormData(document.getElementById('insuranceForm'));
|
||||
const users = [];
|
||||
|
||||
// Loop through each .user-card
|
||||
document.querySelectorAll('.user-card').forEach(card => {
|
||||
const userId = card.getAttribute('data-user-id'); // e.g., "user1", "user2"
|
||||
|
||||
const user = {
|
||||
pk: formData.get(`${userId}_pk`),
|
||||
pre_hr_id: formData.get(`${userId}_pre_hr_id`),
|
||||
post_hr_id: formData.get(`${userId}_post_hr_id`),
|
||||
post_client_id: formData.get(`${userId}_post_client_id`),
|
||||
allowed_modules: getCheckedValues(`${userId}_modules`),
|
||||
allowed_pre_policies: getCheckedValues(`${userId}_pre_policies`),
|
||||
allowed_active_policies: getCheckedValues(`${userId}_active_policies`),
|
||||
allowed_cd: getCheckedValues(`${userId}_cd`),
|
||||
allowed_claims: getCheckedValues(`${userId}_claims`)
|
||||
};
|
||||
|
||||
users.push(user);
|
||||
});
|
||||
|
||||
console.log("users array", users);
|
||||
|
||||
const jsonOutput = users.map(user => {
|
||||
return {
|
||||
pk: parseInt(user.pk) || 0,
|
||||
pre_hr_id: user.pre_hr_id || "",
|
||||
post_hr_id: user.post_hr_id || "",
|
||||
post_client_id: user.post_client_id || "",
|
||||
allowed_modules: user.allowed_modules.length ? `[${user.allowed_modules.join(',')}]` : '[]',
|
||||
allowed_pre_policies: user.allowed_pre_policies.length ? `[${user.allowed_pre_policies.join(',')}]` : '[]',
|
||||
allowed_active_policies: user.allowed_active_policies.length ? `[${user.allowed_active_policies.join(',')}]` : '[]',
|
||||
allowed_cd: user.allowed_cd.length ? `[${user.allowed_cd.join(',')}]` : '[]',
|
||||
allowed_claims: user.allowed_claims.length ? `[${user.allowed_claims.join(',')}]` : '[]'
|
||||
};
|
||||
});
|
||||
|
||||
const output = JSON.stringify(jsonOutput, null, 1);
|
||||
|
||||
// Display the output
|
||||
const outputElement = document.getElementById('outputTable');
|
||||
if (outputElement) {
|
||||
outputElement.textContent = output;
|
||||
}
|
||||
|
||||
// Copy to clipboard
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(output).then(() => {
|
||||
console.log('Output copied to clipboard');
|
||||
}).catch(err => {
|
||||
console.error('Failed to copy to clipboard:', err);
|
||||
});
|
||||
}
|
||||
|
||||
console.log(output);
|
||||
|
||||
let url = '<?= base_url('util/saveHrAccessData') ?>';
|
||||
let requestData = {json : output, client_id : client_id};
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
console.log('Data fetched successfully:', response);
|
||||
|
||||
if (response.status === true) {
|
||||
$('#hr_access_append_area').empty();
|
||||
$('#hr_access_append_area').append(response.data)
|
||||
toastr.success(response.message, 'SUCCESS');
|
||||
} else {
|
||||
console.error(response.message, 'WARNING');
|
||||
}
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Helper function to get checked checkbox values (if not already defined)
|
||||
function getCheckedValues(namePrefix) {
|
||||
const checkboxes = document.querySelectorAll(`input[name^="${namePrefix}"]:checked`);
|
||||
return Array.from(checkboxes).map(cb => cb.value);
|
||||
}
|
||||
|
||||
// $(document).on('change', '.select-all', function () {
|
||||
// let type = $(this).data('type');
|
||||
// let user = $(this).data('user');
|
||||
// let group = $(this).data('group');
|
||||
|
||||
// let selector = '.policy-checkbox[data-user="' + user + '"][data-group="' + group + '"]';
|
||||
|
||||
// if (type === 'active') {
|
||||
// selector += '.active';
|
||||
// } else if (type === 'inactive') {
|
||||
// selector += '.inactive';
|
||||
// }
|
||||
|
||||
// $(selector).prop('checked', this.checked);
|
||||
// });
|
||||
|
||||
$(document).on('change', '.select-all', function () {
|
||||
let $this = $(this);
|
||||
let type = $this.data('type');
|
||||
let user = $this.data('user');
|
||||
let group = $this.data('group');
|
||||
|
||||
console.log('--- SELECT-ALL CHANGED ---');
|
||||
console.log('Type:', type); // all / active / inactive
|
||||
console.log('User:', user); // user index
|
||||
console.log('Group:', group); // pre / post
|
||||
|
||||
// Step 1: Uncheck other "select-all" checkboxes in the same user/group
|
||||
$('.select-all[data-user="' + user + '"][data-group="' + group + '"]').not(this).prop('checked', false);
|
||||
console.log('Unchecked other master checkboxes in same group');
|
||||
|
||||
// Step 2: Build full selector
|
||||
let baseSelector = '.policy-checkbox[data-user="' + user + '"][data-group="' + group + '"]';
|
||||
let targetSelector = baseSelector;
|
||||
|
||||
if (type === 'active') {
|
||||
targetSelector += '.active';
|
||||
console.log('Targeting ACTIVE checkboxes only');
|
||||
} else if (type === 'inactive') {
|
||||
targetSelector += '.inactive';
|
||||
console.log('Targeting INACTIVE checkboxes only');
|
||||
} else {
|
||||
console.log('Targeting ALL checkboxes');
|
||||
}
|
||||
|
||||
// Step 3: Uncheck all policy checkboxes in that group
|
||||
$(baseSelector).prop('checked', false);
|
||||
console.log('Unchecked all checkboxes for user', user, 'group', group);
|
||||
|
||||
// Step 4: If this master is checked, apply checking to relevant ones
|
||||
if ($this.is(':checked')) {
|
||||
$(targetSelector).prop('checked', true);
|
||||
console.log('Checked selector:', targetSelector);
|
||||
} else {
|
||||
console.log('Master checkbox was unchecked — no checkboxes set');
|
||||
}
|
||||
|
||||
console.log('--- END ---');
|
||||
});
|
||||
|
||||
// $(document).on('change', '.post-select-all', function () {
|
||||
|
||||
// let $this = $(this);
|
||||
// let type = $this.data('type');
|
||||
// let user = $this.data('user');
|
||||
// let group = $this.data('group');
|
||||
|
||||
// console.log('--- POST SELECT-ALL CHANGED ---');
|
||||
// console.log('Type:', type); // all / active / inactive
|
||||
// console.log('User:', user); // user index
|
||||
// console.log('Group:', group); // pre / post
|
||||
|
||||
// // Step 1: Uncheck other "select-all" checkboxes in the same user/group
|
||||
// $('.post-select-all[data-user="' + user + '"][data-group="' + group + '"]').not(this).prop('checked', false);
|
||||
// console.log('Unchecked other master checkboxes in same group');
|
||||
|
||||
// // Step 2: Build selector for post policy checkboxes
|
||||
// // Note: Post policy checkboxes use name="userX_active_policies" not class="policy-checkbox"
|
||||
// let baseSelector = 'input[name="user' + user + '_active_policies"][data-user="' + user + '"][data-group="' + group + '"]';
|
||||
// let targetSelector = baseSelector;
|
||||
|
||||
// if (type === 'active-post') {
|
||||
// // Target checkboxes that have 'active' in their class or are associated with active policies
|
||||
// targetSelector = baseSelector + ':not(.inactive)';
|
||||
// console.log('Targeting ACTIVE checkboxes only');
|
||||
// } else if (type === 'inactive-post') {
|
||||
// // Target checkboxes that have 'inactive' in their class
|
||||
// targetSelector = baseSelector + '.inactive';
|
||||
// console.log('Targeting INACTIVE checkboxes only');
|
||||
// } else {
|
||||
// console.log('Targeting ALL checkboxes');
|
||||
// }
|
||||
|
||||
// // Step 3: Uncheck all policy checkboxes in that group first
|
||||
// $(baseSelector).prop('checked', false);
|
||||
// console.log('Unchecked all checkboxes for user', user, 'group', group);
|
||||
|
||||
// // Step 4: If this master is checked, apply checking to relevant ones
|
||||
// if ($this.is(':checked')) {
|
||||
// if (type === 'active') {
|
||||
// // Check all checkboxes that don't have 'inactive' class
|
||||
// $(baseSelector).each(function() {
|
||||
// if (!$(this).hasClass('inactive')) {
|
||||
// $(this).prop('checked', true);
|
||||
// }
|
||||
// });
|
||||
// } else if (type === 'inactive') {
|
||||
// // Check all checkboxes that have 'inactive' class
|
||||
// $(baseSelector + '.inactive').prop('checked', true);
|
||||
// } else {
|
||||
// // Check all checkboxes
|
||||
// $(baseSelector).prop('checked', true);
|
||||
// }
|
||||
// console.log('Applied checking based on type:', type);
|
||||
// } else {
|
||||
// console.log('Master checkbox was unchecked — no checkboxes set');
|
||||
// }
|
||||
|
||||
// console.log('--- END ---');
|
||||
// });
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
178
app/Views/hr_access_controll.php
Normal file
178
app/Views/hr_access_controll.php
Normal file
@ -0,0 +1,178 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<?php if(isset($hr_access_data) && !empty($hr_access_data)) { ?>
|
||||
<form id="insuranceForm" onsubmit="submitForm(event)">
|
||||
|
||||
<?php foreach ($hr_access_data as $key => $value) {
|
||||
$key = $key + 1 ?>
|
||||
|
||||
<!-- User 1 Card -->
|
||||
<div class="user-card" data-user-id="<?= 'user' . $key ?>">
|
||||
<!-- Hidden form elements for User 1 -->
|
||||
<input type="hidden" name="<?= 'user' . $key ?>_pk" value="<?= $value['hr_access_table_pk'] ?>">
|
||||
<input type="hidden" name="<?= 'user' . $key ?>_pre_hr_id" value="<?= $value['pre_hr_id'] ?>">
|
||||
<input type="hidden" name="<?= 'user' . $key ?>_post_hr_id" value="<?= $value['post_hr_id'] ?>">
|
||||
<input type="hidden" name="<?= 'user' . $key ?>_post_client_id" value="<?= $value['post_client_id'] ?>">
|
||||
|
||||
<div class="card-header" onclick="toggleAccordion(this)">
|
||||
<div class="user-info">
|
||||
<h5 class="mb-0"><?= $value['hr_name'] ?></h5>
|
||||
<p class="user-email"><?= $value['hr_mail'] ?></p>
|
||||
</div>
|
||||
<div class="accordion-icon">
|
||||
<i class="fas fa-chevron-down"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="content-inner">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-lg-3">
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<input type="checkbox" class="main-checkbox"
|
||||
onchange="toggleSection(this, '<?= 'user' . $key ?>-pre')" name="<?= 'user' . $key ?>_modules"
|
||||
value="1" <?php if (in_array(1, $value['allowed_pre_modules'] ?? [])) {
|
||||
echo 'checked';
|
||||
} ?>>
|
||||
<i class="fas fa-user-plus mr-2"></i>Pre enrollment
|
||||
</div>
|
||||
|
||||
<div class="<?= in_array(1, $value['allowed_pre_modules']) ? 'checkbox-group' : 'checkbox-group hidden' ?>" id="<?= 'user' . $key ?>-pre">
|
||||
|
||||
<!-- Select All -->
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="select-all" data-type="all" data-user="<?= $key ?>" data-group="pre">
|
||||
<label>Select all</label>
|
||||
</div>
|
||||
|
||||
<!-- Select All Active -->
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="select-all" data-type="active" data-user="<?= $key ?>" data-group="pre">
|
||||
<label>Select all Active policies</label>
|
||||
</div>
|
||||
|
||||
<!-- Select All Inactive -->
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="select-all" data-type="inactive" data-user="<?= $key ?>" data-group="pre">
|
||||
<label>Select all In-Active policies</label>
|
||||
</div>
|
||||
|
||||
<?php foreach ($pre_policy_data as $key1 => $policies) {
|
||||
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
||||
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
|
||||
?>
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="policy-checkbox <?= $statusClass ?>" name="<?= 'user' . $key ?>_pre_policies" data-user="<?= $key ?>" data-group="pre" value="<?= $policies['client_policy_id'] ?>"
|
||||
<?= in_array($policies['client_policy_id'], $value['allowed_pre_policies']) ? 'checked' : '' ?>>
|
||||
<label style="<?php if($policies['policy_status'] == 0){echo 'color:#ff5757';} ?>"><?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?></label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-lg-3">
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<input type="checkbox" class="main-checkbox"
|
||||
onchange="toggleSection(this, '<?= 'user' . $key ?>-active')" name="<?= 'user' . $key ?>_modules"
|
||||
value="2" <?php if (in_array(2, $value['allowed_post_modules'])) {
|
||||
echo 'checked';
|
||||
} ?>>
|
||||
<i class="fas fa-check-circle mr-2"></i>Active policies
|
||||
</div>
|
||||
<div class="<?php if (in_array(2, $value['allowed_post_modules'])) {echo 'checkbox-group';} else {echo 'checkbox-group hidden';} ?>" id="<?= 'user' . $key ?>-active">
|
||||
|
||||
|
||||
<!-- Select All -->
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="select-all" data-type="all" data-user="<?= $key ?>" data-group="post">
|
||||
<label>Select all</label>
|
||||
</div>
|
||||
|
||||
<!-- Select All Active -->
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="select-all" data-type="active" data-user="<?= $key ?>" data-group="post">
|
||||
<label>Select all Active policies</label>
|
||||
</div>
|
||||
|
||||
<!-- Select All Inactive -->
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="select-all" data-type="inactive" data-user="<?= $key ?>" data-group="post">
|
||||
<label>Select all In-Active policies</label>
|
||||
</div>
|
||||
|
||||
<?php foreach ($post_policy_data as $key2 => $policies) {
|
||||
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
||||
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
|
||||
?>
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="policy-checkbox <?= $statusClass ?>" id="<?= 'user' . $key ?>-gmc2" name="<?= 'user' . $key ?>_active_policies" data-user="<?= $key ?>" data-group="post"
|
||||
value="<?= $policies['client_policy_id'] ?>" <?php if (in_array($policies['client_policy_id'], $value['allowed_active_policies'])) {echo 'checked';} ?>>
|
||||
<label for="<?= 'user' . $key ?>-gmc2" style="<?php if($policies['policy_status'] == 0){echo 'color:#ff5757';} ?>"><?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?></label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-lg-3">
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<input type="checkbox" class="main-checkbox"
|
||||
onchange="toggleSection(this, '<?= 'user' . $key ?>-cd')" name="<?= 'user' . $key ?>_modules" value="3" <?php if (in_array(3, $value['allowed_post_modules'])) { echo 'checked';} ?>>
|
||||
<i class="fas fa-file-alt mr-2"></i>CD statement
|
||||
</div>
|
||||
|
||||
<div class="<?php if (in_array(3, $value['allowed_post_modules'])) {echo 'checkbox-group';} else {echo 'checkbox-group hidden';} ?>" id="<?= 'user' . $key ?>-cd">
|
||||
|
||||
<!-- Select All -->
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="select-all" data-type="all" data-user="<?= $key ?>" data-group="cd">
|
||||
<label>Select all</label>
|
||||
</div>
|
||||
|
||||
<?php foreach ($post_cd_data as $key3 => $cd) { ?>
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="policy-checkbox" data-user="<?= $key ?>" data-group="cd" id="<?= 'user' . $key ?>-icici1" name="<?= 'user' . $key ?>_cd" value="<?= $cd['cd_master_pk'] ?>" <?php if (in_array($cd['cd_master_pk'], $value['allowed_cd'])) { echo 'checked';} ?>>
|
||||
<label for="<?= 'user' . $key ?>-icici1"><?= $cd['insurer_short_name'] ?> - <span class="policy-number"><?= $cd['cd_account_no'] ?></span></label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-lg-3">
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<input type="checkbox" class="main-checkbox" name="<?= 'user' . $key ?>_modules" value="4" <?php if (in_array(4, $value['allowed_post_modules'])) {echo 'checked';} ?>>
|
||||
<i class="fas fa-clipboard-list mr-2"></i>Claims
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- Submit Section -->
|
||||
<div class="submit-container">
|
||||
<button type="submit" class="btn btn-primary btn-submit">
|
||||
Submit Form
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php } else { ?>
|
||||
<div class="submit-container"><b>There is no HR data</b></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user