From 5c87de3d730230296fdc3f3738bfb86fc37ed76f Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 28 Jan 2025 15:25:32 +0530 Subject: [PATCH 01/17] CHANGE_CLAIM_MODULE : RV --- app/Config/Routes.php | 3 +- app/Controllers/ClientController.php | 42 ++++++- app/Controllers/TicketController.php | 95 ++++++++++++--- app/Models/TicketMasterModel.php | 14 +-- app/Views/ticket_edit_onbording.php | 70 ++++++++++- app/Views/ticket_form_gmc.php | 73 +++++++----- app/Views/ticket_form_gpa.php | 125 +++++++++++-------- app/Views/ticket_form_handler.php | 172 ++++++++++++++++++++++----- 8 files changed, 445 insertions(+), 149 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index eb828452..08ad836a 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -337,6 +337,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) { $routes->post('unmap_employees/(:num)', 'EmployeeController::unmapEmployees/$1'); $routes->get('transformMailContent', 'LeadsController::transformMailContent'); $routes->get('getCDAmount', 'ClientController::getCDAmount'); + $routes->get('getTheEmpDataForClaim/(:any)', 'ClientController::getTheEmpDataForClaim/$1'); }); $routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) { @@ -497,7 +498,7 @@ $routes->group("/ticket", ["filter" => "authMVC"], function ($routes) { $routes->match( ['get', 'post'], 'list','TicketController::ticketList'); $routes->get('new/(:any)','TicketController::ticket_form/$1'); $routes->post('create','TicketController::createTicket'); - $routes->get('update','TicketController::updateTicket'); + $routes->post('update','TicketController::updateTicket'); $routes->get('view/(:any)','TicketController::view_ticket/$1'); $routes->get('mail_template','TicketController::createMailTemplate'); }); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 38192213..ad47e155 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -4138,6 +4138,46 @@ class ClientController extends AdminController } else { return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found'], 200); } - } + } + + public function getTheEmpDataForClaim($client_policy_id) + { + $data = $this->clientPolicyModel->select(" + + clients.id as client_id, + clients.client_name, + insurers.id as insurer_id, + insurers.name as insurer_name, + tpa.id as tpa_id, + tpa.name as tpa_name, + + employees.id as emp_id, + employees.name as emp_name, + employees.emp_code, + employees.mobile as emp_mobile, + employees.email_corporate as emp_email, + + employee_polices.uhid as policy_no, + ") + ->join('clients', 'client_policy.client_id = clients.id', 'left') + ->join('insurers', 'client_policy.insurer_id = insurers.id', 'left') + ->join('tpa', 'client_policy.tpa_id = tpa.id', 'left') + ->join('employees', 'clients.id = employees.client_id', 'left') + ->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left') + ->where('client_policy.id',) + ->where('client_policy.is_active', 1) + ->where('insurers.is_active', 1) + ->where('tpa.is_active', 1) + ->where('employees.is_active', 1) + ->where('employee_polices.is_active', 1) + ->where('client_policy.id', $client_policy_id) + ->findAll(); + + if($data){ + return $this->respond(['status' => true, 'code' => 200, 'data' => $data], 200); + } else { + return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found', "client_policy_id" =>$client_policy_id], 200); + } + } } diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index c489e247..4da42c00 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -135,6 +135,12 @@ class TicketController extends BaseController public function ticket_form($ticket_type) { + $data = $this->ticket_form_data($ticket_type); + return $this->loadLayout('ticket_form_handler', $data); + } + + public function ticket_form_data($ticket_type) + { $data['ticket_form'] = 1; $data['ticket_type'] = $this->ticketType; $data['priorityType'] = $this->priorityType; @@ -156,12 +162,9 @@ class TicketController extends BaseController ->getResultArray(); if($ticket_type == 1){ - $data['modeOFIntimate'] = $this->claimType[1]; - return $this->loadLayout('ticket_form_handler', $data); + $data['claim_type'] = $this->claimType[1]; }else{ - - $data['modeOFIntimate'] = $this->claimType[2]; - + $data['claim_type'] = $this->claimType[2]; if($ticket_type == 2){ $data['ticket_form'] = 'GPA'; }else if($ticket_type = 3){ @@ -169,34 +172,79 @@ class TicketController extends BaseController }else if($ticket_type = 4){ $data['ticket_form'] = 'GTLI'; } - - return $this->loadLayout('ticket_form_handler', $data); } + + return $data; } public function view_ticket($ticket_id) - { - $data = []; + { + $ticket_data = $this->ticketMasterModel->where('id', $ticket_id)->where('is_active', 1)->first(); + $ticket_data = $this->formatDateForClaim($ticket_data, 'd/m/Y'); + // dd($ticket_data); + $data = $this->ticket_form_data($ticket_data['ticket_type_id']); + $data['ticket_data'] = $ticket_data; return $this->loadLayout('ticket_edit_onbording', $data); } - public function createTicket() - { - $ticket_data = $this->request->getPost(); - // print_rr($ticket_data); die; + public function formatDateForClaim($ticket_data, $out_put_format = 'Y-m-d') + { if(empty($ticket_data['doa'])){ $ticket_data['doa'] = null; }else{ - $ticket_data['doa'] = change_date_format($ticket_data['doa']); + $ticket_data['doa'] = change_date_format($ticket_data['doa'], null, $out_put_format); } if(empty($ticket_data['dod'])){ $ticket_data['dod'] = null; }else{ - $ticket_data['dod'] = change_date_format($ticket_data['dod']); + $ticket_data['dod'] = change_date_format($ticket_data['dod'], null, $out_put_format); } + if(empty($ticket_data['dob'])){ + $ticket_data['dob'] = null; + }else{ + $ticket_data['dob'] = change_date_format($ticket_data['dob'], null, $out_put_format); + } + + if(empty($ticket_data['date_of_join'])){ + $ticket_data['date_of_join'] = null; + }else{ + $ticket_data['date_of_join'] = change_date_format($ticket_data['date_of_join'], null, $out_put_format); + } + + if(empty($ticket_data['date_of_incep'])){ + $ticket_data['date_of_incep'] = null; + }else{ + $ticket_data['date_of_incep'] = change_date_format($ticket_data['date_of_incep'], null, $out_put_format); + } + + if(empty($ticket_data['date_of_accident'])){ + $ticket_data['date_of_accident'] = null; + }else{ + $ticket_data['date_of_accident'] = change_date_format($ticket_data['date_of_accident'], null, $out_put_format); + } + + if(empty($ticket_data['date_of_death'])){ + $ticket_data['date_of_death'] = null; + }else{ + $ticket_data['date_of_death'] = change_date_format($ticket_data['date_of_death'], null, $out_put_format); + } + + if(empty($ticket_data['date_of_intimat'])){ + $ticket_data['date_of_intimat'] = null; + }else{ + $ticket_data['date_of_intimat'] = change_date_format($ticket_data['date_of_intimat'], null, $out_put_format); + } + + return $ticket_data; + } + + public function createTicket() + { + $ticket_data = $this->request->getPost(); + $ticket_data = $this->formatDateForClaim($ticket_data); // print_rr($ticket_data); die; if($ticket_data){ @@ -212,7 +260,22 @@ class TicketController extends BaseController } public function updateTicket() - { + { + $ticket_id = $this->request->getPost('ticket_master_id'); + $ticket_data = $this->request->getPost(); + $ticket_data = $this->formatDateForClaim($ticket_data); + // print_rr($ticket_data); die; + + if($ticket_data){ + $return_value = $this->ticketMasterModel->where('id', $ticket_id)->set($ticket_data)->update(); + if($return_value){ + return $this->respond(['status' => true, 'code' => 200, 'data' => $ticket_data, "message" => "Claim updated successfully"], 200); + } else { + return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to update claim'], 200); + } + }else{ + return $this->respond(['status' => false, 'code' => 404, 'message' => 'claim data not found'], 200); + } } public function createMailTemplate() diff --git a/app/Models/TicketMasterModel.php b/app/Models/TicketMasterModel.php index ab41a1fe..1d980ed5 100644 --- a/app/Models/TicketMasterModel.php +++ b/app/Models/TicketMasterModel.php @@ -12,15 +12,6 @@ class TicketMasterModel extends Model protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; -<<<<<<< HEAD - protected $allowedFields = ['id', 'ticket_type_id', 'claim_status_id', 'acm_id', 'insurer_id', - 'tpa_id', 'client_id', 'priority', 'policy_no', 'emp_code', 'tpa_no', 'emp_name', 'insured_name', - 'relationship', 'emp_mobile', 'emp_mail', 'mode_of_intimation', 'claim_type', 'hospital_name', - 'doa', 'dod', 'claim_amount', 'pod_no', 'created_by', 'updated_by', 'created_at', 'updated_at', - 'date_of_join', 'date_of_incep', 'dob', 'date_of_accident', 'date_of_death', 'date_of_intimat', - 'si_amt','claim_number,is_active' - ]; -======= protected $allowedFields = [ 'id', 'ticket_type_id', @@ -57,10 +48,11 @@ class TicketMasterModel extends Model 'date_of_intimat', 'si_amt', 'is_active', - 'claim_number' + 'claim_number', + 'emp_id', + 'insured_emp_id', ]; ->>>>>>> 3a4f7b1e836fc71f477cb6ad32a635dcae0192d0 // Callbacks protected $allowCallbacks = true; diff --git a/app/Views/ticket_edit_onbording.php b/app/Views/ticket_edit_onbording.php index 22b50aba..20873990 100644 --- a/app/Views/ticket_edit_onbording.php +++ b/app/Views/ticket_edit_onbording.php @@ -22,25 +22,29 @@ diff --git a/app/Views/renewal_search.php b/app/Views/renewal_search.php index 7876090f..341020f9 100644 --- a/app/Views/renewal_search.php +++ b/app/Views/renewal_search.php @@ -12,7 +12,7 @@
-
+
@@ -23,10 +23,24 @@ >
+
+ + +
+
- - @@ -34,8 +48,8 @@
- -
@@ -55,11 +69,17 @@
-
-
-
+
+ - \ No newline at end of file From 75c00c20cea990b0dc48d89d7ecc00d83c813c18 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Fri, 31 Jan 2025 15:16:45 +0530 Subject: [PATCH 14/17] FEAT_UNLAYER_ADDED_TO_ALL_MAIL_TEMPLATES_SRI --- app/Views/notification old.php | 2009 +++++++++++++++++++++++++ app/Views/notification.php | 2594 +++++++++++++++----------------- 2 files changed, 3261 insertions(+), 1342 deletions(-) create mode 100644 app/Views/notification old.php diff --git a/app/Views/notification old.php b/app/Views/notification old.php new file mode 100644 index 00000000..ed5f8ee5 --- /dev/null +++ b/app/Views/notification old.php @@ -0,0 +1,2009 @@ + +
+ +
+
+ +
+ + + +
+

