nhance-enrollment/app/Views/policy_gmc_terms.php

1813 lines
79 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 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;
}
</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;">
<div class="col-md-4">
<label for="sumInsured">Sum Insured</label>
</div>
<div class="col-md-4">
<input style="width: 128%;" type="text" name="sum_insured" id="sum_insured" class="form-control"
onkeypress="return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word(this)">
</div>
<div class="col-md-2" style="position: relative;left: 88px;">
<button type="button" class="btn btn-primary si-add-more" onclick="appendGMCSIAddMore()">+</button>
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
<div id='numberToWordGMC' class="text-danger-2"></div>
</div>
</div>
<div id="gmc_si_add_more"></div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-4">
<label for="totalSumInsured">Family Floater</label>
</div>
<div class="col-md-6">
<input type="radio" name="family_floater" class="family_floater" value="1"> Yes
<input type="radio" name="family_floater" class="family_floater" value="0" style="margin-left:10px">No
</div>
<div class="col-md-4">
</div>
<div class="col-md-8" style="margin-bottom:10px">
<table>
<tbody>
<tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Self:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;"
name="family_floaters[]" value="self" id="self" checked> </td>
<td style="width: 28%;">
<div class="self-age"><span style="margin-right: 20px;">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>
</td>
<td style="width: 28%;">
<div class="self-age"><span style="margin-right: 20px;">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>
</td>
<td style="width: 11%;"><span class="self-age"
style="margin-right: 20px;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="self-age" type="checkbox"
style="margin-right: 70px;" name="is_payable_employee_for_self"
id="is_payable_employee_for_self"> </td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Spouse:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;"
name="family_floaters[]" value="spouse" id="spouse"></td>
<td style="width: 28%;">
<div class="spouse-age"><span style="margin-right: 20px;">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>
</td>
<td style="width: 28%;">
<div class="spouse-age"><span style="margin-right: 20px;">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>
</td>
<td style="width: 11%;"><span class="spouse-age"
style="margin-right: 20px;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="spouse-age" type="checkbox"
style="margin-right: 70px;" name="is_payable_employee_for_spouse"
id="is_payable_employee_for_spouse"> </td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="width: 11%;"><span for="children">Children:</span></td>
<td style="width: 11%;"><select name="family_floaters[]" id="children">
<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>
</td>
<td style="width: 28%;">
<div class="child-age"><span style="margin-right: 20px;">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>
</td>
<td style="width: 28%;">
<div class="child-age"><span style="margin-right: 20px;">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>
</td>
<td style="width: 11%;"><span class="child-age"
style="margin-right: 20px;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="child-age" type="checkbox"
style="margin-right: 70px;" name="is_payable_employee_for_child"
id="is_payable_employee_for_child"> </td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<div style="margin-top:10px"></div>
<div style="margin-top:10px"></div>
<div style="margin-top:10px">
<span for="family_floaters">Select Other Members:</span>
<select name="family_floaters[]" id="family_floaters" style="margin-left: 10px;">
<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>
<div style="margin-top:10px">
<table>
<tbody>
<tr>
<td style="width: 22%;">
<div class="other-member-age"><span style="margin-right: 20px;">Elders
Count:</span><input class="underline-input" id="member_count"
style="width: 30%; width: 30%;background: lightgray;" type="number"
name="elder_member_count" id="member_count" readonly></div>
</td>
<td style="width: 28%;">
<div class="other-member-age" style="margin-left: 32px;"><span
style="margin-right: 20px;">Min Age:</span><input
class="underline-input min_age"
value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>"
style="width: 35%;;" type="number" class="underline-input min_age"
name="other_member_min_age" id="other_member_min_age"
onchange="lowerIsEighteen(this)"></div>
</td>
<td style="width: 28%;">
<div class="other-member-age" style="margin-left: 17px;"><span
style="margin-right: 20px;">Max Age:</span><input
class="underline-input max_age"
value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>"
style="width: 35%;;" type="number" class="underline-input max_age"
name="other_member_max_age" id="other_member_max_age"
onchange="lowerIsEighteen(this)"></div>
</td>
<td style="width: 11%;"><span class="other-member-age"
style="margin-right: 20px;font-size: 12px;">Is Payable by employee:</span>
</td>
<td style="width: 11%;"><input class="other-member-age" type="checkbox"
style="margin-right: 70px;" name="is_payable_employee_for_elders"
id="is_payable_employee_for_elders"> </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<hr>
<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="totalSumInsured">Waiver of Pre-existing Diseases</label>
</div>
<div class="col-md-6">
<input type="text" name="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"
value="">
</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="totalSumInsured">9-month waiting Period waived</label>
</div>
<div class="col-md-6">
<input type="text" name="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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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" 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="totalSumInsured">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="totalSumInsured">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="totalSumInsured">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">
<input type="radio" name="suminsuredenhancement" class="suminsuredenhancement" value="1"> Yes
<input type="radio" name="suminsuredenhancement" class="suminsuredenhancement" value="0" style="margin-left:10px"> No
</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 = '';
$('.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));
$.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);
}
});
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() {
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();
} else {
$('#btnGridSubmit1').show();
$('#myButtonSpecialCondition').show();
}
let jsonObject = JSON.parse(response.data);
Object.keys(jsonObject).forEach(function(key) {
if (key.includes("special_condition_label") || key.includes(
"special_condition_input")) {
if (key.includes("special_condition_label")) {
for (let index = 0; index < jsonObject[key]
.length; index++) {
specialCondition();
}
}
//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.includes("family_floaters")) {
let checkboxes = document.querySelectorAll(
`input[name="${key}[]"]`);
if (jsonObject[key]) {
//console.log(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") {
element.parentElement.nextElementSibling.style
.display = '';
element.parentElement.parentElement
.parentElement.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 {
if (jsonObject[key] == undefined) {
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]) {
if (jsonObject[key].self == 0) {
$('#is_payable_employee_for_self').prop('checked',
false);
} else {
$('#is_payable_employee_for_self').prop('checked',
true);
}
if (jsonObject[key].spouse == 0) {
$('#is_payable_employee_for_spouse').prop('checked',
false);
} else {
$('#is_payable_employee_for_spouse').prop('checked',
true);
}
if (jsonObject[key].childern == 0) {
$('#is_payable_employee_for_child').prop('checked',
false);
} else {
$('#is_payable_employee_for_child').prop('checked',
true);
}
if (jsonObject[key].elders == 0) {
$('#is_payable_employee_for_elders').prop('checked',
false);
} else {
$('#is_payable_employee_for_elders').prop('checked',
true);
}
}
}
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();
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("");
}
};
</script>
<!-- Jodit RTE -->
<script>
// $(document).ready(function() {
// var editor = new Jodit('#additionalsicknessbenefit', {
// buttons: 'bold,italic,underline,|,align,alignCenter,alignRight,alignJustify',
// });
// var editor = new Jodit('#Wellness', {
// buttons: 'bold,italic,underline,|,align,alignCenter,alignRight,alignJustify',
// });
// });
// </script>
<!-- Policy terms Add Special Condition -->
<script>
document.getElementById('myButtonSpecialCondition').addEventListener('click', function(event) {
//console.log('specialCondition callback clicked')
event.preventDefault();
specialCondition();
});
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() {
$('#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);
}
}
function appendGMCSIAddMore(data = null) {
console.log('function called')
var html = `
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-4">
<label for="sumInsured">Additional Sum Insured</label>
</div>
<div class="col-md-4">
<input style="width: 128%;" value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]" class="form-control multiple_sum_insured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this); numtowordinkeyup(this)">
</div>
<div class="col-md-2" style="position: relative;left: 88px;">
<button type="button" class="btn btn-danger si-remove-multi" onclick="removeGMCAdditionalSI(this)">x</button>
<button type="button" class="btn btn-primary si-add-more" onclick="appendGMCSIAddMore()">+</button>
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
<div class="text-danger-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) {
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";
$('#' + display_id).prop('checked', true);
console.log('display_id : ', display_id);
}
} else {
console.log(`${key} is not an object.`);
}
}
}
</script>