From 03e90088988732cbf2744486d7ad0595812f7455 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Thu, 14 Aug 2025 11:51:06 +0530 Subject: [PATCH 01/49] FIX_VIEW_TERS : RV --- app/Controllers/TicketController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 95a4bbe2..4c344c28 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -95,6 +95,7 @@ class TicketController extends BaseController 4 => "Smart Service Desk", 5 => "Direct to TPA" ]; + $this->claimType = [ 1 => [ 1 => "Main Hospitalization", @@ -2383,7 +2384,7 @@ class TicketController extends BaseController // 5. Merge the Sum Insured value if the multiple sum insured exists if(isset($data['multiple_sum_insured'])){ - if($data['sumInsured2']){ + if(isset($data['sumInsured2'])){ $data['sumInsured2'] = $data['sumInsured2'] . ", " . implode(", ", $data['multiple_sum_insured']); }else{ $data['sum_insured'] = $data['sum_insured'] . ", " . implode(", ", $data['multiple_sum_insured']); From b3361766fea082772a913fcce107326834959235 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Thu, 14 Aug 2025 12:37:35 +0530 Subject: [PATCH 02/49] FIX_LEAD_VIEW_DEMO : RV --- app/Controllers/LeadsController.php | 177 +++++++++++++++------------- app/Views/view_rfq.php | 2 +- 2 files changed, 93 insertions(+), 86 deletions(-) diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 4d7e2170..fc4a4e86 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -2080,95 +2080,102 @@ class LeadsController extends BaseController if (!$lead_data) { return ['status' => 'failed', 'message' => 'Lead data not found']; } - if ($lead_data['file_name']) { - // $file_name_with_path = WRITEPATH . "/uploads/lead_files/NonPrintableCharacters.xlsx"; - //check physical file - if (!file_exists($file_name_with_path)) { - //file not found update status and reason - $message = "Lead Physcial file not found"; - // echo $message; - $this->myLogger->logme('error', ($message . ' for file ' . $file_name_with_path)); - return ['status' => 'failed', 'message' => 'no physical file']; - } + try{ + if ($lead_data['file_name']) { + // $file_name_with_path = WRITEPATH . "/uploads/lead_files/NonPrintableCharacters.xlsx"; - $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path); - - //get members data - $members_sheet = $spreadsheet->getSheet(0); - $highestRowAndColumn = $members_sheet->getHighestRowAndColumn(); - // dd($highestRowAndColumn); - $uncleaned_members = $members_sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); - $members = ExcelSanitizeHelper::sanitizeArrayData($uncleaned_members); - //get age band data - $age_band_sheet = $spreadsheet->getSheet(1); - $highestRowAndColumn = $age_band_sheet->getHighestRowAndColumn(); - $age_band_data = $age_band_sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); - - - //check age or dob column - $members_heading = $members[0]; - $available_col = null; - $col_index = null; - - if (in_array('age', array_map('strtolower', $members_heading))) { - $available_col = 'age'; - $col_index = array_search('age', array_map('strtolower', $members_heading)); - } elseif (in_array('dob', array_map('strtolower', $members_heading))) { - $available_col = 'dob'; - $col_index = array_search('dob', array_map('strtolower', $members_heading)); - } - - if ($available_col == null) { - $message = 'No DOB or Age column '; - $this->myLogger->logme('error', ($message . $file_name_with_path)); - return ['status' => 'failed', 'message' => $message]; - } - - try { - $classifiers = $this->getDemographyData($members, $age_band_data, $members_heading, $available_col, $col_index); - } catch (Exception $e) { - return ['status' => 'fail', 'message' => $e->getMessage()]; - } - - //for this to view the demography in the RFQ and QCR page to using internal - if($returnType == "internal"){ - return ['data' => $classifiers]; - // print_rr($classifiers); die; - } - - - try { - $result = $this->generateClassifierSpreadsheet($classifiers, WRITEPATH . 'uploads/lead_files/'); - if ($result['success']) { - $this->myLogger->logme('error', "Spreadsheet generated successfully!"); - - echo "Location: " . $result['fullpath'] . "\n"; - echo "Filename: " . $result['filename'] . "\n"; - $filePaths = [ - ['file_path' => WRITEPATH . 'uploads/lead_files/' . $lead_data['file_name'], 'sheets' => [0, 1]], - ['file_path' => WRITEPATH . '/uploads/lead_files/' . $result['filename'], 'sheets' => []], - ]; - $outputPath = WRITEPATH . 'uploads/lead_files/' . $lead_data['file_name']; - $result_merge = ExcelMergeHelper::mergeExcelFiles($filePaths, $outputPath); - if ($result_merge) { - // Call the delete function after the file is successfully created - $deleteResponse = $this->deleteGeneratedFile($result['fullpath']); - - // Add delete message to response - $response['deleteMessage'] = $deleteResponse['message']; - return ['status' => 'success', 'message' => 'Member_Data Merged Suceesfully']; - } - } else { - echo "Error generating spreadsheet: " . $result['error']; + //check physical file + if (!file_exists($file_name_with_path)) { + //file not found update status and reason + $message = "Lead Physcial file not found"; + // echo $message; + $this->myLogger->logme('error', ($message . ' for file ' . $file_name_with_path)); + return ['status' => 'failed', 'message' => 'no physical file']; } - } catch (Exception $e) { - echo "Error: " . $e->getMessage(); - return ['status' => 'fail', 'message' => $e->getMessage()]; + + $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path); + + //get members data + $members_sheet = $spreadsheet->getSheet(0); + $highestRowAndColumn = $members_sheet->getHighestRowAndColumn(); + // dd($highestRowAndColumn); + $uncleaned_members = $members_sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); + $members = ExcelSanitizeHelper::sanitizeArrayData($uncleaned_members); + //get age band data + $age_band_sheet = $spreadsheet->getSheet(1); + $highestRowAndColumn = $age_band_sheet->getHighestRowAndColumn(); + $age_band_data = $age_band_sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']); + + + //check age or dob column + $members_heading = $members[0]; + $available_col = null; + $col_index = null; + + if (in_array('age', array_map('strtolower', $members_heading))) { + $available_col = 'age'; + $col_index = array_search('age', array_map('strtolower', $members_heading)); + } elseif (in_array('dob', array_map('strtolower', $members_heading))) { + $available_col = 'dob'; + $col_index = array_search('dob', array_map('strtolower', $members_heading)); + } + + if ($available_col == null) { + $message = 'No DOB or Age column '; + $this->myLogger->logme('error', ($message . $file_name_with_path)); + return ['status' => 'failed', 'message' => $message]; + } + + try { + $classifiers = $this->getDemographyData($members, $age_band_data, $members_heading, $available_col, $col_index); + } catch (Exception $e) { + return ['status' => 'fail', 'message' => $e->getMessage()]; + } + + //for this to view the demography in the RFQ and QCR page to using internal + if($returnType == "internal"){ + return ['data' => $classifiers]; + // print_rr($classifiers); die; + } + + + try { + $result = $this->generateClassifierSpreadsheet($classifiers, WRITEPATH . 'uploads/lead_files/'); + if ($result['success']) { + $this->myLogger->logme('error', "Spreadsheet generated successfully!"); + + echo "Location: " . $result['fullpath'] . "\n"; + echo "Filename: " . $result['filename'] . "\n"; + $filePaths = [ + ['file_path' => WRITEPATH . 'uploads/lead_files/' . $lead_data['file_name'], 'sheets' => [0, 1]], + ['file_path' => WRITEPATH . '/uploads/lead_files/' . $result['filename'], 'sheets' => []], + ]; + $outputPath = WRITEPATH . 'uploads/lead_files/' . $lead_data['file_name']; + $result_merge = ExcelMergeHelper::mergeExcelFiles($filePaths, $outputPath); + if ($result_merge) { + // Call the delete function after the file is successfully created + $deleteResponse = $this->deleteGeneratedFile($result['fullpath']); + + // Add delete message to response + $response['deleteMessage'] = $deleteResponse['message']; + return ['status' => 'success', 'message' => 'Member_Data Merged Suceesfully']; + } + } else { + echo "Error generating spreadsheet: " . $result['error']; + } + } catch (Exception $e) { + echo "Error: " . $e->getMessage(); + return ['status' => 'fail', 'message' => $e->getMessage()]; + } + } else { + $this->myLogger->logme('error', (' no file found ' . $file_name_with_path)); + return ['status' => 'failed', 'message' => 'no file found']; } - } else { - $this->myLogger->logme('error', (' no file found ' . $file_name_with_path)); - return ['status' => 'failed', 'message' => 'no file found']; + + }catch(Exception $e){ + $this->myLogger->logme("error", "Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString()); + return ['status' => 'fail', 'error' => "File not found / Wrong file"]; } } diff --git a/app/Views/view_rfq.php b/app/Views/view_rfq.php index f00350cb..58e0fc03 100644 --- a/app/Views/view_rfq.php +++ b/app/Views/view_rfq.php @@ -706,7 +706,7 @@ if(isset($demogrphy_html_data) && !empty($demogrphy_html_data)){ echo $demogrphy_html_data; }else{ - echo "

No Demography Data Found

"; + echo "

No Demography Data Found or Wrong File

"; } ?> From 1240eef35ced3da910ea7dd836427cf7cddedefb Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Thu, 14 Aug 2025 14:34:29 +0530 Subject: [PATCH 03/49] CHNAGE_DEMOGRAPHY : RV --- app/Views/view_rfq.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Views/view_rfq.php b/app/Views/view_rfq.php index 58e0fc03..9e906235 100644 --- a/app/Views/view_rfq.php +++ b/app/Views/view_rfq.php @@ -293,7 +293,7 @@ onclick="checkTheTableDataChanged(3)">Send Insurer Mail - + From b933a02561b2898234c9ebc68cf550f810b62dc7 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 16 Aug 2025 12:47:49 +0530 Subject: [PATCH 04/49] CHANGE DASHBOARD THEME NEW - VADIVEL J 2025-08-16 --- app/Config/Routes.php | 5 +- app/Controllers/ThzController.php | 75 +- app/Models/ThzMasterNotesModel.php | 4 +- app/Views/DashBoard.php | 157 ++- app/Views/bds_dash.php | 132 ++- app/Views/claims_dash.php | 157 ++- app/Views/endorsement_dash.php | 290 +++-- app/Views/layout/footer.php | 84 +- app/Views/layout/footer_old.php | 936 +++++++++++++++ app/Views/layout/header.php | 1023 ++++++++--------- app/Views/layout/header_old.php | 899 +++++++++++++++ app/Views/leads_dash.php | 255 ++-- app/Views/ticket_search.php | 3 +- public/assets/images/active_bds.png | Bin 0 -> 537 bytes public/assets/images/active_claims.png | Bin 0 -> 1361 bytes .../images/active_leads_and_bds_renewal.png | Bin 0 -> 1196 bytes .../assets/images/active_pending_actions.png | Bin 0 -> 826 bytes public/assets/images/inactive_bds.png | Bin 0 -> 664 bytes public/assets/images/inactive_claims.png | Bin 0 -> 1426 bytes .../images/inactive_leads_and_bds_renewal.png | Bin 0 -> 1869 bytes .../images/inactive_pending_actions.png | Bin 0 -> 775 bytes 21 files changed, 3129 insertions(+), 891 deletions(-) create mode 100644 app/Views/layout/footer_old.php create mode 100644 app/Views/layout/header_old.php create mode 100644 public/assets/images/active_bds.png create mode 100644 public/assets/images/active_claims.png create mode 100644 public/assets/images/active_leads_and_bds_renewal.png create mode 100644 public/assets/images/active_pending_actions.png create mode 100644 public/assets/images/inactive_bds.png create mode 100644 public/assets/images/inactive_claims.png create mode 100644 public/assets/images/inactive_leads_and_bds_renewal.png create mode 100644 public/assets/images/inactive_pending_actions.png diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 2377fc38..1cb35d79 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -634,4 +634,7 @@ $routes->post('newClaim','VidalApiController::newClaim'); $routes->post('enrollment','VidalApiController::enrollment'); -$routes->post("ticketCreation", "ThzController::ticketCreation"); \ No newline at end of file +$routes->post("ticketCreation", "ThzController::ticketCreation"); +$routes->post("ticketList", "ThzController::ticketList"); +$routes->post("ticketConversationSave", "ThzController::ticketConversationSave"); +$routes->post("conversationListPerTicket", "ThzController::conversationListPerTicket"); \ No newline at end of file diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index 590e8f78..6613cb6b 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -33,13 +33,7 @@ class ThzController extends BaseController $data = $this->request->getJSON(true); - $cleanedData = $this->thzControllerCleaner->ticketCreation($data); - - if ($cleanedData === false) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); - } - - $result = $this->thzMasterModel->insert($cleanedData); + $result = $this->thzMasterModel->insert($data); return $this->response->setJSON((['status' => 'success', 'message' => 'Ticket created successfully'])); @@ -49,20 +43,17 @@ class ThzController extends BaseController $data = $this->request->getJson(true); - $cleanedData = $this->thzControllerCleaner->ticketList($data); + $id = $data['id'] ?? null; - if( $cleanedData === false ) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); + if ( isset($id) && !empty($id) ) { + //Find Specific Ticket per id + $mobile = $data['mobile'] ?? null; + $result = $this->thzMasterModel->where('mobile',$mobile)->findAll(); + }else{ + // Find all the Ticket For the Manager who can see all the Tickets + $result = $this->thzMasterModel->findAll(); } - $id = $cleanedData['id'] ?? null; - - if (empty($id)) { - $result = $this->thzMasterModel->findAll(); - } - - $result = $this->thzMasterModel->where('id',$id)->findAll(); - if(empty($result)){ return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); } @@ -71,16 +62,11 @@ class ThzController extends BaseController } + public function ticketConversationSave(){ $data = $this->request->getJson(true); - $cleanedData = $this->thzControllerCleaner->ticketList($data); - - if( $cleanedData === false ) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); - } - $result = $this->thzMasterNotesModel->insert($data); if(empty($result)){ @@ -92,17 +78,13 @@ class ThzController extends BaseController } - public function ticketListForUser(){ + public function conversationListPerTicket(){ $data = $this->request->getJson(true); - $cleanedData = $this->thzControllerCleaner->ticketList($data); + $thz_id = $data['thz_id'] ?? null; - if( $cleanedData === false ) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); - } - - $result = $this->thzMasterNotesModel->insert($data); + $result = $this->thzMasterNotesModel->conversationListPerTicket($thz_id); if(empty($result)){ return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); @@ -112,37 +94,6 @@ class ThzController extends BaseController } - public function conversationListForUserPerTicket(){ - - $data = $this->request->getJson(true); - - $cleanedData = $this->thzControllerCleaner->ticketList($data); - - if( $cleanedData === false ) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); - } - - $thz_id = $cleanedData['thz_id'] ?? null; - - $result = $this->thzMasterNotesModel->conversationListForUserPerTicket($thz_id); - - if(empty($result)){ - return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); - } - - return $this->response->setJSON((['status' => 'success', 'data' => $result])); - - } - - public function ticketListForAssignedStaff(){ - - } - - public function conversationListForAssignedStaffPerTicket(){ - - } - - diff --git a/app/Models/ThzMasterNotesModel.php b/app/Models/ThzMasterNotesModel.php index 2072c094..cd02a52c 100644 --- a/app/Models/ThzMasterNotesModel.php +++ b/app/Models/ThzMasterNotesModel.php @@ -40,7 +40,7 @@ class ThzMasterNotesModel extends Model protected $beforeDelete = []; protected $afterDelete = []; - public function conversationListForUserPerTicket($thz_id){ + public function conversationListPerTicket($thz_id){ if(empty($thz_id)){ @@ -50,6 +50,7 @@ class ThzMasterNotesModel extends Model $sql = "SELECT + thz_master.*, thz_master_notes.id, thz_master_notes.thz_id, thz_master_notes.notes, @@ -60,6 +61,7 @@ class ThzMasterNotesModel extends Model thz_master_notes Join thz_master ON thz_master.thz_id = :thz_id: + WHERE thz_master_notes.thz_id = :thz_id: ORDER BY diff --git a/app/Views/DashBoard.php b/app/Views/DashBoard.php index 08e08855..b0cefc4e 100755 --- a/app/Views/DashBoard.php +++ b/app/Views/DashBoard.php @@ -171,79 +171,109 @@ margin: 0 5px 10px!important; } + .nav-link{ + color:black !important; + background-color: #D4F5F6 !important; + font-size: small; + padding:8px; + border-radius: 10px !important; + } + .nav-link.active-tab { + color: white !important; + background-color: #00999E !important; + font-size: small; + padding:8px; + border-radius: 10px !important; + + } + .tab-content-styles{ + background-color:#F4F4F4; + margin-right:20px; + border-radius:25px!important; + min-height: 70vh !important; + } + + +

Dashboard

+
-
-
-
-
-
-
- -
+
-
+
+
+ @@ -257,7 +287,6 @@ - + +
+ + + + + +
+
+
+
+ © NHANCE +
+ +
+
+
+ + +
+ + + + + + +
+ + + +
+
+ +
+ + Notification +
+
+
    + +
+
+ + +
+ + TO DOs +
+
+
    + +
+
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 6ac2e4ee..0b311aee 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -327,6 +327,136 @@ } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ /assets/images/nhance-loader-fast.gif" height="40" width="40" alt="Loading..."> +
+
+ + + +
+ + + + + + +
+ + + + +
+ + + +
+ + +
+ + + + + + +
+
+ + +
\ No newline at end of file diff --git a/app/Views/leads_dash.php b/app/Views/leads_dash.php index 6effa135..b6b24fc4 100644 --- a/app/Views/leads_dash.php +++ b/app/Views/leads_dash.php @@ -1,8 +1,4 @@
-
-
-
-
Leads
-

-

-

 

-

 

+
+
+
+
+

Leads

+

+

+
Lead Tracker
+
-
-
-
-
-
BDS Renewals
-

-

-

 

-

 

+
+
+
+

BDS Renewals

+

+ +

+
Renewal Tracker
+
+
-
+
@@ -164,88 +196,102 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_
- + $value) : ?> + + $value) : ?> - - + 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus; + $showTooltip = strlen($formattedStatus) > 20; + ?> + +
- - $value) : ?> +
- - 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus; - $showTooltip = strlen($formattedStatus) > 20; - ?> - + + // Get the background color for the current tile + $bgColor = $colorShades[$colorSetIndex][$shadeIndex]; + ?> + 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus; + $showTooltip = strlen($formattedStatus) > 20; + ?> + + + +
+ + diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 0b311aee..59150e0f 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -64,6 +64,9 @@ + + + + + + + @@ -504,8 +531,8 @@
  • - - + + Dashboard
  • @@ -513,8 +540,8 @@
  • - - + /assets/images/clients_sb.png" alt="Logo" height="24"> Clients @@ -524,8 +551,8 @@
  • - - + /assets/images/action_on_policies_sb.png" alt="Logo" height="20"> Action on Policies @@ -556,7 +583,7 @@
  • - + /assets/images/masters_sb.png" alt="Logo" height="20"> Masters @@ -608,7 +635,7 @@
  • - + /assets/images/claims_sb.png" alt="Logo" height="20"> Claims @@ -638,7 +665,7 @@
  • - + /assets/images/leads_sb.png" alt="Logo" height="20"> Leads @@ -649,7 +676,7 @@
  • - + /assets/images/policy_transactions_sb.png" alt="Logo" height="20"> Policy Transactions @@ -798,7 +825,7 @@
  • - + /assets/images/app_content_mng_sb.png" alt="Logo" height="20"> App Content Mgmt @@ -816,7 +843,7 @@
  • - " class="waves-effect" target="_blank" rel="noopener noreferrer"> + " class="waves-effect img-inactive-not-working" target="_blank" rel="noopener noreferrer"> /assets/images/user_manual_sb.png" alt="Logo" height="20"> User Manual @@ -883,6 +910,7 @@
  • +
    diff --git a/app/Views/lead_filter.php b/app/Views/lead_filter.php index 441b363b..86938097 100644 --- a/app/Views/lead_filter.php +++ b/app/Views/lead_filter.php @@ -11,7 +11,7 @@
    -

    Lead Filter

    +

    Lead Filter

    Date: Sat, 16 Aug 2025 18:55:49 +0530 Subject: [PATCH 09/49] CHANGE DASHBOARD THEME NEW - VADIVEL J 2025-08-16 --- app/Config/Routes.php | 4 +- app/Controllers/ThzController.php | 102 +++++++++++++++++++++-------- app/Models/ThzMasterNotesModel.php | 2 +- 3 files changed, 79 insertions(+), 29 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 1cb35d79..dee21c88 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -634,7 +634,7 @@ $routes->post('newClaim','VidalApiController::newClaim'); $routes->post('enrollment','VidalApiController::enrollment'); -$routes->post("ticketCreation", "ThzController::ticketCreation"); +$routes->post("ticketSave", "ThzController::ticketSave"); $routes->post("ticketList", "ThzController::ticketList"); $routes->post("ticketConversationSave", "ThzController::ticketConversationSave"); -$routes->post("conversationListPerTicket", "ThzController::conversationListPerTicket"); \ No newline at end of file +$routes->post("ticketConversationList", "ThzController::ticketConversationList"); \ No newline at end of file diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index 6613cb6b..be2d0f5f 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -29,43 +29,67 @@ class ThzController extends BaseController // } - public function ticketCreation(){ + public function ticketSave(){ $data = $this->request->getJSON(true); - $result = $this->thzMasterModel->insert($data); + 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(); + } else { + $data['created_by'] = get_session_userid(); + $text = "create"; + + $result = $this->thzMasterModel->insert($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' => 'success', 'message' => 'Ticket created successfully'])); } + - public function ticketList(){ + public function ticketList() + { - $data = $this->request->getJson(true); - - $id = $data['id'] ?? null; - - if ( isset($id) && !empty($id) ) { - //Find Specific Ticket per id - $mobile = $data['mobile'] ?? null; - $result = $this->thzMasterModel->where('mobile',$mobile)->findAll(); - }else{ - // Find all the Ticket For the Manager who can see all the Tickets - $result = $this->thzMasterModel->findAll(); - } - - if(empty($result)){ - return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); - } - - return $this->response->setJSON((['status' => 'success', 'data' => $result])); + $returnType = strtolower($this->request->getGet('return_type') ?? 'api'); + $data = $this->request->getJSON(true); + + $tickets = $this->fetchTicketsBasedOnrole($data); + + + + if ($returnType === 'api') { + if (empty($tickets)) { + return $this->response->setJSON([ 'status' => 'error','message' => 'No tickets found',])->setStatusCode(404); + } + }else{ + + $data['page_name'] = "Ticket List"; + $data['ticket_data'] = $tickets; + $data['assigner'] = $this->userModel->where('is_active', 1)->findAll(); + return $this->loadLayout('ticket_list_web', $data); + } + + + + return $this->response->setJSON([ + 'status' => 'success', + 'data' => $tickets, + ]); } public function ticketConversationSave(){ - $data = $this->request->getJson(true); + $data = $this->request->getJSON(true); $result = $this->thzMasterNotesModel->insert($data); @@ -78,13 +102,13 @@ class ThzController extends BaseController } - public function conversationListPerTicket(){ + public function ticketConversationList(){ - $data = $this->request->getJson(true); + $data = $this->request->getJSON(true); $thz_id = $data['thz_id'] ?? null; - $result = $this->thzMasterNotesModel->conversationListPerTicket($thz_id); + $result = $this->thzMasterNotesModel->ticketConversationList($thz_id); if(empty($result)){ return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); @@ -114,6 +138,32 @@ class ThzController extends BaseController } + private function fetchTicketsBasedOnrole(array $data): array + { + $id = $data['thz_id'] ?? null; + $assign_to = $data['assign_to'] ?? null; + $mobile = $data['mobile'] ?? null; + + if (!empty($assign_to)) { + // Tickets assigned to a staff + return $this->thzMasterModel + ->where('assign_to', $assign_to) + ->findAll(); + } + + if (!empty($id) && !empty($mobile)) { + // Specific ticket by ID and mobile + return $this->thzMasterModel + ->where('thz_id', $id) + ->where('mobile', $mobile) + ->findAll(); + } + + // All tickets (e.g., for managers) + return $this->thzMasterModel->findAll(); + } + } + diff --git a/app/Models/ThzMasterNotesModel.php b/app/Models/ThzMasterNotesModel.php index cd02a52c..769b505d 100644 --- a/app/Models/ThzMasterNotesModel.php +++ b/app/Models/ThzMasterNotesModel.php @@ -40,7 +40,7 @@ class ThzMasterNotesModel extends Model protected $beforeDelete = []; protected $afterDelete = []; - public function conversationListPerTicket($thz_id){ + public function ticketConversationList($thz_id){ if(empty($thz_id)){ From 5b2299210dea4937a561c2bb085b677c16ab32a2 Mon Sep 17 00:00:00 2001 From: velz Date: Sat, 16 Aug 2025 18:57:52 +0530 Subject: [PATCH 10/49] FIX_CHATBOT_BG_IMG_HEIGHT --- app/Views/chatbot.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Views/chatbot.php b/app/Views/chatbot.php index 89812c6a..4b374423 100644 --- a/app/Views/chatbot.php +++ b/app/Views/chatbot.php @@ -262,9 +262,9 @@ function setupMessageObserver() { const chatElements = doc.querySelectorAll("#messageArea .chat, #messageArea ol.chat, ol.chat"); chatElements.forEach(element => { if (element) { - element.style.setProperty("height", 95 + "vh", "important"); - element.style.setProperty("max-height", 95 + "vh", "important"); - element.style.setProperty("min-height", 95 + "vh", "important"); + element.style.setProperty("height", 85 + "vh", "important"); + element.style.setProperty("max-height", 85 + "vh", "important"); + element.style.setProperty("min-height", 85 + "vh", "important"); element.style.setProperty("transition", "height 0.3s ease", "important"); console.log('Direct style applied to:', element); } @@ -417,9 +417,9 @@ function setupMessageObserver() { const chatElements = doc.querySelectorAll("#messageArea .chat, #messageArea ol.chat, ol.chat"); chatElements.forEach(element => { if (element) { - element.style.setProperty("height", 95 + "vh", "important"); - element.style.setProperty("max-height", 95 + "vh", "important"); - element.style.setProperty("min-height", 95 + "vh", "important"); + element.style.setProperty("height", 85 + "vh", "important"); + element.style.setProperty("max-height", 85 + "vh", "important"); + element.style.setProperty("min-height", 85 + "vh", "important"); } }); From d607afe5edb79a5716e4fe2b04fd0370578fd6c5 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sun, 17 Aug 2025 21:39:57 +0530 Subject: [PATCH 11/49] 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 12/49] 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

    - "> + ">
    diff --git a/app/Views/policy_transaction_inception_list.php b/app/Views/policy_transaction_inception_list.php index cec7a681..c2cf5253 100644 --- a/app/Views/policy_transaction_inception_list.php +++ b/app/Views/policy_transaction_inception_list.php @@ -321,7 +321,7 @@ table.dataTable tbody td { Edit - + Delete
    @@ -1668,9 +1668,14 @@ function hideDateField(input = null) } } -function removePolicyTransaction(input, pt_id) { +function removePolicyTransaction(input, pt_id, policy_type_id) { - confirmActionSweertAlert("Do you want to delete this transaction?", "Yes, Proceed!", "No, Cancel").then((confirmed) => { + let string = "Do you want to delete this transaction?"; + if(policy_type_id > 7){ + string = "Do you want to delete this transaction? Deleting this will also remove the linked CRM policy entry."; + } + + confirmActionSweertAlert(string, "Yes, Proceed!", "No, Cancel").then((confirmed) => { if (confirmed) { let url = '' + pt_id; @@ -1694,6 +1699,4 @@ function removePolicyTransaction(input, pt_id) { }); } - - \ No newline at end of file From 8a20d137a682824a180dc96e62983778a4d133d0 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Fri, 22 Aug 2025 10:40:13 +0530 Subject: [PATCH 46/49] FIX_LIVE_ISSUE : RV --- app/Controllers/TicketController.php | 15 +++++++++------ app/Views/layout/header.php | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index a50b55be..800f464b 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -2386,17 +2386,20 @@ class TicketController extends BaseController } // 5. Merge the Sum Insured value if the multiple sum insured exists - if(isset($data['multiple_sum_insured'])){ - if(isset($data['sumInsured2'])){ - $data['sumInsured2'] = $data['sumInsured2'] . ", " . implode(", ", $data['multiple_sum_insured']); - }else{ - $data['sum_insured'] = $data['sum_insured'] . ", " . implode(", ", $data['multiple_sum_insured']); + if (isset($data['multiple_sum_insured'])) { + + $multipleSumInsured = is_array($data['multiple_sum_insured']) ? $data['multiple_sum_insured'] : [$data['multiple_sum_insured']]; // force into array if string + + if (isset($data['sumInsured2'])) { + $data['sumInsured2'] .= ", " . implode(", ", $multipleSumInsured); + } else { + $data['sum_insured'] .= ", " . implode(", ", $multipleSumInsured); } + unset($data['multiple_sum_insured']); } // 6. Add the special condition to key value pair - if(!empty($data['special_condition_label'])){ foreach ($data['special_condition_label'] as $key => $value) { if($value != "" && $value != null) { diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 712a44f1..dc34b27d 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -537,7 +537,7 @@ .show > .btn-ternary:dropdown-toggle:focus { box-shadow: 0 0 0 0.15rem rgba(226, 103, 40, 0.5); } - .btn-border-radius{ .border-radius: 10px !important; } + .btn-border-radius{ border-radius: 10px !important; } From 938279db0364f2ab329a9a0d58cd629cfe63f3a7 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Fri, 22 Aug 2025 12:04:42 +0530 Subject: [PATCH 47/49] BUG_Mentioned issues fixes --- app/Models/ThzMasterNotesModel.php | 2 +- app/Views/thz_list.php | 74 ++++++++++++++++++++---------- app/Views/thz_notes.php | 53 ++++++++++----------- 3 files changed, 78 insertions(+), 51 deletions(-) diff --git a/app/Models/ThzMasterNotesModel.php b/app/Models/ThzMasterNotesModel.php index 413781df..ac970b67 100644 --- a/app/Models/ThzMasterNotesModel.php +++ b/app/Models/ThzMasterNotesModel.php @@ -105,7 +105,7 @@ class ThzMasterNotesModel extends Model AND LOWER(thz_master_notes.notes_by) = 'user' WHERE thz_master_notes.thz_id = ". $integer_ticket_id ." $ticketTypeFilter - ORDER BY thz_master_notes.created_at ASC"; + ORDER BY thz_master_notes.created_at DESC"; $result = $this->db->query($notes_sql)->getResultArray(); diff --git a/app/Views/thz_list.php b/app/Views/thz_list.php index e711f27a..b56b45fd 100644 --- a/app/Views/thz_list.php +++ b/app/Views/thz_list.php @@ -80,6 +80,11 @@ tbody tr td:last-child { white-space: nowrap !important; } +.maincard{ + margin-top:0 !important; + padding-top: 0 !important; +} + .col-12 { max-width: 98% !important; @@ -122,8 +127,8 @@ td .text-muted {
    -
    -
    +
    +

    Ticket List

    @@ -155,7 +160,10 @@ td .text-muted {
    - + + @@ -259,22 +267,23 @@ td .text-muted {
    +
    + + +
    + +
    -
    - - -
    - - - + +
    + +
    - + - +
    @@ -368,6 +378,11 @@ td .text-muted { myModal.show(); } + function resetTicket(){ + var form = document.getElementById('ticketForm'); + form.reset(); + } + function submitTicket() { var form = document.getElementById('ticketForm'); @@ -512,6 +527,19 @@ td .text-muted { var policyId = selectedOption.getAttribute("data-id"); document.getElementById('policy_id').value = policyId || ""; } + + function hideandshowpolicy() { + var select = document.getElementById('ticket_type').value; + var policyContainer = document.getElementById('policy_container'); + + if (select === 'Service') { + policyContainer.style.display = "block"; // show + } else { + policyContainer.style.display = "none"; // hide + document.getElementById('policy_no').value = ""; + document.getElementById('policy_id').value = ""; + } + }