+
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +     + Edit +
+
+ +
+ +
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+
+
+ Submit +
+
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/Views/notification.php b/app/Views/notification.php index cb738661..051d2f98 100755 --- a/app/Views/notification.php +++ b/app/Views/notification.php @@ -14,15 +14,14 @@ min-height: 600px; } -#account_maneger_summary_mail_modal .modal-dialog, -#member_review_and_summary_mail_modal .modal-dialog { +.modal-dialog { max-width: 90% !important; width: 90% !important; } /* Also ensure the modal body has proper height */ -#account_maneger_summary_mail_modal .modal-body, -#member_review_and_summary_mail_modal .modal-body { + +.modal-body { min-height: 600px; padding: 20px; } @@ -34,178 +33,178 @@
- +
-
- +
+
-

+ ?>

-
+
-
-
- - -
-
- - -
+
+
+ +
- -
-
- - -
-
- - -
-
- -
-
- - -     - Edit -
-
- -
- -
- -
-
- - -     - Edit -
-
- -
-
- -
-
- - -     - Edit -
-
- -
-
- -
-
- - -     - Edit -
-
- -
-
- -
-
- - -     - Edit -
-
- -
-
- -
-
- - -     - Edit -
-
- -
-
- -
-
-
-
- Submit -
+
+ +
+
+
+ + +
+
+ + +
+
+ +
+
+ + +     + Edit +
+
+ +
+ +
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+ + +     + Edit +
+
+ +
+
+ +
+
+
+
+ Submit +
+
+
+
@@ -217,7 +216,7 @@
-
+
- - - - - + \ No newline at end of file From d537185d2204ddd52f5b6b9defb5d8c91d3e0c80 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Fri, 31 Jan 2025 15:30:56 +0530 Subject: [PATCH 15/17] FIX_MAIL_SENDER_IN_EMPRESTCONTROLLER_SRI --- app/Controllers/EmployeeRestController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 800f6941..0b26b442 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -3159,7 +3159,7 @@ class EmployeeRestController extends AdminController if ($mail_sent_status->status == 'success') { $sent_message_data['ticket_id'] = $ticket_id; - $sent_message_data['sender'] = 'user'; + $sent_message_data['sender'] = 'staff'; $sent_message_data['emp_mail'] = $mail_sent_status->data->params->mail; $sent_message_data['mail_subject'] = $mail_sent_status->data->params->subject; $sent_message_data['mail_content'] = $mail_sent_status->data->params->message; From 491f3e001013b9ed15db7495d2be550908c2fed3 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Fri, 31 Jan 2025 18:08:24 +0530 Subject: [PATCH 16/17] FEAT_EMP_TABLE_VIA_AJAX, FIX_MAIL_TEMPLATE_IN_CLAIMS --- app/Controllers/EmployeeController.php | 7 ++++- app/Views/employee_list.php | 38 +++++++++++++++----------- app/Views/ticket_mail_template.php | 4 +-- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 9e81f1a9..050437cd 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -97,7 +97,7 @@ class EmployeeController extends AdminController // Convert the status field to an array if it exists in the request data if (isset($filterData['status']) && !empty($filterData['status'])) { - $filterData['status'] = explode(",", $filterData['status']); + // $filterData['status'] = explode(",", $filterData['status']); }else{ $filterData['status'] = []; } @@ -114,6 +114,11 @@ class EmployeeController extends AdminController // log_message('error',json_encode($data['employees'])); // Set getData in $data array with the processed $filterData $data['getData'] = $filterData; + + // return view('employee_list',$data); + $html = view('employee_data_list', $data); + return $this->respond(['status' => true, 'html' => $html], 200); + } // dd($this->employeeModel->getLastQuery()); diff --git a/app/Views/employee_list.php b/app/Views/employee_list.php index 255d8278..7c35a42d 100755 --- a/app/Views/employee_list.php +++ b/app/Views/employee_list.php @@ -135,8 +135,9 @@ table.dataTable tbody td { - + +
@@ -502,24 +503,29 @@ function fetchEmpolyeeList(event) { const queryString = objectToQueryString(queryParams); const apiURL = $('#get-emp-list').attr('href') + "?" + queryString; // console.log(apiURL); - window.location.href = apiURL; + // window.location.href = apiURL; // var apiURL2 = $('#get-emp-list').attr('href'); // Get href attribute value - // console.log(apiURL); - // $.ajax({ - // url: apiURL, - // method: 'GET', - // data: queryParams, - // success: function(response) { - // // Assuming response is a JSON array - // // displayDataTables(response); - // console.log(response); - // }, - // error: function(xhr, status, error) { - // console.error('Error:', error); - // } - // }); + console.log(apiURL); + $.ajax({ + url: apiURL, + method: 'GET', + data: queryParams, + success: function(response) { + if(response.status == true){ + $('.loader').fadeIn(); + $('.loader-mask').fadeIn(); + $('#employee_table_list').html(response.html); + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + } + }, + error: function(xhr, status, error) { + console.error('Error:', error); + toastr.error('Failed to fetch Data','Error'); + } + }); } diff --git a/app/Views/ticket_mail_template.php b/app/Views/ticket_mail_template.php index e36b2718..1100e26a 100644 --- a/app/Views/ticket_mail_template.php +++ b/app/Views/ticket_mail_template.php @@ -191,10 +191,10 @@ table.dataTable tbody td {