maintained filteration in stay type in cost calculator

This commit is contained in:
2025-08-25 16:20:07 +05:45
parent dc32ac8f91
commit 658d3600a2
4 changed files with 184 additions and 166 deletions

View File

@@ -14,10 +14,9 @@ class CostCalculatorService
$query->where('country_id', $request->country_id); $query->where('country_id', $request->country_id);
} }
if ($request->filled('stay_type_id')) { // if ($request->filled('stay_type_id')) {
$query->where("stay_type_id", $request->stay_type_id); // $query->where("stay_type_id", $request->stay_type_id);
} // }
})->latest()->paginate(10)->withQueryString(); })->latest()->paginate(10)->withQueryString();
} }

View File

@@ -18,6 +18,7 @@ use Modules\CourseFinder\Models\Coop;
use Modules\CourseFinder\Models\Program; use Modules\CourseFinder\Models\Program;
use Modules\CourseFinder\Models\ProgramLevel; use Modules\CourseFinder\Models\ProgramLevel;
use Modules\CourseFinder\Services\ProgramService; use Modules\CourseFinder\Services\ProgramService;
use Illuminate\Support\Str;
class WebsiteController extends Controller class WebsiteController extends Controller
{ {
@@ -328,14 +329,16 @@ class WebsiteController extends Controller
}; };
$data = [ $data = [
'serviceStatus' => $request->services,
'costs' => $costs, 'costs' => $costs,
'fee' => $program, 'fee' => $program,
'title' => 'View Cost Calculation', 'title' => 'View Cost Calculation',
'cost' => $cost, 'cost' => $cost,
'type' => Str::slug($request->status_type_id),
'breakdowns' => [ 'breakdowns' => [
'alone' => $getBreakdown('Alone'), 'alone' => $getBreakdown('Alone'),
'with_spouse' => $getBreakdown('With Spouse'), 'with-spouse' => $getBreakdown('With Spouse'),
'with_spouse_and_child' => $getBreakdown('With Spouse and Child'), 'with-spouse-and-child' => $getBreakdown('With Spouse and Child'),
], ],
]; ];

View File

@@ -149,9 +149,11 @@
<div> <div>
<label class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs" <label
for="{{ $country->id }}"> <input type="radio" name="country_id" value="{{ $country->id }}" class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs"
id="{{ $country->id }}"> {{ $country->title }} </label> for="{{ $country->id }}"> <input type="radio" name="country_id"
value="{{ $country->id }}" id="{{ $country->id }}">
{{ $country->title }} </label>
</div> </div>
</div> </div>
@endforeach @endforeach
@@ -167,8 +169,10 @@
<div class="col col-sm-6"> <div class="col col-sm-6">
<div class=""> <div class="">
<label class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs" <label
for="{{ $status }}"> <input type="radio" name="status_type_id" value="{{ $key }}" 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 }}"> <input type="radio"
name="status_type_id" value="{{ $status }}"
id="{{ $status }}"> {{ $status }}</label> id="{{ $status }}"> {{ $status }}</label>
</div> </div>
</div> </div>
@@ -185,16 +189,22 @@
<div> <div>
<label class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs" for="serviceYes"> <input name="services" type="radio" id="serviceYes"> Yes</label> <label
class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs"
for="yes"> <input name="services" type="radio" id="yes"
value="yes"> Yes</label>
</div> </div>
</div> </div>
<div class="col col-sm-4"> <div class="col col-sm-4">
<div > <div>
<label class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs" for="serviceNo"> <input name="services" type="radio" id="serviceNo">No</label> <label
class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs"
for="no"> <input name="services" type="radio" id="no"
value="no">No</label>
</div> </div>
@@ -209,12 +219,14 @@
<div class="row flex flex-wrap py-20"> <div class="row flex flex-wrap py-20">
@foreach ($programLevelOptions as $level) @foreach ($programLevelOptions as $level)
<div class="col col-sm-4"> <div class="col col-sm-4">
<div > <div>
<label class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs" <label
for="{{ $level }}"> <input type="radio" name="" id="{{ $level }}" class="text-20 text-ter p-0 m-0 flex items-center gap-10 px-10 py-12 bg-white rounded-30 tabs"
value=""> {{ $level }}</label> for="{{ $level }}"> <input type="radio" name=""
id="{{ $level }}" value="">
{{ $level }}</label>
</div> </div>
</div> </div>
@endforeach @endforeach

View File

@@ -53,7 +53,11 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-lg-12"> <div class="col-lg-12">
@foreach ($breakdowns as $type => $breakdown)
@php
$breakdown = $breakdowns[$type];
@endphp
<div class="a4-page"> <div class="a4-page">
{{-- <div class="card shadow-lg border-0 rounded-4"> --}} {{-- <div class="card shadow-lg border-0 rounded-4"> --}}
@@ -175,6 +179,7 @@
</table> </table>
</div> </div>
@if ($serviceStatus === 'yes')
<!-- Service Costs --> <!-- Service Costs -->
<h6 class="fw-bold mt-30 text-primary">Service Costs</h6> <h6 class="fw-bold mt-30 text-primary">Service Costs</h6>
<div class="table-responsive"> <div class="table-responsive">
@@ -204,6 +209,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
@endif
<!-- Overall --> <!-- Overall -->
<div class="table-responsive mt-4"> <div class="table-responsive mt-4">
@@ -228,8 +234,6 @@
</div> </div>
</div> </div>
{{-- </div> --}}
@endforeach
</div> </div>
</div> </div>
</div> </div>