From 64ac479c30c8013786811b232fe4c8711110ed41 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Tue, 23 Dec 2025 16:30:05 +0530 Subject: [PATCH] FIX_Velmurugan told me to add postDB[encrypt] in DataBase.php config Folder And View Member Client dropdown fixes and Dashbaord SSession Enrollment_data removed --- app/Config/Database.php | 4 + app/Controllers/DashboardController.php | 2 +- app/Views/employee_list.php | 249 ++++++++++++++---------- app/Views/insurer_or_tpa_data.php | 2 +- 4 files changed, 153 insertions(+), 104 deletions(-) diff --git a/app/Config/Database.php b/app/Config/Database.php index dcc1c2dd..c0f91c65 100755 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -134,6 +134,10 @@ class Database extends Config 'ssl_ca' => ROOTPATH . 'ca.pem', 'ssl_verify' => true, ]; + $this->preDB['encrypt'] = [ + 'ssl_ca' => ROOTPATH . 'ca.pem', + 'ssl_verify' => true, + ]; } } diff --git a/app/Controllers/DashboardController.php b/app/Controllers/DashboardController.php index 8958c26d..50a9e4c1 100755 --- a/app/Controllers/DashboardController.php +++ b/app/Controllers/DashboardController.php @@ -238,7 +238,7 @@ class DashboardController extends AdminController $data['client_branch_emp_list'] = $results; $session = \Config\Services::session(); - $session->set('enrollment_data', json_encode($data)); + // $session->set('enrollment_data', json_encode($data)); $data['pendingActionsData'] = $pendingActionsData; $data['businessTeamCount'] = count($businessTeamData) ?? 0; diff --git a/app/Views/employee_list.php b/app/Views/employee_list.php index 45ad39a0..6f6d74dc 100755 --- a/app/Views/employee_list.php +++ b/app/Views/employee_list.php @@ -355,11 +355,54 @@ // } }); + + var client_list = ''; // local variable for storing the client branch list + var branch_list = ''; // local variable for storing the client branch list + var policy_list = ''; // local variable for storing the client policy list + var branch_policy = ''; + var policy_list_by_client = ''; + + $(document).ready(function() { + getClientAndBranchAndPolicy(); + }) + + //featch client and branch and policy + function getClientAndBranchAndPolicy() { + $.ajax({ + url: '', + type: "GET", + dataType: 'json', + success: function(res) { + + console.log('getClientAndBranchAndPolicy', res); + if (res.status == true) { + + client_list = res.client_data; + branch_list = res.branch_data; + policy_list = res.policy_data; + policy_list_by_client = res.policyListByClient; + + appendClients(client_list); + // appendBranch(branch_list); + // appendPolicies(policy_list); + + } else { + console.log('No data found'); + } + + }, + error: function(xhr, status, error) { + console.error(xhr.responseText); + console.error(status, error); + } + }); + } + // Declare a global variable to store API response data - var clientPolicies = []; - var clientPoliciesWithBranch = { - policies: [] - }; + // var clientPolicies = []; + // var clientPoliciesWithBranch = { + // policies: [] + // }; var client_id = ''; var client_branch_id = ''; @@ -376,91 +419,91 @@ }); - $(document).ready(function() { - console.log("document loaded"); - //fetchClientPolicies(); - }); + // $(document).ready(function() { + // console.log("document loaded"); + // //fetchClientPolicies(); + // }); - $(window).on("load", function() { - console.log("window loaded"); - fetchClientPolicies(); - }); + // $(window).on("load", function() { + // console.log("window loaded"); + // fetchClientPolicies(); + // }); - function fetchClientPolicies() { - $('#loader').show(); - var apiURL = '' + 'util/clients-with-policies'; - console.log('fetchClientPolicies'); - // console.log(apiURL); - $.ajax({ - url: apiURL, - method: 'GET', - headers: { - "Content-Type": "application/json", - "X-Requested-With": "XMLHttpRequest" - }, - success: function(response) { - // console.log(response.code); - // console.log(response.dataStatus); - // console.log(response.data); - if (response.code === 200 && response.dataStatus === true && response.data !== "") { - try { - clientPolicies = (response.data); + // function fetchClientPolicies() { + // $('#loader').show(); + // var apiURL = '' + 'util/clients-with-policies'; + // console.log('fetchClientPolicies'); + // // console.log(apiURL); + // $.ajax({ + // url: apiURL, + // method: 'GET', + // headers: { + // "Content-Type": "application/json", + // "X-Requested-With": "XMLHttpRequest" + // }, + // success: function(response) { + // // console.log(response.code); + // // console.log(response.dataStatus); + // // console.log(response.data); + // if (response.code === 200 && response.dataStatus === true && response.data !== "") { + // try { + // clientPolicies = (response.data); - response.data.forEach(policy => { - // console.log('policies', policy.policies); - policy.policies.forEach(p => { - clientPoliciesWithBranch.policies.push(p); - }); - }); + // response.data.forEach(policy => { + // // console.log('policies', policy.policies); + // policy.policies.forEach(p => { + // clientPoliciesWithBranch.policies.push(p); + // }); + // }); - // console.log('1',clientPolicies); - appendClients(clientPolicies); + // // console.log('1',clientPolicies); + // appendClients(clientPolicies); - //this function for reselect the policy - setTimeout(function() { - if (client_id != 0) { - var foundPolicies = clientPolicies.find(function(item) { - // console.log(typeof item.id) - return item.id == client_id; - }); - appendBranch(foundPolicies.branchs); - } - }, 500); + // //this function for reselect the policy + // setTimeout(function() { + // if (client_id != 0) { + // var foundPolicies = clientPolicies.find(function(item) { + // // console.log(typeof item.id) + // return item.id == client_id; + // }); + // appendBranch(foundPolicies.branchs); + // } + // }, 500); - setTimeout(function() { - if (client_branch_id != 0) { + // setTimeout(function() { + // if (client_branch_id != 0) { - var foundPolicies = clientPoliciesWithBranch.policies.filter(function(item) { - // console.log('item', item); - return item.branch_id === client_branch_id; - }); + // var foundPolicies = clientPoliciesWithBranch.policies.filter(function(item) { + // // console.log('item', item); + // return item.branch_id === client_branch_id; + // }); - if (foundPolicies) { - // console.log('foundPolicies', foundPolicies); - appendPolicies(foundPolicies); - } else { - console.log('No policies found for the selected client'); - } - } - }, 500); - //end + // if (foundPolicies) { + // // console.log('foundPolicies', foundPolicies); + // appendPolicies(foundPolicies); + // } else { + // console.log('No policies found for the selected client'); + // } + // } + // }, 500); + // //end - } catch (error) { - console.error('Error parsing API response data:', error); - } - } else if (response.code === 404 && response.dataStatus === false) { - console.error('no data found', response); - } else { - console.error('Something went wrong!'); - } - }, - error: function(xhr, status, error) { - console.error('Error fetching data from API:', error); - } - }); + // } catch (error) { + // console.error('Error parsing API response data:', error); + // } + // } else if (response.code === 404 && response.dataStatus === false) { + // console.error('no data found', response); + // } else { + // console.error('Something went wrong!'); + // } + // }, + // error: function(xhr, status, error) { + // console.error('Error fetching data from API:', error); + // } + // }); - $('#loader').hide(); - } + // $('#loader').hide(); + // } function appendClients(data) { var clientID = ; @@ -507,8 +550,9 @@ // console.log(PolicyID) $.each(data, function(index, item) { var option = $('