672 lines
37 KiB
PHP
672 lines
37 KiB
PHP
<!-- Modal content for the Large example -->
|
||
<style>
|
||
.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;
|
||
}
|
||
.form-control-client-policy-master{
|
||
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;
|
||
}
|
||
.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;
|
||
}
|
||
.form-control-client-policy-masters{
|
||
margin-left: 30px;
|
||
width: 689px;
|
||
}
|
||
</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="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="form-column">
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Sum Insured</label>
|
||
<input type="text" name="sum_insured" id="sum_insured" class="form-control form-control-client-policy-master" onkeypress = "return onlyNumbers(event)">
|
||
</div>
|
||
|
||
<div id='numberToWordGMC' class="text-danger" style="float: right;position: relative;right: 25px;bottom: 10px;"></div>
|
||
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class=" " style="width: 400px;">Family Floater</label><br>
|
||
<div class="flex-container">
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="family_floater" value="1"> Yes
|
||
<input type="radio" name="family_floater" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
<div style="display:none; margin-top: 27px;margin-bottom: 7px; margin-left: 31px;">
|
||
<div>
|
||
<input type="checkbox" name="family_floaters[]" value="self" id="self" checked disabled> Self
|
||
<input type="checkbox" name="family_floaters[]" value="spouse" id="spouse"> Spouse
|
||
<input type="checkbox" name="family_floaters[]" value="child1" id="child1"> Child 1
|
||
<input type="checkbox" name="family_floaters[]" value="child2" id="child2"> Child 2
|
||
<input type="checkbox" name="family_floaters[]" value="child3" id="child3"> Child 3
|
||
<input type="checkbox" name="family_floaters[]" value="child4" id="child4"> Child 4
|
||
</div>
|
||
<div style="margin-top:10px">
|
||
<input type="checkbox" name="family_floaters[]" value="parent1" id="parent1"> Parent 1
|
||
<input type="checkbox" name="family_floaters[]" value="parent2" id="parent2"> Parent 2
|
||
<input type="checkbox" name="family_floaters[]" value="parent_in_law1" id="parent_in_law1"> Parent-In-Law 1
|
||
<input type="checkbox" name="family_floaters[]" value="parent_in_law2" id="parent_in_law2"> Parent-In-Law 2
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
|
||
<label class="form-check-label " for="corporatebuffer" style="width: 400px;">Corporate Buffer</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="corporatebuffer" value="1"> Yes
|
||
<input type="radio" name="corporatebuffer" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="waiverofpreexistingdiseases" style="width: 400px;">Waiver of Pre-existing Diseases</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="waiverofpreexistingdiseases" value="1"> Yes, waived off
|
||
<input type="radio" name="waiverofpreexistingdiseases" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
|
||
<label for="emp_code" class=" " style="width: 400px;">Maternity Coverage</label>
|
||
<input type="text" name="maternitycoverage" id="maternitycoverage" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
|
||
<label for="emp_code" class=" " style="width: 400px; ">Twin Delivery</label>
|
||
<input type="text" name="twindelivery" id="twindelivery" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
|
||
<label for="emp_code" class=" " style="width: 400px; ">Pre and Post natal</label>
|
||
<input type="text" name="preandpostnatal" id="preandpostnatal" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
|
||
<label for="emp_code" class=" " style="width: 400px; ">Baby Day 1 Cover</label>
|
||
<input type="text" name="babyday1cover" id="babyday1cover" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="9monthwaitingperiodwaived" style="width: 400px;">9-month waiting Period –waived</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="9monthwaitingperiodwaived" value="1"> Yes, waived off
|
||
<input type="radio" name="9monthwaitingperiodwaived" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Cover from the date of Joining</label>
|
||
<input type="text" name="coverfromthedateofjoining" id="coverfromthedateofjoining" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="waiverof1,2,3&4thyearexclusions" style="width: 400px;">Waiver of 1, 2, 3 & 4th year Exclusions</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="waiverof1,2,3&4thyearexclusions" value="1"> Yes, waived off
|
||
<input type="radio" name="waiverof1,2,3&4thyearexclusions" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="waiverof30dayswaitingperiod" style="width: 400px;">Waiver of 30 days waiting period</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="waiverof30dayswaitingperiod" value="1"> Yes, waived off
|
||
<input type="radio" name="waiverof30dayswaitingperiod" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Pre Hospitalization Cover</label>
|
||
<input type="text" name="prehospitalizationcover" id="prehospitalizationcover" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<!-- <div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Post Hospitalization Cover</label>
|
||
<input type="text" name="posthospitalizationcover" id="posthospitalizationcover" class="form-control form-control-client-policy-master">
|
||
</div> -->
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="congenitaldiseasesinternal" style="width: 400px;">Congenital Diseases - Internal</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="congenitaldiseasesinternal" value="internal"> Internal Covered
|
||
<input type="radio" name="congenitaldiseasesinternal" value="no" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<!-- <div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="congenitaldiseasesexternal" style="width: 400px;">Congenital Diseases - External</label>
|
||
<input type="text" name="congenitaldiseasesexternal" id="congenitaldiseasesexternal" class="form-control form-control-client-policy-master">
|
||
</div> -->
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="copayzonewisecopay" class=" " style="width: 400px;">Co-Pay/Zone wise Co Pay</label>
|
||
<select name="copayzonewisecopay" id="copayzonewisecopay" class="form-control form-control-client-policy-master">
|
||
<option value="">Select an option</option>
|
||
<option value="5%">5%</option>
|
||
<option value="10%">10%</option>
|
||
<option value="15%">15%</option>
|
||
<option value="20%">20%</option>
|
||
<option value="25%">25%</option>
|
||
<option value="30%">30%</option>
|
||
<option value="35%">35%</option>
|
||
<option value="40%">40%</option>
|
||
<option value="45%">45%</option>
|
||
<option value="50%">50%</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Bio absorbable stent / Toric lens/ Multi Focal lens</label>
|
||
<input type="text" name="bioabsorbablestenttoriclensmultifocallens" id="bioabsorbablestenttoriclensmultifocallens" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Room Rent Limit</label>
|
||
<input type="text" name="roomrentlimit" id="roomrentlimit" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="proportionatedeductionclause" class=" " style="width: 400px;">Proportionate Deduction Clause</label>
|
||
<select name="proportionatedeductionclause" id="proportionatedeductionclause" class="form-control form-control-client-policy-master">
|
||
<option value="">Select an option</option>
|
||
<option value="NotApplicable/WaivedOff">Not Applicable / Waived Off</option>
|
||
<option value="Applicable">Applicable</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Nursing Allowance</label>
|
||
<input type="text" name="nursingallowance" id="nursingallowance" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="ailmentcapping" style="width: 400px;">Ailment capping</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="ailmentcapping" value="1"> Yes
|
||
<input type="radio" name="ailmentcapping" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Ambulance Charges</label>
|
||
<input type="text" name="ambulancecharges" id="ambulancecharges" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Air Ambulance</label>
|
||
<input type="text" name="airambulance" id="airambulance" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Family Transportation Benefit</label>
|
||
<input type="text" name="familytransportationbenefit" id="familytransportationbenefit" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="reasonableandcustomarycharges" style="width: 400px;">Reasonable and Customary Charges</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="reasonableandcustomarycharges" value="1">Applicable
|
||
<input type="radio" name="reasonableandcustomarycharges" value="0" style="margin-left:10px">Not Applicable
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Day Care Treatment</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="daycaretreatment" value="1"> Yes
|
||
<input type="radio" name="daycaretreatment" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label class="form-check-label " for="ayudhtreatmentcover" style="width: 400px;">AYUSH treatment cover</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="ayudhtreatmentcover" value="1"> Yes
|
||
<input type="radio" name="ayudhtreatmentcover" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">ARMD Covered</label>
|
||
<input type="text" name="armdcovered" id="armdcovered" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Sum Insured enhancement</label>
|
||
<div class="radiobuttondiv">
|
||
<input type="radio" name="suminsuredenhancement" value="1"> Yes
|
||
<input type="radio" name="suminsuredenhancement" value="0" style="margin-left:10px"> No
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Automatic Sum Insured reinstatement</label>
|
||
<input type="text" name="automaticsuminsuredreinstatement" id="automaticsuminsuredreinstatement" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Additional Sickness Benefit</label>
|
||
<textarea name="additionalsicknessbenefit" id="additionalsicknessbenefit" class="form-control form-control-client-policy-master"></textarea>
|
||
</div>
|
||
<!-- <div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Additional Sickness Benefit</label>
|
||
<input type="text" name="additionalsicknessbenefit" id="additionalsicknessbenefit" class="form-control form-control-client-policy-master">
|
||
</div> -->
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Lasik Surgery</label>
|
||
<input type="text" name="lasiksurgery" id="lasiksurgery" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Mid Term inclusion</label>
|
||
<input type="text" name="midterminclusion" id="midterminclusion" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">CAPD</label>
|
||
<input type="text" name="capd" id="capd" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Organ donor expenses</label>
|
||
<input type="text" name="organdonorexpenses" id="organdonorexpenses" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Modern treatments as per IRDAI</label>
|
||
<input type="text" name="moderntreatmentsasperirdai" id="moderntreatmentsasperirdai" class="form-control form-control-client-policy-master">
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="emp_code" class=" " style="width: 400px;">Wellness</label>
|
||
<textarea name="Wellness" id="Wellness" class="form-control form-control-client-policy-master"></textarea>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="days_of_discharge" class=" ">Days of Discharge</label>
|
||
<div class="input-group mb-3" style="margin-left: 0px;">
|
||
<input type="text" id="days_of_discharge" name="days_of_discharge" class="form-control form-control-client-policy-master" placeholder="Enter the number of days">
|
||
<div class="input-group-append input-group-append-client-policy-master">
|
||
<span class="input-group-text" id="basic-addon2">Days</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group col-md-6 form-group-client-policy-master">
|
||
<label for="days_from_dod" class=" ">Days from DOD</label>
|
||
<div class="input-group mb-3" style="margin-left: 0px;">
|
||
<input type="text" id="days_from_dod" name="days_from_dod" class="form-control form-control-client-policy-master" placeholder="Enter the number of days">
|
||
<div class="input-group-append input-group-append-client-policy-master">
|
||
<span class="input-group-text" id="basic-addon2">Days</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<!-- <hr> -->
|
||
|
||
<!-- <div class="form-row" id="grid_content_input">
|
||
</div> -->
|
||
|
||
</div>
|
||
<div class="form-group text-right m-b-0" style="margin-top: -49px;">
|
||
<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="btnGridSubmit" 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="family_floater"]').change(function() {
|
||
console.log($(this).val());
|
||
if ($(this).val() == '1') {
|
||
var element = $(this).parent().next()[0];
|
||
$(element).css("display", "block");
|
||
var element2 = $(this).parent().parent().parent().next()[0];
|
||
$(element2).css("display", "");
|
||
} else {
|
||
var element = $(this).parent().next()[0];
|
||
$(element).css("display", "none");
|
||
var element2 = $(this).parent().parent().parent().next()[0];
|
||
$(element2).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) {
|
||
|
||
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 ;
|
||
}
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
|
||
var formData = new FormData($('#policyJsonForm')[0]);
|
||
var policy_form_action = '<?= base_url("client/policy/policyGMCTerms") ?>';
|
||
|
||
$.ajax({
|
||
data: formData,
|
||
url: policy_form_action,
|
||
type: "POST",
|
||
dataType: 'json',
|
||
processData: false,
|
||
contentType: false,
|
||
success: function(res) {
|
||
|
||
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');
|
||
$('#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');
|
||
}, 1000);
|
||
});
|
||
|
||
|
||
$('body').on('click', '.btnPolicyMaster', function () {
|
||
|
||
var policy_id = $(this).data('id');
|
||
$('#policy_id').val(policy_id);
|
||
|
||
var client_id = $('#Client_id').val();
|
||
$('#client_policy_id').val(policy_id);
|
||
|
||
var gmc_policy_type_id = $(this).attr('id');
|
||
console.log('gmc_policy_type_id', typeof gmc_policy_type_id)
|
||
|
||
|
||
if(gmc_policy_type_id >= '2'){
|
||
|
||
$('#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');
|
||
|
||
|
||
$.ajax({
|
||
url: '<?= base_url("client/policy/getterms") ?>',
|
||
method: 'GET',
|
||
data: { policy_id : policy_id , client_id: client_id},
|
||
success: function(response) {
|
||
|
||
$('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
|
||
$('gmc_emp_count').val(response.count)
|
||
if(response.count){
|
||
|
||
$('emp_count').val(response.count)
|
||
if(response.count === false){
|
||
$("#btnGPATermsSubmit").prop("disabled", true);
|
||
}else{
|
||
$("#btnGPATermsSubmit").prop("disabled", false);
|
||
}
|
||
|
||
}
|
||
|
||
if (response) {
|
||
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();
|
||
}
|
||
}
|
||
let elements = document.getElementsByName(`${key}[]`);
|
||
|
||
if (elements) {
|
||
elements.forEach((element,index) => {
|
||
element.value = jsonObject[key][index];
|
||
});
|
||
}
|
||
}
|
||
|
||
if (key.includes("family_floaters")) {
|
||
let checkboxes = document.querySelectorAll(`input[name="${key}[]"]`);
|
||
if (jsonObject[key]) {
|
||
jsonObject[key].forEach(element => {
|
||
let checkbox = $(`#${element}`);
|
||
if (checkbox.is(":checkbox")) {
|
||
checkbox.prop("checked", true);
|
||
}
|
||
});
|
||
}
|
||
|
||
}
|
||
|
||
|
||
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 {
|
||
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 {
|
||
element.value = jsonObject[key];
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
$('.jodit-wysiwyg').each(function() {
|
||
$(this).click();
|
||
});
|
||
|
||
|
||
},
|
||
|
||
error: function(xhr, status, error) {
|
||
console.error('Error:', status, error);
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
});
|
||
|
||
$("#sum_insured").on("keyup", function() {
|
||
var inputNumber = parseInt($(this).val());
|
||
if (!isNaN(inputNumber)) {
|
||
var result = convertNumberToWords(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) {
|
||
event.preventDefault();
|
||
specialCondition();
|
||
});
|
||
|
||
|
||
function specialCondition(count =0) {
|
||
if (count === 0) {
|
||
var index =$('.modifyclassinput').length;
|
||
var appendElement =`<div class="form-group col-md-6 form-group-client-policy-masters removeDom">
|
||
<label for="specialconditionlabel" class="special_condition_label[]" style="width: 400px;"><input name="special_condition_label[]" id="special_condition_label[]"><span class="specialConditionClose" style="color: red;margin-left: 20px;">X</span></label>
|
||
<input type="text" name="special_condition_input[]" id="special_condition_input[]" class="form-control form-control-client-policy-masters special_condition_input[]">
|
||
</div>`;
|
||
$('.form-column').each(function() {
|
||
$(this).append(appendElement);
|
||
});
|
||
}
|
||
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','');
|
||
});
|
||
|
||
</script> |