CHANGE_NOTIFICATION_CHECKS_GMS_EDIT_AGE_ISSUE : AADHAVAN

This commit is contained in:
aadhavan valli 2024-05-15 16:28:22 +05:30
parent 96167760c0
commit c509399f91
7 changed files with 102 additions and 77 deletions

View File

@ -168,6 +168,8 @@ class ClientController extends AdminController
// echo "<pre>";
// print_r($data); die;
$data['placeHolders'] = ['member_name','nhance_logo','tpa_id','ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'client_name'];
echo view('layout/header', $headerData);
echo view('client_onboarding', $data);
@ -1241,19 +1243,19 @@ class ClientController extends AdminController
$client_policy_id = $this->request->getPost("client_policy_id");
$data['sum_insured'] =str_replace(',', '',$this->request->getPost("sum_insured"));
$data['family_floater'] =$this->request->getPost("family_floater");
$data['corporatebuffer'] = $this->request->getPost("corporatebuffer");
$data['family_floater'] =$this->request->getPost("family_floater") ? $this->request->getPost("family_floater") : 0;
$data['corporatebuffer'] = $this->request->getPost("corporatebuffer") ? $this->request->getPost("corporatebuffer") : 0;
$data['family_floaters'] = $this->request->getPost("family_floaters") ?? [];
// print_r($this->request->getPost());die;
$data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age");
$data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age");
$data['age_ratio']['spouse']['min'] = $this->request->getPost("spouse_min_age");
$data['age_ratio']['spouse']['max'] = $this->request->getPost("spouse_max_age");
$data['age_ratio']['child']['min'] = $this->request->getPost("child_min_age");
$data['age_ratio']['child']['max'] = $this->request->getPost("child_max_age");
$data['age_ratio']['elders']['min'] = $this->request->getPost("other_member_min_age");
$data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_max_age");
$data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age") ? $this->request->getPost("self_min_age") :0;
$data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age") ? $this->request->getPost("self_max_age") : 0;
$data['age_ratio']['spouse']['min'] = $this->request->getPost("spouse_min_age") ? $this->request->getPost("spouse_min_age") : 0;
$data['age_ratio']['spouse']['max'] = $this->request->getPost("spouse_max_age") ? $this->request->getPost("spouse_max_age") : 0;
$data['age_ratio']['child']['min'] = $this->request->getPost("child_min_age") ? $this->request->getPost("child_min_age") : 0;
$data['age_ratio']['child']['max'] = $this->request->getPost("child_max_age") ? $this->request->getPost("child_max_age") : 0;
$data['age_ratio']['elders']['min'] = $this->request->getPost("other_member_min_age") ? $this->request->getPost("other_member_min_age") :0;
$data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_min_age") ? $this->request->getPost("other_member_min_age") : 0;
@ -1327,7 +1329,7 @@ class ClientController extends AdminController
}
}
$data['family_floaters']['elders_count'] =$this->request->getPost("member_count");
$data['family_floaters']['elders_count'] =$this->request->getPost("member_count") ? $this->request->getPost("member_count") : 0;
$data['waiverofpreexistingdiseases'] =$this->request->getPost("waiverofpreexistingdiseases");
if ($data['waiverofpreexistingdiseases'] == 1) {

View File

@ -1954,29 +1954,30 @@ class EmpDataServiceController extends BaseController
$client_data = $this->clientModel->where('id',$get_emp_email_and_other_details['client_id'])->first();
$notification = $this->notificationModel->where('client_id',$get_emp_email_and_other_details['client_id'])->where('template_name','member_ecard_mail')->first();
if ($get_emp_email_and_other_details != null && $get_emp_email_and_other_details != "" && $notification['enabled'] == 1) {
$rand_string = $get_emp_email_and_other_details['rand_string'];
$tpa_id = $get_emp_email_and_other_details['tpa_id'];
$params['rand_string'] = $rand_string;
$params['tpa_id'] = $tpa_id;
$params['notification'] = $notification;
$params['client_data'] = $client_data;
$params['notification'] = $notification;
$params['notification'] = $notification;
$params['get_emp_email_and_other_details'] = $get_emp_email_and_other_details;
$wholeData = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
$count++;
if($count == 20 || $count == count($ids)-1){
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $wholeData]);
$wholeData = [];
$count = 0;
}
}
if ($get_emp_email_and_other_details != null && $get_emp_email_and_other_details != "" && $notification['enabled'] == 1) {
$rand_string = $get_emp_email_and_other_details['rand_string'];
$tpa_id = $get_emp_email_and_other_details['tpa_id'];
$params['rand_string'] = $rand_string;
$params['tpa_id'] = $tpa_id;
$params['notification'] = $notification;
$params['client_data'] = $client_data;
$params['notification'] = $notification;
$params['notification'] = $notification;
$params['get_emp_email_and_other_details'] = $get_emp_email_and_other_details;
$wholeData = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
$count++;
if($count == 20 || $count == count($ids)-1){
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $wholeData]);
$wholeData = [];
$count = 0;
}
}
}
return true; // Email(s) sent successfully
} catch (\Exception $e) {

View File

@ -618,7 +618,6 @@ class EmployeeRestController extends AdminController
$client_data = $this->clientModel->where('id', $client_id)->first();
$notification = $this->notificationModel->where('client_id',$client_id)->where('template_name','member_welcome_mail')->first();
$jwt = $this->request->getHeader('Authorization');
$jwtParts = explode(' ', $jwt);
@ -874,8 +873,9 @@ class EmployeeRestController extends AdminController
$emp_policy = $this->employeePolicyModel->insert($emp_policy_data);
}
$notification = $this->notificationModel->where('client_id',$client_id)->where('template_name','member_welcome_mail')->first();
if ($notification['enabled'] == 1) {
if (isset($notification) && $notification['enabled'] == 1) {
//trigger
if ($dataToInsert[$a]['relationship'] == 'Self') {
@ -900,7 +900,6 @@ class EmployeeRestController extends AdminController
// if ($dataToInsert[$a]['email_corporate'] != null || $dataToInsert[$a]['email_corporate'] != '' && $dataToInsert[$a]['relationship'] == 'Self') {
}
}
return $this->respond(['status' => 'success', 'code' => 200, 'message' => "Success" ], 200);
}else{
@ -1650,26 +1649,33 @@ public function iAgreeForAddOn()
$find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
$array_list[] = $find;
}
$params ['array_list'] = $array_list;
$params ['client_policy_id'] = $client_policy_id;
$params ['emp_code'] = $emp_code;
$params ['client_id'] = $client_id;
$wholeData =sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
MailHelper::send_email($wholeData[0]);
$notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();
if (isset($wholeData[0])) {
$account_manager_wholeData =sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
foreach ($account_manager_wholeData as $key => $value) {
MailHelper::send_email($value);
}
if (isset($notification) && $notification['enabled'] == 1) {
$params ['array_list'] = $array_list;
$params ['client_policy_id'] = $client_policy_id;
$params ['emp_code'] = $emp_code;
$params ['client_id'] = $client_id;
$params ['notification'] = $notification;
$client_hr_wholeData =sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
$wholeData =sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
MailHelper::send_email($wholeData[0]);
foreach ($client_hr_wholeData as $key => $value) {
MailHelper::send_email($value);
if (isset($wholeData[0])) {
$account_manager_wholeData =sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
foreach ($account_manager_wholeData as $key => $value) {
MailHelper::send_email($value);
}
$client_hr_wholeData =sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
foreach ($client_hr_wholeData as $key => $value) {
MailHelper::send_email($value);
}
}
}

View File

@ -58,7 +58,6 @@ class MailHelper
}
}
public static function bulk_mail(array $mails = [])
{
// print_r();die;
@ -78,6 +77,5 @@ class MailHelper
}
}
}
?>

