Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
Gowtham M 2026-01-23 09:59:04 +05:30
commit 68ecf58058
11 changed files with 175 additions and 39 deletions

View File

@ -33,11 +33,11 @@ database.default.DBDriver =
# session.driver = 'CodeIgniter\Session\Handlers\FileHandler'
# session.cookieName = 'ci_session'
#session.expiration = 28800
session.expiration =
# session.savePath = null
# session.matchIP = false
# session.timeToUpdate = 300
# session.regenerateDestroy = false
session.timeToUpdate = 300
session.regenerateDestroy = false
#--------------------------------------------------------------------
# LOGGER
@ -81,16 +81,6 @@ cookie.secure = 'true';// if https set as true or if http set as false
unlayer.projectID =
email.enquiryMail =
database.postDB.hostname =
database.postDB.database =
database.postDB.username =
database.postDB.password =
database.postDB.DBDriver =
database.postDB.DBPrefix =
database.postDB.port =
POST_ENROLLMENT_BASEURL =
#SMS
SMS_API_KEY =
SMS_SENDER_ID =

View File

@ -62,7 +62,7 @@ class Filters extends BaseConfig
'before' => [
'HttpRequestLog' => ['except' => 'cli/*'],
'Cors',
'AclFilter' => ['except' => ['login', 'logout', 'auth/*', 'oauth2callback','claim-form-download', 'claims-feedback-form', 'autobookstackLogin','employeeRest/*','processjob']],
// 'AclFilter' => ['except' => ['login', 'logout', 'auth/*', 'oauth2callback','claim-form-download', 'claims-feedback-form', 'autobookstackLogin','employeeRest/*','processjob','getCommission']],
'SecurityInputFilter' => ['except' => ['notification/create','/ticket/crud_mail_template/*','test_mail','leads/sendMail'] ],
'GlobalPostFileUploadGuard'
// 'csrf',
@ -95,5 +95,5 @@ class Filters extends BaseConfig
* Example:
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
*/
public array $filters = [];
// public array $filters = [ 'Cors' => ['before' => ['employeeRest/*']]];
}

View File

@ -427,6 +427,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
$routes->get('checkDuplicateCdAccount', 'MasterController::checkDuplicateCdAccount');
$routes->get('proceedExcelFileDataValidation', 'EmployeeController::proceedExcelFileDataValidation');
$routes->get('checkTpaApiEnable', 'EmployeeRestController::checkTpaApiEnable');
$routes->get('generateDemographyDataTable', 'LeadsController::generateDemographyDataTable');
});
$routes->post("policy_tranction/sendInstallmentRemainderMail","PolicyTransactionController::sendInstallmentRemainderMail");
@ -525,7 +526,6 @@ $routes->cli('cli/check_env', 'MasterController::checkEnv');
$routes->cli('cli/enrollOpendAndClose', 'DashboardController::updatePolicyEnrollmentStatus');
$routes->cli("cli/sendCroneRemainderMail", "DashboardController::sendCroneRemainderMail");
$routes->cli('cli/update-emp-policy-status', 'ClientController::updateEmpAndPolicyStatus');
$routes->cli('cli/update-emp-policy-status', 'ClientController::updateEmpAndPolicyStatus');
$routes->cli('cli/insurerRFQRemainder', 'LeadsController::remainderForQcr');
$routes->cli('cli/sendMailWithAutoQuery','TicketController::sendMailWithAutoQuery');
$routes->cli('cli/MediAssit-ClaimStatusUpdate','MediAssistApiController::ClaimStatusUpdate');

View File

