From cb06e7799b89f540285ec115af3373cb103ebc08 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Tue, 26 Aug 2025 18:25:24 +0530 Subject: [PATCH] FIX_little changes --- app/Config/Routes.php | 3 +- app/Controllers/ThzController.php | 39 ++++++++++++++ app/Models/TicketTypesModel.php | 44 ++++++++++++++++ app/Views/thz_list.php | 87 ++++++++++++++++++++++++++----- app/Views/thz_notes.php | 17 +++++- 5 files changed, 175 insertions(+), 15 deletions(-) create mode 100644 app/Models/TicketTypesModel.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 75b95c76..acb156bd 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -659,4 +659,5 @@ $routes->post("ticketSave", "ThzController::ticketSave"); $routes->get("ticketList", "ThzController::ticketList"); $routes->post("ticketConversationSave", "ThzController::ticketConversationSave"); $routes->get("ticketConversationList", "ThzController::ticketConversationList"); -$routes->post('ticketAutoFetchDetails',"ThzController::ticketAutoFetchDetails"); \ No newline at end of file +$routes->post('ticketAutoFetchDetails',"ThzController::ticketAutoFetchDetails"); +// $routes->match(['get','post','put'], 'ticketType', 'ThzController::ticketType'); \ No newline at end of file diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index e6703a0e..e286d651 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -13,6 +13,7 @@ use App\Models\UserModel; use App\Models\ClientPolicyModel; use App\Models\ClientModel; use App\Models\TicketMailTemplateModel; +// use App\Models\TicketTypesModel; class ThzController extends BaseController @@ -28,6 +29,7 @@ class ThzController extends BaseController protected $clientModel; protected $ticketMailTemplateModel; + // protected $ticketTypesModel; public function __construct() { @@ -226,6 +228,43 @@ class ThzController extends BaseController } + // public function ticketType() + // { + // $method = $this->request->getMethod(); // get, post + + // if ($method === 'get') { + + // $types = $this->ticketTypesModel->where('is_active', 1)->findAll(); + // if (empty($types)) { + // return $this->response->setJSON(['status' => 'error','message' => 'No ticket types found'])->setStatusCode(404); + // } + // return $this->response->setJSON(['status' => 'success','data' => $types])->setStatusCode(200); + + // } + + // if ($method === 'post') { + + // $data = $this->request->getPost(); + // if (!empty($data['id'])) { + // $text = "update"; + // $result = $this->ticketTypesModel->update($data['id'], $data); + // $updateID = $data['id']; + // } else { + // $text = "create"; + // $insertID = $this->ticketTypesModel->insert($data); + // $result = true; + // } + + // $id = isset($insertID) && !empty($insertID) ? $insertID : $updateID ; + + // return $this->response->setJSON([ + // 'status' => $id ? 'success' : 'error', + // 'message' => $id ? "Ticket Type {$text}d successfully " : "Unable to {$text} ticket type. Please try again." , + // 'id' => $id + // ])->setStatusCode($id ? 200 : 400); + // } + // return $this->response->setJSON(['status' => 'error','message' => 'No ticket types found'])->setStatusCode(404); + // } /************************************************** PRIVATE FUNCTIONS ********************************************************/ diff --git a/app/Models/TicketTypesModel.php b/app/Models/TicketTypesModel.php new file mode 100644 index 00000000..33f31915 --- /dev/null +++ b/app/Models/TicketTypesModel.php @@ -0,0 +1,44 @@ + -