FEAT_CLIENT_BASIC_INFO_PAGE : RV

This commit is contained in:
VENKATESHWARAN 2024-05-23 12:34:30 +05:30
parent dddc960142
commit 404ee3f03f
21 changed files with 1994 additions and 1100 deletions

View File

@ -234,6 +234,8 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
$routes->get("preview-card/(:any)", "EmployeeController::previewTemplate/$1");
$routes->get("export-import-error-list/(:any)", "EmployeeController::errorListExportImport/$1");
$routes->get("has_policy_config_completed/(:any)", "EmployeeController::hasPolicyConfigCompleted/$1");
$routes->get("get-client-branch/(:any)", "ClientController::getClientBranch/$1");
$routes->get("get-client-details/(:any)", "ClientController::getClientAllDetailsByUsingClientID/$1");
});
$routes->cli('cli/processjob', 'JobWorker::processJob');

View File

@ -98,12 +98,13 @@ class ClientController extends AdminController
public function index()
{
$this->myLogger->logme('error','Client list function called');
$headerData['page_name'] = 'Client List';
$data['clientList'] = $this->clientModel->getCreatedByUserName();
$data['client_rm'] = $this->clientRMModel->getAllClientRM();
// dd($data);
echo view('layout/header', $headerData);
echo view('client_list', $data);
echo view('layout/footer');
@ -584,6 +585,19 @@ class ClientController extends AdminController
$this->myLogger->logme('error','Client policy CREATE function called');
$policy_id = $this->request->getPost('policy_id');
$client_branch_id = $this->request->getPost('client_branch_id');
$policyCount = $this->clientPolicyModel
->where('policy_id', $policy_id)
->where('client_branch_id', $client_branch_id)
->countAllResult();
if($policyCount > 0 ){
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($this->request->getPost('client_id'));
return $this->respond(['status' => 'policy_exist','code' => 200,'data' => $clientPoliceData, 'method' => 'CERATE'], 200);
}
$insurerValue = (string) $this->request->getPost('insurer');
list($insurerBranchId, $insurerId) = explode('-', $insurerValue);
$client_id = $this->request->getPost('client_id');
@ -623,6 +637,7 @@ class ClientController extends AdminController
$data['base_policy'] = $this->request->getPost('base_policy');
$data['policy_status'] = 1;
$data['inception_type'] = $this->request->getPost('inception_type') ? 2 : 1;
$data['client_branch_id'] = $this->request->getPost('client_branch_id');
@ -717,6 +732,8 @@ class ClientController extends AdminController
$data['base_policy'] = $this->request->getPost('base_policy');
$data['policy_status'] = 1;
$data['inception_type'] = $this->request->getPost('inception_type') ? 2 : 1;
$data['client_branch_id'] = $this->request->getPost('client_branch_id');
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
@ -1707,4 +1724,330 @@ class ClientController extends AdminController
return "File not found.";
}
}
public function getClientBranch($client_id){
$branchs = $this->clientBranchModel
->select('*')
->where('client_id',$client_id)
->findAll();
return $this->respond(['status' => true,'code' => 200, 'data' => $branchs], 200);
}
public function getClientAllDetailsByUsingClientID($client_id)
{
$db = \Config\Database::connect();
$builder = $db->table('clients');
$builder->select('
policies.name as policy_name,
policy_type.policy_type,
insurers.name as insurer_name,
insurers.short_name as insurer_short_name,
tpa.name as tpa_name,
tpa.short_name as tpa_short_name,
client_policy.policy_terms,
DATE_FORMAT(client_policy.policy_start_date, "%d-%b-%Y") as policy_start_date,
DATE_FORMAT(client_policy.policy_end_date, "%d-%b-%Y") as policy_end_date,
CASE
WHEN client_policy.base_policy IS NULL THEN "Not Appear"
WHEN client_policy.base_policy = 0 THEN "Not Appear"
ELSE (SELECT policies.name
FROM client_policy AS base_client_policy
JOIN policies ON policies.id = base_client_policy.policy_id
WHERE base_client_policy.id = client_policy.base_policy)
END as base_policy_name,
CASE
WHEN client_policy.is_addon = 1 THEN "Base Policy"
WHEN client_policy.is_addon = 2 THEN "SI Topup"
WHEN client_policy.is_addon = 3 THEN "Dependent Addon"
ELSE "n/a"
END as is_addon,
CASE
WHEN client_policy.policy_status = 1 THEN "Active"
WHEN client_policy.policy_status = 0 THEN "Expired"
ELSE "n/a"
END as policy_status,
CASE
WHEN client_policy.inception_type = 1 THEN "File Upload"
WHEN client_policy.inception_type = 2 THEN "Enrollment"
ELSE "n/a"
END as inception_type,
CASE
WHEN client_policy.open_for_enrollment = 1 THEN "Open"
WHEN client_policy.open_for_enrollment = 0 THEN "Closed"
ELSE "n/a"
END as open_for_enrollment,
client_branch.branch_name
', false);
$builder->join('client_policy', 'client_policy.client_id = clients.id');
$builder->join('client_branch', 'client_policy.client_branch_id = client_branch.id');
$builder->join('policies', 'policies.id = client_policy.policy_id');
$builder->join('policy_type', 'policy_type.id = policies.policy_type_id');
$builder->join('insurers', 'insurers.id = client_policy.insurer_id');
$builder->join('tpa', 'tpa.id = client_policy.tpa_id');
$builder->where('clients.is_active', 1);
$builder->where('client_policy.is_active', 1);
$builder->where('policies.is_active', 1);
$builder->where('policy_type.is_active', 1);
$builder->where('client_policy.policy_status', 1);
$builder->where('clients.id', $client_id);
$query = $builder->get();
$client_policy = $query->getResultArray();
$gmc_keys = [
"sum_insured" => "Sum Insured",
"family_floater" => "Family Floater",
"family_floaters" => "Family Floaters",
"member_count" => "Elders Count:",
"other_member_min_age" => "Min Age:",
"other_member_max_age" => "Min Age:",
"waiverofpreexistingdiseases" => "Waiver of Pre-existing Diseases",
"9monthwaitingperiodwaived" => "9-month waiting Period waived",
"coverfromthedateofjoining" => "Cover from the date of Joining",
"waiverof1,2,3&4thyearexclusions" => "Waiver of 1, 2, 3 & 4th year Exclusions",
"waiverof30dayswaitingperiod" => "Waiver of 30 days waiting period",
"prehospitalizationcover" => "Pre Hospitalization Cover",
"congenitaldiseasesinternal" => "Congenital Diseases - Internal",
"copayzonewisecopay" => "Co-Pay/Zone wise Co Pay",
"bioabsorbablestenttoriclensmultifocallens" => "Bio absorbable stent / Toric lens/ Multi Focal lens",
"roomrentlimit" => "Room Rent Limit",
"proportionatedeductionclause" => "Proportionate Deduction Clause",
"nursingallowance" => "Nursing Allowance",
"ailmentcapping" => "Ailment capping",
"ambulancecharges" => "Ambulance Charges",
"airambulance" => "Air Ambulance",
"familytransportationbenefit" => "Family Transportation Benefit",
"reasonableandcustomarycharges" => "Reasonable and Customary Charges",
"daycaretreatment" => "Day Care Treatment",
"ayudhtreatmentcover" => "AYUSH treatment cover",
"armdcovered" => "ARMD Covered",
"suminsuredenhancement" => "Sum Insured enhancement",
"automaticsuminsuredreinstatement" => "Automatic Sum Insured reinstatement",
"additionalsicknessbenefit" => "Additional Sickness Benefit",
"lasiksurgery" => "Lasik Surgery",
"midterminclusion" => "Mid Term inclusion",
"capd" => "CAPD",
"organdonorexpenses" => "Organ donor expenses",
"moderntreatmentsasperirdai" => "Modern treatments as per IRDAI",
"Wellness" => "Wellness",
"days_of_discharge" => "Claim Intimation Clause",
"days_from_dod" => "Claim Submission",
"cataract" => "Cataract"
];
$gpa_keys = [
"sumInsured2" => "Sum Insured",
"totalSumInsured" => "Total Sum Assured",
"self" => "Self",
"self_min_age" => "Min Age",
"self_max_age" => "Max Age",
"accidentalDeathBenefit" => "Accidental Death Benefit",
"permanentTotalDisablement" => "Permanent Total Disablement",
"permanentPartialDisablement" => "Permanent Partial Disablement",
"temporaryTotalDisablementBenefit" => "Temporary Total Disablement benefit",
"accidentalHospitalizationExpenses" => "Accidental Hospitalization Expenses",
"childrenEducationWelfareFund" => "Children Education Welfare Fund",
"compassionateVisitExpenses" => "Compassionate Visit Expenses",
"compassionateVisitExpensesData" => "Compassionate Visit Expenses Data",
"brokenBoneExpenses" => "Broken Bone Expenses",
"brokenBoneExpensesData" => "Broken Bone Expenses Data",
"ambulanceCharges" => "Ambulance charges",
"ambulanceChargesData" => "Ambulance charges Data",
"burnExpenses" => "Burn Expenses",
"burnExpensesData" => "Burn Expenses Data",
"carriageOfDeadBody" => "Carriage of Dead Body",
"carriageOfDeadBodyData" => "Carriage of Dead Body Data",
"animalSnakeInsectBite" => "Animal/Snake/Insect bite",
"terrorism" => "Terrorism",
"worldwideCover" => "Worldwide Cover"
];
foreach ($client_policy as $key => $value) {
$policy_terms = json_decode($value['policy_terms'], true);
$mapping = $gmc_keys;
if ($value['policy_type'] == 'GPA') {
$mapping = $gpa_keys;
}
$client_policy[$key]['policy_terms'] = $this->transformArray($policy_terms, $mapping);
}
$data['client_policy'] = $client_policy;
$data['client_branch'] = $this->clientModel
->select('
client_branch.branch_name,
client_branch.branch_code,
client_branch.city,
level_contacts.name as hr_name,
level_contacts.designation,
level_contacts.mobile,
level_contacts.email
')
->join('client_branch', 'client_branch.client_id = clients.id')
->join('level_contacts', 'level_contacts.ref_id = client_branch.id')
->where('clients.is_active', 1)
->where('client_branch.is_active', 1)
->where('level_contacts.is_active', 1)
->where('level_contacts.contact_type', 'client')
->where('clients.id', $client_id)
->get()->getResultArray();
$data['client'] = $this->clientModel
->select('clients.*, states.state as state')
->join('states', 'states.id = clients.state')
->where('clients.id', $client_id)->first();
$client_rm = $this->clientRMModel
->select('client_rm.*, user_profiles.first_name as user_name')
->join('user_profiles', 'user_profiles.id = client_rm.user_id')
->where('client_id', $client_id)->get()->getResultArray();
$account_managers = [];
$managers = [];
$heads = [];
foreach ($client_rm as $key => $value) {
if ($value['level'] == 3) {
$account_managers[] = $value['user_name'];
} elseif ($value['level'] == 2) {
$managers[] = $value['user_name'];
} elseif ($value['level'] == 1) {
$heads[] = $value['user_name'];
}
}
$data['account_managers'] = $account_managers;
$data['managers'] = $managers;
$data['heads'] = $heads;
// dd($data);
//$this->loadLayout('client_info', $data);
$html = view('client_info', $data);
return $this->respond(['status' => true,'code' => 200, 'data' => $html], 200);
}
public function transformArray($data, $mapping) {
// dd($data);
$transformedData = [];
if (!is_array($data)) {
return json_encode($transformedData, JSON_PRETTY_PRINT);
}
foreach ($data as $key => $value) {
if ($key == 'family_floaters') {
$transformedData[$key] = $this->transformFamilyFloaters($value, $data);
}else if (array_key_exists($key, $mapping)) {
$transformedData[$mapping[$key]] = $value;
}else if($key == 'special_condition_label'){
foreach ($value as $key => $value) {
$transformedData[$value] = $data['special_condition_input'][$key];
}
}else if($key == 'gpa_special_condition_label'){
foreach ($value as $key => $value) {
$transformedData[$value] = $data['gpa_special_condition_input'][$key];
}
}else if($key == 'age_ratio'){
if(isset($data['sumInsured2'])){
$transformedData['Self'] = "(Min: " . $data['age_ratio']['self']['min'] . ", Max: " . $data['age_ratio']['self']['max'] . ")";
}
}else {
$transformedData[$key] = $value;
}
}
return json_encode($transformedData, JSON_PRETTY_PRINT);
}
public function transformFamilyFloaters($familyFloaters, $json) {
$result = [];
$min = $json['age_ratio']['self'];
$max = $json['age_ratio']['self'];
$spouse_min = $json['age_ratio']['spouse'];
$spouse_max = $json['age_ratio']['spouse'];
$child_min = $json['age_ratio']['child'];
$child_max = $json['age_ratio']['child'];
$elders_min = $json['age_ratio']['elders'];
$elders_max = $json['age_ratio']['elders'];
foreach ($familyFloaters as $key => $value) {
if ($value !== 0) {
switch ($key) {
case 'self':
$result[] = "Self (Min: {$min['min']}, Max: {$max['max']})";
break;
case 'spouse':
$result[] = "Spouse (Min: {$spouse_min['min']}, Max: {$spouse_max['max']})";
break;
case 'childrens':
$result[] = "Children(s) - $value (Min: {$child_min['min']}, Max: {$child_max['max']})";
break;
case 'parents':
$result[] = "Parent(s) - $value (Min: {$elders_min['min']}, Max: {$elders_max['max']})";
break;
case 'parents-in-law':
$result[] = "Parents-in-Law - $value (Min: {$elders_min['min']}, Max: {$elders_max['max']})";
break;
case 'either-parents-pil':
$result[] = "Either Parents Nor Parents-in-Law - $value (elders_min: {$elders_min['min']}, Max: {$elders_max['max']})";
break;
}
}
}
return implode(", ", $result);
}
}

View File

@ -41,7 +41,8 @@ class ClientPolicyModel extends Model
"Is_active",
"date_of_exit",
"reason_for_exit",
"policy_no"
"policy_no",
"client_branch_id"
];
public function getClientPolicyById($id){

View File

@ -42,7 +42,7 @@ table.dataTable tbody td {
<div class="card-body">
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">User List</h4>
<h4 style="position: relative;">User List</h4>
</div>
<div class="col-6" style="text-align: right; position: relative;top: 53px;">
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-target="#con-close-modal" data-placement="top" title="Add" data-trigger="hover">ADD</button>

View File

@ -8,12 +8,12 @@
}
</style>
<div class="col-12">
<div class="col-12" id="second_page">
<div class="card">
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Batch List</h4>
<h4 style="position: relative;">Batch List</h4>
</div>
</div>
@ -54,7 +54,7 @@
<td><?php echo $file['event_type'] ?></td>
<td><?php echo $file['insurer_or_tpa'] ?></td>
<td><?php echo $file['actions'] ?></td>
<td><?php echo $file['count'] ?></td>
<td><?php echo $file['count'] == null ? '-' : $file['count'] ?></td>
<td class="indian-number"><?php echo intval($file['amount']) ?></td>
<td class="reload" data-toggle="tooltip" data-placement="top" title="<?php echo date('d-M-Y H:i:a', strtotime($file['created_at'])) ?> by <?php echo get_username($file['created_by']) ?>">
@ -104,7 +104,8 @@
</div>
</div>
</div><!-- end col -->
</div>
</div>
<script>
$(document).ready(function() {

331
app/Views/client_info.php Normal file
View File

@ -0,0 +1,331 @@
<div id="client_info">
<div class="row">
<div class="col-12">
<div id="accordion" class="mb-3">
<div class="card">
<div class="row" style="padding-top: 20px;margin-bottom: 18px;">
<div class="col-6">
<h4 style="position: relative;left: 18px;top: 2px;">Client Basic Info</h4>
</div>
<div class="col-6">
<div class="row">
<div class="col-6" style="position: relative;left: 455px;">
<button id="close_btn" class="btn btn-primary waves-effect waves-light client_info_close">Close</button>
</div>
<div class="col-1 float-right" style="position: relative;left: 255px;">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse"
href="#collapseOne" aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary"
style="font-size: 28px;"></i>
</a>
</div>
</div>
</div>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body" style="position: relative;bottom: 25px;">
<div class="row" >
<div class="col-6">
<table>
<tr>
<td style="font-size: 18px;"> <strong> <?= $client['client_name'] ?> (
<?= $client['short_name'] ?> ) </strong></td>
</tr>
</table>
</div>
<div class="col-6">
<table>
<tr>
<td style="font-size: 18px;"> <strong> Relationship Manager </strong></td>
</tr>
</table>
</div>
</div>
<br>
<div class="row">
<div class="col-6">
<table>
<tr>
<td style="padding: 3px;"><label>Address :</label>
<?= $client['address1'] ?> <br> <?= $client['address2'] ?></td>
</tr>
<tr>
<td style="padding: 3px;"><?= $client['city'] ?>, <?= $client['state'] ?> -
<?= $client['pincode'] ?></td>
</tr>
</table>
</div>
<div class="col-6">
<table>
<tr>
<td style="padding: 3px;"><label> Account Manager :
</label> <?= implode(', ', $account_managers) ?></td>
</tr>
<tr>
<td style="padding: 3px;"><label> Manager :
</label> <?= implode(', ', $managers) ?></td>
</tr>
<tr>
<td style="padding: 3px;"><label> Head : </label>
<?= implode(', ', $heads) ?>
</td>
</tr>
</table>
</div>
</div>
<!-- end row-->
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div id="accordion" class="mb-3">
<div class="card">
<div class="row" style="padding-top: 20px;margin-bottom: 18px;">
<div class="col-6">
<h4 style="position: relative;left: 18px;top: 2px;">Client Policies</h4>
</div>
<div class="col-6">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo"
aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary"
style="font-size: 28px;"></i>
</a>
</div>
</div>
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body" style="position: relative;bottom: 25px;">
<div class="row">
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100"
cellspacing="0">
<thead class="bg-light">
<tr>
<th class="font-weight-medium"><label> Branch Name </label></th>
<th class="font-weight-medium"><label> Policy Name </label></th>
<th class="font-weight-medium"><label> Insurer </label></th>
<th class="font-weight-medium"><label> TPA </label></th>
<th class="font-weight-medium"><label> Policy Validity </label></th>
<th class="font-weight-medium"><label> Enrollment Status </label></th>
<th class="font-weight-medium"><label> Policy Status </label></th>
</tr>
</thead>
<tbody>
<?php foreach ($client_policy as $key => $value) { ?>
<tr class="policy_terms"
data-id="<?= htmlspecialchars($value['policy_terms']) ?>"
data-toggle="modal" data-target="#bs-example-modal-lg">
<td><?= $value['branch_name'] ?></td>
<td><?= $value['policy_name'] ?> ( <?= $value['policy_type'] ?> )</td>
<td><?= $value['insurer_short_name'] ?></td>
<td><?= $value['tpa_short_name'] ?></td>
<td><?= $value['policy_start_date'] ?> / <?= $value['policy_end_date'] ?>
</td>
<td>
<?php if($value['open_for_enrollment'] == 'Open' ) { ?>
<span
class="badge badge-success"><?= $value['open_for_enrollment'] ?></span>
<?php } else if($value['open_for_enrollment'] == 'Closed') { ?>
<span
class="badge badge-warning"><?= $value['open_for_enrollment'] ?></span>
<?php } else { ?>
<span
class="badge badge-secondary"><?= $value['open_for_enrollment'] ?></span>
<?php } ?>
</td>
<td>
<?php if($value['policy_status'] == 'Active' ) { ?>
<span class="badge badge-success"><?= $value['policy_status'] ?></span>
<?php } else { ?>
<span class="badge badge-danger"><?= $value['policy_status'] ?></span>
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- end row -->
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div id="accordion" class="mb-3">
<div class="card">
<div class="row" style="padding-top: 20px;margin-bottom: 18px;">
<div class="col-6">
<h4 style="position: relative;left: 18px;top: 2px;">Client Contacts</h4>
</div>
<div class="col-6">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse"
href="#collapseThree" aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary"
style="font-size: 28px;"></i>
</a>
</div>
</div>
<div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body" style="position: relative;bottom: 25px;">
<div class="row">
<table id="tb1" class="table table-hover m-0 table-centered dt-responsive nowrap w-100"
cellspacing="0">
<thead class="bg-light">
<tr>
<th class="font-weight-medium"><label> HR Name </label></th>
<th class="font-weight-medium"><label> Mobile </label></th>
<th class="font-weight-medium"><label> Email </label></th>
<th class="font-weight-medium"><label> Branch Name </label></th>
</tr>
</thead>
<tbody>
<?php foreach ($client_branch as $key => $value) { ?>
<tr>
<td><?= $value['hr_name'] ?> ( <?= $value['designation'] ?> )</td>
<td><?= $value['mobile'] ?></td>
<td><?= $value['email'] ?></td>
<td><?= $value['branch_name'] ?> ( <?= $value['branch_code'] ?> )</td>
</tr>
<?php } ?>
</tbody>
</table>
</div> <!-- end row-->
</div>
</div>
</div>
</div>
<!-- end row -->
</div>
</div>
</div>
<!-- Modal content for the Large example -->
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
aria-hidden="true" aria-modal="true" data-backdrop="static" style="padding-right: 15px">
<div class="modal-dialog modal-full-width">
<div class="modal-content">
<div class="modal-header" style="background: #02a8b5;">
<h4 class="modal-title" id="myLargeModalLabel">Policy Terms <span id="nameOfThePolicy"></span>
</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body" id="modal_body" >
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
$(document).ready(function() {
// $('#tb1').DataTable({
// paging: true,
// });
})
$(document).on('click', '.policy_terms', function() {
var terms = $(this).data('id');
console.log(terms);
// terms = JSON.parse(terms);
$('#modal_body').empty();
function createListItems(obj) {
const fragment = document.createDocumentFragment();
for (const key in obj) {
if (obj.hasOwnProperty(key) && obj[key] !== null && obj[key] !== '' && key !=
'family_floater' && key != 'gpa_special_condition_input' && key !=
'gpa_special_condition_label' && key != 'special_condition_label' && key !=
'special_condition_input' && key != 'age_ratio') {
const listItem = document.createElement('li');
var formattedKey = '';
formattedKey = key.replace(/_/g, ' ');
obj[key] = obj[key].replace(/<\/?[^>]+>/gi, '');
if (obj[key] == 0) {
obj[key] = 'No';
}
if (obj[key] == 1) {
obj[key] = 'Yes';
}
console.log(formattedKey)
if (key == 'burnExpenses' && obj[key] == 'Yes') {
listItem.innerHTML =
`<strong>${formattedKey.charAt(0).toUpperCase() + formattedKey.slice(1)}:</strong> ${obj['burnExpensesData']}`;
} else if (typeof obj[key] === 'object' && !Array.isArray(obj[key])) {
listItem.innerHTML =
`<strong>${formattedKey.charAt(0).toUpperCase() + formattedKey.slice(1)}:</strong>`;
const nestedList = document.createElement('ul');
nestedList.appendChild(createListItems(obj[key]));
listItem.appendChild(nestedList);
} else {
listItem.innerHTML =
`<strong>${formattedKey.charAt(0).toUpperCase() + formattedKey.slice(1)}:</strong> ${Array.isArray(obj[key]) ? JSON.stringify(obj[key]) : obj[key]}`;
}
fragment.appendChild(listItem);
}
}
return fragment;
}
$('#modal_body').append(createListItems(terms));
});
</script>

View File

@ -7,6 +7,15 @@
table.dataTable tbody td {
padding: 4px 4px !important;
}
table.dataTable thead th {
padding: 4px 4px !important;
}
.col-12{
max-width: 98% !important;
}
</style>
<div class="row" id="client_list">
@ -15,9 +24,9 @@ table.dataTable tbody td {
<div class="card-body">
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Client List</h4>
<h4 style="position: relative;">Client List</h4>
</div>
<div class="col-6" style="text-align: right; position: relative;top: 53px;">
<div class="col-6" style="text-align: right; position: relative;top: 56px;">
<a href="<?= base_url("client/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>
</div>
</div>
@ -33,8 +42,8 @@ table.dataTable tbody td {
<tbody>
<?php foreach($clientList as $row){ ?>
<tr>
<td><?php echo $row->client_name; ?> ( <?php echo $row->short_name; ?> ) </td>
<tr >
<td class="client_info" data-id="<?php echo $row->id; ?>"><?php echo $row->client_name; ?> ( <?php echo $row->short_name; ?> ) </td>
<td>
<?php $account_managers = ''; ?>
<?php foreach ($client_rm as $client): ?>
@ -66,10 +75,10 @@ table.dataTable tbody td {
</div>
<!-- end row -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> -->
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> -->
<!-- Include DataTables JS -->
<!-- <script src="https://cdn.datatables.net/1.11.6/js/jquery.dataTables.min.js"></script> -->
<div id="append_client_info"></div>
<script>
@ -96,7 +105,8 @@ table.dataTable tbody td {
// pagingType: 'full_numbers'
});
})
})
@ -136,4 +146,57 @@ table.dataTable tbody td {
}
$(document).on('click', '.client_info', function() {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var client_id = $(this).data('id')
$('#append_client_info').empty();
console.log(client_id);
console.log('client_info');
$('#client_info').show();
$('#client_list').hide();
$.ajax({
url: "<?= base_url('util/get-client-details/') ?>" + client_id,
type: "GET",
dataType: 'json',
processData: false,
contentType: false,
success: function(res) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log(res);
console.log(res.data.length);
$('#append_client_info').append(res.data);
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}
});
});
$(document).on('click', '.client_info_close', function() {
console.log('client_info_close');
$('#client_info').hide();
$('#client_list').show();
});
</script>

View File

@ -41,7 +41,7 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Client Onboarding <?php if(isset($client)) {echo ' - ' . $client['client_name']; } ?></h4>
<h4 style="position: relative;">Client Onboarding <?php if(isset($client)) {echo ' - ' . $client['client_name']; } ?></h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url("client/list"); ?>"><i class="fas fa-arrow-left" style="font-size: 17px;"></i></a>

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Employees</h4>
<h4 style="position: relative;">Employees</h4>
</div>
</div>

View File

@ -80,7 +80,7 @@ table.dataTable tbody td {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Endorsement List</h4>
<h4 style="position: relative;">Endorsement List</h4>
</div>
</div>

View File

@ -14,7 +14,7 @@
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Files</h4>
<h4 style="position: relative;">Files</h4>
</div>
</div>

View File

@ -4,7 +4,7 @@
<div class="card-body">
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Insurer List</h4>
<h4 style="position: relative;">Insurer List</h4>
</div>
<div class="col-6" style="text-align: right; position: relative;top: 53px;">
<a href="<?= base_url("master/insurer/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>

View File

@ -36,7 +36,7 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Insurer</h4>
<h4 style="position: relative;">Insurer</h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url("master/insurer/list"); ?>" >

View File

@ -4,7 +4,7 @@
<div class="card-body">
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">KYC List</h4>
<h4 style="position: relative;">KYC List</h4>
</div>
<div class="col-6" style="text-align: right; position: relative;top: 53px;">
<a href="<?= base_url("master/kyc/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>

View File

@ -36,7 +36,7 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">KYC Entity Type</h4>
<h4 style="position: relative;">KYC Entity Type</h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url("master/kyc/list"); ?>" ><i class="fas fa-arrow-left" style="font-size: 17px;"></i> </a>

View File

@ -295,7 +295,7 @@
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').fadeOut('slow');
}, 2000);
}, 1000);
});
</script>

View File

@ -4,7 +4,7 @@
<div class="card-body">
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Policy Type List</h4>
<h4 style="position: relative;">Policy Type List</h4>
</div>
<div class="col-6" style="text-align: right; position: relative;top: 53px;">
<a href="<?= base_url("master/policy/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>

View File

@ -36,7 +36,7 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Policy Type</h4>
<h4 style="position: relative;">Policy Type</h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url("master/policy/list"); ?>"><i class="fas fa-arrow-left" style="font-size: 17px;"></i> </a>

View File

@ -4,7 +4,7 @@
<div class="card-body">
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">TPA List</h4>
<h4 style="position: relative;">TPA List</h4>
</div>
<div class="col-6" style="text-align: right; position: relative;top: 53px;">
<a href="<?= base_url("master/tpa/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>

View File

@ -36,7 +36,7 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">TPA</h4>
<h4 style="position: relative;">TPA</h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url("master/tpa/list"); ?>"><i class="fas fa-arrow-left" style="font-size: 17px;"></i> </a>