From 5b18ebbfc99c32e36052d4577f3743dc64e58abe Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Tue, 11 Nov 2025 17:38:54 +0530 Subject: [PATCH 1/3] FIX_Switch button CSS --- app/Config/Routes.php | 1 + .../AppContentManagementController.php | 66 ++++-- app/Views/add_image_list.php | 216 ++++++++++++------ app/Views/client_policy.php | 23 +- 4 files changed, 197 insertions(+), 109 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index ad1d3874..1c8b6002 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -42,6 +42,7 @@ $routes->post("add_advertise_image", "AppContentManagementController::add_advert $routes->get("add_image_index", "AppContentManagementController::add_image_index"); $routes->get("getAdvertiseImage/(:any)", "AppContentManagementController::getAdvertiseImage/$1"); $routes->get("frontend_content", "AppContentManagementController::frontend_content"); +$routes->get('showAdvertiseImage/(:any)', 'AdvertiseController::showAdvertiseImage/$1'); // $routes->get('/', 'LoginController::index'); diff --git a/app/Controllers/AppContentManagementController.php b/app/Controllers/AppContentManagementController.php index 33d6ce1d..f9e1d356 100755 --- a/app/Controllers/AppContentManagementController.php +++ b/app/Controllers/AppContentManagementController.php @@ -40,36 +40,58 @@ class AppContentManagementController extends AdminController // $this->loadLayout('client_onboarding', $data); } - public function add_advertise_image(){ + public function add_advertise_image() { + try { + $file = $this->request->getFile('advertise_image'); + //1) original file name for vaildations + $fileName = $file->getClientName(); //original file name for vaildations + $existing = $this->addImgModel->where('name', $fileName)->where('is_active', 1)->first(); + if($existing){ return $this->respond(['status' => false, 'message' => 'This file has already been uploaded in active state.'], 400); } - // print_r($this->request->getPost());die; - $uploadFilePath = ROOTPATH . 'public/uploads/advertiseImage/'; - $file_name = file_Upload($this->request->getFile('advertise_image'), $uploadFilePath); - $data['id'] = $this->request->getPost('add_image_id'); - // $data['created_by'] = get_session_userid(); - $data['name'] = $file_name; + //skip 1) and use this + // $fileName = $file->getRandomName(); // Same Name Multiple time upload means different name - if($data['id'] == 0){ - $insert = $this->addImgModel->insert($data); - if($insert){ - return $this->respond(['status' => true,'code' => 200,'data' => "success"], 200); + if (!$file || !$file->isValid()) { + return $this->respond(['status' => false, 'message' => 'No file uploaded or invalid file.'], 400); + } - }else{ - return $this->respond(['status' => false,'code' => 404,'message' => 'no data found'], 200); + $uploadPath = WRITEPATH . 'uploads/advertiseImage/'; + if (!is_dir($uploadPath)) mkdir($uploadPath, 0755, true); - } - }else{ - $id = $data['id']; - $update = $this->addImgModel->update($id,$data); - if($update){ - return $this->respond(['status' => true,'code' => 200,'data' => "success"], 200); + + $file->move($uploadPath, $fileName); - }else{ - return $this->respond(['status' => false,'code' => 404,'message' => 'no data found'], 200); - } + $id = $this->request->getPost('add_image_id'); + $data = ['name' => $fileName]; + + if ($id == 0) { + $this->addImgModel->insert($data); + } else { + $this->addImgModel->update($id, $data); + } + + return $this->respond(['status' => true, 'message' => 'Image saved successfully.']); + } catch (\Exception $e) { + return $this->respond(['status' => false, 'message' => $e->getMessage()], 500); } } + public function showAdvertiseImage($fileName) + { + + $filePath = WRITEPATH . 'uploads/advertiseImage/' . $fileName; + + if (!file_exists($filePath)) { + return $this->response->setStatusCode(404, 'File not found'); + } + + $mimeType = mime_content_type($filePath); + header('Content-Type: ' . $mimeType); + readfile($filePath); + exit; + } + + public function getAdvertiseImage($image_id){ $image_data = $this->addImgModel->select('name')->where(['id' => $image_id])->first(); diff --git a/app/Views/add_image_list.php b/app/Views/add_image_list.php index 5d8d65ad..52f4a658 100755 --- a/app/Views/add_image_list.php +++ b/app/Views/add_image_list.php @@ -53,7 +53,7 @@ table.dataTable thead th { @@ -82,17 +82,15 @@ table.dataTable thead th { -
- - + +
- +
@@ -101,8 +99,9 @@ table.dataTable thead th {
+
- +
@@ -113,68 +112,69 @@ table.dataTable thead th { \ No newline at end of file diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index 3b21c09d..fdb0c39e 100755 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -51,23 +51,24 @@ position: relative; width: 50px; height: 25px; -background-color: #fff; +background-color: #cccccc; border-radius: 25px; box-shadow: 0 0 5px rgba(0,0,0,0.2); transition: 0.3s; } -.slider::before , +/* Round knob (always white) */ +.slider::before, .slider_blue::before { -content: ""; -position: absolute; -height: 19px; -width: 19px; -left: 3px; -top: 3px; -background-color: #ccc; -border-radius: 50%; -transition: 0.3s; + content: ""; + position: absolute; + height: 19px; + width: 19px; + left: 3px; + top: 3px; + background-color: #fff; /* always white */ + border-radius: 50%; + transition: 0.3s; } input:checked + .slider { From a7a798916e541190884913356c2a3eddeee840f6 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Tue, 11 Nov 2025 17:40:49 +0530 Subject: [PATCH 2/3] FIX_ICON --- app/Views/add_image_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Views/add_image_list.php b/app/Views/add_image_list.php index 52f4a658..29d7c14c 100755 --- a/app/Views/add_image_list.php +++ b/app/Views/add_image_list.php @@ -222,7 +222,7 @@ var table; $(document).ready(function() { table = $('#tickets-table').DataTable({ - dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, button right + dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" + // Filter left, button right "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", buttons: [ From 261f5dc1dc712fd04eb7dac069c02a38539e79b1 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Tue, 11 Nov 2025 18:19:38 +0530 Subject: [PATCH 3/3] FIX_+ - Interchanges in policy terms --- app/Views/other_policy_terms.php | 3 ++- app/Views/policy_gmc_terms.php | 10 +++++----- app/Views/policy_gpa_terms.php | 9 +++++---- app/Views/report_bds.php | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/Views/other_policy_terms.php b/app/Views/other_policy_terms.php index e674fa52..16166973 100755 --- a/app/Views/other_policy_terms.php +++ b/app/Views/other_policy_terms.php @@ -215,6 +215,7 @@ } }); + window.scrollTo({ top: 0, behavior: 'smooth' }); setTimeout(function() { $('.loader').fadeOut(); $('.loader-mask').delay(350).fadeOut('slow'); @@ -749,8 +750,8 @@
- +
diff --git a/app/Views/policy_gmc_terms.php b/app/Views/policy_gmc_terms.php index e9f6848f..5c28b10a 100755 --- a/app/Views/policy_gmc_terms.php +++ b/app/Views/policy_gmc_terms.php @@ -1052,6 +1052,7 @@ } }); + window.scrollTo({ top: 0, behavior: 'smooth' }); setTimeout(function() { $('.loader').fadeOut(); @@ -1761,15 +1762,14 @@ value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]" class="form-control multiple_sum_insured mr-2" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this); numtowordinkeyup(this)"> + -
diff --git a/app/Views/policy_gpa_terms.php b/app/Views/policy_gpa_terms.php index b8be22c0..87a151b9 100755 --- a/app/Views/policy_gpa_terms.php +++ b/app/Views/policy_gpa_terms.php @@ -499,6 +499,7 @@ } }); + window.scrollTo({ top: 0, behavior: 'smooth' }); setTimeout(function() { $('.loader').fadeOut(); @@ -927,14 +928,14 @@ style="max-width:200px;" value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]" class="form-control multiple_sum_insured mr-2" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this); numtowordinkeyup(this)"> - +
diff --git a/app/Views/report_bds.php b/app/Views/report_bds.php index bbb03f73..3aaab25d 100644 --- a/app/Views/report_bds.php +++ b/app/Views/report_bds.php @@ -103,8 +103,8 @@ table.dataTable tbody td { Premium
(without GST) Total Premium - BP % - TP/Ter % + BP% + TP/Ter% Rewards Agreed Amount Invoiced Amount @@ -147,8 +147,8 @@ table.dataTable tbody td { -  % -  % + % + %