From 79d54dd60b4424285ee6e9ee0b9e9864b8b9173b Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Fri, 10 Apr 2026 18:02:44 +0530 Subject: [PATCH 1/3] FIX_SalesTrackerValidation --- app/Views/sales/tracker_view.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Views/sales/tracker_view.php b/app/Views/sales/tracker_view.php index 29027714..a8a755ed 100644 --- a/app/Views/sales/tracker_view.php +++ b/app/Views/sales/tracker_view.php @@ -249,7 +249,7 @@
- +
@@ -577,7 +577,7 @@
- +
From 1f4ff4989d037fec002ccd8d06874dc0f8f68c10 Mon Sep 17 00:00:00 2001 From: Venkatesh Date: Wed, 15 Apr 2026 10:01:25 +0530 Subject: [PATCH 2/3] FIX_VALIDATION_FORM_JS_FILE --- .env.sample | 16 +++++++ app/Helpers/session_helper.php | 4 +- .../assets/js/pages/leads_form_validation.js | 24 ++-------- .../js/pages/new_client_modal_validation.js | 24 ++-------- .../js/pages/ticket_form_input_validation.js | 47 +++---------------- 5 files changed, 33 insertions(+), 82 deletions(-) diff --git a/.env.sample b/.env.sample index cc9a927c..b8c1b80f 100755 --- a/.env.sample +++ b/.env.sample @@ -159,3 +159,19 @@ bds.dailyReportEmails = MEDIASSIST_WELLNESS_KEY = MEDIASSIST_WELLNESS_IV = MEDIASSIST_WELLNESS_LOGIN_URL = + + +#-------------------------------------------------------------------- +# Icici api details LIVE +#-------------------------------------------------------------------- + +ICICI_TOKEN_URL = +ICICI_BASE_URL = +ICICI_PASSWORD = +ICICI_CLIENT_ID = +ICICI_CLIENT_SECRET = +ICICI_API_SCOPE = +ICICI_GRANT_TYPE = + + +ICICI_PRIMARY_KEY_CONSTANT = diff --git a/app/Helpers/session_helper.php b/app/Helpers/session_helper.php index bd54744c..8769216e 100755 --- a/app/Helpers/session_helper.php +++ b/app/Helpers/session_helper.php @@ -180,8 +180,8 @@ if (!function_exists('user_team')) { function user_team() { // $CI =& get_instance(); - $session = \Config\Services::session(); - return $session->get('user_team'); + $session = \Config\Services::session(); + return $session->get('user_team') ?: []; } } diff --git a/public/assets/js/pages/leads_form_validation.js b/public/assets/js/pages/leads_form_validation.js index 0f470a38..7b76a89d 100644 --- a/public/assets/js/pages/leads_form_validation.js +++ b/public/assets/js/pages/leads_form_validation.js @@ -1,3 +1,7 @@ +/** + * Parsley validation for the leads form. Does not strip or rewrite user input; + * invalid values are reported via Parsley messages only. + */ (function (getJq) { 'use strict'; @@ -162,25 +166,6 @@ }); } - function sanitizeOnInput(el) { - if (!el || isSkippableField(el)) { - return; - } - if (isMobileField(el)) { - var clean = (el.value || '').replace(/\D/g, '').substring(0, 10); - if (el.value !== clean) { - el.value = clean; - } - return; - } - if (isCharsetCandidate(el)) { - var raw = el.value || ''; - if (!TEXT_ALLOWED.test(raw)) { - el.value = raw.replace(/[^A-Za-z0-9/_.\- ]/g, ''); - } - } - } - function refreshParsley($form) { if (!$form || !$form.length || !isParsleyReady()) { return; @@ -227,7 +212,6 @@ $form.off(NS); $form.on('input' + NS, 'input:not([type=hidden]), textarea', function () { - sanitizeOnInput(this); validateField(this); }); $form.on('change' + NS, 'select, input:not([type=hidden]), textarea', function () { diff --git a/public/assets/js/pages/new_client_modal_validation.js b/public/assets/js/pages/new_client_modal_validation.js index fef444e2..c4db1770 100644 --- a/public/assets/js/pages/new_client_modal_validation.js +++ b/public/assets/js/pages/new_client_modal_validation.js @@ -1,3 +1,7 @@ +/** + * Parsley validation for the new-client modal. Does not strip or rewrite user input; + * invalid values are reported via Parsley messages only. + */ (function (getJq) { 'use strict'; @@ -142,25 +146,6 @@ }); } - function sanitizeOnInput(el) { - if (!el || isSkippable(el)) { - return; - } - if (isMobile(el)) { - var d = (el.value || '').replace(/\D/g, '').substring(0, 10); - if (el.value !== d) { - el.value = d; - } - return; - } - if (isCharsetCandidate(el)) { - var raw = el.value || ''; - if (!TEXT_ALLOWED.test(raw)) { - el.value = raw.replace(/[^A-Za-z0-9/_.\- ]/g, ''); - } - } - } - function refreshParsley($form) { try { var p = $form.parsley(); @@ -200,7 +185,6 @@ $form.off(NS); $form.on('input' + NS, 'input:not([type=hidden]), textarea', function () { - sanitizeOnInput(this); validateField(this); }); $form.on('change' + NS, 'select, input:not([type=hidden]), textarea', function () { diff --git a/public/assets/js/pages/ticket_form_input_validation.js b/public/assets/js/pages/ticket_form_input_validation.js index b8cfed70..b0e82a4f 100644 --- a/public/assets/js/pages/ticket_form_input_validation.js +++ b/public/assets/js/pages/ticket_form_input_validation.js @@ -1,6 +1,7 @@ /** * Ticket forms + claim file upload: charset, email, pincode, mobile, URLs, doc names. * Integrates with Parsley only — no separate Bootstrap invalid-feedback. + * Does not strip or rewrite user input; invalid values are reported via Parsley messages only. * Requires jQuery + Parsley. Inits run before form-validation.init binds .parsley-examples. * * Do not capture window.jQuery at parse time: layout/header.php loads full jQuery then jquery.slim, @@ -28,6 +29,8 @@ var MOBILE_IDS = ['emp_mobile', 'hospital_phone_no']; var PINCODE_IDS = ['hospital_pin_code']; var DIGITS_ONLY_IDS = ['claim_amount', 'approved_amount', 'si_amt']; + /** Same validation as claim upload URL fields — charset rules would strip : ? & from https links. */ + var APPROVED_SETTLE_LETTER_URL_IDS = ['approved_letter', 'settle_letter']; var MESSAGES = { text: 'Only letters, numbers, spaces, and the characters / _ - . are allowed.', @@ -83,6 +86,9 @@ if (DIGITS_ONLY_IDS.indexOf(id) !== -1) { return 'digits'; } + if (APPROVED_SETTLE_LETTER_URL_IDS.indexOf(id) !== -1) { + return 'urlfield'; + } return 'text'; } @@ -360,51 +366,12 @@ }); } - function sanitizeOnInput(el) { - var id = el.id; - if (!id || el.type === 'hidden' || isReadonly(el)) { - return; - } - - var kind = getFieldKindFromElement(el); - var $el = $(el); - - if (kind === 'mobile') { - var m = (el.value || '').replace(/\D/g, '').substring(0, 10); - if (el.value !== m) { - el.value = m; - } - } else if (kind === 'pincode') { - var p = (el.value || '').replace(/\D/g, '').substring(0, 6); - if (el.value !== p) { - el.value = p; - } - } else if (kind === 'digits') { - var d = (el.value || '').replace(/\D/g, ''); - if (el.value !== d) { - el.value = d; - } - } else if (kind === 'email' || kind === 'personalemail' || kind === 'urlfield') { - return; - } else if (kind === 'docname') { - var dn = el.value || ''; - if (!DOCNAME_ALLOWED.test(dn)) { - el.value = dn.replace(/[^a-zA-Z0-9_\- ]/g, ''); - } - } else if (kind === 'text') { - var raw = el.value || ''; - if (!TEXT_ALLOWED.test(raw)) { - el.value = raw.replace(/[^A-Za-z0-9/_.\- ]/g, ''); - } - } - } - function onFormInput(e) { var el = e.target; if (!el || (el.tagName !== 'INPUT' && el.tagName !== 'TEXTAREA')) { return; } - sanitizeOnInput(el); + revalidateParsleyField(el); } function revalidateParsleyField(el) { From 14ad99ac92746e031ad8ca2d2233c9e6812dd6cc Mon Sep 17 00:00:00 2001 From: Venkatesh Date: Wed, 15 Apr 2026 14:19:53 +0530 Subject: [PATCH 3/3] FIX_ENDORSEMENT_AND_INCEPTION_FRONTEND_VALIDATION --- app/Controllers/ClientController.php | 26 +++- .../PolicyTransactionController.php | 22 ++- app/Views/client_kyc.php | 2 +- .../policy_transaction_endorsement_form.php | 105 +++++++++++-- .../policy_transaction_endorsement_form_2.php | 97 ++++++++++-- .../policy_transaction_endorsement_list.php | 3 + .../policy_transaction_endorsement_list_2.php | 3 + .../policy_transaction_inception_form.php | 87 ++++++++++- .../policy_transaction_inception_form_2.php | 94 +++++++++++- .../policy_transaction_inception_list.php | 3 + .../policy_transaction_inception_list_2.php | 3 + ...transaction_endorsement_form_validation.js | 130 +++++++++++++++- ...y_transaction_inception_form_validation.js | 143 +++++++++++++++++- 13 files changed, 654 insertions(+), 64 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index b5d1706c..fe698d03 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -145,6 +145,7 @@ class ClientController extends AdminController private const ALLOWED_DUPLICATE_CHECK_TABLES = [ 'clients', 'client_branch', 'level_contacts', 'insurers', 'insurer_branch', 'tpa', 'tpa_branch', 'policies', 'client_policy', 'user_profiles', + 'policy_transaction', ]; public function checkDuplicateTableFieldValue() @@ -5873,6 +5874,7 @@ class ClientController extends AdminController $policyListByClient = []; $unitList = []; $insurerBranchList = []; + $policyCount = []; //for client branch mapping to the client foreach ($branches as $branch) { @@ -5901,20 +5903,30 @@ class ClientController extends AdminController $client['client_policy_count'] = $policyCount[$client['id']] ?? 0; } - if (!empty($branchList)) { + if (!empty($clients)) { return $this->respond([ 'status' => true, 'client_data' => $clients, 'vehicle_data' => $vehicles, - 'branch_data' => $branchList, - 'policy_data' => $policyList, - 'policyListByClient' => $policyListByClient, + 'branch_data' => $branchList ?? [], + 'policy_data' => $policyList ?? [], + 'policyListByClient' => $policyListByClient ?? [], 'insurer_data' => $insurers, - 'insurer_branch_data' => $insurerBranchList, - 'unit_data' => $unitList, + 'insurer_branch_data' => $insurerBranchList ?? [], + 'unit_data' => $unitList ?? [], ], 200); } else { - return $this->respond(['status' => false], 200); + return $this->respond([ + 'status' => false, + 'client_data' => [], + 'vehicle_data' => [], + 'branch_data' => [], + 'policy_data' => [], + 'policyListByClient' => [], + 'insurer_data' => [], + 'insurer_branch_data' => [], + 'unit_data' => [], + ], 200); } } diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index da5c0612..a2ff2325 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -2318,7 +2318,7 @@ class PolicyTransactionController extends BaseController $policy_type_id = (!isset($policy_type_id) || $policy_type_id === '' || $policy_type_id === null) ? 0 : $policy_type_id; $date_type = (!isset($date_type) || $date_type === '' || $date_type === null) ? 0 : $date_type; $issuer = (!isset($issuer) || $issuer === '' || $issuer === null) ? 0 : $issuer; - $status = (!isset($issuer) || $status === '' || $status === null) ? 0 : $status; + $status = (!isset($status) || $status === '' || $status === null) ? 0 : $status; if($bds_edit_pt_id == null){ $data['endorsement_data_list'] = $this->policyTransactionModel->getEndorsementTranctionListData($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $status); @@ -2412,7 +2412,7 @@ class PolicyTransactionController extends BaseController $policy_type_id = (!isset($policy_type_id) || $policy_type_id === '' || $policy_type_id === null) ? 0 : $policy_type_id; $date_type = (!isset($date_type) || $date_type === '' || $date_type === null) ? 0 : $date_type; $issuer = (!isset($issuer) || $issuer === '' || $issuer === null) ? 0 : $issuer; - $status = (!isset($issuer) || $status === '' || $status === null) ? 0 : $status; + $status = (!isset($status) || $status === '' || $status === null) ? 0 : $status; if($bds_edit_pt_id == null){ $data['endorsement_data_list'] = $this->policyTransactionModel->getEndorsementTranctionListData($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $status); @@ -5102,9 +5102,20 @@ class PolicyTransactionController extends BaseController // ->where('client_policy.is_active', 1) // ->findAll(); + // Only columns needed for policy_transaction_endorsement_list appendPolicies() JSON — not policy_transaction.* + // (full rows + json_encode duplicated memory and exceeded PHP memory_limit on large datasets). $policies = $this->policyTransactionModel ->select(" - policy_transaction.*, + policy_transaction.id, + policy_transaction.client_id, + policy_transaction.client_branch_id, + policy_transaction.policy_no, + policy_transaction.policy_type_id, + policy_transaction.insurer_id, + policy_transaction.insurer_branch_id, + policy_transaction.tpa_id, + policy_transaction.tpa_branch_id, + policy_transaction.cd_ac_no, policy_type.policy_type, policy_type.ebp, policy_type.etp, @@ -5124,11 +5135,6 @@ class PolicyTransactionController extends BaseController foreach ($policies as $policy) { $policyList[$policy['client_branch_id']][] = $policy; $policyListByClient[$policy['client_id']][] = $policy; - if (isset($policyCount[$policy['client_id']])) { - $policyCount[$policy['client_id']]++; - } else { - $policyCount[$policy['client_id']] = 1; - } } return [$policyList, $policyListByClient]; diff --git a/app/Views/client_kyc.php b/app/Views/client_kyc.php index 635f3db4..8fa6c56d 100755 --- a/app/Views/client_kyc.php +++ b/app/Views/client_kyc.php @@ -92,7 +92,7 @@ - + @@ -181,7 +197,7 @@ >Back --> -
+ @@ -1055,6 +1071,9 @@ $('.loader-mask').fadeIn(); $('#endorsement_form_id')[0].reset(); + if (typeof window.resetEndorsementFormParsley === 'function') { + window.resetEndorsementFormParsley('#endorsement_form_id'); + } // var id = $(input).attr('data-id'); var id = input; @@ -1088,10 +1107,77 @@ $('#policy_tranction_primarykey_for_file_upload').val(res.data.id); $('#client_policy_id_for_file_upload').val(res.data.client_policy_id); $('#policy_tranction_primarykey').val(res.data.id); - $('#client_type').val(res.data.client_type).trigger('change'); - $('#client_id').val(res.data.client_id).change(); $('#base_cd_amount').val(res.data.base_cd_amount); + var applyEndorsementClientSelection = function () { + var clientType = String(res.data.client_type || ''); + var clientId = String(res.data.client_id || ''); + var branchId = String(res.data.client_branch_id || ''); + var policyId = String(res.data.client_policy_id || ''); + var $clientType = $('#client_type'); + var $client = $('#client_id'); + var $branch = $('#client_branch_id'); + var $policy = $('#client_policy_id'); + + if (clientType) { + $clientType.val(clientType).trigger('change'); + } + + if (clientId && !$client.find("option[value='" + clientId + "']").length) { + $client.append($('