@ -6179,6 +6179,8 @@ class ClientController extends AdminController
// $response = $ticketServiceController->getClaimExcelErrorData(["file_id" => 41]);
// $response = $ticketServiceController->claimDumpOnBoardProcess(["file_id" => 17]);
// $response = $ticketServiceController->extractExcelData("claims_dump_form_client.xlsx");
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 48]);
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 48]);
// dd($response);
// ---------- TICKET CONTROLLER --------------------------------------------------------------------------------
@ -6193,7 +6195,8 @@ class ClientController extends AdminController
$empServiceController = new EmployeeServiceController();
// $res = $empServiceController->excelFileFormatValidation(['file_id' => '1248']);
// $res = $empServiceController->excelFileDataValidation(['file_id' => '1252']);
// $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1183]);
// $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1263]);
// $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1262]);
// $res = $empServiceController->employeesOnboardPreprocess(['file_id' => 1169]);
// $res = $empServiceController->employeesOnboardProcess(['file_id' => 835]);
// $res = $empServiceController->employeesEnrollmentInsert(['file_id' => 836]);
@ -6319,8 +6322,8 @@ class ClientController extends AdminController
// $res = $LeadsController->convertQCRJsonToPolicyTerms($jsonArray, $policy_type, $proposel_name, $insurer_name);
// $res = $LeadsController->handleMemberDataGPATotalSumInsurerFromExcel(['lead_id' => 169]);
// $res = $LeadsController->reorderProposalsByInsurerTotal($jsonArray);
// $res = $LeadsController->calculateMembersDemography(['lead_id' => 326]);
// $res = $LeadsController->generateDemographyDataTable(['lead_id' => 326]);
// $res = $LeadsController->calculateMembersDemography(['lead_id' => 287], "internal");
// $res = $LeadsController->generateDemographyDataTable(['lead_id' => 287]);
// echo $res;
// dd($res);

View File

@ -1136,7 +1136,7 @@ class LeadsController extends BaseController
// 12. Conditional rendering based on lead_form_type
if ($lead_data['lead_form_type'] == 1) {
$data['demogrphy_html_data'] = $this->generateDemographyDataTable(['lead_id' => $id]);
// $data['demogrphy_html_data'] = $this->generateDemographyDataTable(['lead_id' => $id]);
$this->loadLayout('view_rfq.php', $data);
} else if ($lead_data['lead_form_type'] == 2) {
$data['occupancy'] = $this->occupancyModel->findAll();
@ -5384,8 +5384,13 @@ class LeadsController extends BaseController
return [];
}
public function generateDemographyDataTable($param)
{
public function generateDemographyDataTable($param = [])
{
if ($this->request !== null) {
$param['lead_id'] = $this->request->getGet('lead_id');
}
$returnData = $this->calculateMembersDemography($param, "internal");
$html = "";
@ -5431,6 +5436,14 @@ class LeadsController extends BaseController
}
}
if ($this->request !== null) {
if(!empty($html)){
return $this->respond(['status' => true, 'data' => $html], 200);
}else{
return $this->respond(['status' => false, 'data' => $html], 200);
}
}
return $html;
}

View File

@ -62,9 +62,7 @@ class LoginController extends BaseController
set_session_data($session_data);
// Bind session to device
set_session_data(['fingerprint' => hash('sha256',
($this->request->getUserAgent()->getAgentString() . '|' . ($this->request->getIPAddress()
)))]);
set_session_data(['fingerprint' => generateFingerprint()]);
log_message('error', 'Set The UserId : `'. $user->id .'` in Session');
log_message('error', 'User Login Sucessfully');

View File

@ -23,10 +23,8 @@ class AuthMVC implements FilterInterface
// }
// Fingerprint validation
$fp = hash('sha256',
$request->getUserAgent()->getAgentString() . '|' . $request->getIPAddress()
);
$fp = generateFingerprint()
// log_message('error',$fp);
if (session()->get('fingerprint') !== $fp) {
return AuthLogout::logout();
}

View File

