From 9a3988072a05e7a2432b245b43a186878a90d766 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 5 Feb 2025 12:44:23 +0530 Subject: [PATCH 1/5] FIX_LIST : RV --- app/Controllers/EmployeeController.php | 1 + app/Controllers/TicketController.php | 161 +++++++++++----------- app/Models/TicketMasterModel.php | 180 +++++++++++++++++++++++-- 3 files changed, 253 insertions(+), 89 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 06bb8532..a613c87b 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -2225,6 +2225,7 @@ class EmployeeController extends AdminController } } + //UPDATE EMPLOYEE public function update_emp_data() { $data = $this->request->getPost(); diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 630313e1..800ce03d 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -141,52 +141,68 @@ class TicketController extends BaseController } public function ticketSearch($action = null) - { + { + $db = db_connect(); + + $subquery = $db->table('ticket_history th') + ->select([ + 'th.ticket_id', + "CASE + WHEN DATEDIFF( + th.created_at, + COALESCE( + (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = th.ticket_id), + tm.created_at + ) + ) BETWEEN 0 AND 6 THEN '0-6 Days' + WHEN DATEDIFF( + th.created_at, + COALESCE( + (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = th.ticket_id), + tm.created_at + ) + ) BETWEEN 7 AND 12 THEN '7-12 Days' + WHEN DATEDIFF( + th.created_at, + COALESCE( + (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = th.ticket_id), + tm.created_at + ) + ) BETWEEN 13 AND 20 THEN '13-20 Days' + ELSE 'Above 20 Days' + END AS tat" + ]) + ->join('ticket_master tm', 'tm.id = th.ticket_id', 'right') + ->where('tm.is_active', 1) + ->groupBy('th.ticket_id, tm.created_at'); + //action 1 get last 100 rows, action 2 filter and get all rows related to that if ($action == 1) { - $data = $this->ticketMasterModel - ->select(" + $query = $db->table('ticket_master tm') + ->select([ + 'tm.id', + 'tcs.claim_status AS status', + 'tm.claim_number AS claim_no', + 'tm.tpa_id', + 'tm.emp_name', + 'i.name AS insurer_name', + 'c.client_name', + 'tm.insured_name', + 'c.short_name', + 'DATE_FORMAT(tm.created_at, "%d-%m-%Y") AS ticket_created_date', + 'COALESCE(tat_category.tat, "0-6 Days") AS tat' + ]) + ->join('insurers i', 'i.id = tm.insurer_id AND i.is_active = 1', 'left') + ->join('clients c', 'c.id = tm.client_id AND c.is_active = 1', 'left') + ->join('ticket_claim_status tcs', 'tcs.id = tm.claim_status_id AND tcs.is_active = 1', 'left') + ->join("({$subquery->getCompiledSelect()}) tat_category", 'tm.id = tat_category.ticket_id', 'left') + ->where('tm.is_active', 1) + ->orderBy('tm.id', 'DESC'); - ticket_master.id, - ticket_claim_status.claim_status as status, - ticket_master.claim_number as claim_no, - ticket_master.tpa_id, - ticket_master.emp_name, - insurers.name as insurer_name, - clients.client_name, - ticket_master.insured_name, - clients.short_name, - DATE_FORMAT(ticket_master.created_at, '%d-%m-%Y') as ticket_created_date, - CASE - WHEN DATEDIFF( - ticket_master.updated_at, - COALESCE(ticket_master.updated_at, ticket_history.created_at) - ) BETWEEN 0 AND 6 THEN '0-6 Days' - WHEN DATEDIFF( - ticket_master.updated_at, - COALESCE(ticket_master.updated_at, ticket_history.created_at) - ) BETWEEN 7 AND 12 THEN '7-12 Days' - WHEN DATEDIFF( - ticket_master.updated_at, - COALESCE(ticket_master.updated_at, ticket_history.created_at) - ) BETWEEN 13 AND 20 THEN '13-20 Days' - ELSE 'Above 20 Days' - END AS tat + $data = $query->get()->getResultArray(); - ") - ->join('insurers', 'insurers.id = ticket_master.insurer_id and insurers.is_active = 1', 'left') - ->join('clients', 'clients.id = ticket_master.client_id and clients.is_active = 1', 'left') - ->join('ticket_claim_status', 'ticket_claim_status.id = ticket_master.claim_status_id and ticket_claim_status.is_active = 1', 'left') - ->join('ticket_history', "ticket_master.id = ticket_history.ticket_id") - ->where('ticket_master.is_active', 1) - ->where('ticket_history.is_active', 1) - ->groupBy('ticket_master.id') - ->orderBy('ticket_master.id', 'DESC') - ->limit(100) - ->findAll(); - - // dd($data); + // dd(db_connect()->getLastQuery()); return $data; @@ -200,46 +216,33 @@ class TicketController extends BaseController } } // print_rr($where); - $data = $this->ticketMasterModel - ->select(" - ticket_master.id, - ticket_claim_status.claim_status as status, - ticket_master.claim_number as claim_no, - ticket_master.tpa_id, - ticket_master.emp_name, - insurers.name as insurer_name, - clients.client_name,ticket_master.insured_name, - clients.short_name, - DATE_FORMAT(ticket_master.created_at, '%d-%m-%Y') as ticket_created_date, - CASE - WHEN DATEDIFF( - ticket_master.updated_at, - COALESCE(ticket_master.updated_at, ticket_history.created_at) - ) BETWEEN 0 AND 6 THEN '0-6 Days' - WHEN DATEDIFF( - ticket_master.updated_at, - COALESCE(ticket_master.updated_at, ticket_history.created_at) - ) BETWEEN 7 AND 12 THEN '7-12 Days' - WHEN DATEDIFF( - ticket_master.updated_at, - COALESCE(ticket_master.updated_at, ticket_history.created_at) - ) BETWEEN 13 AND 20 THEN '13-20 Days' - ELSE 'Above 20 Days' - END AS tat - ") - ->join('insurers', 'insurers.id = ticket_master.insurer_id and insurers.is_active = 1', 'left') - ->join('clients', 'clients.id = ticket_master.client_id and clients.is_active = 1', 'left') - ->join('ticket_claim_status', 'ticket_claim_status.id = ticket_master.claim_status_id and ticket_claim_status.is_active = 1', 'left') - ->join('ticket_history', "ticket_master.id = ticket_history.ticket_id") - ->where('ticket_master.is_active', 1) - ->where('ticket_history.is_active', 1) + $query = $db->table('ticket_master tm') + ->select([ + 'tm.id', + 'tcs.claim_status AS status', + 'tm.claim_number AS claim_no', + 'tm.tpa_id', + 'tm.emp_name', + 'i.name AS insurer_name', + 'c.client_name', + 'tm.insured_name', + 'c.short_name', + 'DATE_FORMAT(tm.created_at, "%d-%m-%Y") AS ticket_created_date', + 'COALESCE(tat_category.tat, "0-6 Days") AS tat' + ]) + ->join('insurers i', 'i.id = tm.insurer_id AND i.is_active = 1', 'left') + ->join('clients c', 'c.id = tm.client_id AND c.is_active = 1', 'left') + ->join('ticket_claim_status tcs', 'tcs.id = tm.claim_status_id AND tcs.is_active = 1', 'left') + ->join("({$subquery->getCompiledSelect()}) tat_category", 'tm.id = tat_category.ticket_id', 'left') + ->where('tm.is_active', 1) ->where($where) - ->groupBy('ticket_master.id') - ->orderBy('ticket_master.id', 'DESC') - ->findAll(); - // print_rr($data); - // log_message('error',' Claims Master Data '.json_encode($data));die(); + ->orderBy('tm.id', 'DESC'); + + $data = $query->get()->getResultArray(); + // print_rr($data); + // log_message('error',' Claims Master Data '.json_encode($data));die(); // print_rr($data);die(); + return $data; } } diff --git a/app/Models/TicketMasterModel.php b/app/Models/TicketMasterModel.php index b22fbd1e..adce7dff 100644 --- a/app/Models/TicketMasterModel.php +++ b/app/Models/TicketMasterModel.php @@ -147,6 +147,155 @@ class TicketMasterModel extends Model } //get TAT report BAND wise Data + // public function getTATReport($ticket_type = null, $start_date = null, $end_date = null) + // { + // //set default last 3 months data date + // $fromDate = date('Y-m-d', strtotime('-90 days')); + // $toDate = date('Y-m-d 23:59:59'); + + // if (!empty($start_date) && !empty($end_date)) { + // $fromDate = change_date_format($start_date); + // $toDate = change_date_format($end_date); + // } + // $ticket_type_data_1 = ""; + // $ticket_type_data_2 = ""; + // if(!empty($ticket_type)){ + // $ticket_type_data_1 = "AND ticket_type = $ticket_type"; + // $ticket_type_data_2 = "AND tm.ticket_type_id = $ticket_type"; + // } + + // // Fetch claim statuses from the `ticket_claim_status` table + // $statusQuery = " SELECT + // id, claim_status, ticket_type + // FROM ticket_claim_status + // Where is_active = 1 + // $ticket_type_data_1 + // "; + // $statusResult = $this->db->query($statusQuery)->getResultArray(); + // // dd($statusResult); + + // // Initialize dynamic query parts + // $dynamicSelect = ''; + + // // Loop through each claim status and generate the COALESCE and CASE statements for the SELECT + // foreach ($statusResult as $status) { + + // $columnName = $status['claim_status']; // Default column name + + // if (empty($ticket_type)) { + // // Append the insurance type prefix based on `ticket_type` + // switch ($status['ticket_type']) { + // case 1: + // $columnName = "GMC - {$status['claim_status']}"; + // break; + // case 2: + // $columnName = "GPA - {$status['claim_status']}"; + // break; + // case 3: + // $columnName = "EDLI - {$status['claim_status']}"; + // break; + // case 4: + // $columnName = "GTLI - {$status['claim_status']}"; + // break; + // } + // } + + // $dynamicSelect .= " + // COALESCE( + // SUM( + // CASE + // WHEN subquery.status_id = {$status['id']} THEN 1 + // ELSE 0 + // END + // ), + // 0 + // ) AS `$columnName`, "; + // } + + // // Remove the trailing comma from the SELECT part + // $dynamicSelect = rtrim($dynamicSelect, ', '); + // // dd($dynamicSelect); + + + // // Construct the full SQL query + // $sql = " + // SELECT + // tc.TAT_Category, + // $dynamicSelect + // FROM + // ( + // SELECT 'Above 20 Days' AS TAT_Category + // UNION ALL + // SELECT '13-20 Days' + // UNION ALL + // SELECT '7-12 Days' + // UNION ALL + // SELECT '0-6 Days' + // ) AS tc + // LEFT JOIN ( + // SELECT + // tm.id AS ticket_id, + // tcs.claim_status, + // tcs.id AS status_id, + // CASE + // WHEN DATEDIFF( + // COALESCE(th.created_at, tm.created_at), + // COALESCE( + // (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = tm.id), + // tm.created_at + // ) + // ) BETWEEN 0 AND 6 THEN '0-6 Days' + // WHEN DATEDIFF( + // COALESCE(th.created_at, tm.created_at), + // COALESCE( + // (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = tm.id), + // tm.created_at + // ) + // ) BETWEEN 7 AND 12 THEN '7-12 Days' + // WHEN DATEDIFF( + // COALESCE(th.created_at, tm.created_at), + // COALESCE( + // (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = tm.id), + // tm.created_at + // ) + // ) BETWEEN 13 AND 20 THEN '13-20 Days' + // ELSE 'Above 20 Days' + // END AS TAT_Category + // FROM + // ticket_master tm + // JOIN ticket_history th ON tm.id = th.ticket_id + // JOIN ticket_claim_status tcs ON th.field_name = 'claim_status_id' + // AND th.new_value = tcs.id + // WHERE + // tm.ticket_type_id = tcs.id + // $ticket_type_data_2 + // AND tm.created_at >= '$fromDate' + // AND tm.created_at <= '$toDate' + // AND tm.is_active = 1 + // AND th.is_active = 1 + // AND tcs.is_active = 1 + // ) AS subquery ON tc.TAT_Category = subquery.TAT_Category + // GROUP BY + // tc.TAT_Category + // ORDER BY + // FIELD(tc.TAT_Category, 'Above 20 Days', '13-20 Days', '7-12 Days', '0-6 Days'); + // "; + + // // Execute the query and return the result + // $data = $this->db->query($sql)->getResultArray(); + // // print_rr($this->db->getLastQuery(), $data); die; + + // // $tableData = []; + // // if (!empty($data)) { + // // // Extract table headers from the first row keys + // // $headers = array_keys($data[0]); + // // $tableData['headers'] = $headers; + // // $tableData['body'] = $data; + // // } + + // return $data; + // } + public function getTATReport($ticket_type = null, $start_date = null, $end_date = null) { //set default last 3 months data date @@ -161,7 +310,7 @@ class TicketMasterModel extends Model $ticket_type_data_2 = ""; if(!empty($ticket_type)){ $ticket_type_data_1 = "AND ticket_type = $ticket_type"; - $ticket_type_data_2 = "AND tm.ticket_type_id = $ticket_type"; + $ticket_type_data_2 = "WHERE tm.ticket_type_id = $ticket_type"; } // Fetch claim statuses from the `ticket_claim_status` table @@ -233,36 +382,47 @@ class TicketMasterModel extends Model SELECT '0-6 Days' ) AS tc LEFT JOIN ( + SELECT th.ticket_id, tcs.claim_status, tcs.id AS status_id, CASE WHEN DATEDIFF( - tm.updated_at, - COALESCE(tm.updated_at, th.created_at) + th.created_at, + COALESCE( + (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = th.ticket_id), + tm.created_at + ) ) BETWEEN 0 AND 6 THEN '0-6 Days' WHEN DATEDIFF( - tm.updated_at, - COALESCE(tm.updated_at, th.created_at) + th.created_at, + COALESCE( + (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = th.ticket_id), + tm.created_at + ) ) BETWEEN 7 AND 12 THEN '7-12 Days' WHEN DATEDIFF( - tm.updated_at, - COALESCE(tm.updated_at, th.created_at) + th.created_at, + COALESCE( + (SELECT MIN(created_at) FROM ticket_history th2 WHERE th2.ticket_id = th.ticket_id), + tm.created_at + ) ) BETWEEN 13 AND 20 THEN '13-20 Days' ELSE 'Above 20 Days' END AS TAT_Category + FROM ticket_master tm JOIN ticket_history th ON tm.id = th.ticket_id - JOIN ticket_claim_status tcs ON th.field_name = 'claim_status_id' - AND th.new_value = tcs.id + JOIN ticket_claim_status tcs ON th.field_name = 'claim_status_id' AND th.new_value = tcs.id $ticket_type_data_2 AND tm.created_at >= '$fromDate' AND tm.created_at <= '$toDate' AND tm.is_active = 1 AND th.is_active = 1 AND tcs.is_active = 1 + ) AS subquery ON tc.TAT_Category = subquery.TAT_Category GROUP BY tc.TAT_Category @@ -278,7 +438,7 @@ class TicketMasterModel extends Model // Execute the query and return the result $data = $this->db->query($sql)->getResultArray(); - // dd($this->db->getLastQuery(), $data); + // print_rr($this->db->getLastQuery(), $data); die; // $tableData = []; // if (!empty($data)) { From 8c5872326a22d7ae88f99447021e11b1674b1bd5 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 5 Feb 2025 14:38:02 +0530 Subject: [PATCH 2/5] FIX_CD_AC_PK : RV --- app/Controllers/EmpDataServiceController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index 0cc8c4f4..b2190254 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -152,7 +152,7 @@ class EmpDataServiceController extends BaseController $objects = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data); $policy_details = $this->clientPolicyModel->where('id', $export_data['client_policy_id'])->first(); - if ($policy_details['cd_ac_no'] == null) { + if ($policy_details['cd_ac_pk'] == null) { $this->myLogger->logme('error', 'The policy does not have a CD account number.'); return 5; } @@ -649,7 +649,7 @@ class EmpDataServiceController extends BaseController $policy_details = $this->clientPolicyModel->where('id', $export_data['client_policy_id'])->first(); - if ($policy_details['cd_ac_no'] == null) { + if ($policy_details['cd_ac_pk'] == null) { $this->myLogger->logme('error', 'The policy does not have a CD account number.'); return 1; } @@ -959,7 +959,7 @@ class EmpDataServiceController extends BaseController $policy_details = $this->clientPolicyModel->where('id', $export_data['client_policy_id'])->first(); - if ($policy_details['cd_ac_no'] == null) { + if ($policy_details['cd_ac_pk'] == null) { $this->myLogger->logme('error', 'The policy does not have a CD account number.'); return 5; } From 7d528263920c149ef33fcd9aec93979746590712 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 5 Feb 2025 18:16:53 +0530 Subject: [PATCH 3/5] FIX_LIVE_ISSUE : RV --- app/Controllers/EmpDataServiceController.php | 2 +- app/Helpers/excel_util_helper.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index b2190254..ff032276 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -1829,7 +1829,7 @@ class EmpDataServiceController extends BaseController if(!empty($name) && !empty($emp_code)){ - $totals = $totals + $amount; + $totals = $totals + floatval($amount); $query = $db->table('employee_polices'); $query->select('employee_polices.id'); diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index 0b6a3a7b..31bb0f1b 100755 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -234,7 +234,7 @@ if(!function_exists('check_si')) $is_si_found = false; $is_age_slab_found = false; - if($policy_details['policy_type_id'] == 1 && $slab_details['slab_rates'][0]['policy_grid_id'] == 1 && $slab_details['slab_rates'][0]['si_or_bp'] == 2) // GPA && grid type 1 for GPA && sub type is basic pay + if(($policy_details['policy_type_id'] == 1 || $policy_details['policy_type_id'] == 6 || $policy_details['policy_type_id'] == 7) && $slab_details['slab_rates'][0]['policy_grid_id'] == 1 && $slab_details['slab_rates'][0]['si_or_bp'] == 2) // GPA && grid type 1 for GPA && sub type is basic pay { $is_si_found = true; $is_age_slab_found = true; From c35eb8545abb8ae0e7afd81cc81e42d1ab6e066b Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Fri, 7 Feb 2025 11:56:10 +0530 Subject: [PATCH 4/5] CHANGE_SENDMAIL_PLACEHOLDER : RV --- app/Config/Routes.php | 1 + app/Controllers/ClientController.php | 306 +++++++++++++++++++ app/Controllers/EmpDataServiceController.php | 2 +- app/Controllers/EmployeeController.php | 11 +- app/Controllers/NotificationController.php | 2 +- app/Helpers/sendMailNotification.php | 154 +++++----- app/Views/ticket_form_gmc.php | 7 + app/Views/ticket_form_gpa.php | 7 + app/Views/vehicle_master_list.php | 4 +- 9 files changed, 413 insertions(+), 81 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 5065832a..77b01b3d 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -29,6 +29,7 @@ $routes->get("updatePolicyTermsKey", "ClientController::updatePolicyTermsKey"); $routes->get("updateRemainderDate", "ClientController::updateRemainderDate"); $routes->get("sendCroneRemainderMail", "DashboardController::sendCroneRemainderMail"); $routes->get("sendextraparam", "ClientController::sendextraparam"); +$routes->get("updateRenewalData", "ClientController::updateRenewalData"); // $routes->post("iAgreeForAddOn", "EmployeeRestController::iAgreeForAddOn"); // $routes->get("sendCroneRemainderMail", "DashboardController::sendCroneRemainderMail"); // $routes->post("employeeUpload", "EmployeeRestController::employeeUpload"); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 6714a44d..63f167df 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -44,8 +44,11 @@ use App\Controllers\EmpDataServiceController; use App\Controllers\GoogleDriveController; use App\Helpers\sendMailNotification; +use App\Models\PTCOShareDetailsModel; use App\Models\RFQModel; use App\Models\TicketMasterModel; +use SebastianBergmann\Type\NullType; +use Kint\Kint; class ClientController extends AdminController { @@ -4321,4 +4324,307 @@ class ClientController extends AdminController } + // ----------------------------------------------------------------------------------------------------- + + + public function updateRenewalData() + { + $db = db_connect(); + $renewalData = $db->table('old_renewal_data_copy') + ->where('client_id IS NOT NULL') + ->where('is_inserted != 1') + ->get() + ->getResultArray(); + + $successData = []; + foreach ($renewalData as $key => $value) { + // Get branch_id properly + $branch = $this->clientBranchModel->where('client_id', $value['client_id'] ?? 0)->first(); + $value['branch_id'] = $branch['branch_id'] ?? null; + + // Fix vehicle_id key (previously "vehicel_id") + $value['vehicle_id'] = null; + if ($value['policy_type_id'] == 8 && !empty($value['policy_type_id'])) { + $value['vehicle_id'] = $this->prepareVehicleData($value); + } + + // Process client policy, policy transaction, and co-share details + $value['client_policy_id'] = $this->prepareClientPolicy($value); + $value['pt_id'] = $this->preparePolicyData($value); + $value['pt_co_id'] = $this->preparePtCoShareDetails($value); + + // Update is_inserted field in DB + $db->table('old_renewal_data_copy') + ->where('id', $value['id']) + ->set(['is_inserted' => 1]) + ->update(); + + $successData[] = ['id' => $value['id'], 'client' => $value['insured']]; + } + + kint::dump($successData); + } + + // private function preparePolicyData($renewalData) + // { + // $data = [ + // 'issuer' => $renewalData['issuer_type_id'], + // 'client_id' => $renewalData['client_id'], + // 'client_branch_id' => $renewalData['branch_id'] ?? null, + // 'vehicle_id' => $renewalData['vehicle_id'], + // 'insurer_id' => $renewalData['insurer_id'], + // 'insurer_branch_id' => $renewalData['insurer_branch_id'], + // 'policy_type_id' => $renewalData['policy_type_id'], + // 'client_policy_id' => $renewalData['client_policy_id'] ?? null, + // 'policy_no' => $renewalData['policy_no'], + // 'policy_issue_date' => $renewalData['date_date_of_issue'], + // 'policy_start_date' => $renewalData['date_policy_start_date'], + // 'policy_end_date' => $renewalData['date_policy_end_date'], + // 'policy_holder_name' => $renewalData['insured'], + // 'status' => 'completed', + // 'is_active' => 1, + // 'tsi' => '500000', + // 'month' => '2025-02-01', + // 'ct_type' => 1, + // 'cd_ac_pk' => $renewalData['cd_ac_pk'] ?? null, + // ]; + + // $policyTransactionModel = new PolicyTransactionModel(); + // return $policyTransactionModel->insert($data); + // } + + // private function prepareVehicleData($renewalData) + // { + // $vehicleData = [ + // 'vehicle_no' => $renewalData['veh_no'], + // 'owner' => $renewalData['client_id'], + // 'branch_id' => ($renewalData['client_type_id'] == 1) ? $renewalData['branch_id'] : null, + // ]; + + // $vehicleModel = new VehicleModel(); + // return $vehicleModel->insert($vehicleData); + // } + + // private function preparePtCoShareDetails($renewalData) + // { + // $ptCoShareDetails = [ + // 'pt_id' => $renewalData['pt_id'], + // 'insurer_id' => $renewalData['insurer_id'], + // 'insurer_branch_id' => $renewalData['insurer_branch_id'], + // 'co_share_type' => 0, + // 'co_share_per' => 0.00, + // 'bp_amt' => 0.00, + // 'tp_amt' => 0.00, + // 'tep_amt' => 0.00, + // 'follower_policy_no' => $renewalData['policy_no'], + // ]; + + // $ptCoShareDetailsModel = new PTCOShareDetailsModel(); + // return $ptCoShareDetailsModel->insert($ptCoShareDetails); + // } + + // private function prepareClientPolicy($renewalData) + // { + // $clientPolicy = [ + // 'client_id' => $renewalData['client_id'], + // 'client_branch_id' => $renewalData['branch_id'], + // 'policy_type_id' => $renewalData['policy_type_id'], + // 'insurer_id' => $renewalData['insurer_id'], + // 'insurer_branch_id' => $renewalData['insurer_branch_id'], + // 'policy_no' => $renewalData['policy_no'], + // 'policy_start_date' => $renewalData['date_policy_start_date'], + // 'policy_end_date' => $renewalData['date_policy_end_date'], + // 'policy_status' => 1, + // 'gst' => 18.00, + // 'cd_ac_pk' => $renewalData['cd_ac_pk'], + // ]; + + // $clientPolicyModel = new ClientPolicyModel(); + // return $clientPolicyModel->insert($clientPolicy); + // } + + private function preparePolicyData($renewalData) + { + $data = [ + 'issuer' => $renewalData['issuer_type_id'], + 'client_id' => $renewalData['client_id'], + 'client_branch_id' => $renewalData['branch_id'] ?? 0, + 'vehicle_id' => $renewalData['vehicel_id'], + 'insurer_id' => $renewalData['insurer_id'], + 'insurer_branch_id' => $renewalData['insurer_branch_id'], + 'tpa_id' => null, + 'tpa_branch_id' => null, + 'policy_type_id' => $renewalData['policy_type_id'], + 'client_policy_id' => $renewalData['client_policy_id'] ?? null, + 'issue_type' => 1, + 'source_client_policy_id' => null, + 'policy_no' => $renewalData['policy_no'], + 'cd_ac_no' => null, + 'policy_issue_date' => $renewalData['date_date_of_issue'], + 'policy_start_date' => $renewalData['date_policy_start_date'], + 'policy_end_date' => $renewalData['date_policy_end_date'], + 'action_type' => 'inception', + 'endorsement_no' => null, + 'data_received_date' => null, + 'closure_date' => null, + 'emp_count' => null, + 'dependent_count' => null, + 'revenue_type' => $renewalData['revenue_type'] ?? null, + 'co_share' => 0, + 'pre_payable_by' => 1, + 'bro_payable_by' => 1, + 'tsi' => '500000', + 'status' => 'completed', + 'ct_status' => 0, + 'is_active' => 1, + 'co_broking_status' => null, + 'installment' => 0, + 'installment_data' => null, + 'location' => null, + 'links' => null, + 'stage' => null, + 'etat' => null, + 'etat_band' => null, + 'edate' => null, + 'renewal_date' => null, + 'rollover_date' => null, + 'policy_holder_name' => $renewalData['insured'], + 'same_as_proposer' => 1, // 1 - Yes, 0 - No + 'ref' => $renewalData['ref'], + 'spl' => null, + 'fund_received' => null, + 'listed_insurers' => null, + 'ppteam' => null, + 'endorse_eff_date' => null, + 'month' => '2025-02-01', + 'sales_generated_by' => null, + 'serviced_by' => null, + 'ct_type' => 1, + 'ct_tran_id' => null, + 'remarks' => null, + 'cd_ac_pk' =>$renewalData['cd_ac_pk'] ?? null, + 'install_due_date' => null, + 'policy_with_corr' => 0 + ]; + + // kint::dump($data); + $policyTransactionModel = new PolicyTransactionModel(); + $id = $policyTransactionModel->insert($data); + return $id; + } + + private function prepareVehicleData($renewalData) + { + $vehicleData = [ + 'vehicle_no' => $renewalData['veh_no'], + 'type' => null, + 'description' => null, + 'owner' => $renewalData['client_id'], // client_id + 'branch_id' => $renewalData['client_type_id'] == 1 ? $renewalData['branch_id'] : null, // client_branch_id + 'old_owner' => null, + 'rc' => null, + ]; + + $VehicleModel = new VehicleModel(); + $id = $VehicleModel->insert($vehicleData); + return $id; + } + + private function preparePtCoShareDetails($renewalData) + { + $pt_co_share_details = [ + + 'pt_id' => $renewalData['pt_id'], + 'insurer_id' => $renewalData['insurer_id'], + 'insurer_branch_id' => $renewalData['insurer_branch_id'], + 'co_share_type' => 0, + 'co_share_per' => 0.00, + 'bp_amt' => 0.00, + 'bp_gst_amt' => 0.00, + 'bp_igst' => 0, + 'bp_sgst' => 0, + 'bp_cgst' => 0, + 'tp_amt' => 0.00, + 'tp_gst_amt' => 0.00, + 'tp_igst' => 0.00, + 'tp_sgst' => 0.00, + 'tp_cgst' => 0.00, + 'tep_amt' => 0.00, + 'tep_gst_amt' => 0.00, + 'tep_igst' => 0.00, + 'tep_sgst' => 0.00, + 'tep_cgst' => 0.00, + 'agreed_amt' => 0.00, + 'agreed_bp_per' => 0.00, + 'agreed_tp_per' => 0.00, + 'agreed_tep_per' => 0.00, + 'standerd_bp_per' => 0.00, + 'standerd_tp_per' => 0.00, + 'standerd_tep_per' => 0.00, + 'actual_bp_amt' => 0.00, + 'actual_tp_amt' => 0.00, + 'actual_tep_amt' => 0.00, + 'actual_bp_per' => 0.00, + 'actual_tp_per' => 0.00, + 'actual_tep_per' => 0.00, + 'actual_bp_brokerage_amt' => 0.00, + 'actual_tp_brokerage_amt' => 0.00, + 'actual_tep_brokerage_amt' => 0.00, + 'reward' => 0.00, + 'exp_amt' => 0.00, + 'variance' => 0.00, + 'remark' => null, + 'cd_ac_no' => null, + 'amount' => 0.00, + 'stamp_duty' => 0.00, + 'gst_type' => 0, + 'cop_amt' => 0.00, + 'statement_id' => 0, + 'follower_policy_no' => $renewalData['policy_no'], + 'non_comm_per_amt' => 0.00 + ]; + + $PTCOShareDetailsModel = new PTCOShareDetailsModel(); + $id = $PTCOShareDetailsModel->insert($pt_co_share_details); + return $id; + + } + + private function prepareClientPolicy($renewalData) + { + $client_policy = [ + 'client_id' => $renewalData['client_id'], + 'client_branch_id' => $renewalData['branch_id'], + 'policy_type_id' => $renewalData['policy_type_id'], + 'insurer_id' => $renewalData['insurer_id'], + 'insurer_branch_id' => $renewalData['insurer_branch_id'], + 'tpa_id' => null, + 'tpa_branch_id' => null, + 'policy_start_date' => $renewalData['date_policy_start_date'], + 'policy_end_date' => $renewalData['date_policy_end_date'], + 'policy_no' => $renewalData['policy_no'], + 'cd_ac_no' => null, + 'policy_status' => 1, + 'policy_terms' => null, + 'is_addon' => 1, + 'base_policy' => null, + 'inception_type' => 1, + 'open_for_enrollment' => 0, + 'gst' => 18.00, + 'enrolment_visibility' => 1, + 'open_date' => null, + 'close_date' => null, + 'reminder_date' => null, + 'disclaimer' => null, + 'is_member_modify_allowed' => 0, + 'cd_ac_pk' => $renewalData['cd_ac_pk'], + 'is_lgbtq' => 0 + ]; + + $ClientPolicyModel = new ClientPolicyModel(); + $id = $ClientPolicyModel->insert($client_policy); + return $id; + } + + } diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index ff032276..856ef118 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -951,7 +951,7 @@ class EmpDataServiceController extends BaseController if(empty($additionData) && empty($deletionData) && empty($inceptionData) && empty($correctionData) && empty($enhancementData) && empty($dependentAdditionData)){ - return 0; + return false; } //for cd tranction and cd master data is empty check diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index a613c87b..e81684f7 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -590,7 +590,16 @@ class EmployeeController extends AdminController $batch_data['event_type'] = $array; $return = $empDataServiceController->generateExcelForAllEventType($batch_data); - if($return === 6){ + if ($return === 0) { + session()->setFlashdata('error', "Insufficient deposit amount."); + return redirect()->to(base_url('employee/upload')); + + }else if($return === 5){ + + session()->setFlashdata('error', "The policy does not have a CD account number."); + return redirect()->to(base_url('employee/upload')); + } + else if($return === 6){ session()->setFlashdata('error', "The Insurer does not have an Excel export template format."); return redirect()->to(base_url('employee/upload')); diff --git a/app/Controllers/NotificationController.php b/app/Controllers/NotificationController.php index 0dd29522..efdc2571 100755 --- a/app/Controllers/NotificationController.php +++ b/app/Controllers/NotificationController.php @@ -179,7 +179,7 @@ class NotificationController extends AdminController // This function for sent a mail for testing public function sentTestMail($template_id, $test_mail) { - $notification_data = $this->notificationModel->where('id', $template_id)->where('enabled', 1)->first(); + $notification_data = $this->notificationModel->where('id', $template_id)->first(); $client_data = $this->clientModel->where('id', $notification_data['client_id'])->where('is_active', 1)->first(); if(!empty($notification_data)){ diff --git a/app/Helpers/sendMailNotification.php b/app/Helpers/sendMailNotification.php index 3ecb7932..ee8145dc 100755 --- a/app/Helpers/sendMailNotification.php +++ b/app/Helpers/sendMailNotification.php @@ -49,13 +49,13 @@ class sendMailNotification $nhance_logo = $_ENV['NHANCE_LOGO']; $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[member_name]]", $employee_name, $mail_content); - $mail_content = str_replace("[[member_mobile]]", $employee_mobile_no, $mail_content); - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $employee_name, $mail_content); + $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $employee_mobile_no, $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); if ($dataToInsert['relationship'] == 'Self' && $mail != null || $mail != '') { $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments, 'common' => $common]; } @@ -77,16 +77,16 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); $employee_name =$emp_data['name']; $employee_mobile_no =$emp_data['mobile']; - $mail_content = str_replace("[[member_name]]", $employee_name, $mail_content); - $mail_content = str_replace("[[member_mobile]]", $employee_mobile_no, $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $employee_name, $mail_content); + $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $employee_mobile_no, $mail_content); $mail = $emp_data['email_corporate']; $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; @@ -128,16 +128,17 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; // $client_logo = $nhance_logo; - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); - $mail_content = str_replace("[[member_name]]", $name, $mail_content); - $mail_content = str_replace("[[member_mobile]]", $employee_mobile_no, $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(["[[member_name]]", "{{member_name}}"], $name, $mail_content); + $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $employee_mobile_no, $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); + $mail_content = str_replace(["[[post_enrollment_app_link]]", "{{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("[[client_name]]", $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[ecard_download_link]]", "{{ecard_download_link}}"], "Download Insurance Card", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common]; return $wholeData; @@ -172,11 +173,11 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; // $client_logo = $nhance_logo; - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); // Step 1: Replace the placeholder with an HTML table structure $mail = ''; @@ -518,9 +519,9 @@ class sendMailNotification // dd($payable_employee_array, $Addon_list); // print_r($table_content); die; - $mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content); - $mail_content = str_replace("[[member_mobile]]", $employee_mobile_no, $mail_content); - $mail_content = str_replace("[[member_summary]]", $table_content , $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); + $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $employee_mobile_no, $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); // print_r($mail_content); die; @@ -570,11 +571,11 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; // $client_logo = $nhance_logo; - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); // Step 1: Replace the placeholder with an HTML table structure $mail = ''; @@ -816,13 +817,13 @@ class sendMailNotification } - $mail_content = str_replace("[[member_summary]]", $table_content , $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); $account_manager_mail_list = []; if(isset($user_list)){ foreach ($user_list as $key => $value) { $full_name = $value['first_name'] .' ' .$value['last_name']; - $mail_content = str_replace("[[member_name]]", $full_name , $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $full_name , $mail_content); $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to'], 'common' => $common]; // $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']]; @@ -868,11 +869,11 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; // $client_logo = $nhance_logo; - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); // Step 1: Replace the placeholder with an HTML table structure $mail = ''; @@ -1115,7 +1116,7 @@ class sendMailNotification // $table_content .= '
' . $sum_total_words . '
'; } - $mail_content = str_replace("[[member_summary]]", $table_content , $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); $hr_mails = $client_data['hr_mails']; @@ -1173,13 +1174,13 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[member_name]]", $employee_name, $mail_content); - $mail_content = str_replace("[[member_mobile]]", $mobile, $mail_content); - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $employee_name, $mail_content); + $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $mobile, $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); if ($mail != null || $mail != '') { $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'attachments' => $attachments]; @@ -1204,11 +1205,12 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); - $mail_content = str_replace("[[member_mobile]]", $mobile, $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $employee_name, $mail_content); + $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $mobile, $mail_content); if ((isset($notification_data) && $notification_data['enabled'] == 1)) { @@ -1256,15 +1258,15 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); - $mail_content = str_replace("[[member_name]]", $name, $mail_content); - $mail_content = str_replace("[[member_mobile]]", $mobile, $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("[[ecard_download_link]]", "Download Insurance Card", $mail_content); - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name, $mail_content); + $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $mobile, $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); + $mail_content = str_replace(["[[post_enrollment_app_link]]", "{{post_enrollment_app_link}}"], "Review Details", $mail_content); + $mail_content = str_replace(["[[ecard_download_link]]", "{{ecard_download_link}}"], "Download Insurance Card", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails'],'attachments' => $attachments, 'reply_to' => $client_data['reply_to']]; @@ -1301,11 +1303,11 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); // Step 1: Replace the placeholder with an HTML table structure $table_content = ''; @@ -1413,9 +1415,9 @@ class sendMailNotification } } - $mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content); - $mail_content = str_replace("[[member_mobile]]", $mobile, $mail_content); - $mail_content = str_replace("[[member_summary]]", $table_content , $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); + $mail_content = str_replace(["[[member_mobile]]", "{{member_mobile}}"], $mobile, $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to']]; @@ -1453,11 +1455,11 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); // Step 1: Replace the placeholder with an HTML table structure $table_content = ''; @@ -1563,8 +1565,8 @@ class sendMailNotification } } - $mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content); - $mail_content = str_replace("[[member_summary]]", $table_content , $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; @@ -1600,11 +1602,11 @@ class sendMailNotification $client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo']; - $mail_content = str_replace("[[nhance_logo]]", "Nhance Logo", $mail_content); - $mail_content = str_replace("[[client_logo]]", "Client Logo", $mail_content); - $mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content); + $mail_content = str_replace(["[[nhance_logo]]", "{{nhance_logo}}"], "Nhance Logo", $mail_content); + $mail_content = str_replace(["[[client_logo]]", "{{client_logo}}"], "Client Logo", $mail_content); + $mail_content = str_replace(["[[client_name]]", "{{client_name}}"], $client_data['client_name'], $mail_content); - $mail_content = str_replace("[[app_link]]", "Review Details", $mail_content); + $mail_content = str_replace(["[[app_link]]", "{{app_link}}"], "Review Details", $mail_content); // Step 1: Replace the placeholder with an HTML table structure $table_content = ''; @@ -1712,8 +1714,8 @@ class sendMailNotification } } - $mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content); - $mail_content = str_replace("[[member_summary]]", $table_content , $mail_content); + $mail_content = str_replace(["[[member_name]]", "{{member_name}}"], $name . ' (' . $emp_code . ')' , $mail_content); + $mail_content = str_replace(["[[member_summary]]", "{{member_summary}}"], $table_content , $mail_content); $wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'reply_to' => $client_data['reply_to']]; diff --git a/app/Views/ticket_form_gmc.php b/app/Views/ticket_form_gmc.php index d24e22c7..5e02f45c 100644 --- a/app/Views/ticket_form_gmc.php +++ b/app/Views/ticket_form_gmc.php @@ -219,6 +219,13 @@ name="pod_no"> +
+ + +
+
diff --git a/app/Views/ticket_form_gpa.php b/app/Views/ticket_form_gpa.php index 4a4a741d..a072d1dc 100644 --- a/app/Views/ticket_form_gpa.php +++ b/app/Views/ticket_form_gpa.php @@ -195,6 +195,13 @@ name="si_amt">
+
+ + +
+
diff --git a/app/Views/vehicle_master_list.php b/app/Views/vehicle_master_list.php index f28ef11f..67a9bc94 100644 --- a/app/Views/vehicle_master_list.php +++ b/app/Views/vehicle_master_list.php @@ -85,8 +85,8 @@ table.dataTable tbody td { - - + +