diff --git a/app/Config/Routes.php b/app/Config/Routes.php index a32b6788..7e69c587 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -23,12 +23,6 @@ $routes->get('download-e-card/(:any)', 'EmployeeController::generateIDCardForEmp $routes->get('download-kyc-docs/(:segment)', 'ClientController::downloadKYCDocument/$1'); -$routes->get('get-notification', 'DashboardController::getDashboardNotifications'); -$routes->get('acknowledge-notification/(:segment)', 'DashboardController::acknowledgeMessage/$1'); -$routes->get('get-pending-action', 'PendingActionsController::getPendingActions'); - - - $routes->group("/user", ["filter" => "authMVC"], function ($routes) { $routes->post("create", "UserController::create"); $routes->get("create", "UserController::create"); @@ -42,6 +36,9 @@ $routes->group("/user", ["filter" => "authMVC"], function ($routes) { $routes->group("/dashboard", ["filter" => "authMVC"], function ($routes) { $routes->get("view", "DashboardController::dashboard"); + $routes->get('get-notification', 'DashboardController::getDashboardNotifications'); + $routes->get('acknowledge-notification/(:segment)', 'DashboardController::acknowledgeMessage/$1'); + $routes->get('get-pending-action', 'PendingActionsController::getPendingActions'); }); @@ -236,6 +233,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $routes->get("has_policy_config_completed/(:any)", "EmployeeController::hasPolicyConfigCompleted/$1"); $routes->get("get-client-branch/(:any)", "ClientController::getClientBranch/$1"); $routes->get("get-client-details/(:any)", "ClientController::getClientAllDetailsByUsingClientID/$1"); + $routes->get("delete-additional-rack-rate/(:any)", "ClientController::deleteAdditionalRackRate/$1"); }); $routes->cli('cli/processjob', 'JobWorker::processJob'); diff --git a/app/Config/Session.php b/app/Config/Session.php index 591aefdc..e077df64 100644 --- a/app/Config/Session.php +++ b/app/Config/Session.php @@ -40,8 +40,7 @@ class Session extends BaseConfig * The number of SECONDS you want the session to last. * Setting to 0 (zero) means expire when the browser is closed. */ - // public int $expiration = 7200; - public int $expiration = 86400; //24 Hours + public int $expiration = 7200; /** * -------------------------------------------------------------------------- diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 7a9e9263..033300aa 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -169,8 +169,9 @@ class ClientController extends AdminController // echo "
";
// 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'];
+ $data['placeHolders'] = ['member_name','nhance_logo','tpa_id','ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'post_enrollment_app_link', 'client_name'];
+ // dd($data['placeHolders']);
echo view('layout/header', $headerData);
echo view('client_onboarding', $data);
@@ -283,7 +284,7 @@ class ClientController extends AdminController
$editData['notification'] =$this->notificationModel->select('template_name,enabled')->where('client_id',$id)->findAll();
- $editData['placeHolders'] = ['member_name','nhance_logo','tpa_id','ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'client_name'];
+ $editData['placeHolders'] = ['member_name','nhance_logo','tpa_id','ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'post_enrollment_app_link', 'client_name'];
echo view('layout/header', $headerData);
@@ -591,7 +592,7 @@ class ClientController extends AdminController
$policyCount = $this->clientPolicyModel
->where('policy_id', $policy_id)
->where('client_branch_id', $client_branch_id)
- ->countAllResult();
+ ->countAllResults();
if($policyCount > 0 ){
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($this->request->getPost('client_id'));
@@ -809,8 +810,8 @@ class ClientController extends AdminController
$relation_data['spouse'] = $spouse;
$relation_data['childrens'] = $childrens;
$relation_data['parents'] = $parents;
- $relation_data['parents_in_law'] = $parents_in_law;
- $relation_data['either_parents_pil'] = $either_parents_pil;
+ $relation_data['parents-in-law'] = $parents_in_law;
+ $relation_data['either-parents-pil'] = $either_parents_pil;
$jsonDataForRelation = json_encode($relation_data);
@@ -2094,5 +2095,31 @@ class ClientController extends AdminController
}
+ public function deleteAdditionalRackRate($client_id, $client_policy_id, $rack_rate_type)
+ {
+ try {
+ $result = $this->policyPremium2Model
+ ->where('client_id', $client_id)
+ ->where('client_policy_id', $client_policy_id)
+ ->where('rack_rate_type', $rack_rate_type)
+ ->set('is_active', 0)
+ ->update();
+
+ if (!$result) {
+
+ return $this->respond(['status' => false,'code' => 200, 'message' => 'Failed to update the record.'], 200);
+ }
+ } catch (\Exception $e) {
+
+ log_message('error', $e->getMessage());
+ return $this->respond(['status' => false,'code' => 200, 'message' => 'Failed to update the record.'], 200);
+
+ }
+
+ return $this->respond(['status' => true,'code' => 200, 'message' => 'Additionaly Rack Rate Data Remove Successfully'], 200);
+ }
+
+
+
}
\ No newline at end of file
diff --git a/app/Controllers/DashboardController.php b/app/Controllers/DashboardController.php
index 1378abbf..8642c0a5 100644
--- a/app/Controllers/DashboardController.php
+++ b/app/Controllers/DashboardController.php
@@ -18,11 +18,14 @@ class DashboardController extends AdminController
use ResponseTrait;
protected $messageModel;
protected $userMessageModel;
+ protected $myLogger;
public function __construct()
{
+ set_session_context('Dashboard');
$this->messageModel = new MessageModel();
$this->userMessageModel = new UserMessageModel();
+ $this->myLogger = \Config\Services::mylogger();
}
public function dashboard()
@@ -34,15 +37,20 @@ class DashboardController extends AdminController
public function getDashboardNotifications()
{
- //pull notofications to dashboard especially for file upload cases
+ // Pull notifications for the dashboard, especially for file upload cases.
$userId = get_session_userid();
$roleId = 5;
$teamId = 1;
-
- $messages = $this->messageModel->getMessagesForUser($userId, $roleId, $teamId);
-
- return $this->respond($messages);
+
+ if ($userId != null && $roleId != null && $teamId != null) {
+ $messages = $this->messageModel->getMessagesForUser($userId, $roleId, $teamId);
+ return $this->respond(['status' => true, 'code' => 200, 'message' => $messages], 200);
+ } else {
+ $this->myLogger->logme('error', 'The session is not set correctly. USER_ID : {user_id}, ROLE_ID : {role_id}, TEAM_ID : {team_id}', ['user_id' => $userId, 'role_id' => $roleId, 'team_id' => $teamId]);
+ return $this->respond(['status' => false, 'code' => 404, 'message' => 'No data found'], 200);
+ }
}
+
public function acknowledgeMessage($messageId)
{
diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php
index 77a14554..3e73f9a8 100644
--- a/app/Controllers/EmployeeController.php
+++ b/app/Controllers/EmployeeController.php
@@ -1040,6 +1040,34 @@ class EmployeeController extends AdminController
{
$this->loadLayout('ecard_template/default_ecard');
+
+ // Load the session library if it's not autoloaded
+ // $session = \Config\Services::session();
+
+ // Access session data
+ $sessionData = session()->get();
+
+ // Check if session data exists and if expiration time is set
+ if (!empty($sessionData) && isset($sessionData['isLoggedIn']) && isset($sessionData['session_expiration'])) {
+ // Get the session expiration timestamp
+ $expirationTimestamp = $sessionData['session_expiration'];
+
+ // Get the current timestamp
+ $currentTimestamp = time();
+
+ // Check if the current time is greater than the expiration time
+ if ($currentTimestamp > $expirationTimestamp) {
+ // Session has expired
+ echo "Session has expired";
+ } else {
+ // Session is active
+ echo "Session is active";
+ }
+ } else {
+ // Session data is not set or session is not started
+ echo "Session is not started or data is not set";
+ }
+
}
@@ -1253,9 +1281,18 @@ class EmployeeController extends AdminController
{
$client_policy_id = $this->request->uri->getSegment(3);
$policy_details = $this->clientPolicyModel->find($client_policy_id);
- // print_r($policy_details);die();
$policy_terms = isset($policy_details['policy_terms']) ? true : false;
+ $si_enhancement_true_or_false = 1;
+ if($policy_terms){
+ $policyTermsData = json_decode($policy_details['policy_terms']);
+
+ if (isset($policyTermsData->suminsuredenhancement) && $policyTermsData->suminsuredenhancement !== null) {
+ $si_enhancement_true_or_false = $policyTermsData->suminsuredenhancement;
+ }
+ }
+
+
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($client_policy_id,$policy_details['client_id']);
$message = null;
@@ -1270,7 +1307,7 @@ class EmployeeController extends AdminController
}
$message = isset($message) ? ($message . ' not defined for choosed policy') : null;
- return $this->respond(['dataStatus' => true, 'code' => 200, 'message' => $message], 200);
+ return $this->respond(['dataStatus' => true, 'code' => 200, 'message' => $message, 'si_enhancement' => $si_enhancement_true_or_false], 200);
}
diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php
index cfc96b17..0c8c7067 100644
--- a/app/Helpers/sendMailNotification.php
+++ b/app/Helpers/sendMailNotification.php
@@ -105,6 +105,7 @@ class sendMailNotification
$name = $get_emp_email_and_other_details['name'];
$mail_content = $notification['mail_content'];
$nhance_logo = $_ENV['NHANCE_LOGO'];
+ $post_enrollment_app_link = $_ENV['POST_ENROLLMENT_APP_LINK'];
$client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo'];
// $client_logo = $nhance_logo;
@@ -114,8 +115,9 @@ class sendMailNotification
$mail_content = str_replace("[[member_name]]", $name, $mail_content);
$mail_content = str_replace("[[app_link]]", "Review Details", $mail_content);
+ $mail_content = str_replace("[[post_enrollment_app_link]]", "Review Details", $mail_content);
// $mail_content = str_replace("[[tpa_id]]", $tpa_id, $mail_content);
- $mail_content = str_replace("[[ecard_download_link]]", "Download Insurance Card", $mail_content);
+ $mail_content = str_replace("[[ecard_download_link]]", "Download Insurance Card", $mail_content);
$mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content);
$wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails']];
diff --git a/app/Helpers/session_helper.php b/app/Helpers/session_helper.php
index 6e879e4b..ce6a0f56 100644
--- a/app/Helpers/session_helper.php
+++ b/app/Helpers/session_helper.php
@@ -10,6 +10,37 @@ if (!function_exists('check_session')) {
}
}
+if (!function_exists('set_last_visited_time')) {
+ function set_last_visited_time()
+ {
+ $session = \Config\Services::session();
+ $session->set('last_visited', date("Y-m-d H:i:s"));
+ }
+}
+
+if (!function_exists('get_last_visited_time')) {
+ function get_last_visited_time()
+ {
+ // Get the session service
+ $session = \Config\Services::session();
+
+ // Get the last visited time from session
+ $lastVisitTime = $session->get('last_visited');
+
+ // Check if the last visited time is set
+ if ($lastVisitTime) {
+ // Calculate the time five minutes ago
+ $fiveMinutesBefore = date("YmdHi", strtotime('-5 minutes'));
+
+ // Compare the last visited time with the time five minutes ago
+ return date("YmdHi", strtotime($lastVisitTime)) > $fiveMinutesBefore ? 1 : 0;
+ }
+
+ // If last visited time is not set, return 0
+ return 0;
+ }
+}
+
if (!function_exists('get_session_userid')) {
function get_session_userid()
{
diff --git a/app/Models/ClientModel.php b/app/Models/ClientModel.php
index 35beeb4c..fd1e8510 100644
--- a/app/Models/ClientModel.php
+++ b/app/Models/ClientModel.php
@@ -42,7 +42,18 @@ class ClientModel extends Model
foreach ($clients as &$client) {
$clientPolicyModel = new ClientPolicyModel();
- $clientPolicies = $clientPolicyModel->select(['client_branch.id as branch_id','client_branch.branch_name','client_branch.branch_code', 'client_branch.client_id', 'client_policy.id as client_policy_id','p.name','pt.policy_type',])
+ $clientPolicies = $clientPolicyModel
+ ->select(['
+
+ client_branch.id as branch_id',
+ 'client_branch.branch_name',
+ 'client_branch.branch_code',
+ 'client_branch.client_id',
+ 'client_policy.id as client_policy_id',
+ 'client_policy.policy_terms',
+ 'p.name',
+ 'pt.policy_type',
+ ])
->join('client_branch', 'client_branch.id = client_policy.client_branch_id')
->join('policies p', 'p.id = client_policy.policy_id')
->join('policy_type pt','client_policy.policy_type_id = pt.id')
diff --git a/app/Views/client_branch.php b/app/Views/client_branch.php
index c788731c..93ea7137 100644
--- a/app/Views/client_branch.php
+++ b/app/Views/client_branch.php
@@ -234,7 +234,7 @@ $(document).ready(function () {
$("#branch_form").submit(function(event) {
event.preventDefault();
- branch_PrimaryKey = $('#client_id_for_client_branch').val();
+ branch_PrimaryKey = $('#client_id_branch').val();
console.log('branch_PrimaryKey', branch_PrimaryKey)
diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php
index bb844432..ab4e17f4 100644
--- a/app/Views/client_policy.php
+++ b/app/Views/client_policy.php
@@ -47,7 +47,7 @@
@@ -1468,6 +1468,13 @@
$('#client_branch').empty();
+
+ $('#client_branch').append($('";
+ echo "";
}
}
?>
@@ -351,9 +351,10 @@ function fetchClientPolicies() {
},
success: function(response) {
- // console.log(response);
+ console.log(response);
// console.log(response.dataStatus);
// console.log(response.data);
+
if (response.code === 200 && response.dataStatus === true && response.data !== "") {
try {
clientPolicies = (response.data)
@@ -910,7 +911,7 @@ function checkPolicyTermsAndRackRatesHasDefiend(event)
{
// console.log(event.target.id);
var policy_id = (event.target.value);
- // console.log('checkPolicyTermsAndRackRatesHasDefiend called ' + policy_id);
+ console.log('checkPolicyTermsAndRackRatesHasDefiend called ' + policy_id);
if(policy_id != 0 && policy_id != " " && policy_id != undefined)
{
var apiURL = '' + 'util/has_policy_config_completed/' + policy_id;
@@ -930,11 +931,18 @@ function checkPolicyTermsAndRackRatesHasDefiend(event)
success: function(response) {
setTimeout(function() {
- $('.loader').fadeOut();
- $('.loader-mask').delay(350).fadeOut('slow');
- }, 1000);
+ $('.loader').fadeOut();
+ $('.loader-mask').delay(350).fadeOut('slow');
+ }, 1000);
+
+ console.log('check policy responce', response);
+
+ if (response.hasOwnProperty('si_enhancement') && response.si_enhancement == 0) {
+ $('.si-enhancement-option').hide();
+ } else {
+ $('.si-enhancement-option').show();
+ }
- // console.log('check policy responce', response);
if (response.code === 200 && response.dataStatus === true && response.message !== null) {
toastr.error(response.message, 'Error');
diff --git a/app/Views/insurer_or_tpa_data.php b/app/Views/insurer_or_tpa_data.php
index 48cc73a1..c068ec39 100644
--- a/app/Views/insurer_or_tpa_data.php
+++ b/app/Views/insurer_or_tpa_data.php
@@ -76,7 +76,7 @@
$action) {
- echo "";
+ echo "";
}
}
?>
diff --git a/app/Views/layout/footer.php b/app/Views/layout/footer.php
index 114184f7..35093e66 100644
--- a/app/Views/layout/footer.php
+++ b/app/Views/layout/footer.php
@@ -155,27 +155,28 @@
function fetchMessages() {
$.ajax({
- url: '= base_url('get-notification') ?>',
+ url: '= base_url('dashboard/get-notification') ?>',
method: 'GET',
success: function(response) {
- // $(document).ready(function() {
- // $("#playMusic").get(0).play();
- // });
+ console.log('responce', response)
-
- //console.log('responce', response)
+ if(response.status == false){
+ $('#notification_count').html('0')
+ console.log('The session is not set correctly. ')
+ return;
+ }
let messagesList = $('#messages-list');
messagesList.empty();
var html = "";
- pullNotificationCount = response.length
+ pullNotificationCount = response.message.length
localStorage.setItem('pullNotificationCount', pullNotificationCount)
- response.forEach(message => {
+ response.message.forEach(message => {
// if (!message.is_read) {
// unreadCount++;
@@ -183,7 +184,6 @@
var jasonDecodeData = JSON.parse(message.message_text)
-
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
@@ -247,7 +247,7 @@
function acknowledgeMessage(messageId) {
$.ajax({
- url: '= base_url('acknowledge-notification/') ?>' + messageId,
+ url: '= base_url('dashboard/acknowledge-notification/') ?>' + messageId,
method: 'GET',
success: function(response) {
fetchMessages();
@@ -300,7 +300,7 @@
$.ajax({
- url: '= base_url('get-pending-action') ?>',
+ url: '= base_url('dashboard/get-pending-action') ?>',
method: 'GET',
success: function(response) {
diff --git a/app/Views/notification.php b/app/Views/notification.php
index 124094f5..feffdae3 100644
--- a/app/Views/notification.php
+++ b/app/Views/notification.php
@@ -370,7 +370,8 @@