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: '= base_url("/util/getClientAndBranchAndPolicy") ?>',
+ 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 = '= isset($getData) ? $getData['client_id'] : '0' ?>';
var client_branch_id = '= isset($getData) ? $getData['branch_id'] : '0' ?>';
@@ -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 = = isset($getData) ? $getData['client_id'] : '0' ?>;
@@ -507,8 +550,9 @@
// console.log(PolicyID)
$.each(data, function(index, item) {
var option = $('