CLIENTCONTROLLERREECHOTORETURNCONFLICT : AADHAVAN

This commit is contained in:
aadhavan valli 2024-03-02 09:17:28 +05:30
commit a82d98e9c9
13 changed files with 797 additions and 129 deletions

View File

@ -49,7 +49,8 @@ $routes->group("/client", ["filter" => "authMVC"], function($routes){
$routes->group("relation", ["filter" => "authMVC"], function($routes){
$routes->post("create", "ClientController::createClientRelation");
$routes->post("edit", "ClientController::editClientRelation");
});
});
$routes->group("policy", ["filter" => "authMVC"], function($routes){
$routes->post("create", "ClientController::createClientPolicy");
$routes->post("edit", "ClientController::editClientPolicy");
@ -57,16 +58,24 @@ $routes->group("/client", ["filter" => "authMVC"], function($routes){
$routes->post("policyGMCTerms", "ClientController::policyGMCTerms");
$routes->get("getterms", "ClientController::getterms");
});
$routes->group("kyc", ["filter" => "authMVC"], function($routes){
$routes->post("create", "ClientController::createClientKYCInfo");
$routes->post("edit", "ClientController::editClientKYCInfo");
$routes->get("list/(:any)", "ClientController::getKycDocsById/$1");
$routes->get("delete/(:any)", "ClientController::deleteClientKycDocs/$1");
});
$routes->group("premimum", ["filter" => "authMVC"], function($routes){
$routes->post("create", "ClientController::createClientPolicyPremium");
$routes->post("edit", "ClientController::editClientPolicyPremium");
});
$routes->group("terms", ["filter" => "authMVC"], function($routes){
$routes->post("gpa_create", "ClientController::policyGPATerms");
$routes->post("edit", "ClientController::editClientPolicyPremium");
});
});

View File