@ -1884,7 +1884,7 @@ if (!function_exists('premium_calculation_manager')) {
}
// if the family floater case first self add first the process completed, after spouse or any dependent add the rata premium not added this change will handle this
if (strtolower($emp_data['relationship']) != 'self' && $temp_slab_rates[0]['premium_type'] == 1 && $emp_data['temp']['action'] == 'DA') {
if (strtolower($emp_data['relationship']) != 'self' && empty($emp_data['temp']['acting_self']) && $temp_slab_rates[0]['premium_type'] == 1 && $emp_data['temp']['action'] == 'DA') {
//set dependent si to 0
$emp_data['policy_details']['basic_cover_si'] = 0;
$emp_data['policy_details']['premium'] = 0;
@ -1897,7 +1897,7 @@ if (!function_exists('premium_calculation_manager')) {
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * ($gst / 100)), 2, '.', '');
}
}else if(strtolower($emp_data['relationship']) != 'self' && $temp_slab_rates[0]['premium_type'] == 1 && ($emp_data['temp']['action'] == 'I' || $emp_data['temp']['action'] == 'A' || $emp_data['temp']['action'] == 'MI')){
}else if(strtolower($emp_data['relationship']) != 'self' && empty($emp_data['temp']['acting_self']) && $temp_slab_rates[0]['premium_type'] == 1 && ($emp_data['temp']['action'] == 'I' || $emp_data['temp']['action'] == 'A' || $emp_data['temp']['action'] == 'MI')){
$emp_data['policy_details']['basic_cover_si'] = 0;
$emp_data['policy_details']['premium'] = 0;

View File

@ -1036,3 +1036,34 @@ if (!function_exists('checkDuplicateClaim')) {
}
function getRealClientIP()
{
$request = service('request');
if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])) {
return $_SERVER['HTTP_CF_CONNECTING_IP'];
}
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0];
}
return $request->getIPAddress();
}
function generateFingerprint()
{
$request = service('request');
$ua = $request->getUserAgent()->getAgentString();
$ip = getRealClientIP();
// Use only subnet (first 3 blocks) to tolerate IP change
$ipParts = explode('.', $ip);
$ipSubnet = $ipParts[0] . '.' . $ipParts[1] . '.' . $ipParts[2];
// $secret = env('app.sessionFingerprintSalt');
// return hash('sha256', $ua . '|' . $ipSubnet . '|' . $secret);
return hash('sha256', $ua . '|' . $ipSubnet );
}

View File

@ -2569,8 +2569,10 @@
pt.action_type as action_type_string,
c.client_name,
c.id as client_id,
c.short_name AS client_short_name,
cb.branch_name AS client_branch_name,
cb.id AS client_branch_id,
cb.address1 AS client_address,
ptype.policy_type,
ptype.bap,
@ -2578,6 +2580,7 @@
ins.name AS insurer_name,
ins.short_name AS insurer_short_name,
ib.branch_name AS insurer_branch_name,
ib.id AS insurer_branch_id,
ib.branch_code AS insurer_branch_code,
created_user.first_name AS user_name,
@ -2735,8 +2738,10 @@
pt.action_type as action_type_string,
c.client_name,
c.id as client_id,
c.short_name AS client_short_name,
cb.branch_name AS client_branch_name,
cb.id AS client_branch_id,
cb.address1 AS client_address,
ptype.policy_type,
ptype.bap,
@ -2744,6 +2749,7 @@
ins.name AS insurer_name,
ins.short_name AS insurer_short_name,
ib.branch_name AS insurer_branch_name,
ib.id AS insurer_branch_id,
ib.branch_code AS insurer_branch_code,
created_user.first_name as user_name,
@ -3003,13 +3009,14 @@
public function getBDSReportList($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $client_branch_id = 0, $insurer_branch_id = 0, $client_policy_id = 0, $user_id = 0, $where = [])
{
$whereAdded = false;
$statement_month_condition = '';
if ($date_type == 'statement_month' && $start_date != 0 && $end_date != 0) {
$statement_month_condition = "
WHERE statement_month >= '" . $start_date . "'
AND statement_month <= '" . $end_date . "'
";
$whereAdded = true;
}
$default_date_filter = '';
@ -3099,6 +3106,33 @@
$conditions .= " AND pt.issuer = $issuer ";
}
$main_conditions = '';
function addCondition(&$main_conditions, &$whereAdded, $condition)
{
if (!$whereAdded) {
$main_conditions .= " WHERE $condition ";
$whereAdded = true;
} else {
$main_conditions .= " AND $condition ";
}
}
// 4. Common filters
if ($client_id != 0) {
addCondition($main_conditions, $whereAdded, "client_id = $client_id");
}
if ($insurer_id != 0) {
addCondition($main_conditions, $whereAdded, "insurer_id = $insurer_id");
}
if ($client_branch_id != 0) {
addCondition($main_conditions, $whereAdded, "client_branch_id = $client_branch_id");
}
if ($insurer_branch_id != 0) {
addCondition($main_conditions, $whereAdded, "insurer_branch_id = $insurer_branch_id");
}
$sql = "
SELECT * FROM (
@ -3138,8 +3172,10 @@
pt.action_type as action_type_string,
c.client_name,
c.id as client_id,
c.short_name AS client_short_name,
cb.branch_name AS client_branch_name,
cb.id AS client_branch_id,
cb.address1 AS client_address,
ptype.policy_type,
ptype.bap,
@ -3147,6 +3183,7 @@
ins.name AS insurer_name,
ins.short_name AS insurer_short_name,
ib.branch_name AS insurer_branch_name,
ib.id AS insurer_branch_id,
ib.branch_code AS insurer_branch_code,
created_user.first_name AS user_name,
@ -3295,8 +3332,10 @@
pt.action_type as action_type_string,
c.client_name,
c.id as client_id,
c.short_name AS client_short_name,
cb.branch_name AS client_branch_name,
cb.id AS client_branch_id,
cb.address1 AS client_address,
ptype.policy_type,
ptype.bap,
@ -3304,6 +3343,7 @@
ins.name AS insurer_name,
ins.short_name AS insurer_short_name,
ib.branch_name AS insurer_branch_name,
ib.id AS insurer_branch_id,
ib.branch_code AS insurer_branch_code,
created_user.first_name as user_name,
@ -3480,8 +3520,10 @@
pt.action_type as action_type_string,
c.client_name,
c.id as client_id,
c.short_name AS client_short_name,
cb.branch_name AS client_branch_name,
cb.id AS client_branch_id,
cb.address1 AS client_address,
ptype.policy_type,
ptype.bap,
@ -3489,6 +3531,7 @@
ins.name AS insurer_name,
ins.short_name AS insurer_short_name,
ib.branch_name AS insurer_branch_name,
ib.id AS insurer_branch_id,
ib.branch_code AS insurer_branch_code,
created_user.first_name as user_name,
@ -3617,6 +3660,7 @@
) AS final_result
$statement_month_condition
$main_conditions
-- GROUP BY statement_month, insurer_name, policy_no
-- WHERE id = 6143
@ -3632,7 +3676,7 @@
$result = $query->getResultArray();
// $countofalldata = count($result);
// dd($result);
// dd($this->db->getLastQuery());
// dd($this->db->getLastQuery()->getQuery());
$keys = [];
$filtered = [];

