POLICYGMCTERMSMODELREMOVE : AADHAVAN
This commit is contained in:
parent
af6f5eb087
commit
6ce5d01c71
@ -54,8 +54,8 @@ $routes->group("/client", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->post("create", "ClientController::createClientPolicy");
|
$routes->post("create", "ClientController::createClientPolicy");
|
||||||
$routes->post("edit", "ClientController::editClientPolicy");
|
$routes->post("edit", "ClientController::editClientPolicy");
|
||||||
$routes->get("list/(:any)", "ClientController::getClientPolicyById/$1");
|
$routes->get("list/(:any)", "ClientController::getClientPolicyById/$1");
|
||||||
$routes->post("jsonPost", "ClientController::jsonPost");
|
$routes->post("policyGMCTerms", "ClientController::policyGMCTerms");
|
||||||
$routes->get("getjson", "ClientController::getjson");
|
$routes->get("getterms", "ClientController::getterms");
|
||||||
});
|
});
|
||||||
$routes->group("kyc", ["filter" => "authMVC"], function($routes){
|
$routes->group("kyc", ["filter" => "authMVC"], function($routes){
|
||||||
$routes->post("create", "ClientController::createClientKYCInfo");
|
$routes->post("create", "ClientController::createClientKYCInfo");
|
||||||
|
|||||||
@ -671,15 +671,15 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jsonPost()
|
public function policyGMCTerms()
|
||||||
{
|
{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->myLogger->logme('error','JSon CREATE function called');
|
$this->myLogger->logme('error','Terms CREATE function called');
|
||||||
// print_r($this->request->getPost());
|
// print_r($this->request->getPost());
|
||||||
$client_id = $this->request->getPost("client_id");
|
$client_id = $this->request->getPost("client_id");
|
||||||
$policy_id = $this->request->getPost("policy_id");
|
$policy_id = $this->request->getPost("policy_id");
|
||||||
$data['sumInsured'] =$this->request->getPost("sumInsured");
|
$data['sum_insured'] =$this->request->getPost("sum_insured");
|
||||||
$data['family_floater'] =$this->request->getPost("family_floater");
|
$data['family_floater'] =$this->request->getPost("family_floater");
|
||||||
// print_r($data['familyfloater']);
|
// print_r($data['familyfloater']);
|
||||||
if (!$data['family_floater'] || $data['family_floater'] == 0) {
|
if (!$data['family_floater'] || $data['family_floater'] == 0) {
|
||||||
@ -707,7 +707,9 @@ class ClientController extends AdminController
|
|||||||
$data['waiverof1,2,3&4thyearexclusions'] =$this->request->getPost("waiverof1,2,3&4thyearexclusions");
|
$data['waiverof1,2,3&4thyearexclusions'] =$this->request->getPost("waiverof1,2,3&4thyearexclusions");
|
||||||
$data['waiverof30dayswaitingperiod'] =$this->request->getPost("waiverof30dayswaitingperiod");
|
$data['waiverof30dayswaitingperiod'] =$this->request->getPost("waiverof30dayswaitingperiod");
|
||||||
$data['prehospitalizationcover'] =$this->request->getPost("prehospitalizationcover");
|
$data['prehospitalizationcover'] =$this->request->getPost("prehospitalizationcover");
|
||||||
|
// $data['posthospitalizationcover'] =$this->request->getPost("posthospitalizationcover");
|
||||||
$data['congenitaldiseasesinternal'] =$this->request->getPost("congenitaldiseasesinternal");
|
$data['congenitaldiseasesinternal'] =$this->request->getPost("congenitaldiseasesinternal");
|
||||||
|
// $data['congenitaldiseasesexternal'] =$this->request->getPost("congenitaldiseasesexternal");
|
||||||
$data['copayzonewisecopay'] =$this->request->getPost("copayzonewisecopay");
|
$data['copayzonewisecopay'] =$this->request->getPost("copayzonewisecopay");
|
||||||
$data['bioabsorbablestenttoriclensmultifocallens'] =$this->request->getPost("bioabsorbablestenttoriclensmultifocallens");
|
$data['bioabsorbablestenttoriclensmultifocallens'] =$this->request->getPost("bioabsorbablestenttoriclensmultifocallens");
|
||||||
$data['roomrentlimit'] =$this->request->getPost("roomrentlimit");
|
$data['roomrentlimit'] =$this->request->getPost("roomrentlimit");
|
||||||
@ -731,17 +733,17 @@ class ClientController extends AdminController
|
|||||||
$data['Wellness'] =$this->request->getPost("Wellness");
|
$data['Wellness'] =$this->request->getPost("Wellness");
|
||||||
$data['days_of_discharge'] =$this->request->getPost("days_of_discharge");
|
$data['days_of_discharge'] =$this->request->getPost("days_of_discharge");
|
||||||
$data['days_from_dod'] =$this->request->getPost("days_from_dod");
|
$data['days_from_dod'] =$this->request->getPost("days_from_dod");
|
||||||
$data['specialConditionLabel'] = $this->request->getPost("specialConditionLabel") ?? [];
|
$data['special_condition_label'] = $this->request->getPost("special_condition_label") ?? [];
|
||||||
$data['specialConditionInput'] = $this->request->getPost("specialConditionInput") ?? [];
|
$data['special_condition_input'] = $this->request->getPost("special_condition_input") ?? [];
|
||||||
|
|
||||||
|
|
||||||
// print_r($data);
|
|
||||||
|
|
||||||
// print_r($this->request->getPost());
|
// print_r($this->request->getPost());
|
||||||
// die();
|
// die();
|
||||||
|
|
||||||
$jsonData = json_encode($data);
|
$jsonData = json_encode($data);
|
||||||
$dataa = array(
|
$dataa = array(
|
||||||
'json' => $jsonData,
|
'policy_terms' => $jsonData,
|
||||||
'client_id' => $client_id,
|
'client_id' => $client_id,
|
||||||
'policy_id' => $policy_id
|
'policy_id' => $policy_id
|
||||||
);
|
);
|
||||||
@ -772,14 +774,14 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getjson()
|
public function getterms()
|
||||||
{
|
{
|
||||||
$client_id = $this->request->getVar('client_id');
|
$client_id = $this->request->getVar('client_id');
|
||||||
$policy_id = $this->request->getVar('policy_id');
|
$policy_id = $this->request->getVar('policy_id');
|
||||||
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
|
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
|
||||||
|
|
||||||
if ($record) {
|
if ($record) {
|
||||||
echo $record['json'];
|
echo $record['policy_terms'];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
echo "Record not found.";
|
echo "Record not found.";
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class ClientPolicyModel extends Model
|
|||||||
"earned_premium_amount",
|
"earned_premium_amount",
|
||||||
"claims_incurred_amount",
|
"claims_incurred_amount",
|
||||||
|
|
||||||
"json",
|
"policy_terms",
|
||||||
"created_by",
|
"created_by",
|
||||||
"updated_by",
|
"updated_by",
|
||||||
"Is_active",
|
"Is_active",
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<?php include('policy_grid.php'); ?>
|
|
||||||
<?php include('policy_gmc_terms.php'); ?>
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="police-tab">
|
<div class="tab-pane fade" id="police-tab">
|
||||||
|
|
||||||
@ -102,6 +101,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- end -->
|
<!-- end -->
|
||||||
|
|
||||||
|
<!-- *************************************************** -->
|
||||||
|
|
||||||
|
<?php include('policy_grid.php'); ?>
|
||||||
|
<?php include('policy_gmc_terms.php'); ?>
|
||||||
|
|
||||||
|
<!-- *************************************************** -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
.jodit-container{
|
.jodit-container{
|
||||||
width: 690px !important;
|
width: 821px !important;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
margin-left: 30px;
|
margin-left: 30px;
|
||||||
@ -70,16 +70,11 @@
|
|||||||
width: 689px;
|
width: 689px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="modal fade" id="bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
|
|
||||||
<div class="modal-dialog modal-full-width">
|
|
||||||
<div class="modal-content" style="border-radius: 10px;">
|
|
||||||
<div class="modal-header" style="background-color: #02a8b5; border-top-right-radius: 10px;border-top-left-radius: 10px;">
|
|
||||||
<h4 class="modal-title" id="myLargeModalLabel" style="color: white;">Client Policy Master</h4>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
|
|
||||||
<form role="form" class="parsley-examples" method="post" id="policyJsonForm" enctype="multipart/form-data">
|
<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 GMC Terms</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" 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_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="client_policy_id" id="client_policy_id" />
|
||||||
@ -89,7 +84,7 @@
|
|||||||
<div class="form-column">
|
<div class="form-column">
|
||||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||||
<label for="emp_code" class=" " style="width: 400px;">Sum Insured</label>
|
<label for="emp_code" class=" " style="width: 400px;">Sum Insured</label>
|
||||||
<input type="text" name="sumInsured" id="sumInsured" class="form-control form-control-client-policy-master">
|
<input type="text" name="sum_insured" id="sum_insured" class="form-control form-control-client-policy-master">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||||
<label class=" " style="width: 400px;">Family Floater</label><br>
|
<label class=" " style="width: 400px;">Family Floater</label><br>
|
||||||
@ -99,14 +94,20 @@
|
|||||||
<input type="radio" name="family_floater" value="0" style="margin-left:10px"> No
|
<input type="radio" name="family_floater" value="0" style="margin-left:10px"> No
|
||||||
</div>
|
</div>
|
||||||
<div style="display:none; margin-top: 27px;margin-bottom: 7px; margin-left: 31px;">
|
<div style="display:none; margin-top: 27px;margin-bottom: 7px; margin-left: 31px;">
|
||||||
<input type="checkbox" name="family_floaters[]" value="Self" id="Self"> Self
|
<div>
|
||||||
<input type="checkbox" name="family_floaters[]" value="Spouse" id="Spouse"> Spouse
|
<input type="checkbox" name="family_floaters[]" value="Self" id="Self"> Self
|
||||||
<input type="checkbox" name="family_floaters[]" value="Child1" id="Child1"> Child 1
|
<input type="checkbox" name="family_floaters[]" value="Spouse" id="Spouse"> Spouse
|
||||||
<input type="checkbox" name="family_floaters[]" value="Child2" id="Child2"> Child 2
|
<input type="checkbox" name="family_floaters[]" value="Child1" id="Child1"> Child 1
|
||||||
<input type="checkbox" name="family_floaters[]" value="Child3" id="Child3"> Child 3
|
<input type="checkbox" name="family_floaters[]" value="Child2" id="Child2"> Child 2
|
||||||
<input type="checkbox" name="family_floaters[]" value="Child4" id="Child4"> Child 4
|
<input type="checkbox" name="family_floaters[]" value="Child3" id="Child3"> Child 3
|
||||||
<input type="checkbox" name="family_floaters[]" value="Parent1" id="Parent1"> Parent 1
|
<input type="checkbox" name="family_floaters[]" value="Child4" id="Child4"> Child 4
|
||||||
<input type="checkbox" name="family_floaters[]" value="Parent2" id="Parent2"> Parent 2
|
</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>
|
||||||
|
|
||||||
@ -170,6 +171,10 @@
|
|||||||
<label for="emp_code" class=" " style="width: 400px;">Pre Hospitalization Cover</label>
|
<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">
|
<input type="text" name="prehospitalizationcover" id="prehospitalizationcover" class="form-control form-control-client-policy-master">
|
||||||
</div>
|
</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">
|
<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>
|
<label class="form-check-label " for="congenitaldiseasesinternal" style="width: 400px;">Congenital Diseases - Internal</label>
|
||||||
<div class="radiobuttondiv">
|
<div class="radiobuttondiv">
|
||||||
@ -177,6 +182,10 @@
|
|||||||
<input type="radio" name="congenitaldiseasesinternal" value="no" style="margin-left:10px"> No
|
<input type="radio" name="congenitaldiseasesinternal" value="no" style="margin-left:10px"> No
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<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>
|
<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">
|
<select name="copayzonewisecopay" id="copayzonewisecopay" class="form-control form-control-client-policy-master">
|
||||||
@ -335,9 +344,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
|
||||||
</div><!-- /.modal-dialog -->
|
|
||||||
</div><!-- /.modal -->
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -348,7 +355,7 @@ $('#gmc_remove').hide();
|
|||||||
$('#btnGridSubmit').hide();
|
$('#btnGridSubmit').hide();
|
||||||
$('.close').click(function(){
|
$('.close').click(function(){
|
||||||
|
|
||||||
$('#sumInsured').val("");
|
$('#sum_insured').val("");
|
||||||
$('#familyfloater').val("");
|
$('#familyfloater').val("");
|
||||||
$('#waiverofpreexistingdiseases').prop('checked', false);
|
$('#waiverofpreexistingdiseases').prop('checked', false);
|
||||||
$('#maternitycoverage').val("");
|
$('#maternitycoverage').val("");
|
||||||
@ -377,45 +384,44 @@ $('.close').click(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function() {
|
// $(document).ready(function() {
|
||||||
|
|
||||||
if ($('input[name="waiverofpreexistingdiseases"]').val() == '1') {
|
// if ($('input[name="waiverofpreexistingdiseases"]').val() == '1') {
|
||||||
var element = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next()[0];
|
// var element = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
var element2 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next()[0];
|
// var element2 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next()[0];
|
||||||
$(element2).css("display", "");
|
// $(element2).css("display", "");
|
||||||
var element3 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next().next()[0];
|
// var element3 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next().next()[0];
|
||||||
$(element3).css("display", "");
|
// $(element3).css("display", "");
|
||||||
var element4 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next().next().next()[0];
|
// var element4 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next().next().next()[0];
|
||||||
$(element4).css("display", "");
|
// $(element4).css("display", "");
|
||||||
} else {
|
// } else {
|
||||||
var element = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next()[0];
|
// var element = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
var element2 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next()[0];
|
// var element2 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next()[0];
|
||||||
$(element2).css("display", "none");
|
// $(element2).css("display", "none");
|
||||||
var element3 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next().next()[0];
|
// var element3 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next().next()[0];
|
||||||
$(element3).css("display", "none");
|
// $(element3).css("display", "none");
|
||||||
var element4 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next().next().next()[0];
|
// var element4 = $('input[name="waiverofpreexistingdiseases"]').parent().parent().next().next().next().next()[0];
|
||||||
$(element4).css("display", "none");
|
// $(element4).css("display", "none");
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
// console.log("Family_floater");
|
||||||
if ($('input[name="family_floater"]').val() == '1') {
|
// console.log($('input[name="family_floater"]').val());
|
||||||
var element = $('input[name="family_floater"]').parent().next()[0];
|
// if ($('input[name="family_floater"]').val() == '1') {
|
||||||
$(element).css("display", "");
|
// var element = $('input[name="family_floater"]').parent().next()[0];
|
||||||
var element2 = $('input[name="family_floater"]').parent().parent().parent().next()[0];
|
// $(element).css("display", "");
|
||||||
$(element2).css("display", "");
|
// var element2 = $('input[name="family_floater"]').parent().parent().parent().next()[0];
|
||||||
} else {
|
// $(element2).css("display", "");
|
||||||
var element = $('input[name="family_floater"]').parent().next()[0];
|
// } else {
|
||||||
$(element).css("display", "none");
|
// var element = $('input[name="family_floater"]').parent().next()[0];
|
||||||
var element2 = $('input[name="family_floater"]').parent().parent().parent().next()[0];
|
// $(element).css("display", "none");
|
||||||
$(element2).css("display", "none");
|
// var element2 = $('input[name="family_floater"]').parent().parent().parent().next()[0];
|
||||||
}
|
// $(element2).css("display", "none");
|
||||||
});
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
$('input[name="waiverofpreexistingdiseases"]').change(function() {
|
$('input[name="waiverofpreexistingdiseases"]').change(function() {
|
||||||
console.log("test 739 line.....");
|
|
||||||
console.log($(this).val());
|
|
||||||
if ($(this).val() == '1') {
|
if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
$(element).css("display", "");
|
||||||
@ -451,7 +457,7 @@ $("#policyJsonForm").submit(function(event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var formData = new FormData($('#policyJsonForm')[0]);
|
var formData = new FormData($('#policyJsonForm')[0]);
|
||||||
var policy_form_action = '<?= base_url("client/policy/jsonPost") ?>';
|
var policy_form_action = '<?= base_url("client/policy/policyGMCTerms") ?>';
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: formData,
|
data: formData,
|
||||||
@ -466,7 +472,7 @@ $("#policyJsonForm").submit(function(event) {
|
|||||||
toastr.error('Policy Dose Not Create', 'Error');
|
toastr.error('Policy Dose Not Create', 'Error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
document.querySelectorAll('.specialConditionLabel\\[\\]').forEach(element => {
|
document.querySelectorAll('.special_condition_label\\[\\]').forEach(element => {
|
||||||
element.parentNode.remove();
|
element.parentNode.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -481,37 +487,38 @@ $("#policyJsonForm").submit(function(event) {
|
|||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$('#policyGMCTerms').css('display', 'none');
|
||||||
|
$('#police-tab').css('display', '');
|
||||||
|
$('.nav.nav-pills.navtab-bg').css('display','');
|
||||||
|
$('.nav.nav-pills.navtab-bg').prev().css('display','');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('body').on('click', '.btnPolicyMaster', function () {
|
$('body').on('click', '.btnPolicyMaster', function () {
|
||||||
|
|
||||||
var policy_id = $(this).data('id');
|
var policy_id = $(this).data('id');
|
||||||
// console.log('policy_id :' ,policy_id);
|
|
||||||
$('#policy_id').val(policy_id);
|
$('#policy_id').val(policy_id);
|
||||||
|
|
||||||
var client_id = $('#Client_id').val();
|
var client_id = $('#Client_id').val();
|
||||||
$('#client_policy_id').val(policy_id);
|
$('#client_policy_id').val(policy_id);
|
||||||
|
|
||||||
// console.log('client_id :' ,client_id);
|
|
||||||
|
$('#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({
|
$.ajax({
|
||||||
url: '<?= base_url("client/policy/getjson") ?>',
|
url: '<?= base_url("client/policy/getterms") ?>',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
data: { policy_id : policy_id , client_id: client_id},
|
data: { policy_id : policy_id , client_id: client_id},
|
||||||
|
|
||||||
// dataType: 'json',
|
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
console.log(response);
|
|
||||||
// let jsonString = response.substring(response.indexOf('{'), response.lastIndexOf('}') + 1);
|
|
||||||
// console.log(jsonString);
|
|
||||||
if (response) {
|
if (response) {
|
||||||
let jsonObject = JSON.parse(response);
|
let jsonObject = JSON.parse(response);
|
||||||
// console.log(jsonObject);
|
|
||||||
Object.keys(jsonObject).forEach(function(key) {
|
Object.keys(jsonObject).forEach(function(key) {
|
||||||
|
if (key.includes("special_condition_label") || key.includes("special_condition_input")) {
|
||||||
if (key.includes("specialConditionLabel") || key.includes("specialConditionInput")) {
|
if (key.includes("special_condition_label")) {
|
||||||
if (key.includes("specialConditionLabel")) {
|
|
||||||
for (let index = 0; index < jsonObject[key].length; index++) {
|
for (let index = 0; index < jsonObject[key].length; index++) {
|
||||||
specialCondition();
|
specialCondition();
|
||||||
}
|
}
|
||||||
@ -527,12 +534,15 @@ $('body').on('click', '.btnPolicyMaster', function () {
|
|||||||
|
|
||||||
if (key.includes("family_floaters")) {
|
if (key.includes("family_floaters")) {
|
||||||
let checkboxes = document.querySelectorAll(`input[name="${key}[]"]`);
|
let checkboxes = document.querySelectorAll(`input[name="${key}[]"]`);
|
||||||
jsonObject[key].forEach(element => {
|
if (jsonObject[key]) {
|
||||||
let checkbox = $(`#${element}`);
|
jsonObject[key].forEach(element => {
|
||||||
if (checkbox.is(":checkbox")) {
|
let checkbox = $(`#${element}`);
|
||||||
checkbox.prop("checked", true);
|
if (checkbox.is(":checkbox")) {
|
||||||
}
|
checkbox.prop("checked", true);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -540,11 +550,31 @@ $('body').on('click', '.btnPolicyMaster', function () {
|
|||||||
if (elements && elements.length > 0) {
|
if (elements && elements.length > 0) {
|
||||||
let element = elements[0]; // Assuming you want to update the first element with the name
|
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.tagName === 'INPUT' && (element.type === 'checkbox' || element.type === 'radio')) {
|
||||||
|
|
||||||
if (element.type === 'checkbox') {
|
if (element.type === 'checkbox') {
|
||||||
element.checked = jsonObject[key] === '1'; // Assuming jsonObject[key] is '1' or '0' for checkbox
|
element.checked = jsonObject[key] === '1'; // Assuming jsonObject[key] is '1' or '0' for checkbox
|
||||||
} else if (element.type === 'radio') {
|
} else if (element.type === 'radio') {
|
||||||
element.checked = element.value === jsonObject[key];
|
|
||||||
|
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"){
|
}else if(key === "Wellness" || key === "additionalsicknessbenefit"){
|
||||||
let wysiwygElement = element.previousElementSibling.querySelector('.jodit-wysiwyg');
|
let wysiwygElement = element.previousElementSibling.querySelector('.jodit-wysiwyg');
|
||||||
@ -564,6 +594,13 @@ $('body').on('click', '.btnPolicyMaster', function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('.jodit-wysiwyg').each(function() {
|
||||||
|
$(this).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
@ -931,8 +968,8 @@ function removebutton(index, type) {
|
|||||||
if (count === 0) {
|
if (count === 0) {
|
||||||
var index =$('.modifyclassinput').length;
|
var index =$('.modifyclassinput').length;
|
||||||
var appendElement =`<div class="form-group col-md-6 form-group-client-policy-masters">
|
var appendElement =`<div class="form-group col-md-6 form-group-client-policy-masters">
|
||||||
<label for="specialconditionlabel" class="specialConditionLabel[]" style="width: 400px;"><input name="specialConditionLabel[]" id="specialConditionLabel[]"><span class="specialConditionClose" style="color: red;margin-left: 20px;">X</span></label>
|
<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="specialConditionInput[]" id="specialConditionInput[]" class="form-control form-control-client-policy-masters specialConditionInput[]">
|
<input type="text" name="special_condition_input[]" id="special_condition_input[]" class="form-control form-control-client-policy-masters special_condition_input[]">
|
||||||
</div>`;
|
</div>`;
|
||||||
$('.form-column').each(function() {
|
$('.form-column').each(function() {
|
||||||
$(this).append(appendElement);
|
$(this).append(appendElement);
|
||||||
@ -950,5 +987,11 @@ function removebutton(index, type) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(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>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user