@ -502,7 +502,6 @@ class ClientController extends AdminController
}
}
public function createClientPolicyPremium()
{
$policy_type = $this->request->getPost('policy_type');
@ -658,14 +657,11 @@ class ClientController extends AdminController
$results = $this->policyGridModel->like('policy_type', $search_term)->findAll();
if($search_term === 'GPA'){
$premiumData = $this->policyPremium1Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
}else{
$premiumData = $this->policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
}
// echo '<pre>';
// print_r($results);
// print_r($data[0]->policy_type); die;
@ -739,6 +735,118 @@ class ClientController extends AdminController
$data['special_condition_input'] = $this->request->getPost("special_condition_input") ?? [];
$jsonData = json_encode($data);
$dataa = array(
'policy_terms' => $jsonData,
'client_id' => $client_id,
'policy_id' => $policy_id
);
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
if ($record) {
$update = $this->clientPolicyModel->update($record['id'], $dataa);
if ($update) {
return $this->respond(['status' => true,'code' => 200,'message' => 'Data updated successfully'], 200);
} else {
return $this->respond(['status' => false,'code' => 404, 'message' => 'Failed to update data'], 200);
}
}else{
$insert = $this->clientPolicyModel->insert($dataa);
if ($insert) {
return $this->respond(['status' => true,'code' => 200,'message' => 'Data stored successfully'], 200);
} else {
return $this->respond(['status' => false,'code' => 404, 'message' => 'Failed to store data'], 200);
}
}
} catch (\Exception $e) {
echo "Failed to insert data: " . $e->getMessage();
// Log the error
log_message('error', 'Failed to insert data: ' . $e->getMessage());
}
}
public function getjson()
{
$client_id = $this->request->getVar('client_id');
$policy_id = $this->request->getVar('policy_id');
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
if ($record) {
echo $record['policy_terms'];
} else {
echo "Record not found.";
}
}
public function policyGPATerms()
{
try {
$this->myLogger->logme('error','Policy GPA Terms CREATE function called');
// print_r($this->request->getPost());
$client_id = $this->request->getPost("client_id");
$policy_id = $this->request->getPost("policy_id");
$data['sumInsured2'] =$this->request->getPost("sumInsured2");
$data['totalSumInsured'] =$this->request->getPost("totalSumInsured");
$data['accidentalDeathBenefit'] =$this->request->getPost("accidentalDeathBenefit");
$data['permanentTotalDisablement'] =$this->request->getPost("permanentTotalDisablement");
$data['permanentPartialDisablement'] =$this->request->getPost("permanentPartialDisablement");
$data['temporaryTotalDisablementBenefit'] =$this->request->getPost("temporaryTotalDisablementBenefit");
$data['accidentalHospitalizationExpenses'] =$this->request->getPost("accidentalHospitalizationExpenses");
$data['childrenEducationWelfareFund'] =$this->request->getPost("childrenEducationWelfareFund");
$data['compassionateVisitExpenses'] =$this->request->getPost("compassionateVisitExpenses");
if ($data['compassionateVisitExpenses'] == 1) {
$data['compassionateVisitExpensesData'] =$this->request->getPost("compassionateVisitExpensesData");
}else{
$data['compassionateVisitExpensesData'] ="";
}
$data['brokenBoneExpenses'] = $this->request->getPost("brokenBoneExpenses");
if ($data['brokenBoneExpenses'] == 1) {
$data['brokenBoneExpensesData'] = $this->request->getPost("brokenBoneExpensesData");
}else{
$data['brokenBoneExpensesData'] ="";
}
$data['ambulanceCharges'] =$this->request->getPost("ambulanceCharges");
if ($data['ambulanceCharges'] == 1) {
$data['ambulanceChargesData'] =$this->request->getPost("ambulanceChargesData");
}else{
$data['ambulanceChargesData'] ="";
}
$data['burnExpenses'] = $this->request->getPost("burnExpenses");
if ($data['burnExpenses'] == 1) {
$data['burnExpensesData'] = $this->request->getPost("burnExpensesData");
}else{
$data['burnExpensesData'] = "";
}
$data['carriageOfDeadBody'] = $this->request->getPost("carriageOfDeadBody");
if ($data['carriageOfDeadBody'] == 1) {
$data['carriageOfDeadBodyData'] = $this->request->getPost("carriageOfDeadBodyData");
}else{
$data['carriageOfDeadBodyData'] = "";
}
$data['animalSnakeInsectBite'] = $this->request->getPost("animalSnakeInsectBite");
$data['terrorism'] = $this->request->getPost("terrorism");
$data['worldwideCover'] = $this->request->getPost("worldwideCover");
print_r($data);
// print_r($this->request->getPost());
// die();
$jsonData = json_encode($data);
$dataa = array(
'policy_terms' => $jsonData,
@ -770,10 +878,8 @@ class ClientController extends AdminController
}
public function getPolicyGPATerms(){
public function getterms()
{
$client_id = $this->request->getVar('client_id');
$policy_id = $this->request->getVar('policy_id');
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();

View File

@ -139,6 +139,9 @@ $(document).ready(function () {
form_action = '<?= base_url("client/general/edit"); ?>';
}
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var formData = new FormData($('#general_form')[0]);
var OptionsHTML1 = ''
@ -150,8 +153,19 @@ $(document).ready(function () {
processData: false,
contentType: false,
success: function(res) {
if(res){
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
$('#kyc_tab').click();
var message = (PrimaryKey === '') ? 'Client General Info Created successfully' : 'Client General Info Updated successfully';
toastr.success(message, 'Success');
}, 1000);
}
console.log(res);
$('#client_id').val(res.data.id);
$('#client_id_relation').val(res.data.id);
$('#relation_PrimaryKey').val(res.data.id);
@ -162,10 +176,6 @@ $(document).ready(function () {
$('#client_id_kyc').val(res.data.id);
$('#kyc_PrimaryKey').val(res.data.id);
$('#entity_type').val(res.data.entity_type_id);
$('#kyc_tab').click();
var message = (PrimaryKey === '') ? 'Client General Info Created successfully' : 'Client General Info Updated successfully';
toastr.success(message, 'Success');
$.ajax({
url: '<?= base_url("client/kyc/list/"); ?>' + res.data.entity_type_id,

View File

@ -237,6 +237,9 @@ $(document).ready(function () {
if (isValid) {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var formData = new FormData($('#branch_form')[0]);
$.ajax({
@ -247,9 +250,21 @@ $(document).ready(function () {
processData: false,
contentType: false,
success: function(res) {
console.log(res);
var message = (branch_PrimaryKey === '') ? 'Client General Info Created successfully' : 'Client General Info Updated successfully';
toastr.success(message, 'Success');
if(res){
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
$('#add_branch').hide();
$('#branch_table').show();
$('.btnBack').hide();
$('#btnBranchAdd').show();
var message = (branch_PrimaryKey === '') ? 'Client Branch Created successfully' : 'Client Branch Updated successfully';
toastr.success(message, 'Success');
}, 1000);
}
$('#branch_list tr').remove();
var branchTableInsert = ''
$.each(res.data, function(index, item) {
@ -262,10 +277,7 @@ $(document).ready(function () {
`;
});
$('#branch_list').append(branchTableInsert);
$('#add_branch').hide();
$('#branch_table').show();
$('.btnBack').hide();
$('#btnBranchAdd').show();
},
error: function (xhr, status, error) {
console.error(xhr.responseText);

View File

@ -170,8 +170,6 @@
});
});
;
if(kycPrimaryKey !== ''){
$.ajax({
@ -205,8 +203,10 @@
}
});
var table = '';
var data = <?= isset($client_kyc) ? json_encode($client_kyc) : '[]' ?>;
console.log(data)
$('#other_docs tr').remove();
$.each(data, function(index, item) {
@ -223,14 +223,15 @@
});
$('#other_docs').append(table);
$.each(data, function(index, item) {
// console.log(item.kyc_doc_type_id);
// console.log('name_' + item.kyc_doc_type_id);
// console.log(document.getElementById('name_' + item.kyc_doc_type_id));
setTimeout(function() {
$('#name_'+item.kyc_doc_type_id).show();
$('#name_'+item.kyc_doc_type_id).html(item.file_name);
$('#form_'+item.kyc_doc_type_id).hide();
$('#name_'+item.id).show();
$('#name_'+item.id).html(item.file_name);
$('#form_'+item.id).hide();
}, 1000);
});

View File

@ -36,12 +36,15 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Client Onboarding</h4>
<h4 class="header-title" style="position: relative;">Client Onboarding <?php if(isset($client)) {echo ' - ' . $client['client_name']; } ?></h4>
</div>
<div class="col-6" style="text-align: right;">
<!-- <a href="<?= base_url("client/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a> -->
</div>
</div>
<br>
<ul class="nav nav-pills navtab-bg">
<li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"

View File

@ -1,5 +1,3 @@
<div class="tab-pane fade" id="police-tab">
@ -101,103 +99,101 @@
</div>
<!-- end -->
<!-- *************************************************** -->
<?php include('policy_grid.php'); ?>
<?php include('policy_gmc_terms.php'); ?>
<!-- *************************************************** -->
<?php include('policy_gpa_terms.php'); ?>
<script>
var policy_PrimaryKey = $('#client_id_policy').val();
var policy_client = $('#policy_PrimaryKey').val();
var policy_PrimaryKey = $('#client_id_policy').val();
var policy_client = $('#policy_PrimaryKey').val();
$(document).ready(function () {
$(document).ready(function () {
// Get today's date
var today = new Date();
// Get today's date
var today = new Date();
// Initialize Flatpickr for the start date with today's date
var startDatePicker = flatpickr("#start_date", {
dateFormat: "d-m-Y",
defaultDate: today,
allowInput: false,
onChange: function(selectedDates, dateStr, instance) {
var endDate = new Date(selectedDates[0]);
endDate.setFullYear(endDate.getFullYear() + 1);
endDatePicker.setDate(endDate);
}
});
// Calculate the end date (today + 1 year)
var endDate = new Date(today);
endDate.setFullYear(endDate.getFullYear() + 1);
// Initialize Flatpickr for the end date with the calculated end date
var endDatePicker = flatpickr("#end_date", {
dateFormat: "d-m-Y",
defaultDate: endDate,
allowInput: false
});
$('#add_form').hide();
$('.btnBack').hide();
$('.btnAdd').click(function(){
$('#add_form').show();
$('#table_list').hide();
$('.btnBack').show();
$('.btnAdd').hide();
$('#policy_form_action').val('<?= base_url("client/policy/create"); ?>');
})
$('.btnBack').click(function(){
$('#GMC').remove();
$('#GPA').remove();
$('#add_form').hide();
$('#table_list').show();
$('.btnBack').hide();
$('.btnAdd').show();
$('#insurer').val('');
$('#tpa').val('');
$('#start_date').val('');
$('#end_date').val('');
$('#policy').html('<option value="" selected>Select Policy</option>');
})
if (policy_PrimaryKey !== '') {
var policyTable = '';
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
data.forEach(function(item) {
policyTable += `
<tr>
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
<td>${item.policy_name}</td>
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
<td>
<a data-id="${item.id}" class="btnPolicyEdit mdi mdi-lead-pencil" href="#" style="font-size:18px;"></a>&nbsp;&nbsp;
<a data-id="${item.policy_id}" class="btnPolicyModel mdi mdi-book-open" href="#" data-toggle="modal" data-target="#bs-example-modal-lg" style="font-size:18px;"></a>
<a data-id="${item.policy_id}" class="btnPolicyMaster mdi mdi-wrench" href="#" data-toggle="modal" data-target="#bs-example-modal-sm" style="font-size:18px; margin-left: 7px;"></a>
</td>
</tr>
`;
// Initialize Flatpickr for the start date with today's date
var startDatePicker = flatpickr("#start_date", {
dateFormat: "d-m-Y",
defaultDate: today,
allowInput: false,
onChange: function(selectedDates, dateStr, instance) {
var endDate = new Date(selectedDates[0]);
endDate.setFullYear(endDate.getFullYear() + 1);
endDatePicker.setDate(endDate);
}
});
$('#policy_table').append(policyTable);
}
// Calculate the end date (today + 1 year)
var endDate = new Date(today);
endDate.setFullYear(endDate.getFullYear() + 1);
// Initialize Flatpickr for the end date with the calculated end date
var endDatePicker = flatpickr("#end_date", {
dateFormat: "d-m-Y",
defaultDate: endDate,
allowInput: false
});
});
$('#add_form').hide();
$('.btnBack').hide();
$('.btnAdd').click(function(){
$('#add_form').show();
$('#table_list').hide();
$('.btnBack').show();
$('.btnAdd').hide();
$('#policy_form_action').val('<?= base_url("client/policy/create"); ?>');
})
$('.btnBack').click(function(){
$('#GMC').remove();
$('#GPA').remove();
$('#add_form').hide();
$('#table_list').show();
$('.btnBack').hide();
$('.btnAdd').show();
$('#insurer').val('');
$('#tpa').val('');
$('#start_date').val('');
$('#end_date').val('');
$('#policy').html('<option value="" selected>Select Policy</option>');
})
if (policy_PrimaryKey !== '') {
var policyTable = '';
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
data.forEach(function(item) {
policyTable += `
<tr>
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
<td>${item.policy_name}</td>
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
<td>
<a data-id="${item.id}" class="btnPolicyEdit mdi mdi-lead-pencil" href="#" style="font-size:18px;"></a>&nbsp;&nbsp;
<a data-id="${item.policy_id}" class="btnPolicyModel mdi mdi-book-open" href="#" data-toggle="modal" data-target="#bs-example-modal-lg" style="font-size:18px;"></a>
<a data-id="${item.policy_id}" class="btnPolicyMaster mdi mdi-wrench" href="#" data-toggle="modal" data-target="${item.policy_type_id >= 2 ? '#bs-example-modal-sm' : '#bs-example-modal-sm_2'}" style="font-size:18px; margin-left: 7px;"></a>
</td>
</tr>
`;
});
$('#policy_table').append(policyTable);
}
});
//for form submit using AJAX
$("#policy_form").submit(function(event) {
@ -221,6 +217,9 @@ $(document).ready(function () {
return ;
}
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var formData = new FormData($('#policy_form')[0]);
var policy_form_action = $('#policy_form_action').val();
@ -238,9 +237,20 @@ $(document).ready(function () {
return;
}
console.log(res);
var message = (policy_PrimaryKey === '') ? 'Policy Created successfully' : 'Policy Updated Successfully';
toastr.success(message, 'Success');
if(res){
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
$('#add_form').hide();
$('#table_list').show();
$('.btnBack').hide();
$('.btnAdd').show();
var message = (policy_PrimaryKey === '') ? 'Policy Created successfully' : 'Policy Updated Successfully';
toastr.success(message, 'Success');
}, 1000);
}
$('#policy_table tr').remove();
var policyTable = '';
@ -253,15 +263,12 @@ $(document).ready(function () {
<td>
<a data-id="${item.id}" class="btnPolicyEdit mdi mdi-lead-pencil" href="#" style="font-size:18px;"></a>&nbsp;&nbsp;
<a data-id="${item.policy_id}" class="btnPolicyModel mdi mdi-book-open" href="#" data-toggle="modal" data-target="#bs-example-modal-lg" style="font-size:18px;"></a>
<a data-id="${item.policy_id}" class="btnPolicyMaster mdi mdi-wrench" href="#" data-toggle="modal" data-target="${item.policy_type_id >= 2 ? '#bs-example-modal-sm' : '#bs-example-modal-sm_2'}" style="font-size:18px; margin-left: 7px;"></a>
</td>
</tr>
`;
});
$('#policy_table').append(policyTable);
$('#add_form').hide();
$('#table_list').show();
$('.btnBack').hide();
$('.btnAdd').show();
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
@ -271,7 +278,7 @@ $(document).ready(function () {
});
//To get th POLICY base on Insurer
/********* To get th POLICY base on Insurer *******/
$('#insurer').change(function() {
var id = $(this).val();
var parts = id.split('-');
@ -326,7 +333,7 @@ $(document).ready(function () {
dataType: 'json',
success: function (res) {
console.log(res);
console.log('clientPolicy : ', res);
$('#policy_form_action').val('<?= base_url("client/policy/edit"); ?>');
@ -368,6 +375,7 @@ $(document).ready(function () {
});
});
function appendPolicyFormFields(policy_type, data = false){
var html = '';

View File

@ -115,6 +115,9 @@ $(document).ready(function(){
if (isValid) {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
if(relation_PrimaryKey === ''){
form_action = '<?= base_url("client/relation/create"); ?>';
}else{
@ -132,9 +135,18 @@ $(document).ready(function(){
contentType: false,
success: function(res) {
console.log(res);
var message = (relation_PrimaryKey === '') ? 'Client Relation Created successfully' : 'Client Relation Updated successfully';
toastr.success(message, 'Success');
$('#branch_tab').click();
if(res){
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
var message = (relation_PrimaryKey === '') ? 'Client Relation Created successfully' : 'Client Relation Updated successfully';
toastr.success(message, 'Success');
$('#branch_tab').click();
}, 1000);
}
},
error: function(xhr, status, error) {
console.error(xhr.responseText);

View File

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

View File

@ -36,7 +36,7 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">KYC Entity Type Onboarding</h4>
<h4 class="header-title" style="position: relative;">KYC Entity Type</h4>
</div>
<!-- <div class="col-6" style="text-align: right;">
<a href="<?= base_url("master/kyc/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a>

View File

@ -0,0 +1,507 @@
<!-- 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: 690px !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 class="modal fade" id="bs-example-modal-sm_2" 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 Terms</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="policyGPATerms" 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="gpa_policy_id"/>
<div class="form-group">
<div class="form-column">
<div class="form-group col-md-6 form-group-client-policy-master">
<label for="sumInsured" class=" " style="width: 400px;">Sum Insured</label>
<input type="text" name="sumInsured2" id="sumInsured" class="form-control form-control-client-policy-master">
</div>
<div class="form-group col-md-6 form-group-client-policy-master">
<label for="totalSumInsured" class=" " style="width: 400px;">Total Sum Insured</label>
<input type="text" name="totalSumInsured" id="totalSumInsured" 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 class="form-check-label " for="corporatebuffer" style="width: 400px;">Accidental Death Benefit</label>
<div class="radiobuttondiv">
<input type="radio" name="accidentalDeathBenefit" value="1"> Yes
<input type="radio" name="accidentalDeathBenefit" value="0" style="margin-left:10px" checked> No
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<label for="permanentTotalDisablement" class=" " style="width: 400px;">Permanent Total Disablement</label>
<input type="text" name="permanentTotalDisablement" id="permanentTotalDisablement" 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="permanentPartialDisablement" class=" " style="width: 400px;">Permanent Partial Disablement</label>
<input type="text" name="permanentPartialDisablement" id="permanentPartialDisablement" 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="temporaryTotalDisablementBenefit" class=" " style="width: 400px;">Temporary Total Disablement benefit</label>
<input type="text" name="temporaryTotalDisablementBenefit" id="temporaryTotalDisablementBenefit" class="form-control form-control-client-policy-master">
</div>
<div class="form-group col-md-6 form-group-client-policy-master">
<label for="accidentalHospitalizationExpenses" class=" " style="width: 400px;">Accidental Hospitalization Expenses</label>
<select name="accidentalHospitalizationExpenses" id="accidentalHospitalizationExpenses" class="form-control form-control-client-policy-master">
<option value="">Select an option</option>
<option value="No">No</option>
<option value="10%-40%">Covered upto 10% of SI or 40% of actual which ever is less</option>
<option value="20%-50%">Covered upto 20% of SI or 50% of actual which ever is less</option>
<option value="50K-500k">INR 50K, to vary in multiples of 25K till 5 Lacs</option>
</select>
</div>
<div class="form-group col-md-6 form-group-client-policy-master">
<label for="childrenEducationWelfareFund" class=" " style="width: 400px;">Children Education Welfare Fund</label>
<select name="childrenEducationWelfareFund" id="childrenEducationWelfareFund" class="form-control form-control-client-policy-master">
<option value="">Select an option</option>
<option value="No">No</option>
<option value="10000">Covered upto 10,000/­ per child ( Restricted to 2 children)</option>
<option value="5000">Covered upto 5,000/­ per child ( Restricted to 2 children)</option>
</select>
</div>
<div class="form-group col-md-6 form-group-client-policy-master">
<label class="form-check-label " for="compassionateVisitExpenses" style="width: 400px;">Compassionate Visit Expenses</label>
<div class="radiobuttondiv">
<input type="radio" name="compassionateVisitExpenses" value="1"> Yes
<input type="radio" name="compassionateVisitExpenses" value="0" style="margin-left:10px" checked> No
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<label for="compassionateVisitExpensesData" class=" " style="width: 400px; ">Compassionate Visit Expenses Data</label>
<input type="text" name="compassionateVisitExpensesData" id="compassionateVisitExpensesData" 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="brokenBoneExpenses" style="width: 400px;">Broken Bone Expenses</label>
<div class="radiobuttondiv">
<input type="radio" name="brokenBoneExpenses" value="1"> Yes
<input type="radio" name="brokenBoneExpenses" value="0" style="margin-left:10px" checked> No
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<label for="brokenBoneExpensesData" class=" " style="width: 400px; ">Broken Bone Expenses Data</label>
<input type="text" name="brokenBoneExpensesData" id="brokenBoneExpensesData" 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="ambulanceCharges" style="width: 400px;">Ambulance charges</label>
<div class="radiobuttondiv">
<input type="radio" name="ambulanceCharges" value="1"> Yes
<input type="radio" name="ambulanceCharges" value="0" style="margin-left:10px" checked> No
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<label for="ambulanceChargesData" class=" " style="width: 400px; ">Ambulance charges Data</label>
<input type="text" name="ambulanceChargesData" id="ambulanceChargesData" 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="burnExpenses" style="width: 400px;">Burn Expenses</label>
<div class="radiobuttondiv">
<input type="radio" name="burnExpenses" value="1"> Yes
<input type="radio" name="burnExpenses" value="0" style="margin-left:10px" checked> No
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<label for="burnExpensesData" class=" " style="width: 400px; ">Burn Expenses Data</label>
<input type="text" name="burnExpensesData" id="burnExpensesData" 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="carriageOfDeadBody" style="width: 400px;">Carriage of Dead Body</label>
<div class="radiobuttondiv">
<input type="radio" name="carriageOfDeadBody" value="1"> Yes
<input type="radio" name="carriageOfDeadBody" value="0" style="margin-left:10px" checked> No
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<label for="carriageOfDeadBodyData" class=" " style="width: 400px; ">Carriage of Dead Body Data</label>
<input type="text" name="carriageOfDeadBodyData" id="carriageOfDeadBodyData" 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="animalSnakeInsectBite" style="width: 400px;">Animal/Snake/Insect bite</label>
<div class="radiobuttondiv">
<input type="radio" name="animalSnakeInsectBite" value="1"> Yes
<input type="radio" name="animalSnakeInsectBite" value="0" style="margin-left:10px" checked> No
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master">
<label class="form-check-label" for="terrorism" style="width: 400px;">Terrorism</label>
<div class="radiobuttondiv">
<input type="radio" name="terrorism" value="1"> Yes
<input type="radio" name="terrorism" value="0" style="margin-left:10px" checked> No
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master">
<label for="worldwideCover" class=" " style="width: 400px;">Worldwide Cover</label>
<div class="radiobuttondiv">
<input type="radio" name="worldwideCover" value="1"> Yes
<input type="radio" name="worldwideCover" value="0" style="margin-left:10px" checked> No
</div>
</div>
</div>
</div>
<div class="form-group text-right m-b-0" style="margin-top: -49px;">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnGridSubmit" style="margin-top: 100px;">Submit</button>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
var policy_grid_id = $('#client_id').val();
var grid_html = '';
$('#gmc_remove').hide();
$('#btnGridSubmit').hide();
$('.close').click(function(){
});
$('input[name="burnExpenses"]').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="compassionateVisitExpenses"]').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="carriageOfDeadBody"]').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="ambulanceCharges"]').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="brokenBoneExpenses"]').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");
}
});
$("#policyGPATerms").submit(function(event) {
event.preventDefault();
var isValid = $('#policyGPATerms').parsley().validate();
console.log('isvalid', isValid);
if (!isValid) {
console.log('Form is Empty', 'Warning');
return ;
}
var formData = new FormData($('#policyGPATerms')[0]);
var policy_form_action = '<?= base_url("client/terms/gpa_create") ?>';
$.ajax({
data: formData,
url: policy_form_action,
type: "POST",
dataType: 'json',
processData: false,
contentType: false,
success: function(res) {
console.log(res);
if (res.status === false) {
toastr.error('Policy Dose Not Create', 'Error');
return;
}
var message = (policy_PrimaryKey === '') ? 'Policy Terms Added successfully' : 'Policy Terms Updated Successfully';
toastr.success(res.message, 'Success');
$('.close').click();
},
error: function(xhr, status, error) {
$('.close').click();
console.error(xhr.responseText);
console.error(status, error);
}
});
});
$('body').on('click', '.btnPolicyMaster', function () {
var policy_id = $(this).data('id');
// console.log('policy_id :' ,policy_id);
$('#gpa_policy_id').val(policy_id);
var client_id = $('#Client_id').val();
$('#client_policy_id').val(policy_id);
$.ajax({
url: '<?= base_url("client/policy/getjson") ?>',
method: 'GET',
data: { policy_id : policy_id , client_id: client_id},
success: function(response) {
console.log(response);
if (response) {
let jsonObject = JSON.parse(response);
if(jsonObject.compassionateVisitExpenses == '1'){
console.log(true)
var element = $('input[name="compassionateVisitExpenses"]').parent().parent().next()[0];
console.log(element)
$(element).css("display", "");
}
if(jsonObject.brokenBoneExpenses == '1'){
var element = $('input[name="brokenBoneExpenses"]').parent().parent().next()[0];
console.log(element)
$(element).css("display", "");
}
if(jsonObject.ambulanceCharges == '1'){
var element = $('input[name="ambulanceCharges"]').parent().parent().next()[0];
console.log(element)
$(element).css("display", "");
}
if(jsonObject.burnExpenses == '1'){
var element = $('input[name="burnExpenses"]').parent().parent().next()[0];
console.log(element)
$(element).css("display", "");
}
if(jsonObject.carriageOfDeadBody == '1'){
var element = $('input[name="carriageOfDeadBody"]').parent().parent().next()[0];
console.log(element)
$(element).css("display", "");
}
Object.keys(jsonObject).forEach(function(key) {
console.log(key);
let elements = document.getElementsByName(key);
if (elements && elements.length > 0) {
let element = elements[0];
if (element.tagName === 'INPUT' && (element.type === 'checkbox' || element.type === 'radio')) {
if (element.type === 'checkbox') {
element.checked = jsonObject[key] === '1';
} else if (element.type === 'radio') {
element.checked = element.value === jsonObject[key];
}
}else {
element.value = jsonObject[key];
}
}
});
}
},
error: function(xhr, status, error) {
console.error('Error:', status, error);
}
});
});
</script>
<script>
$(document).ready(function() {
var editor = new Jodit('#additionalsicknessbenefit', {
buttons: 'bold,italic,underline,|,align',
});
var editor = new Jodit('#Wellness', {
buttons: 'bold,italic,underline,|,align',
});
});
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">
<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>
<input type="text" name="specialConditionInput[]" id="specialConditionInput[]" class="form-control form-control-client-policy-masters specialConditionInput[]">
</div>`;
$('.form-column').each(function() {
$(this).append(appendElement);
});
}
else{
}
}
$(document).on('click', '.specialConditionClose', function() {
$(this)[0].parentNode.parentNode.remove();
});
</script>

View File

@ -36,7 +36,7 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Policy Type Onboarding</h4>
<h4 class="header-title" style="position: relative;">Policy Type</h4>
</div>
<!-- <div class="col-6" style="text-align: right;">
<a href="<?= base_url("master/policy/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a>

View File

@ -36,7 +36,7 @@ body {
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">TPA Onboarding</h4>
<h4 class="header-title" style="position: relative;">TPA</h4>
</div>
<!-- <div class="col-6" style="text-align: right;">
<a href="<?= base_url("master/tpa/list"); ?>" class="btn btn-primary waves-effect waves-light">Back</a>