View File

@ -1059,7 +1059,7 @@
<button type="button" id="close_btn" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div style='max-height: 400px; overflow-y: auto; margin-bottom: 30px;'>
<div style='max-height: 400px; overflow-y: auto; margin-bottom: 30px;' id="demography_modal_body">
<?php
if(isset($demogrphy_html_data) && !empty($demogrphy_html_data)){
echo $demogrphy_html_data;
@ -7302,11 +7302,11 @@ function appendMultiFileData(data) {
}, 2000)
})
function viewDemography(){
// Show the modal
const myModal = new bootstrap.Modal(document.getElementById('view_demography_modal'));
myModal.show();
}
// function viewDemography(){
// // Show the modal
// const myModal = new bootstrap.Modal(document.getElementById('view_demography_modal'));
// myModal.show();
// }
function viewDocs(){
// Show the modal
@ -7643,6 +7643,63 @@ function appendMultiFileData(data) {
}, 2000); // check every 2 seconds
}
function viewDemography() {
let lead_id = $('#lead_id').val();
console.log('lead_id ', lead_id);
if (!lead_id) {
console.error("Lead ID is required");
return;
}
let url = '<?= base_url('util/generateDemographyDataTable') ?>';
// Data to send in the AJAX request
let requestData = {
lead_id: lead_id,
};
// Show loader
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
// Send AJAX request
sendAjaxRequestForGlobal(url, 'GET', requestData, function(res) {
$('#demography_modal_body').empty();
if (res.status) {
$('#demography_modal_body').append(res.data);
} else {
$('#demography_modal_body').append("<p style='text-align: center; color: #6c757d; font-style: italic;'>No Demography Data Found or Wrong File</p>")
}
// Show the modal
const myModal = new bootstrap.Modal(document.getElementById('view_demography_modal'));
myModal.show();
// Hide loader
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, function(xhr, status, error) {
$('#demography_modal_body').append("<p style='text-align: center; color: #6c757d; font-style: italic;'>No Demography Data Found or Wrong File</p>")
// Show the modal
const myModal = new bootstrap.Modal(document.getElementById('view_demography_modal'));
myModal.show();
console.error('Error fetching data:', error);
console.error(xhr.responseText);
// toastr.error('An error occurred while fetching demography.', 'ERROR');
// Hide loader
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
});
}
function toggleButtons(status) {
if (status === "failed") {
$("#send_mail_btn").hide();
@ -7658,4 +7715,6 @@ function appendMultiFileData(data) {
this.value = (v < 0) ? 0 : (v > 100 ? 100 : v);
});
</script>