From d607afe5edb79a5716e4fe2b04fd0370578fd6c5 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sun, 17 Aug 2025 21:39:57 +0530 Subject: [PATCH 1/8] CHANGE TICKETING SYSTEM - VADIVEL J 2025-08-17 --- app/Config/Routes.php | 4 +- app/Controllers/ThzController.php | 82 +++++++++++++++---------------- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 3aaaaabd..b6233e82 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -636,6 +636,6 @@ $routes->post('enrollment','VidalApiController::enrollment'); $routes->post("ticketSave", "ThzController::ticketSave"); -$routes->post("ticketList", "ThzController::ticketList"); +$routes->get("ticketList", "ThzController::ticketList"); $routes->post("ticketConversationSave", "ThzController::ticketConversationSave"); -$routes->post("ticketConversationList", "ThzController::ticketConversationList"); \ No newline at end of file +$routes->get("ticketConversationList", "ThzController::ticketConversationList"); \ No newline at end of file diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index be2d0f5f..c5fd2d17 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -8,6 +8,7 @@ use CodeIgniter\HTTP\ResponseInterface; use App\Models\ThzMasterModel; use App\Models\ThzMasterNotesModel; use App\ControllerCleaners\ThzControllerCleaner; +use app\Models\UserModel; class ThzController extends BaseController { @@ -17,11 +18,14 @@ class ThzController extends BaseController protected $thzControllerCleaner; + protected $userModel; + public function __construct() { $this->thzMasterModel = new ThzMasterModel(); $this->thzMasterNotesModel = new ThzMasterNotesModel(); $this->thzControllerCleaner = new ThzControllerCleaner(); + $this->userModel = new UserModel(); } public function index() @@ -33,34 +37,26 @@ class ThzController extends BaseController $data = $this->request->getJSON(true); - if (!empty($data['thz_id'])) { - $data['updated_by'] = get_session_userid(); - $ticket_id = $data['thz_id']; - $text = "update"; - - $result = $this->thzMasterModel->where('thz_id', $ticket_id)->set($data)->update(); + if (!empty($data['thz_id'])) { + $text = "update"; + $result = $this->updateTicket($data); } else { - $data['created_by'] = get_session_userid(); - $text = "create"; - - $result = $this->thzMasterModel->insert($data); + $text = "create"; + $result = $this->insertTicket($data); } - return $this->response->setJSON(([ 'status' => $result ? 'success' : 'error' , - 'message' => $result ? "Ticket {$text}d successfully" : "Unable to {$text} ticket. Please try again." ])); - - - - + return $this->response->setJSON([ + 'status' => $result ? 'success' : 'error', + 'message' => $result ? "Ticket {$text}d successfully" : "Unable to {$text} ticket. Please try again." + ]); } - public function ticketList() { $returnType = strtolower($this->request->getGet('return_type') ?? 'api'); - $data = $this->request->getJSON(true); + $data = $this->request->getGet(); $tickets = $this->fetchTicketsBasedOnrole($data); @@ -86,16 +82,15 @@ class ThzController extends BaseController ]); } - public function ticketConversationSave(){ $data = $this->request->getJSON(true); $result = $this->thzMasterNotesModel->insert($data); - if(empty($result)){ - return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); - } + if(empty($result)){ + return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); + } return $this->response->setJSON((['status' => 'success', 'data' => $result])); @@ -104,40 +99,24 @@ class ThzController extends BaseController public function ticketConversationList(){ - $data = $this->request->getJSON(true); + $data = $this->request->getGet(); $thz_id = $data['thz_id'] ?? null; $result = $this->thzMasterNotesModel->ticketConversationList($thz_id); - if(empty($result)){ - return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); - } + if(empty($result)){ + return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); + } return $this->response->setJSON((['status' => 'success', 'data' => $result])); } - - /************************************************** PRIVATE FUNCTIONS ********************************************************/ - private function checkGeneralUserOrEmployee($data){ - - if($data['empcode']){ - return $data['empcode']; - } elseif ($data['mobile']) { - return $data['mobile']; - } elseif ($data['email']) { - return $data['email']; - } else { - return null; - } - - } - private function fetchTicketsBasedOnrole(array $data): array { $id = $data['thz_id'] ?? null; @@ -163,6 +142,25 @@ class ThzController extends BaseController return $this->thzMasterModel->findAll(); } + private function updateTicket($data){ + + $data['updated_by'] = get_session_userid(); + $ticket_id = $data['thz_id']; + $result = $this->thzMasterModel->where('thz_id', $ticket_id)->set($data)->update(); + + return $result; + + } + + private function insertTicket($data){ + + $data['created_by'] = get_session_userid(); + $result = $this->thzMasterModel->insert($data); + + return $result; + + } + } From 2918ee067658418ae1d3b72c66741f6b91ca760d Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 18 Aug 2025 11:00:43 +0530 Subject: [PATCH 2/8] CHANGE UI CHANGE FINAL - VADIVEL J 2025-08-17 --- app/Config/Routes.php | 3 +- app/Controllers/ThzController.php | 79 ++++++++++++++++--- app/Views/bds_dash.php | 2 +- app/Views/business_team_list.php | 4 +- app/Views/claims_dash.php | 2 +- app/Views/client_deposit_list.php | 2 +- app/Views/client_onboarding.php | 2 +- app/Views/finance_team_list.php | 4 +- app/Views/hr_activity_history.php | 4 +- app/Views/insurer_onboarding.php | 2 +- app/Views/irba_report.php | 4 +- app/Views/kyc_onboarding.php | 2 +- app/Views/layout/header.php | 3 + app/Views/leads_dash.php | 2 +- app/Views/outstanding_report_list.php | 4 +- .../policy_transaction_endorsement_list.php | 4 +- .../policy_transaction_inception_list.php | 4 +- app/Views/policy_type_onboarding.php | 2 +- app/Views/renewal_search.php | 4 +- app/Views/report_bds_filter.php | 4 +- app/Views/ticket_conversation.php | 4 +- app/Views/ticket_edit_onbording.php | 2 +- app/Views/ticket_form_gmc.php | 4 +- app/Views/ticket_form_gpa.php | 4 +- app/Views/ticket_reports.php | 4 +- app/Views/tpa_onboarding.php | 2 +- app/Views/variance_report_list.php | 4 +- app/Views/view_deposit.php | 2 +- .../libs/bootstrap-daterangepicker/index.html | 6 +- .../website/index.html | 6 +- 30 files changed, 118 insertions(+), 57 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b6233e82..bafc5373 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -638,4 +638,5 @@ $routes->post('enrollment','VidalApiController::enrollment'); $routes->post("ticketSave", "ThzController::ticketSave"); $routes->get("ticketList", "ThzController::ticketList"); $routes->post("ticketConversationSave", "ThzController::ticketConversationSave"); -$routes->get("ticketConversationList", "ThzController::ticketConversationList"); \ No newline at end of file +$routes->get("ticketConversationList", "ThzController::ticketConversationList"); +$routes->get('ticketAssigning',"ThzController::ticketAssigning"); \ No newline at end of file diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index c5fd2d17..2b9dafcc 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -37,18 +37,18 @@ class ThzController extends BaseController $data = $this->request->getJSON(true); - if (!empty($data['thz_id'])) { - $text = "update"; - $result = $this->updateTicket($data); - } else { - $text = "create"; - $result = $this->insertTicket($data); - } + if (!empty($data['thz_id'])) { + $text = "update"; + $result = $this->updateTicket($data); + } else { + $text = "create"; + $result = $this->insertTicket($data); + } - return $this->response->setJSON([ - 'status' => $result ? 'success' : 'error', - 'message' => $result ? "Ticket {$text}d successfully" : "Unable to {$text} ticket. Please try again." - ]); + return $this->response->setJSON([ + 'status' => $result ? 'success' : 'error', + 'message' => $result ? "Ticket {$text}d successfully" : "Unable to {$text} ticket. Please try again." + ]); } public function ticketList() @@ -111,6 +111,46 @@ class ThzController extends BaseController return $this->response->setJSON((['status' => 'success', 'data' => $result])); + } + + public function ticketSaveNotification($data){ + + } + + public function ticketConversationSaveNotification($data){ + + } + + public function ticketAssigning(){ + + $returnType = strtolower($this->request->getGet('return_type') ?? 'api'); + + $data = $this->request->getVar(); + + $assignee_id = $data['assignee_id']; + + $thz_id = $data['thz_id']; + + $result = $this->thzMasterModel->set('assign_to',$assignee_id)->where('thz_id',$thz_id)->update(); + + if($returnType === 'api'){ + + if(empty($result)){ + return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); + } + + return $this->response->setJSON((['status' => 'success', 'data' => $result])); + + }else{ + + + + } + + + + + } @@ -142,6 +182,23 @@ class ThzController extends BaseController return $this->thzMasterModel->findAll(); } + private function notificationBasedOnRole($data){ + + $id = $data['thz_id'] ?? null; + $assign_to = $data['assign_to'] ?? null; + $mobile = $data['mobile'] ?? null; + + if (!empty($assign_to)) { + + } + + if (!empty($id) && !empty($mobile)) { + + } + + + } + private function updateTicket($data){ $data['updated_by'] = get_session_userid(); diff --git a/app/Views/bds_dash.php b/app/Views/bds_dash.php index 24a5effa..9f27e8a2 100644 --- a/app/Views/bds_dash.php +++ b/app/Views/bds_dash.php @@ -160,7 +160,7 @@
Current Tile : diff --git a/app/Views/outstanding_report_list.php b/app/Views/outstanding_report_list.php index 97d8f40c..682180a8 100644 --- a/app/Views/outstanding_report_list.php +++ b/app/Views/outstanding_report_list.php @@ -132,8 +132,8 @@ table.dataTable tbody td {
-   - +   +
diff --git a/app/Views/policy_transaction_endorsement_list.php b/app/Views/policy_transaction_endorsement_list.php index 52eb4fea..03530e65 100644 --- a/app/Views/policy_transaction_endorsement_list.php +++ b/app/Views/policy_transaction_endorsement_list.php @@ -268,8 +268,8 @@ custom-dropdown-menu {
@@ -58,7 +58,7 @@
-
@@ -51,7 +51,7 @@
-
-   - +   +
> > diff --git a/app/Views/tpa_onboarding.php b/app/Views/tpa_onboarding.php index 2d6196aa..107d61f9 100755 --- a/app/Views/tpa_onboarding.php +++ b/app/Views/tpa_onboarding.php @@ -39,7 +39,7 @@ body {

TPA

- "> + ">