View File

@ -201,11 +201,11 @@ body {
if(check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0){
$('#btnBranchAdd').hide();
$('#notification-tab').hide();
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
}else{
if ($('#btnBranchBack')[0].style.display == 'none') {
$('#btnBranchAdd').show();
if ($('#notification-tab')[0].style.display == 'none') {
$('#notification-tab').show();
}
}
@ -236,10 +236,10 @@ body {
client_branch_contact();
});
// document.getElementById("notification_tab").addEventListener("click", function(event) {
// event.preventDefault();
// client_notification();
// });
document.getElementById("notification_tab").addEventListener("click", function(event) {
event.preventDefault();
client_notification();
});
</script>

View File

@ -25,6 +25,7 @@
$member_review_and_summary_mail = 0;
$account_maneger_summary_mail = 0;
$client_hr_summary_mail = 0;
if(isset($notification)){
foreach($notification as $value){
if ($value['template_name'] == 'member_welcome_mail') {
@ -50,6 +51,7 @@
if ($value['template_name'] == 'client_hr_summary_mail') {
$client_hr_summary_mail = $value['enabled'];
}
}
}
?></p>
</div>
@ -57,15 +59,15 @@
<div class="form-row">
<div class="form-group col-md-6">
<label for="branch_name">Nhance team mail ID's<span class="text-danger">*</span></label>
<textarea name="" id="nhance_team_mail_ids" class="form-control" placeholder="Example: jhon@gmail.com, dave@gmail.com"><?php echo $client['common_mails'] ?></textarea>
<textarea name="" id="nhance_team_mail_ids" class="form-control" placeholder="Example: jhon@gmail.com, dave@gmail.com"><?php echo isset($client['common_mails']) ? $client['common_mails'] : ''; ?></textarea>
</div>
<div class="form-group col-md-6">
<label for="branch_name">HR mail ID's<span class="text-danger">*</span></label>
<textarea name="" id="hr_mail_id" class="form-control" placeholder="Example: jhon@gmail.com, dave@gmail.com"><?php echo $client['hr_mails'] ?></textarea>
<textarea name="" id="hr_mail_id" class="form-control" placeholder="Example: jhon@gmail.com, dave@gmail.com"><?php echo isset($client['hr_mails']) ? $client['hr_mails'] : ''; ?></textarea>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-5">
<div class="form-group col-md-6">
<label for="branch_name">Member welcome mail</label>
<label class="switch">
<input id="member_welcome_mail_btn" type="checkbox" name="member_welcome_mail_btn" <?= ($member_welcome_mail == 1) ? 'checked' : '' ?>>
@ -81,8 +83,8 @@
</div>
<div class="form-row">
<div class="form-group col-md-5">
<label for="branch_name">Member remider mail</label>
<div class="form-group col-md-6">
<label for="branch_name">Member reminder mail</label>
<label class="switch">
<input id="member_reminder_mail_btn" type="checkbox" name="member_reminder_mail_btn" <?= $member_reminder_mail == 1 ? 'checked' : '' ?>>
<span class="slider round" style="height: 27px;"></span>
@ -96,7 +98,7 @@
</div>
<div class="form-row">
<div class="form-group col-md-5">
<div class="form-group col-md-6">
<label for="branch_name">Member ECard mail</label>
<label class="switch">
<input id="member_ecard_mail_btn" type="checkbox" name="member_ecard_mail_btn" <?= $member_ecard_mail == 1 ? 'checked' : '' ?>>
@ -111,7 +113,7 @@
</div>
<div class="form-row">
<div class="form-group col-md-5">
<div class="form-group col-md-6">
<label for="branch_name">Member Review and summary mail</label>
<label class="switch">
<input id="member_review_and_summary_mail_btn" type="checkbox" name="member_review_and_summary_mail_btn" <?= $member_review_and_summary_mail == 1 ? 'checked' : '' ?>>
@ -126,7 +128,7 @@
</div>
<div class="form-row">
<div class="form-group col-md-5">
<div class="form-group col-md-6">
<label for="branch_name">Account Maneger summary mail</label>
<label class="switch">
<input id="account_maneger_summary_mail_btn" type="checkbox" name="account_maneger_summary_mail_btn" <?= $account_maneger_summary_mail ? 'checked' : '' ?>>
@ -141,7 +143,7 @@
</div>
<div class="form-row">
<div class="form-group col-md-5">
<div class="form-group col-md-6">
<label for="branch_name">Client HR summary mail</label>
<label class="switch">
<input id="client_hr_summary_mail_btn" type="checkbox" name="client_hr_summary_mail_btn" <?= $client_hr_summary_mail == 1 ? 'checked' : '' ?>>
@ -210,7 +212,7 @@
<div class="form-group col-md-12">
<select id="member_welcome_mail_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
<option value="">PlaceHolders</option>
<?php foreach ($placeHolders as $value): ?>
<?php foreach ($placeHolders as $value): ?>
<?php if($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){ ?>
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
<option value="[[<?php echo $value; ?>]]"><?php echo $valueChange; ?></option>
@ -265,7 +267,7 @@
<label for="emp_code">Template Name</label>
</div>
<div class="form-group col-md-5">
<input type="text" id="template_name" name="template_name" class="form-control" value="Member Remider Mail" readonly placeholder="Template Name">
<input type="text" id="template_name" name="template_name" class="form-control" value="Member Reminder Mail" readonly placeholder="Template Name">
</div>
</div>
@ -293,7 +295,7 @@
<div class="form-group col-md-12">
<select id="member_reminder_mail_modal_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
<option value="">PlaceHolders</option>
<?php foreach ($placeHolders as $value): ?>
<?php foreach ($placeHolders as $value): ?>
<?php if($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){ ?>
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
<option value="[[<?php echo $value; ?>]]"><?php echo $valueChange; ?></option>

View File

@ -136,13 +136,13 @@
<tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Self:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;" name="family_floaters[]" value="self" id="self" checked> </td>
<td style="width: 28%;" ><div class="self-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($self_min_age) ? $self_min_age : '18'; ?>" style="width: 25%;;" type="number" name="self_min_age" id="self_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="self-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo (isset($self_min_age) && $self_min_age > 0) ? $self_min_age : '18'; ?>" style="width: 25%;;" type="number" name="self_min_age" id="self_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="self-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>" style="width: 25%;;" type="number" name="self_max_age" id="self_max_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Spouse:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;"name="family_floaters[]" value="spouse" id="spouse"></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($spouse_min_age) ? $spouse_min_age : '18'; ?>" style="width: 25%;;" type="number" name="spouse_min_age" id="spouse_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo (isset($spouse_min_age) && $spouse_min_age > 0) ? $spouse_min_age : '18'; ?>" style="width: 25%;;" type="number" name="spouse_min_age" id="spouse_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>" style="width: 25%;;" type="number" name="spouse_max_age" id="spouse_max_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr>
@ -686,8 +686,8 @@
if (!$('#self').prop('checked')) {
$('#self_min_age').removeAttr('name')
$('#self_max_age').removeAttr('name')
$('#self_min_age').removeAttr('name');
$('#self_max_age').removeAttr('name');
}
if (!$('#spouse').prop('checked')) {
@ -1040,6 +1040,9 @@
if ($('#spouse').prop('checked')) {
$('.spouse-age').css('display','');
$('#spouse_min_age').val(18);
$('#spouse_max_age').val(60);
} else {
$('.spouse-age').css('display','none');
}
@ -1253,6 +1256,12 @@
$('#spouse').change(function () {
if ($(this).prop('checked')) {
$('.spouse-age').css('display','');
if($('#spouse_min_age').val() < 0 || $('#spouse_min_age').val() == '' ){
$('#spouse_min_age').val(18);
}
if($('#spouse_max_age').val() < 0 || $('#spouse_max_age').val() == '' ){
$('#spouse_max_age').val(60);
}
}else{
$('.spouse-age').css('display','none');
}
@ -1262,6 +1271,13 @@
$('#children').change(function () {
if ($(this).val() != 0) {
$('.child-age').css('display','');
if($('#child_min_age').val() < 0 || $('#child_min_age').val() == '' ){
$('#child_min_age').val(0);
}
if($('#child_max_age').val() < 0 || $('#child_max_age').val() == '' ){
$('#child_max_age').val(25);
}
}else{
$('.child-age').css('display','none');
}