2158 lines
96 KiB
PHP
Executable File
2158 lines
96 KiB
PHP
Executable File
<!-- Modal content for the Large example -->
|
||
<style>
|
||
.underline-input {
|
||
border: none;
|
||
border-bottom: 1px solid grey;
|
||
/* Underline style */
|
||
outline: none;
|
||
/* Remove default focus outline */
|
||
padding: 2px 5px;
|
||
/* Adjust padding (top/bottom right/left) */
|
||
font-size: 16px;
|
||
/* Adjust font size */
|
||
}
|
||
|
||
.button-like {
|
||
display: inline-block;
|
||
padding: 8px 15px;
|
||
background-color: #02a8b5;
|
||
color: white;
|
||
text-decoration: none;
|
||
border-radius: 2px;
|
||
cursor: pointer;
|
||
margin-right: -85px;
|
||
}
|
||
|
||
.radiobuttondiv {
|
||
margin-left: 32px;
|
||
}
|
||
|
||
/* .{
|
||
width:62% !important;
|
||
margin-left: 30px;
|
||
margin-top: 3px
|
||
} */
|
||
/* .form-group.col-md-6 */
|
||
.form-group-client-policy-master {
|
||
display: -webkit-box;
|
||
max-width: 100% !important;
|
||
/* border:1px solid; */
|
||
/* background-color: #0001; */
|
||
}
|
||
|
||
.form-group-client-policy-masters {
|
||
display: -webkit-box;
|
||
max-width: 100% !important;
|
||
margin-left: -23px;
|
||
}
|
||
|
||
.flex-container {
|
||
display: block;
|
||
/* flex-wrap: wrap; */
|
||
/* align-items: center; Align items vertically center */
|
||
}
|
||
|
||
.flex-container>div {
|
||
flex: 1;
|
||
/* Each div takes equal space */
|
||
}
|
||
|
||
label {
|
||
padding-top: 7px;
|
||
width: 400px;
|
||
/* background-color: #0001; */
|
||
height: 36px;
|
||
/* text-align: center; */
|
||
}
|
||
|
||
.jodit-status-bar {
|
||
display: none;
|
||
}
|
||
|
||
/* .jodit-container{
|
||
width: 821px !important;
|
||
margin-top: 3px;
|
||
margin-bottom: 3px;
|
||
margin-left: 30px;
|
||
height: 0px !important;
|
||
min-height: 100px !important;
|
||
} */
|
||
.input-group {
|
||
width: 64.5% !important;
|
||
}
|
||
|
||
.input-group-append-client-policy-master {
|
||
margin-top: 3px;
|
||
}
|
||
|
||
.jodit-wysiwyg {
|
||
margin-bottom: 162px;
|
||
}
|
||
|
||
.s {
|
||
margin-left: 50px;
|
||
/* width: 689px; */
|
||
/* margin-left: 141px; */
|
||
width: 576px;
|
||
}
|
||
|
||
#policyGMCTerms input ,
|
||
#policyGMCTerms select,
|
||
#policyGMCTerms .select2-container .select2-selection--single ,
|
||
#policyGMCTerms .select2-container .select2-selection--multiple {
|
||
background-color: #ECECEC !important;
|
||
border:1px solid #ECECEC !important;
|
||
box-shadow: none !important;
|
||
}
|
||
|
||
.policy-base-info{
|
||
margin-top:10px;
|
||
}
|
||
|
||
</style>
|
||
|
||
<div id="policyGMCTerms" style="display:none">
|
||
<span id="policyGMCTermsClose"
|
||
style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
||
<h5><label for="gmcTerms" style="margin-bottom: 20px;">Policy Terms <span id="nameOfThePolicyInGMC"></span></label>
|
||
</h5>
|
||
<form role="form" class="parsley-examples" method="post" id="policyJsonForm" enctype="multipart/form-data">
|
||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||
<input type="hidden" name="client_id" id="Client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||
<input type="hidden" name="client_policy_id" id="gmc_client_policy_id" />
|
||
<input type="hidden" name="policy_id" id="policy_id" />
|
||
<input type="hidden" id="gmc_emp_count" />
|
||
|
||
<div class="form-group">
|
||
|
||
<!-- <div class="row" style="margin-bottom: 10px;">
|
||
REF: VR
|
||
<div class="col">
|
||
<div class="d-flex align-items-center gap-2">
|
||
<label for="sumInsured" class="form-label" >Sum Insured</label>
|
||
<input class="form-control mr-2" type="text" name="sum_insured" id="sum_insured" style="max-width:200px;"
|
||
onkeypress="return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word(this)">
|
||
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGMCSIAddMore()"
|
||
style="background-color: #e26728; border:1px solid #e26728;"
|
||
>
|
||
<i class="mdi mdi-plus"></i>
|
||
</button>
|
||
<div id='numberToWordGMC' class="text-danger-2 mr-2"></div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
REF: VR
|
||
<div id="gmc_si_add_more"></div>
|
||
REF: VR
|
||
<div class="row" style="margin-bottom:10px;">
|
||
<div class="col">
|
||
<label for="totalSumInsured" class="form-label me-3">Family Floater</label>
|
||
|
||
<div class="form-check form-check-inline">
|
||
<input class="form-check-input" type="radio" id="familyFloaterYes" name="family_floater" value="1">
|
||
<label class="form-check-label" for="familyFloaterYes">Yes</label>
|
||
</div>
|
||
|
||
<div class="form-check form-check-inline">
|
||
<input class="form-check-input" type="radio" id="familyFloaterNo" name="family_floater" value="0">
|
||
<label class="form-check-label" for="familyFloaterNo">No</label>
|
||
</div>
|
||
</div>
|
||
</div> -->
|
||
|
||
<div class="row mb-2">
|
||
<div class="col-md-4">
|
||
<label class="form-label">Sum Insured</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<div class="d-flex align-items-center gap-2">
|
||
<input class="form-control" type="text" name="sum_insured" id="sum_insured"
|
||
style="max-width:200px;"
|
||
onkeypress="return onlyNumbers(event)"
|
||
onkeyup="formatNumber(this); si_keup_num_to_word(this)">
|
||
|
||
<button type="button" class="btn btn-primary ml-2 si-add-more"
|
||
onclick="appendGMCSIAddMore()"
|
||
style="background-color:#e26728;border:1px solid #e26728;">
|
||
<i class="mdi mdi-plus"></i>
|
||
</button>
|
||
</div>
|
||
|
||
<div id="numberToWordGMC" class="text-danger-2 mt-1"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="gmc_si_add_more"></div>
|
||
|
||
<div class="row mb-2">
|
||
<div class="col-md-4">
|
||
<label class="form-label">Family Floater</label>
|
||
</div>
|
||
|
||
<div class="col-md-6">
|
||
<div class="form-check form-check-inline">
|
||
<input class="form-check-input" type="radio" id="familyFloaterYes" name="family_floater" value="1">
|
||
<label class="form-check-label" for="familyFloaterYes" style="width: 52px !important">Yes</label>
|
||
<input class="form-check-input" type="radio" id="familyFloaterNo" name="family_floater" value="0">
|
||
<label class="form-check-label" for="familyFloaterNo">No</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col"
|
||
style="background-color: #F5FFFF;border-radius:10px;box-shadow: 0px 2px 2px 0px #00000040;
|
||
padding:20px;">
|
||
|
||
<div class="d-flex align-items-center policy-base-info">
|
||
<input type="checkbox" style="margin-right: 10px;color:black;"
|
||
name="family_floaters[]" value="self" id="self" checked>
|
||
|
||
<span style="margin-right:150px;color:black;">Self:</span>
|
||
|
||
<div class="self-age">
|
||
<span style="margin-right:10px;color:black;;">Min Age:</span>
|
||
<input
|
||
class="underline-input min_age"
|
||
value="<?php echo (isset($self_min_age) && $self_min_age > 0) ? $self_min_age : '18'; ?>"
|
||
style="width: 35%;;" type="number" name="self_min_age" id="self_min_age"
|
||
onchange="lowerIsEighteen(this)">
|
||
</div>
|
||
|
||
<div class="self-age">
|
||
<span style="margin-right:10px;color:black;">Max Age:</span>
|
||
<input
|
||
class="underline-input max_age"
|
||
value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>"
|
||
style="width: 35%;;" type="number" name="self_max_age" id="self_max_age"
|
||
onchange="lowerIsEighteen(this)">
|
||
</div>
|
||
|
||
<div class="self-age d-flex align-items-center ml-3">
|
||
<span style="margin-right:8px;color:black;font-size:12px;white-space:nowrap;">Is Payable by employee:</span>
|
||
<input type="checkbox" name="is_payable_employee_for_self" id="is_payable_employee_for_self" value="1">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="d-flex align-items-center policy-base-info">
|
||
<input type="checkbox" style="margin-right:10px;"
|
||
name="family_floaters[]" value="spouse" id="spouse">
|
||
|
||
<span style="margin-right:125px;color:black;">
|
||
Spouse:</span>
|
||
|
||
<div class="spouse-age"><span style="margin-right:10px;color:black;">Min Age:</span>
|
||
<input
|
||
class="underline-input min_age"
|
||
value="<?php echo isset($spouse_min_age) ? $spouse_min_age : '18'; ?>"
|
||
style="width: 35%;;" type="number" name="spouse_min_age" id="spouse_min_age"
|
||
onchange="lowerIsEighteen(this)">
|
||
</div>
|
||
|
||
<div class="spouse-age"><span style="margin-right:10px;color:black;">Max Age:</span>
|
||
<input
|
||
class="underline-input max_age"
|
||
value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>"
|
||
style="width: 35%;;" type="number" name="spouse_max_age" id="spouse_max_age"
|
||
onchange="lowerIsEighteen(this)">
|
||
</div>
|
||
|
||
<div class="spouse-age d-flex align-items-center ml-3">
|
||
<span style="margin-right:8px;color:black;font-size:12px;white-space:nowrap;">Is Payable by employee:</span>
|
||
<input type="checkbox" name="is_payable_employee_for_spouse" id="is_payable_employee_for_spouse" value="1">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="d-flex align-items-center policy-base-info">
|
||
<span for="children" style="color:black;" class="mr-2">Children:</span>
|
||
|
||
<select name="family_floaters[]" id="children" style="margin-right:60px;" class="px-1" >
|
||
<option value="0">None</option>
|
||
<option value="1">1</option>
|
||
<option value="2">2</option>
|
||
<option value="3">3</option>
|
||
<option value="4">4</option>
|
||
</select>
|
||
|
||
<div class="child-age"><span style="margin-right:10px;color:black;">Min Age:</span>
|
||
<input
|
||
class="underline-input min_age"
|
||
value="<?php echo isset($child_min_age) ? $child_min_age : '0'; ?>"
|
||
style="width: 35%;;" type="number" name="child_min_age" id="child_min_age"
|
||
oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div>
|
||
|
||
<div class="child-age"><span style="margin-right:10px;color:black;">Max Age:</span>
|
||
<input
|
||
class="underline-input max_age"
|
||
value="<?php echo isset($child_max_age) ? $child_max_age : '25'; ?>"
|
||
style="width: 35%;;" type="number" name="child_max_age" id="child_max_age"
|
||
oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)">
|
||
</div>
|
||
|
||
<div class="child-age d-flex align-items-center ml-3">
|
||
<span style="margin-right:8px;color:black;font-size:12px;white-space:nowrap;">Is Payable by employee:</span>
|
||
<input type="checkbox" name="is_payable_employee_for_child" id="is_payable_employee_for_child" value="1">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="d-flex align-items-center policy-base-info flex-nowrap">
|
||
|
||
<!-- Select Other Members -->
|
||
<div class="d-flex align-items-center">
|
||
<span class="me-2 fw-bold text-dark mr-3">
|
||
<b>Select Other Members:</b>
|
||
</span>
|
||
<select name="family_floaters[]" id="family_floaters" class="form-select mr-3 px-1">
|
||
<option value="0">None</option>
|
||
<option value="1P">Only one parent (Either Father / Mother)</option>
|
||
<option value="2P">Only two parents (Father+Mother)</option>
|
||
<option value="1PIL">Only one parent in law (Either MIL / FIL)</option>
|
||
<option value="2PIL">Only two parents in law (FIL + MIL)</option>
|
||
<option value="2EPORPIL">Parents or PIL (Any two of Father, Mother, MIL, FIL)</option>
|
||
<option value="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option>
|
||
<option value="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
|
||
</select>
|
||
</div>
|
||
|
||
<!-- Elders Count -->
|
||
<div class="d-flex align-items-center">
|
||
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Elders Count:</span>
|
||
<input class="underline-input" type="number" style="width: 35%;"
|
||
name="elder_member_count" id="member_count" readonly>
|
||
</div>
|
||
|
||
<!-- Min Age -->
|
||
<div class="d-flex align-items-center">
|
||
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Min Age:</span>
|
||
<input class="underline-input" type="number"
|
||
name="other_member_min_age" id="other_member_min_age" style="width: 35%;"
|
||
value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>"
|
||
onchange="lowerIsEighteen(this)">
|
||
</div>
|
||
|
||
<!-- Max Age -->
|
||
<div class="d-flex align-items-center">
|
||
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Max Age:</span>
|
||
<input class="underline-input" type="number"
|
||
name="other_member_max_age" id="other_member_max_age" style="width: 35%;"
|
||
value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>"
|
||
onchange="lowerIsEighteen(this)">
|
||
</div>
|
||
|
||
<div class="other-member-age d-flex align-items-center ml-3">
|
||
<span style="margin-right:8px;color:black;font-size:12px;white-space:nowrap;">Is Payable by employee:</span>
|
||
<input type="checkbox" name="is_payable_employee_for_elders" id="is_payable_employee_for_elders" value="1">
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="waiverofpreexistingdiseases_display" id="waiverofpreexistingdiseases_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="waiverofpreexistingdiseases">Waiver of Pre-existing Diseases</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="waiverofpreexistingdiseases" id="waiverofpreexistingdiseases" class="form-control waiverofpreexistingdiseases">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="waiverof1234thyearexclusions_display"
|
||
id="waiverof1234thyearexclusions_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="waiverof1,2,3&4thyearexclusions">Waiver of 1, 2, 3 & 4th year Exclusions</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="waiverof1,2,3&4thyearexclusions" class="form-control waiverof1234thyearexclusions">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="waiverof30dayswaitingperiod_display"
|
||
id="waiverof30dayswaitingperiod_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="waiverof30dayswaitingperiod">Waiver of 30 days waiting period</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="waiverof30dayswaitingperiod" class="form-control waiverof30dayswaitingperiod">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="waiver_of_90_days_waiting_period_display"
|
||
id="waiver_of_90_days_waiting_period_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="waiver_of_90_days_waiting_period">Waiver of 90 Days Waiting Period</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="waiver_of_90_days_waiting_period" class="form-control waiver_of_90_days_waiting_period">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="waiver_of_other_waiting_periods_display"
|
||
id="waiver_of_other_waiting_periods_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="waiver_of_other_waiting_periods">Waiver of Other Waiting Periods</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="waiver_of_other_waiting_periods" class="form-control waiver_of_other_waiting_periods">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="maternity_benefit_display"
|
||
id="maternity_benefit_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="maternity_benefit">Maternity Benefit</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="maternity_benefit" id="maternity_benefit" class="form-control maternity_benefit">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="9monthwaitingperiodwaived_display"
|
||
id="9monthwaitingperiodwaived_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="9monthwaitingperiodwaived">9-month waiting Period –waived</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="9monthwaitingperiodwaived" id="9monthwaitingperiodwaived" class="form-control 9monthwaitingperiodwaived">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="maternitycoverage_display"
|
||
id="maternitycoverage_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="maternitycoverage">Maternity Coverage</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="maternitycoverage" id="maternitycoverage" class="form-control">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="twindelivery_display"
|
||
id="twindelivery_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="twindelivery">Twin Delivery</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="twindelivery" id="twindelivery" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="well_baby_well_mother_expenses_display"
|
||
id="well_baby_well_mother_expenses_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="well_baby_well_mother_expenses">Well baby / Well Mother Expenses</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="well_baby_well_mother_expenses" id="well_baby_well_mother_expenses" class="form-control well_baby_well_mother_expenses">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="preandpostnatal_display"
|
||
id="preandpostnatal_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="preandpostnatal">Pre and Post natal</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="preandpostnatal" id="preandpostnatal" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="infertility_treatment_coverage_display"
|
||
id="infertility_treatment_coverage_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="infertility_treatment_coverage">Infertility Treatment Coverage</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="infertility_treatment_coverage" id="infertility_treatment_coverage" class="form-control infertility_treatment_coverage">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="babyday1cover_display"
|
||
id="babyday1cover_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="babyday1cover">Baby Day 1 Cover</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="babyday1cover" id="babyday1cover" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="coverfromthedateofjoining_display"
|
||
id="coverfromthedateofjoining_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="coverfromthedateofjoining">Cover from the date of Joining</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="coverfromthedateofjoining" id="coverfromthedateofjoining"
|
||
class="form-control">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="mid_term_addition_of_new_born_newly_wedded_spouse_display"
|
||
id="mid_term_addition_of_new_born_newly_wedded_spouse_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="mid_term_addition_of_new_born_newly_wedded_spouse">Mid Term Addition of New Born / Newly Wedded Spouse</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="mid_term_addition_of_new_born_newly_wedded_spouse" id="mid_term_addition_of_new_born_newly_wedded_spouse" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="prehospitalizationcover_display"
|
||
id="prehospitalizationcover_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="prehospitalizationcover">Pre Hospitalization Cover</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="prehospitalizationcover" id="prehospitalizationcover"
|
||
class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="posthospitalizationcover_display"
|
||
id="posthospitalizationcover_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="posthospitalizationcover">Post Hospitalization Cover</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="posthospitalizationcover" id="posthospitalizationcover"
|
||
class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="congenitaldiseasesinternal_display"
|
||
id="congenitaldiseasesinternal_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="congenitaldiseasesinternal">Congenital Diseases - Internal</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="congenitaldiseasesinternal" class="form-control congenitaldiseasesinternal">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="congenitaldiseasesexternal_display"
|
||
id="congenitaldiseasesexternal_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="congenitaldiseasesexternal">Congenital Diseases - External</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="congenitaldiseasesexternal" id="congenitaldiseasesexternal"
|
||
class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="copayzonewisecopay_display"
|
||
id="copayzonewisecopay_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="copayzonewisecopay">Co-Pay/Zone wise Co Pay</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="copayzonewisecopay" id="copayzonewisecopay" class="form-control copayzonewisecopay">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="roomrentlimit_display"
|
||
id="roomrentlimit_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="roomrentlimit">Room Rent Limit</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="roomrentlimit" id="roomrentlimit" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="icu_limit_display"
|
||
id="icu_limit_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="icu_limit">ICU Limit</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="icu_limit" id="icu_limit" class="form-control icu_limit">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="proportionatedeductionclause_display"
|
||
id="proportionatedeductionclause_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="proportionatedeductionclause">Proportionate Deduction Clause</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="proportionatedeductionclause" id="proportionatedeductionclause" class="form-control proportionatedeductionclause">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="ailmentcapping_display"
|
||
id="ailmentcapping_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="ailmentcapping">Ailment capping</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="ailmentcapping" class="form-control ailmentcapping">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="ailment_capping_details_display"
|
||
id="ailment_capping_details_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="ailment_capping_details">Ailment capping Details</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="ailment_capping_details" id="ailment_capping_details" class="form-control">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="corporatebuffer_display"
|
||
id="corporatebuffer_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="corporatebuffer">Corporate Buffer</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="corporatebuffer" id="corporatebuffer" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="non_admissible_contingency_corporate_buffer_display"
|
||
id="non_admissible_contingency_corporate_buffer_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="non_admissible_contingency_corporate_buffer">Non-Admissible / Contingency Corporate Buffer</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="non_admissible_contingency_corporate_buffer" id="non_admissible_contingency_corporate_buffer"
|
||
class="form-control non_admissible_contingency_corporate_buffer">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="ambulancecharges_display"
|
||
id="ambulancecharges_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="ambulancecharges">Ambulance Charges</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="ambulancecharges" id="ambulancecharges" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="airambulance_display"
|
||
id="airambulance_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="airambulance">Air Ambulance</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="airambulance" id="airambulance" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="reasonableandcustomarycharges_display"
|
||
id="reasonableandcustomarycharges_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="reasonableandcustomarycharges">Reasonable and Customary Charges</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="reasonableandcustomarycharges" class="form-control reasonableandcustomarycharges">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="daycaretreatment_display"
|
||
id="daycaretreatment_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="daycaretreatment">Day Care Treatment</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="daycaretreatment" class="form-control daycaretreatment">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="lasiksurgery_display"
|
||
id="lasiksurgery_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="lasiksurgery">Lasik Surgery</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="lasiksurgery" id="lasiksurgery" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="ayushtreatmentcover_display"
|
||
id="ayushtreatmentcover_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="ayudhtreatmentcover">AYUSH treatment cover</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="ayudhtreatmentcover" id="ayudhtreatmentcover" class="form-control ayudhtreatmentcover">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="moderntreatmentsasperirdai_display"
|
||
id="moderntreatmentsasperirdai_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="moderntreatmentsasperirdai">Modern treatments as per IRDAI</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="moderntreatmentsasperirdai" id="moderntreatmentsasperirdai"
|
||
class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="opd_treatment_display"
|
||
id="opd_treatment_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="opd_treatment">OPD Treatment</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="opd_treatment" id="opd_treatment" class="form-control opd_treatment">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="days_of_discharge_display"
|
||
id="days_of_discharge_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="days_of_discharge">Claim Intimation Clause</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" id="days_of_discharge" name="days_of_discharge" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="days_from_dod_display"
|
||
id="days_from_dod_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="days_from_dod">Claim Submission</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" id="days_from_dod" name="days_from_dod" class="form-control ">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="terrorism_display" id="terrorism_display" class="unchecked"
|
||
checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="terrorism">Terrorism</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" name="terrorism" id="terrorism" class="form-control terrorism">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="widower_cover_display"
|
||
id="widower_cover_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="widower_cover">Widower Cover</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" id="widower_cover" name="widower_cover" class="form-control widower_cover">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="breavement_cover_display"
|
||
id="breavement_cover_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="breavement_cover">Breavement Cover</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<input type="text" id="breavement_cover" name="breavement_cover" class="form-control breavement_cover">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row" style="margin-bottom: 10px;">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="suminsuredenhancement_display" id="suminsuredenhancement_display" class="unchecked" checked>
|
||
</div>
|
||
<div class="col-md-4">
|
||
<label for="totalSumInsured">Sum Insured enhancement</label>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<span>
|
||
<input type="radio" name="suminsuredenhancement" class="suminsuredenhancement" value="1">
|
||
<span style="color:black;"><b>Yes</b></span>
|
||
</span>
|
||
<span>
|
||
<input type="radio" name="suminsuredenhancement" class="suminsuredenhancement" value="0" style="margin-left:10px">
|
||
<span style="color:black;"><b>No</b></span>
|
||
</span>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<hr>
|
||
|
||
<div class="form-column" id="grid_content_input">
|
||
</div>
|
||
|
||
<br>
|
||
|
||
</div>
|
||
|
||
<div class="form-group text-right m-b-0" style="margin-top: -49px;" id="group_btn_1">
|
||
<a href="#" class="button-like" id="myButtonSpecialCondition" title="Special Condition">Special
|
||
Condition</a>
|
||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnGridSubmit1"
|
||
style="margin-top: 100px;">Submit</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
<script>
|
||
var policy_grid_id = $('#client_id').val();
|
||
var grid_html = '';
|
||
var gmc_auto_save_enable = false;
|
||
|
||
$('.close').click(function() {
|
||
|
||
$('#sum_insured').val("");
|
||
$('#familyfloater').val("");
|
||
$('#waiverofpreexistingdiseases').prop('checked', false);
|
||
$('#maternitycoverage').val("");
|
||
|
||
});
|
||
|
||
// $('input[name="ayudhtreatmentcover"]').change(function() {
|
||
|
||
// ////console.log($(this).val());
|
||
|
||
// if ($(this).val() == '1') {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "");
|
||
|
||
// } else {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "none");
|
||
// }
|
||
// });
|
||
|
||
// $('input[name="ailmentcapping"]').change(function() {
|
||
|
||
// ////console.log($(this).val());
|
||
|
||
// if ($(this).val() == '1') {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "");
|
||
|
||
// } else {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "none");
|
||
// }
|
||
// });
|
||
|
||
// $('input[name="copayzonewisecopay"]').change(function() {
|
||
|
||
// ////console.log($(this).val());
|
||
|
||
// if ($(this).val() == '1') {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "");
|
||
|
||
// } else {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "none");
|
||
// }
|
||
// });
|
||
|
||
// $('input[name="cataract"]').change(function() {
|
||
|
||
// //console.log($(this).val());
|
||
|
||
// if ($(this).val() == '1') {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "");
|
||
|
||
// } else {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "none");
|
||
// }
|
||
// });
|
||
|
||
|
||
// $('input[name="waiverofpreexistingdiseases"]').change(function() {
|
||
|
||
// if ($(this).val() == '1') {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "");
|
||
// var element2 = $(this).parent().parent().next().next()[0];
|
||
// $(element2).css("display", "");
|
||
// var element3 = $(this).parent().parent().next().next().next()[0];
|
||
// $(element3).css("display", "");
|
||
// var element4 = $(this).parent().parent().next().next().next().next()[0];
|
||
// $(element4).css("display", "");
|
||
// } else {
|
||
// var element = $(this).parent().parent().next()[0];
|
||
// $(element).css("display", "none");
|
||
// var element2 = $(this).parent().parent().next().next()[0];
|
||
// $(element2).css("display", "none");
|
||
// var element3 = $(this).parent().parent().next().next().next()[0];
|
||
// $(element3).css("display", "none");
|
||
// var element4 = $(this).parent().parent().next().next().next().next()[0];
|
||
// $(element4).css("display", "none");
|
||
// }
|
||
// });
|
||
|
||
|
||
$("#policyJsonForm").submit(function(event) {
|
||
|
||
checkAdditionPremiumJSON()
|
||
|
||
|
||
if (!$('#self').prop('checked')) {
|
||
$('#self_min_age').removeAttr('name');
|
||
$('#self_max_age').removeAttr('name');
|
||
}
|
||
|
||
if (!$('#spouse').prop('checked')) {
|
||
$('#spouse_min_age').removeAttr('name');
|
||
$('#spouse_max_age').removeAttr('name');
|
||
}
|
||
|
||
if ($('#children').val() == 0) {
|
||
$('#child_min_age').removeAttr('name');
|
||
$('#child_min_age').removeAttr('name');
|
||
}
|
||
|
||
if ($('#family_floaters').val() == 0) {
|
||
$('#member_count').removeAttr('name');
|
||
$('#other_member_min_age').removeAttr('name');
|
||
$('#other_member_max_age').removeAttr('name');
|
||
}
|
||
|
||
event.preventDefault();
|
||
var isValid = $('#policyJsonForm').parsley().validate();
|
||
|
||
if ($('#gmc_emp_count').val() == true) {
|
||
toastr.warning('Client has active employees', 'Warning');
|
||
return;
|
||
}
|
||
|
||
if (!isValid) {
|
||
//console.log('Form is Empty', 'Warning');
|
||
return;
|
||
}
|
||
|
||
var specialConditions = [];
|
||
|
||
$(".removeDom").each(function() {
|
||
var isChecked = $(this).find("input[name='special_condition_display[]']").is(":checked");
|
||
|
||
if (isChecked) {
|
||
var label = $(this).find("input[name='special_condition_label[]']").val();
|
||
var input = $(this).find("input[name='special_condition_input[]']").val();
|
||
|
||
specialConditions.push({
|
||
[label]: input
|
||
});
|
||
}
|
||
});
|
||
|
||
console.log("specialConditions", specialConditions);
|
||
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
|
||
var formData = new FormData($('#policyJsonForm')[0]);
|
||
var policy_form_action = '<?= base_url("client/policy/policyGMCTerms") ?>';
|
||
formData.append("special_condition_display_value", JSON.stringify(specialConditions));
|
||
console.log('formData', formData);
|
||
formData.forEach((value, key) => {
|
||
console.log(key + ':', value);
|
||
});
|
||
$.ajax({
|
||
data: formData,
|
||
url: policy_form_action,
|
||
type: "POST",
|
||
dataType: 'json',
|
||
processData: false,
|
||
contentType: false,
|
||
success: function(res) {
|
||
|
||
$('#policyJsonForm')[0].reset();
|
||
$('.text-danger-2').html('');
|
||
if (res.status === false) {
|
||
toastr.error('Policy Dose Not Create', 'Error');
|
||
return;
|
||
}
|
||
document.querySelectorAll('.special_condition_label\\[\\]').forEach(element => {
|
||
element.parentNode.remove();
|
||
});
|
||
|
||
},
|
||
error: function(xhr, status, error) {
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
|
||
setTimeout(function() {
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
//console.log('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
|
||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||
setTimeout(function() {
|
||
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
$('#policyGMCTerms').css('display', 'none');
|
||
$('#police-tab').css('display', '');
|
||
$('.nav.nav-pills.navtab-bg').css('display', '');
|
||
$('.nav.nav-pills.navtab-bg').prev().css('display', '');
|
||
var message = 'Policy Terms Updated successfully';
|
||
toastr.success(message, 'Success');
|
||
}, 500);
|
||
});
|
||
|
||
$('body').on('click', '.btnPolicyMaster', function() {
|
||
// alert("HELLO");
|
||
|
||
var client_policy_id = $(this).data('id');
|
||
//console.log('gmc_client_policy_id :', client_policy_id);
|
||
|
||
$('#gmc_client_policy_id').val(client_policy_id)
|
||
|
||
$('.removeDom').remove();
|
||
$('#gmc_si_add_more').empty();
|
||
|
||
var gmc_policy_type_id = $(this).attr('id');
|
||
// //console.log(gmc_policy_type_id)
|
||
|
||
if (gmc_policy_type_id == 'GMC') {
|
||
|
||
$('#policyGMCTerms').css('display', '');
|
||
$('#police-tab').css('display', 'none');
|
||
$('.nav.nav-pills.navtab-bg').css('display', 'none');
|
||
$('.nav.nav-pills.navtab-bg').prev().css('display', 'none');
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
$.ajax({
|
||
url: '<?= base_url("client/policy/getterms") ?>',
|
||
method: 'GET',
|
||
data: {
|
||
client_policy_id: client_policy_id
|
||
},
|
||
success: function(response) {
|
||
|
||
console.log('response', response);
|
||
|
||
// //console.log('count', response.count);
|
||
setTimeout(function() {
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
}, 1000);
|
||
// $('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
|
||
$('gmc_emp_count').val(response.count);
|
||
|
||
if (response) {
|
||
|
||
if (response.emp_count_by_policy != 0) {
|
||
$('#btnGridSubmit1').hide();
|
||
$('#myButtonSpecialCondition').hide();
|
||
gmc_auto_save_enable = false;
|
||
} else {
|
||
$('#btnGridSubmit1').show();
|
||
$('#myButtonSpecialCondition').show();
|
||
// startAutoSubmit('GMC');
|
||
gmc_auto_save_enable = true;
|
||
}
|
||
|
||
let jsonObject = JSON.parse(response.data);
|
||
disableUnwantedTerms(jsonObject);
|
||
if(jsonObject){
|
||
Object.keys(jsonObject).forEach(function(key) {
|
||
|
||
if (key.includes("special_condition_label") || key.includes("special_condition_input")) {
|
||
if (key.includes("special_condition_label")) {
|
||
if (jsonObject[key] && Array.isArray(jsonObject[key])) {
|
||
for (let index = 0; index < jsonObject[key].length; index++) {
|
||
specialCondition();
|
||
}
|
||
} else {
|
||
console.warn(`jsonObject[${key}] is not a valid array.`);
|
||
}
|
||
}
|
||
|
||
//console.log('key', key)
|
||
let elements = document.getElementsByName(`${key}[]`);
|
||
//console.log(elements)
|
||
|
||
if (elements) {
|
||
elements.forEach((element, index) => {
|
||
//console.log()
|
||
if (jsonObject[key][index] == undefined) {
|
||
element.value = " ";
|
||
} else {
|
||
element.value = jsonObject[key][index];
|
||
|
||
if (key.includes("special_condition_label")) {
|
||
let checkbox = $(element).closest('.form-group').find('input[name="special_condition_display[]"]');
|
||
console.log("First element:", element);
|
||
|
||
if (checkbox.length) {
|
||
console.log("Checkbox found:", checkbox);
|
||
|
||
// Correct way to set the 'id' attribute
|
||
let formattedValue = jsonObject[key][index].replace(/[\s\-\/,&]+/g, '').toLowerCase();
|
||
console.log('formattedValue', formattedValue);
|
||
checkbox.attr('id', formattedValue + '_display');
|
||
|
||
console.log("Updated Checkbox:", checkbox);
|
||
} else {
|
||
console.log("Checkbox not found for:", element);
|
||
}
|
||
}
|
||
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
|
||
// if (key.includes("multiple_sum_insured")) {
|
||
// jsonObject[key].forEach((value, index) => {
|
||
// appendGMCSIAddMore(value);
|
||
// });
|
||
// }
|
||
|
||
if (key.includes("multiple_sum_insured") && key != "") {
|
||
|
||
if (Array.isArray(jsonObject[key])) {
|
||
jsonObject[key].forEach((value, index) => {
|
||
appendGMCSIAddMore(value);
|
||
|
||
});
|
||
} else {
|
||
console.log(`${key} is not an array.`);
|
||
}
|
||
}
|
||
|
||
if (key === "family_floater") {
|
||
|
||
if (jsonObject[key] === "Floater") {
|
||
setTimeout(() => {
|
||
|
||
$("#familyFloaterYes").prop("checked", true);
|
||
}, 100); // delay in milliseconds
|
||
|
||
} else {
|
||
|
||
$("#familyFloaterNo").prop("checked", true);
|
||
}
|
||
}
|
||
|
||
|
||
if (key.includes("family_floaters")) {
|
||
|
||
let checkboxes = document.querySelectorAll(
|
||
`input[name="${key}[]"]`);
|
||
if (jsonObject[key]) {
|
||
|
||
console.log(jsonObject[key]);
|
||
if (jsonObject[key].childrens) {
|
||
$('#children').val(jsonObject[key].childrens);
|
||
}
|
||
|
||
if (jsonObject[key].self == 0) {
|
||
$('#self').prop('checked', false);
|
||
}
|
||
|
||
if (jsonObject[key].spouse == 0) {
|
||
$('#spouse').prop('checked', false);
|
||
} else {
|
||
$('#spouse').prop('checked', true);
|
||
}
|
||
|
||
|
||
if (jsonObject[key]['either-parents-pil'] == 1) {
|
||
$('#family_floaters').val('EPORPIL');
|
||
} else if (jsonObject[key].parents == 1 && jsonObject[key][
|
||
'parents-in-law'
|
||
] == 1) {
|
||
$('#family_floaters').val('2EPORPIL');
|
||
} else if (jsonObject[key].parents == 2 && jsonObject[key][
|
||
'parents-in-law'
|
||
] == 2) {
|
||
$('#family_floaters').val('4EPORPIL');
|
||
} else if (jsonObject[key].parents == 1) {
|
||
$('#family_floaters').val('1P');
|
||
} else if (jsonObject[key].parents == 2) {
|
||
$('#family_floaters').val('2P');
|
||
} else if (jsonObject[key]['parents-in-law'] == 1) {
|
||
$('#family_floaters').val('1PIL');
|
||
} else if (jsonObject[key]['parents-in-law'] == 2) {
|
||
$('#family_floaters').val('2PIL');
|
||
} else if (jsonObject[key]['either-parents-pil'] == 2) {
|
||
$('#family_floaters').val('2EPORPIL');
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
|
||
let elements = document.getElementsByName(key);
|
||
if (elements && elements.length > 0) {
|
||
let element = elements[
|
||
0]; // Assuming you want to update the first element with the name
|
||
|
||
|
||
if (element.tagName === 'INPUT' && (element.type ===
|
||
'checkbox' || element.type === 'radio')) {
|
||
|
||
if (element.type === 'checkbox') {
|
||
element.checked = jsonObject[key] ===
|
||
'1'; // Assuming jsonObject[key] is '1' or '0' for checkbox
|
||
} else if (element.type === 'radio') {
|
||
|
||
if (element.value === jsonObject[key]) {
|
||
element.checked = element.value === jsonObject[key];
|
||
|
||
// if (element.name === "family_floater") { REF: VR
|
||
// element.parentElement.nextElementSibling.style
|
||
// .display = '';
|
||
// element.parentElement.parentElement
|
||
// .parentElement.nextElementSibling.style
|
||
// .display = '';
|
||
// // alert('family floater');
|
||
// }
|
||
if (element.name === "family_floater" && element.checked) {
|
||
|
||
let currentRow = element.closest('.row');
|
||
|
||
if (currentRow && currentRow.nextElementSibling) {
|
||
currentRow.nextElementSibling.style.display = '';
|
||
}
|
||
|
||
if (currentRow && currentRow.nextElementSibling && currentRow.nextElementSibling.nextElementSibling) {
|
||
currentRow.nextElementSibling.nextElementSibling.style.display = '';
|
||
}
|
||
}
|
||
else if (element.name ===
|
||
"waiverofpreexistingdiseases") {
|
||
element.parentElement.parentElement
|
||
.nextElementSibling.style.display = '';
|
||
element.parentElement.parentElement
|
||
.nextElementSibling.nextElementSibling.style
|
||
.display = '';
|
||
element.parentElement.parentElement
|
||
.nextElementSibling.nextElementSibling
|
||
.nextElementSibling.style.display = '';
|
||
element.parentElement.parentElement
|
||
.nextElementSibling.nextElementSibling
|
||
.nextElementSibling.nextElementSibling.style
|
||
.display = '';
|
||
|
||
} else if (element.name === "ayudhtreatmentcover") {
|
||
element.parentElement.parentElement
|
||
.nextElementSibling.style.display = '';
|
||
} else if (element.name === "ailmentcapping") {
|
||
element.parentElement.parentElement
|
||
.nextElementSibling.style.display = '';
|
||
} else if (element.name === "copayzonewisecopay") {
|
||
element.parentElement.parentElement
|
||
.nextElementSibling.style.display = '';
|
||
} else if (element.name === "cataract") {
|
||
element.parentElement.parentElement
|
||
.nextElementSibling.style.display = '';
|
||
}
|
||
|
||
|
||
} else {
|
||
element.nextElementSibling.checked = element.value;
|
||
}
|
||
}
|
||
} else if (key === "Wellness" || key ===
|
||
"additionalsicknessbenefit") {
|
||
let wysiwygElement = element.previousElementSibling
|
||
.querySelector('.jodit-wysiwyg');
|
||
|
||
|
||
if (wysiwygElement) {
|
||
let pTag = wysiwygElement.querySelector(
|
||
'p'); // Find the <p> tag inside the wysiwyg element
|
||
if (pTag) {
|
||
// pTag.innerHTML = ''; // Clear the content inside the <p> tag
|
||
pTag.innerHTML = jsonObject[
|
||
key]; // Add your new content inside the <p> tag
|
||
}
|
||
}
|
||
console.log(jsonObject[key]);
|
||
} else {
|
||
console.log(jsonObject[key]);
|
||
|
||
if (jsonObject[key] === undefined || jsonObject[key] === "" || jsonObject[key] === null) {
|
||
element.value = " ";
|
||
|
||
|
||
} else {
|
||
element.value = jsonObject[key];
|
||
}
|
||
}
|
||
}
|
||
|
||
if (key.includes("age_ratio")) {
|
||
|
||
$('#self_min_age').val(jsonObject[key].self.min);
|
||
$('#self_max_age').val(jsonObject[key].self.max);
|
||
|
||
$('#spouse_min_age').val(jsonObject[key].spouse.min);
|
||
$('#spouse_max_age').val(jsonObject[key].spouse.max);
|
||
|
||
$('#child_min_age').val(jsonObject[key].child.min);
|
||
$('#child_max_age').val(jsonObject[key].child.max);
|
||
|
||
$('#other_member_min_age').val(jsonObject[key].elders.min);
|
||
$('#other_member_max_age').val(jsonObject[key].elders.max);
|
||
}
|
||
|
||
if (key.includes("is_payable_employee")) {
|
||
if (jsonObject[key]) {
|
||
$('#is_payable_employee_for_self').prop('checked', jsonObject[key].self == 1);
|
||
$('#is_payable_employee_for_spouse').prop('checked', jsonObject[key].spouse == 1);
|
||
$('#is_payable_employee_for_child').prop('checked', jsonObject[key].childern == 1);
|
||
$('#is_payable_employee_for_elders').prop('checked', jsonObject[key].elders == 1);
|
||
}
|
||
}
|
||
|
||
if (key.includes("enrollment_display_key") && key != "") {
|
||
|
||
console.log('enrollment_display_key');
|
||
console.log(jsonObject[key]);
|
||
|
||
processJsonObject(jsonObject);
|
||
}
|
||
|
||
});
|
||
}
|
||
}
|
||
|
||
$("#sum_insured").trigger("keyup");
|
||
$(".multiple_sum_insured").trigger("keyup");
|
||
|
||
$('.jodit-wysiwyg').each(function() {
|
||
$(this).click();
|
||
});
|
||
|
||
if ($('#self').prop('checked')) {
|
||
$('.self-age').css('display', '');
|
||
} else {
|
||
$('.self-age').css('display', 'none');
|
||
}
|
||
|
||
if ($('#spouse').prop('checked')) {
|
||
$('.spouse-age').css('display', '');
|
||
// $('#spouse_min_age').val(18);
|
||
// $('#spouse_max_age').val(60);
|
||
|
||
} else {
|
||
$('.spouse-age').css('display', 'none');
|
||
}
|
||
|
||
//console.log("child ");
|
||
//console.log($('#children').val());
|
||
|
||
if ($('#children').val() != 0) {
|
||
$('.child-age').css('display', '');
|
||
} else {
|
||
$('.child-age').css('display', 'none');
|
||
}
|
||
|
||
var family_floaters = $('#family_floaters').val();
|
||
|
||
console.log("========================================================");
|
||
console.log("family_floaters", family_floaters);
|
||
console.log("========================================================");
|
||
|
||
if (family_floaters != 0) {
|
||
$('.other-member-age').css('display', '');
|
||
} else {
|
||
$('.other-member-age').css('display', 'none');
|
||
}
|
||
|
||
if (family_floaters == '1P') {
|
||
$('#member_count').val(1);
|
||
} else if (family_floaters == '2P') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '1PIL') {
|
||
$('#member_count').val(1);
|
||
} else if (family_floaters == '2PIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '2EPORPIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == 'EPORPIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '4EPORPIL') {
|
||
$('#member_count').val(4);
|
||
}
|
||
|
||
|
||
},
|
||
|
||
error: function(xhr, status, error) {
|
||
console.error('Error:', status, error);
|
||
setTimeout(function() {
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
//console.log('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
|
||
} else if (gmc_policy_type_id != 'GPA' && gmc_policy_type_id != 'GMC') {
|
||
// toastr.warning('The terms has no data ', 'Warning');
|
||
}
|
||
|
||
$(document).ready(function() {
|
||
if ($('#self').prop('checked')) {
|
||
$('.self-age').css('display', '');
|
||
} else {
|
||
$('.self-age').css('display', 'none');
|
||
}
|
||
|
||
if ($('#spouse').prop('checked')) {
|
||
$('.spouse-age').css('display', '');
|
||
} else {
|
||
$('.spouse-age').css('display', 'none');
|
||
}
|
||
|
||
//console.log("child ");
|
||
//console.log($('#children').val());
|
||
|
||
if ($('#children').val() != 0) {
|
||
$('.child-age').css('display', '');
|
||
} else {
|
||
$('.child-age').css('display', 'none');
|
||
}
|
||
|
||
var family_floaters = $('#family_floaters').val();
|
||
if (family_floaters != 0) {
|
||
$('.other-member-age').css('display', '');
|
||
} else {
|
||
$('.other-member-age').css('display', 'none');
|
||
}
|
||
|
||
if (family_floaters == '1P') {
|
||
$('#member_count').val(1);
|
||
} else if (family_floaters == '2P') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '1PIL') {
|
||
$('#member_count').val(1);
|
||
} else if (family_floaters == '2PIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '2EPORPIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == 'EPORPIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '4EPORPIL') {
|
||
$('#member_count').val(4);
|
||
}
|
||
|
||
})
|
||
|
||
});
|
||
|
||
function si_keup_num_to_word(input) {
|
||
|
||
console.log('keyup sum insured');
|
||
var inputNumber = $(input).val();
|
||
console.log(inputNumber)
|
||
if (inputNumber) {
|
||
var result = convertCommaNumberToWords(inputNumber);
|
||
|
||
$("#numberToWordGMC").text(result);
|
||
} else {
|
||
$("#numberToWordGMC").text("");
|
||
}
|
||
};
|
||
|
||
$("#sum_insured").on("keyup", function() {
|
||
var inputNumber = $(this).val();
|
||
console.log('keyup sum insured 2nd');
|
||
if (inputNumber) {
|
||
var result = convertCommaNumberToWords(inputNumber);
|
||
$("#numberToWordSumInsured").text(result);
|
||
} else {
|
||
$("#numberToWordSumInsured").text("");
|
||
}
|
||
});
|
||
|
||
$(".multiple_sum_insured").on("keyup", function() {
|
||
|
||
console.log('multiple_sum_insured key up')
|
||
|
||
var inputNumber = $(this).val();
|
||
console.log('inputNumber', inputNumber);
|
||
if (inputNumber) {
|
||
var result = convertCommaNumberToWords(inputNumber);
|
||
console.log(result);
|
||
$(".numberToWordSumInsured").text(result);
|
||
} else {
|
||
$(".numberToWordSumInsured").text("");
|
||
}
|
||
});
|
||
|
||
function numtowordinkeyup(input) {
|
||
|
||
console.log('numtowordinkeyup');
|
||
var inputNumber = $(input).val().toString().replace(/,/g, '').trim();
|
||
var $parentRow = $(input).closest('.row');
|
||
var $targetDiv = $parentRow.find('.numberToWordSumInsured');
|
||
|
||
|
||
if (inputNumber) {
|
||
var result = convertCommaNumberToWords(inputNumber);
|
||
$targetDiv.text(result);
|
||
} else {
|
||
$targetDiv.text("");
|
||
}
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
</script>
|
||
|
||
<!-- Policy terms Add Special Condition -->
|
||
<script>
|
||
|
||
document.getElementById('myButtonSpecialCondition').addEventListener('click', function(event) {
|
||
//console.log('specialCondition callback clicked')
|
||
event.preventDefault();
|
||
specialCondition();
|
||
});
|
||
|
||
const fields = [
|
||
'waiverofpreexistingdiseases',
|
||
'waiverof1,2,3&4thyearexclusions',
|
||
'waiverof30dayswaitingperiod',
|
||
'waiver_of_90_days_waiting_period',
|
||
'waiver_of_other_waiting_periods',
|
||
'maternity_benefit',
|
||
'9monthwaitingperiodwaived',
|
||
'maternitycoverage',
|
||
'twindelivery',
|
||
'well_baby_well_mother_expenses',
|
||
'preandpostnatal',
|
||
'infertility_treatment_coverage',
|
||
'babyday1cover',
|
||
'coverfromthedateofjoining',
|
||
'mid_term_addition_of_new_born_newly_wedded_spouse',
|
||
'prehospitalizationcover',
|
||
'posthospitalizationcover',
|
||
'congenitaldiseasesinternal',
|
||
'congenitaldiseasesexternal',
|
||
'copayzonewisecopay',
|
||
'roomrentlimit',
|
||
'icu_limit',
|
||
'proportionatedeductionclause',
|
||
'ailmentcapping',
|
||
'ailment_capping_details',
|
||
'corporatebuffer',
|
||
'non_admissible_contingency_corporate_buffer',
|
||
'ambulancecharges',
|
||
'airambulance',
|
||
'reasonableandcustomarycharges',
|
||
'daycaretreatment',
|
||
'lasiksurgery',
|
||
'ayudhtreatmentcover',
|
||
'moderntreatmentsasperirdai',
|
||
'opd_treatment',
|
||
'days_of_discharge',
|
||
'days_from_dod',
|
||
'terrorism',
|
||
'widower_cover',
|
||
'breavement_cover',
|
||
'suminsuredenhancement',
|
||
'special_condition_label',
|
||
'special_condition_input',
|
||
'multiple_sum_insured'
|
||
];
|
||
|
||
function specialCondition(count = 0) {
|
||
|
||
//console.log('specialCondition function called')
|
||
|
||
//console.log('before if count', count)
|
||
|
||
if (count === 0) {
|
||
|
||
//console.log('after if count', count)
|
||
|
||
var index = $('.modifyclassinput').length;
|
||
var appendElement = `<div class="form-group col-md-6 form-group-client-policy-masters removeDom">
|
||
<div class="col-md-1">
|
||
<input type="checkbox" style="margin-top: 12px" name="special_condition_display[]" id="special_condition_display" class="unchecked" checked>
|
||
</div>
|
||
<label for="specialconditionlabel" class="special_condition_label[]" style="width: 450px;position: relative;bottom: 6px;">
|
||
<input class="form-control" name="special_condition_label[]" id="special_condition_label[]" style="position: relative;right: 5px;">
|
||
<span class="specialConditionClose" style="color: red; float: right;position: relative;bottom: 28px;left: 15px;">X</span>
|
||
</label>
|
||
<input type="text" name="special_condition_input[]" id="special_condition_input[]" class="form-control s special_condition_input[]">
|
||
</div>`;
|
||
//console.log($(this));
|
||
$('.form-column').each(function() {
|
||
$(this).append(appendElement);
|
||
});
|
||
} else {
|
||
|
||
//console.log('else')
|
||
}
|
||
}
|
||
|
||
$(document).on('click', '.specialConditionClose', function() {
|
||
$(this)[0].parentNode.parentNode.remove();
|
||
});
|
||
|
||
// Close the Policy terms
|
||
$(document).on('click', '#policyGMCTermsClose', function() {
|
||
|
||
//clear the intervel for the autosave
|
||
stopAutoSubmit();
|
||
|
||
$('#policyGMCTerms').css('display', 'none');
|
||
$('#police-tab').css('display', '');
|
||
$('.nav.nav-pills.navtab-bg').css('display', '');
|
||
$('.nav.nav-pills.navtab-bg').prev().css('display', '');
|
||
|
||
$('#policyJsonForm')[0].reset();
|
||
$('.text-danger-2').html('');
|
||
});
|
||
|
||
// function formatNumber(input) {
|
||
// // Remove non-numeric characters
|
||
// let value = input.value.replace(/\D/g, '');
|
||
|
||
// // Add commas
|
||
// value = Number(value).toLocaleString('en-IN');
|
||
|
||
// // Update the input value
|
||
// input.value = value;
|
||
// }
|
||
|
||
|
||
|
||
$('#self').change(function() {
|
||
if ($(this).prop('checked')) {
|
||
$('.self-age').css('display', '');
|
||
} else {
|
||
$('.self-age').css('display', 'none');
|
||
}
|
||
});
|
||
|
||
$('#spouse').change(function() {
|
||
if ($(this).prop('checked')) {
|
||
$('.spouse-age').css('display', '');
|
||
if ($('#spouse_min_age').val() < 17 || $('#spouse_min_age').val() == '') {
|
||
$('#spouse_min_age').val(18);
|
||
}
|
||
if ($('#spouse_max_age').val() < 17 || $('#spouse_max_age').val() == '') {
|
||
$('#spouse_max_age').val(60);
|
||
}
|
||
} else {
|
||
$('.spouse-age').css('display', 'none');
|
||
}
|
||
});
|
||
|
||
$('#children').change(function() {
|
||
if ($(this).val() != 0) {
|
||
$('.child-age').css('display', '');
|
||
|
||
if ($('#child_min_age').val() < 0 || $('#child_min_age').val() == '') {
|
||
$('#child_min_age').val(0);
|
||
}
|
||
if ($('#child_max_age').val() < 24 || $('#child_max_age').val() == '') {
|
||
$('#child_max_age').val(25);
|
||
}
|
||
} else {
|
||
$('.child-age').css('display', 'none');
|
||
}
|
||
});
|
||
|
||
$('#family_floaters').change(function() {
|
||
|
||
checkAdditionPremiumJSON()
|
||
|
||
var family_floaters = $(this).val();
|
||
if ($('#family_floaters').val() != 0) {
|
||
$('.other-member-age').css('display', '');
|
||
if ($('#other_member_min_age').val() < 17 || $('#other_member_min_age').val() == '') {
|
||
$('#other_member_min_age').val(18);
|
||
}
|
||
if ($('#other_member_max_age').val() < 79 || $('#other_member_max_age').val() == '') {
|
||
$('#other_member_max_age').val(60);
|
||
}
|
||
|
||
} else {
|
||
$('.other-member-age').css('display', 'none');
|
||
}
|
||
|
||
if (family_floaters == '1P') {
|
||
$('#member_count').val(1);
|
||
} else if (family_floaters == '2P') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '1PIL') {
|
||
$('#member_count').val(1);
|
||
} else if (family_floaters == '2PIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '2EPORPIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == 'EPORPIL') {
|
||
$('#member_count').val(2);
|
||
} else if (family_floaters == '4EPORPIL') {
|
||
$('#member_count').val(4);
|
||
}
|
||
});
|
||
|
||
function lowerIsEighteen(params) {
|
||
var value = $(params).val();
|
||
|
||
if (value < 18) {
|
||
$(params).val(18);
|
||
} else if (value > 99) {
|
||
$(params).val(99);
|
||
}
|
||
}
|
||
|
||
//REF: VR
|
||
// function appendGMCSIAddMore(data = null) {
|
||
// console.log('function called')
|
||
// var html = `
|
||
// <div class="row" style="margin-bottom: 10px;">
|
||
// <div class="col">
|
||
// <div class="d-flex align-items-center gap-2">
|
||
// <label for="sumInsured" class="form-label" >Additional Sum Insured</label>
|
||
// <input class="form-control mr-2" style="max-width:200px;"
|
||
// value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]"
|
||
// class="form-control multiple_sum_insured mr-2" onkeypress="return onlyNumbers(event)"
|
||
// onkeyup="formatNumber(this); numtowordinkeyup(this)">
|
||
// <button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGMCSIAddMore()"
|
||
// style="background-color: #e26728; border:1px solid #e26728;">
|
||
// <i class="mdi mdi-plus"></i>
|
||
// </button>
|
||
// <button type="button" class="btn btn-danger si-remove-multi mr-2" onclick="removeGMCAdditionalSI(this)"
|
||
// style="background-color: #BD0707;border:1px solid #BD0707">
|
||
// <i class="mdi mdi-delete"></i>
|
||
// </button>
|
||
// <div id='numberToWordSumInsured' class="text-danger-2 mr-2"></div>
|
||
// </div>
|
||
// </div>
|
||
// </div> `;
|
||
// $('#gmc_si_add_more').append(html);
|
||
// }
|
||
|
||
function appendGMCSIAddMore(data = '') {
|
||
console.log('function called')
|
||
var html = `
|
||
<div class="row align-items-start mb-2">
|
||
<div class="col-md-4">
|
||
<label class="form-label">Additional Sum Insured</label>
|
||
</div>
|
||
|
||
<div class="col-md-6">
|
||
<div class="d-flex align-items-center gap-2">
|
||
<input class="form-control" style="max-width:200px;"
|
||
value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]"
|
||
type="text" name="multiple_sum_insured[]"
|
||
onkeypress="return onlyNumbers(event)"
|
||
onkeyup="formatNumber(this); numtowordinkeyup(this)">
|
||
|
||
<button type="button" class="btn btn-primary si-add-more ml-2 "
|
||
onclick="appendGMCSIAddMore()"
|
||
style="background-color:#e26728;border:1px solid #e26728;">
|
||
<i class="mdi mdi-plus"></i>
|
||
</button>
|
||
|
||
<button type="button" class="btn btn-danger si-remove-multi ml-2"
|
||
onclick="removeGMCAdditionalSI(this)"
|
||
style="background-color:#BD0707;border:1px solid #BD0707;">
|
||
<i class="mdi mdi-delete"></i>
|
||
</button>
|
||
</div>
|
||
|
||
<div class="text-danger-2 mr-2 numberToWordSumInsured"></div>
|
||
</div>
|
||
</div>`;
|
||
|
||
$('#gmc_si_add_more').append(html);
|
||
}
|
||
|
||
function removeGMCAdditionalSI(button) {
|
||
console.log('remove clicked');
|
||
$(button).closest('.row').remove();
|
||
}
|
||
|
||
function checkAdditionPremiumJSON() {
|
||
|
||
var client_id = $('#Client_id').val();
|
||
var client_policy_id = $('#gmc_client_policy_id').val();
|
||
|
||
var url = '<?php echo base_url('util/check_addition_premium_JSON/') ?>' + client_id + '/' + client_policy_id;
|
||
|
||
$.get(url, function(response) {
|
||
|
||
console.log(response);
|
||
console.log(response.data);
|
||
|
||
if (response.data > 0) {
|
||
console.log(
|
||
'Any changes made in the policy term for family floater, please update the rack rate configuration.'
|
||
);
|
||
Swal.fire(
|
||
"Any changes made in the policy term for family floater, please update the rack rate configuration."
|
||
);
|
||
}
|
||
console.log('outer');
|
||
|
||
}).fail(function(xhr, status, error) {
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
});
|
||
|
||
}
|
||
|
||
function inArray(key, array) {
|
||
return array.includes(key);
|
||
}
|
||
|
||
function processJsonObject(jsonObject) {
|
||
|
||
// alert("Processing JSON Object");
|
||
// console.log("Processing JSON Object:", jsonObject);
|
||
|
||
if (typeof jsonObject !== 'object' || Array.isArray(jsonObject)) {
|
||
console.log("jsonObject Input is not a valid object.");
|
||
return;
|
||
}
|
||
|
||
$('.unchecked').prop('checked', false);
|
||
|
||
for (let key in jsonObject) {
|
||
if (typeof jsonObject[key] === 'object' && !Array.isArray(jsonObject[key])) {
|
||
// console.log('enrollment_display_key');
|
||
// console.log(jsonObject[key]);
|
||
|
||
for (let innerKey in jsonObject[key]) {
|
||
|
||
const keysToCheck = [
|
||
"Widower Cover",
|
||
"Breavement Cover",
|
||
"OPD Treatment",
|
||
"Non-Admissible / Contingency Corporate Buffer",
|
||
"Maternity Benefit",
|
||
"Well baby / Well Mother Expenses",
|
||
"Infertility Treatment Coverage",
|
||
"Mid Term Addition of New Born / Newly Wedded Spouse",
|
||
"ICU Limit",
|
||
"Waiver of 90 Days Waiting Period",
|
||
"Waiver of Other Waiting Periods",
|
||
"Ailment capping Details"
|
||
];
|
||
|
||
let base_id = innerKey.replace(/[\s\-\/,&]+/g, '').toLowerCase();
|
||
|
||
if (keysToCheck.includes(innerKey)) {
|
||
// console.log("Key found: " + innerKey);
|
||
base_id = innerKey.replace(/[\s\-\/]+/g, '_').toLowerCase();
|
||
} else if (innerKey == "Claim Intimation Clause") {
|
||
// console.log("Key found: " + innerKey);
|
||
base_id = "days_of_discharge";
|
||
} else if (innerKey == "Claim Submission") {
|
||
// console.log("Key found: " + innerKey);
|
||
base_id = "days_from_dod";
|
||
}
|
||
|
||
let display_id = base_id + "_display";
|
||
// console.log("input value : ", jsonObject[key][innerKey]);
|
||
let inputValue = jsonObject[key][innerKey];
|
||
if (inputValue) {
|
||
$('#' + display_id).prop('checked', true);
|
||
}
|
||
console.log('display_id : ', display_id);
|
||
}
|
||
} else {
|
||
console.log(`${key} is not an object.`);
|
||
}
|
||
}
|
||
}
|
||
|
||
function disableUnwantedTerms(jsonObject) {
|
||
|
||
console.log("Disabling unwanted terms");
|
||
console.log("jsonObject : ", jsonObject);
|
||
|
||
if(jsonObject){
|
||
fields.forEach(function(key) {
|
||
// If key NOT in jsonObject, then hide and disable its associated elements
|
||
if (!jsonObject?.hasOwnProperty(key)) {
|
||
const elements = document.getElementsByName(key);
|
||
|
||
elements.forEach(element => {
|
||
element.style.display = "none";
|
||
element.disabled = true;
|
||
|
||
const label = document.querySelector(`label[for="${element.id}"]`);
|
||
if (label) {
|
||
label.style.display = "none";
|
||
}
|
||
|
||
const displayElement = document.getElementById(`${element.id}_display`);
|
||
if (displayElement) {
|
||
displayElement.checked = false;
|
||
displayElement.disabled = true;
|
||
displayElement.style.display = "none";
|
||
}
|
||
|
||
const rowDiv = element.closest('.row');
|
||
if (rowDiv) {
|
||
rowDiv.style.display = "none";
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
function autoSaveGmcTerms()
|
||
{
|
||
|
||
console.log("autoSaveGmcTerms function called");
|
||
|
||
// Add form validation before proceeding
|
||
var form = $('#policyJsonForm')[0];
|
||
if (!form) {
|
||
console.error("Form #policyJsonForm not found");
|
||
return;
|
||
}
|
||
|
||
// Check if form has any data before proceeding
|
||
var formData = new FormData(form);
|
||
var hasData = false;
|
||
|
||
console.log("form entries : ", formData.entries());
|
||
|
||
for (let [key, value] of formData.entries()) {
|
||
console.log("Key:", key, "Value:", value);
|
||
if(key == "sum_insured"){
|
||
if (value && value.toString().trim() !== '') {
|
||
hasData = true;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
if (!hasData) {
|
||
console.warn("Form data is empty, skipping auto-save");
|
||
return;
|
||
}
|
||
|
||
var specialConditions = [];
|
||
|
||
$(".removeDom").each(function() {
|
||
var isChecked = $(this).find("input[name='special_condition_display[]']").is(":checked");
|
||
|
||
if (isChecked) {
|
||
var label = $(this).find("input[name='special_condition_label[]']").val();
|
||
var input = $(this).find("input[name='special_condition_input[]']").val();
|
||
|
||
specialConditions.push({
|
||
[label]: input
|
||
});
|
||
}
|
||
});
|
||
|
||
console.log("specialConditions", specialConditions);
|
||
|
||
// var formData = new FormData($('#policyJsonForm')[0]);
|
||
|
||
var policy_form_action = '<?= base_url("client/policy/policyGMCTerms") ?>';
|
||
console.log("policy_form_action", policy_form_action);
|
||
|
||
formData.append("special_condition_display_value", JSON.stringify(specialConditions));
|
||
|
||
$.ajax({
|
||
data: formData,
|
||
url: policy_form_action,
|
||
type: "POST",
|
||
dataType: 'json',
|
||
processData: false,
|
||
contentType: false,
|
||
success: function(res) {
|
||
|
||
console.log('Auto Save Response : ', res);
|
||
|
||
if (res.status == true) {
|
||
showTinyToast();
|
||
}else{
|
||
console.log('Policy terms Dose Not save', 'Error');
|
||
return;
|
||
}
|
||
},
|
||
error: function(xhr, status, error) {
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
function debounce(fn, delay) {
|
||
let timeout;
|
||
return function () {
|
||
clearTimeout(timeout);
|
||
timeout = setTimeout(fn, delay);
|
||
};
|
||
}
|
||
|
||
$(document).ready(function () {
|
||
const form = document.querySelector("#policyJsonForm");
|
||
|
||
// MutationObserver (always runs)
|
||
const observer = new MutationObserver(() => {
|
||
$("#policyJsonForm").find("input, select, textarea").each(function () {
|
||
if (gmc_auto_save_enable) { // only bind autosave if enabled
|
||
if (!$(this).attr("data-observed")) {
|
||
const debouncedSave = debounce(autoSaveGmcTerms, 1000);
|
||
$(this).on("input change", debouncedSave);
|
||
$(this).attr("data-observed", "true");
|
||
}
|
||
}
|
||
});
|
||
});
|
||
|
||
observer.observe(form, { childList: true, subtree: true });
|
||
|
||
// Bind for existing fields (only if enabled)
|
||
if (gmc_auto_save_enable) {
|
||
const debouncedSave = debounce(autoSaveGmcTerms, 1000);
|
||
$("#policyJsonForm").find("input, select, textarea").each(function () {
|
||
$(this).on("input change", debouncedSave);
|
||
$(this).attr("data-observed", "true");
|
||
});
|
||
} else {
|
||
console.log("This policy has employee processed (autosave disabled) -- GMC") ;
|
||
}
|
||
});
|
||
|
||
</script> |