From 5299aa268f560c5989e6c8c851e82fc7ef91c280 Mon Sep 17 00:00:00 2001 From: Subash Date: Tue, 26 Aug 2025 17:36:15 +0545 Subject: [PATCH] Remove unused class column from enquiries data table and enhance form validation --- app/Http/Controllers/DashboardController.php | 3 - .../raffles/pages/cost-calculator.blade.php | 138 ++++++++---------- resources/views/dashboard.blade.php | 47 +++--- 3 files changed, 84 insertions(+), 104 deletions(-) diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 7464a4f..a1358a3 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -30,9 +30,6 @@ class DashboardController extends Controller $model = Enquiry::query()->where('is_read', 0)->latest(); return DataTables::eloquent($model) ->addIndexColumn() - ->editColumn('class', function (Enquiry $enquiry) { - return $enquiry->class ?? '-'; - }) ->editColumn('subject', function (Enquiry $enquiry) { return $enquiry->subject ?? '-'; }) diff --git a/resources/views/client/raffles/pages/cost-calculator.blade.php b/resources/views/client/raffles/pages/cost-calculator.blade.php index c2463ed..7425c6a 100644 --- a/resources/views/client/raffles/pages/cost-calculator.blade.php +++ b/resources/views/client/raffles/pages/cost-calculator.blade.php @@ -152,7 +152,7 @@ @@ -173,7 +173,7 @@ class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs" for="{{ $status }}"> {{ $status }} + id="{{ $status }}" required> {{ $status }} @endforeach @@ -192,7 +192,7 @@ + value="yes" required> Yes @@ -224,9 +224,9 @@ + for="{{ $level }}"> @endforeach @@ -239,14 +239,12 @@
- @foreach ($programss as $key => $program) - + + @foreach ($programss as $key => $program) - - @endforeach - - + @endforeach +
@@ -331,75 +329,61 @@ @endsection + @push('js') - {{-- --}} + document.getElementById("nextBtn").addEventListener("click", function() { + if (validateStep(currentStep)) { + document.getElementById(`step${currentStep}`).classList.remove("active"); + currentStep++; + document.getElementById(`step${currentStep}`).classList.add("active"); + + if (currentStep === totalSteps) { + document.getElementById("nextBtn").style.display = "none"; + document.getElementById("doneBtn").style.display = "inline-flex"; + } + } + }); + + document.getElementById("prevBtn").addEventListener("click", function() { + document.getElementById(`step${currentStep}`).classList.remove("active"); + currentStep--; + document.getElementById(`step${currentStep}`).classList.add("active"); + + document.getElementById("nextBtn").style.display = "inline-flex"; + document.getElementById("doneBtn").style.display = "none"; + }); + + // Final check before submit + document.getElementById("cost-calculator").addEventListener("submit", function(e) { + if (!validateStep(currentStep)) { + e.preventDefault(); + } + }); + }); + @endpush diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index f774f04..86e014d 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -134,30 +134,29 @@
@php - $columns = [ - [ - 'title' => 'S.N', - 'data' => 'DT_RowIndex', - 'name' => 'DT_RowIndex', - 'orderable' => false, - 'searchable' => false, - 'sortable' => false, - ], - ['title' => 'Name', 'data' => 'name', 'name' => 'name'], - ['title' => 'Email', 'data' => 'email', 'name' => 'email'], - ['title' => 'Contact', 'data' => 'mobile', 'name' => 'mobile'], - ['title' => 'Class', 'data' => 'class', 'name' => 'class'], - ['title' => 'Subject', 'data' => 'subject', 'name' => 'subject'], - ['title' => 'Message', 'data' => 'message', 'name' => 'message'], - [ - 'title' => 'Action', - 'data' => 'action', - 'orderable' => false, - 'searchable' => false, - ], - ]; - @endphp - + $columns = [ + [ + 'title' => 'S.N', + 'data' => 'DT_RowIndex', + 'name' => 'DT_RowIndex', + 'orderable' => false, + 'searchable' => false, + 'sortable' => false, + ], + ['title' => 'Name', 'data' => 'name', 'name' => 'name'], + ['title' => 'Email', 'data' => 'email', 'name' => 'email'], + ['title' => 'Mobile', 'data' => 'mobile', 'name' => 'mobile'], + ['title' => 'Subject', 'data' => 'subject', 'name' => 'subject'], + ['title' => 'Message', 'data' => 'message', 'name' => 'message'], + [ + 'title' => 'Action', + 'data' => 'action', + 'orderable' => false, + 'searchable' => false, + ], + ]; + @endphp +