From 4d3fde7b938410c758bf100cdc02458806f4213d Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Fri, 29 Aug 2025 12:55:43 +0530 Subject: [PATCH] FIX_Email History and Ticket form handler --- app/Config/Routes.php | 1 + app/Controllers/LeadsController.php | 24 ++++ app/Views/layout/header.php | 15 ++- app/Views/leads_list.php | 164 +++++++++++++++++++++++++++- app/Views/thz_list.php | 10 +- app/Views/thz_notes.php | 46 ++++---- app/Views/ticket_form_handler.php | 32 +++--- 7 files changed, 239 insertions(+), 53 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 42964439..a4e9d368 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -369,6 +369,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $routes->get('getPolicyTypeFields', 'LeadsController::getPolicyTypeFields'); $routes->get('removeMultiFile', 'LeadsController::removeMultiFile'); $routes->get('removeInstallments', 'LeadsController::removeInstallments'); + $routes->get('getLeadEmailHistory/(:any)', 'LeadsController::getLeadEmailHistory/$1'); $routes->get('viewHrAccessData', 'ClientController::viewHrAccessData'); $routes->post('saveHrAccessData', 'ClientController::saveHrAccessData'); $routes->get('removeLevelContacts', 'ClientController::removeLevelContacts'); diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index dd227132..742ca2cf 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -31,6 +31,7 @@ use App\Models\InsurerModel; use App\Models\OccupancyMasterModel; use App\Models\LeadFilesModel; use App\Models\LeadInstallmentPaymentDetails; +use App\Models\GmailSentHistoryModel; use App\Helpers\MailHelper; use App\Helpers\ExcelMergeHelper; @@ -70,6 +71,7 @@ class LeadsController extends BaseController protected $occupancyModel; protected $leadFilesModel; protected $leadInstallmentPaymentDetails; + protected $gmailSentHistoryModel; //variables for storing array protected $issuer; @@ -102,6 +104,7 @@ class LeadsController extends BaseController $this->occupancyModel = new OccupancyMasterModel(); $this->leadFilesModel = new LeadFilesModel(); $this->leadInstallmentPaymentDetails = new LeadInstallmentPaymentDetails(); + $this->gmailSentHistoryModel = new GmailSentHistoryModel(); $this->issuer = [1 => 'JIBS', 2 => 'Nhance']; $this->clientType = [1 => 'Group', 2 => 'Individual']; @@ -3668,6 +3671,27 @@ class LeadsController extends BaseController return $this->loadLayout('leads_form_handler', $data); } + public function getLeadEmailHistory($id){ + if(!empty($id)){ + $result = $this->gmailSentHistoryModel + ->where('pk', $id) + ->where('module',"leads") + ->findAll(); + if(!empty($result)){ + $result = !empty($result) ? $result : []; + return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200); + }else{ + return $this->response->setJSON((['status' => 'error', 'message' => 'No History found']))->setStatusCode(400); + } + }else{ + return $this->response->setJSON((['status' => 'error', 'message' => 'ID not found']))->setStatusCode(404); + } + + + // Select * from gmail_sent_history where pk != "" and module = "leads"; + // echo $id; + } + public function getPolicyTypeFields() { diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 97601554..83061695 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -680,11 +680,10 @@ a.app-badge-secondary:focus, a.app-badge-secondary.focus { .app-table-body td { background: #F5FFFF; padding: 12px; - border-top: 1px solid #eee; - border-bottom: 1px solid #eee; + border-top: 0px solid #fff !important; + border-bottom: 0px solid #fff !important; } - .app-table-head th:first-child { border-top-left-radius: 15px !important; border-bottom-left-radius: 15px !important; @@ -694,7 +693,6 @@ a.app-badge-secondary:focus, a.app-badge-secondary.focus { border-bottom-right-radius: 15px !important; } - .app-table-body tr td:first-child { border-top-left-radius: 15px !important; border-bottom-left-radius: 15px !important; @@ -704,6 +702,15 @@ a.app-badge-secondary:focus, a.app-badge-secondary.focus { border-bottom-right-radius: 15px !important; } +.app-table-body tr:hover td { + background-color: #e0e0e0; +} + +.app-datatable { + border-collapse: separate !important; + border-spacing: 0 8px !important; /* space between rows */ + width: 100%; +} diff --git a/app/Views/leads_list.php b/app/Views/leads_list.php index 85cd4a6c..42948856 100644 --- a/app/Views/leads_list.php +++ b/app/Views/leads_list.php @@ -215,6 +215,12 @@ table.dataTable tbody td { + + Email History + @@ -266,6 +272,22 @@ table.dataTable tbody td { + + + + + \ No newline at end of file diff --git a/app/Views/thz_list.php b/app/Views/thz_list.php index 44cecd6f..4c38f373 100644 --- a/app/Views/thz_list.php +++ b/app/Views/thz_list.php @@ -18,17 +18,11 @@ tbody tr { /* box-shadow: 0 2px 5px rgba(0,0,0,0.08); */ } -/* Hover effect */ -#scroll-horizontal-datatable tbody tr:hover td { - background-color: #e0e0e0; - -} - - /* Search input with icon */ .dataTables_filter { position: absolute; } + .dataTables_filter input { padding-right: 30px; background: url('https://cdn.jsdelivr.net/npm/@mdi/svg/svg/magnify.svg') no-repeat right 8px center; @@ -212,7 +206,7 @@ table thead th {
- +
diff --git a/app/Views/thz_notes.php b/app/Views/thz_notes.php index 755a1af1..a5bf3ea1 100644 --- a/app/Views/thz_notes.php +++ b/app/Views/thz_notes.php @@ -1,12 +1,4 @@
Ticket ID