MERGE_CLIENt_ONBOARD_ISSUE
This commit is contained in:
commit
c775e30280
@ -105,7 +105,6 @@ $routes->post('save_deposit', 'ClientController::saveDeposit');
|
||||
$routes->post("gpa_create", "ClientController::policyGPATerms");
|
||||
$routes->post("edit", "ClientController::editClientPolicyPremium");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -140,7 +139,6 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
||||
$routes->get("list/(:any)", "MasterController::insurerBranchList/$1");
|
||||
$routes->get("remove/(:any)", "MasterController::removeInsurerBranch/$1");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$routes->group("tpa", ["filter" => "authMVC"], function ($routes) {
|
||||
@ -177,7 +175,6 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
||||
// $routes->get("list", "MasterController::tpaBranchList");
|
||||
$routes->get("list/(:any)", "MasterController::kycDocsList/$1");
|
||||
$routes->get("remove/(:any)", "MasterController::removeKYCDocs/$1");
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@ -198,7 +195,6 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
||||
$routes->get("list/(:any)", "MasterController::policesList/$1");
|
||||
$routes->get("remove/(:any)", "MasterController::removePolicyPolicies/$1");
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@ -273,8 +269,6 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
||||
$routes->get("exportCashDepositData", "EmployeeRestController::exportCashDepositData");
|
||||
|
||||
$routes->get("removeEmpAndEmpPolicyData", "EmployeeRestController::removeEmpAndEmpPolicyData");
|
||||
|
||||
|
||||
});
|
||||
|
||||
$routes->post("sendEmail", "EmployeeRestController::send_email");
|
||||
|
||||
@ -573,6 +573,9 @@ class ClientController extends AdminController
|
||||
public function createClientPolicy()
|
||||
{
|
||||
|
||||
// print_r($this->request->getPost()); die;
|
||||
|
||||
|
||||
$this->myLogger->logme('error','Client policy CREATE function called');
|
||||
|
||||
$insurerValue = (string) $this->request->getPost('insurer');
|
||||
@ -607,6 +610,8 @@ class ClientController extends AdminController
|
||||
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||
$data['policy_status'] = 1;
|
||||
|
||||
|
||||
|
||||
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
|
||||
|
||||
if ( $this->request->getPost('is_addon') == 2 || $this->request->getPost('is_addon') == 3) {
|
||||
@ -992,7 +997,10 @@ class ClientController extends AdminController
|
||||
{
|
||||
$this->myLogger->logme('error','getPolicesByInsurerId function called');
|
||||
if($id){
|
||||
$police_data = $this->policesModel->where(['insurer_id' => $id, 'is_active' => 1])->findAll();
|
||||
$police_data = $this->policesModel
|
||||
->select('policies.*, policy_type.policy_type')
|
||||
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||
->where(['insurer_id' => $id, 'policies.is_active' => 1])->findAll();
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $police_data], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||
|
||||
@ -970,6 +970,7 @@ class EmployeeRestController extends AdminController
|
||||
// $message = 'Dear ' . $dataToInsert[$a]['name'] . ",<br> We are glad to welcome you to the employee benefit program ," .$policy_name['name'] ."offered by your employer, <br><br><br> Click on the link below to review your personal and family details:<br><a href='https://venbait.in/nhance/app/dev'>Review Details</a>" ;
|
||||
$data['employee_name']=$dataToInsert[$a]['name'];
|
||||
$data['policy_name']=$policy['name'];
|
||||
$data['App_Url'] = $_ENV['App_Url'];
|
||||
|
||||
$message = view('mail_welcome', $data);
|
||||
|
||||
|
||||
@ -56,10 +56,10 @@ class ClientModel extends Model
|
||||
|
||||
return $this->db->table('clients')
|
||||
->select('clients.*')
|
||||
->where('is_active', 1)
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -276,17 +276,18 @@ public function updateStatus(){
|
||||
|
||||
public function getpolicyWithPattern($client_id){
|
||||
|
||||
$query = "
|
||||
SELECT client_policy.*, policies.name, policies.policy_type_id
|
||||
FROM client_policy
|
||||
JOIN policies ON policies.id = client_policy.policy_id
|
||||
JOIN policy_type ON policy_type.id = policies.policy_type_id
|
||||
WHERE policy_type.policy_type = 'GMC'
|
||||
AND client_policy.client_id = {$client_id}";
|
||||
$query = $this->db->table('client_policy')
|
||||
->select('client_policy.*, policies.name, policies.policy_type_id, policy_type.policy_type')
|
||||
->join('policies', 'policies.id = client_policy.policy_id')
|
||||
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||
// ->where('policy_type.policy_type', 'GMC')
|
||||
->whereIn('policy_type.id', [2, 3])
|
||||
->where('client_policy.client_id', $client_id)
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
$result = $this->db->query($query)->getResult();
|
||||
|
||||
return $result;
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function getTopUpPolicy($client_id, $type){
|
||||
|
||||
@ -399,11 +399,11 @@
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
if (xhr.status === 404) {
|
||||
toastr.warning('Resource not found', 'Warning');
|
||||
console.log('Resource not found', 'Warning');
|
||||
} else if (xhr.status === 500) {
|
||||
toastr.warning('Internal server error', 'Warning');
|
||||
console.log('Internal server error', 'Warning');
|
||||
} else {
|
||||
toastr.warning('Unknown error occurred', 'Warning');
|
||||
console.log('Unknown error occurred', 'Warning');
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
@ -418,6 +418,11 @@
|
||||
var secondPart = parts[1];
|
||||
var url = "<?= base_url("util/police-by-insurer/") ?>" + secondPart;
|
||||
|
||||
var selectedOption = $('#base_policy').find(':selected');
|
||||
var base_policy_data_id = selectedOption.data('id');
|
||||
console.log('base_policy_data_id', base_policy_data_id);
|
||||
|
||||
|
||||
$.get(url, function(res) {
|
||||
// res = JSON.parse(res)//
|
||||
// console.log(res)
|
||||
@ -427,29 +432,46 @@
|
||||
$.each(res.data, function(index, item) {
|
||||
|
||||
if ($policy_type_value == 3) {
|
||||
if (item.policy_type_id == 5 || item.policy_type_id == 3) {
|
||||
|
||||
if (base_policy_data_id == 3) {
|
||||
|
||||
if (item.policy_type_id == 5) {
|
||||
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||
item.id +
|
||||
'">' + item.name + '</option>';
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
}
|
||||
} else if ($policy_type_value == 2) {
|
||||
if (item.policy_type_id == 4) {
|
||||
|
||||
} else {
|
||||
|
||||
if (item.policy_type_id == 5 || item.policy_type_id == 3) {
|
||||
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||
item.id +
|
||||
'">' + item.name + '</option>';
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else if ($policy_type_value == 2) {
|
||||
if (item.policy_type_id == 4 || item.policy_type_id == 5) {
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||
item.id +
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
}
|
||||
} else if ($policy_type_value == 1) {
|
||||
if (item.policy_type_id == 1 || item.policy_type_id == 2) {
|
||||
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||
item.id +
|
||||
'">' + item.name + '</option>';
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
}
|
||||
} else {
|
||||
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||
item.id +
|
||||
'">' + item.name + '</option>';
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
}
|
||||
});
|
||||
|
||||
@ -553,11 +575,35 @@
|
||||
}
|
||||
|
||||
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
||||
$('#insurer').prop('disabled', true);
|
||||
$('#tpa').prop('disabled', true);
|
||||
$("#insurer").next(".select2-container").css({
|
||||
'pointer-events': 'none',
|
||||
});
|
||||
$('#select2-insurer-container').css({
|
||||
'background-color': '#ebebe0',
|
||||
});
|
||||
|
||||
$("#tpa").next(".select2-container").css({
|
||||
'pointer-events': 'none',
|
||||
});
|
||||
$('#select2-tpa-container').css({
|
||||
'background-color': '#ebebe0',
|
||||
});
|
||||
|
||||
} else {
|
||||
$('#insurer').prop('disabled', false);
|
||||
$('#tpa').prop('disabled', false);
|
||||
|
||||
$("#insurer").next(".select2-container").css({
|
||||
'pointer-events': 'auto',
|
||||
});
|
||||
$('#select2-insurer-container').css({
|
||||
'background-color': 'transparent',
|
||||
});
|
||||
|
||||
$("#tpa").next(".select2-container").css({
|
||||
'pointer-events': 'auto',
|
||||
});
|
||||
$('#select2-tpa-container').css({
|
||||
'background-color': 'transparent',
|
||||
});
|
||||
}
|
||||
|
||||
var policeOptionHTML = '';
|
||||
@ -672,11 +718,11 @@
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
if (xhr.status === 404) {
|
||||
toastr.warning('Resource not found', 'Warning');
|
||||
console.log('Resource not found', 'Warning');
|
||||
} else if (xhr.status === 500) {
|
||||
toastr.warning('Internal server error', 'Warning');
|
||||
console.log('Internal server error', 'Warning');
|
||||
} else {
|
||||
toastr.warning('Unknown error occurred', 'Warning');
|
||||
console.log('Unknown error occurred', 'Warning');
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
@ -1044,11 +1090,35 @@
|
||||
$('#base_policy').val('').change();
|
||||
|
||||
if ($(this).val() == 2 || $(this).val() == 3) {
|
||||
$('#insurer').prop('disabled', true);
|
||||
$('#tpa').prop('disabled', true);
|
||||
|
||||
$("#insurer").next(".select2-container").css({
|
||||
'pointer-events': 'none',
|
||||
});
|
||||
$('#select2-insurer-container').css({
|
||||
'background-color': '#ebebe0',
|
||||
});
|
||||
|
||||
$("#tpa").next(".select2-container").css({
|
||||
'pointer-events': 'none',
|
||||
});
|
||||
$('#select2-tpa-container').css({
|
||||
'background-color': '#ebebe0',
|
||||
});
|
||||
} else {
|
||||
$('#insurer').prop('disabled', false);
|
||||
$('#tpa').prop('disabled', false);
|
||||
|
||||
$("#insurer").next(".select2-container").css({
|
||||
'pointer-events': 'auto',
|
||||
});
|
||||
$('#select2-insurer-container').css({
|
||||
'background-color': 'transparent',
|
||||
});
|
||||
|
||||
$("#tpa").next(".select2-container").css({
|
||||
'pointer-events': 'auto',
|
||||
});
|
||||
$('#select2-tpa-container').css({
|
||||
'background-color': 'transparent',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -1107,7 +1177,8 @@
|
||||
OptionsHTML += '<option value="" selected>Select Base Policy</option>';
|
||||
$.each(res.data, function(index, item) {
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id +
|
||||
'">' + item.name + '</option>';
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
|
||||
});
|
||||
$('#base_policy').html(OptionsHTML);
|
||||
},
|
||||
@ -1176,6 +1247,8 @@
|
||||
// if (item.policy_type_id == 5) {
|
||||
console.log(item);
|
||||
|
||||
|
||||
|
||||
policeOptionHTML += '<option data-id="' + item.policy_type_id +
|
||||
'" value="' + item.id + '" ' + (res.data.policy_id === item.id ?
|
||||
'selected="selected"' : '') + '>' + item.name + '</option>';
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<p class="rad" style="margin: 0!important; text-align: center!important; font-size: 18px!important;">We are glad to welcome you to the employee benefit program, <?= isset($policy_name) ? $policy_name : '' ?> offered by your employer.</p>
|
||||
</div>
|
||||
<button class="explore" style="padding: 15px 25px; background: linear-gradient(to right, #0267C1, #0280EF); border-radius: 50px; border: 0; color: #fff; transition: all .2s ease-in-out; cursor: pointer; box-shadow: 0 5px 10px rgba(0, 0, 0, .1); margin-bottom: 15px;">
|
||||
<a href="https://venbait.in/nhance/app/dev" style="text-decoration: none; color: #fff;">Review Details</a>
|
||||
<a href="<?= $App_Url; ?>" style="text-decoration: none; color: #fff;">Review Details</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user