Enhance 404 error page with custom layout and image, add admin login routes
This commit is contained in:
@@ -131,7 +131,7 @@ class WebsiteController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function careerSingle($id)
|
||||
public function careerSingle($id)
|
||||
{
|
||||
$data['career'] = Career::findorFail($id);
|
||||
|
||||
@@ -272,61 +272,78 @@ class WebsiteController extends Controller
|
||||
|
||||
public function getCost(Request $request)
|
||||
{
|
||||
$data['costss'] = $this->costCalculatorService->findAll($request);
|
||||
foreach ($data['costss'] as $value) {
|
||||
$id = $value->id;
|
||||
$costs = $this->costCalculatorService->findAll($request);
|
||||
|
||||
if ($costs->isEmpty()) {
|
||||
return view("client.raffles.errors.404");
|
||||
}
|
||||
|
||||
$id = $costs->last()->id;
|
||||
|
||||
$cost = CostCalculator::with([
|
||||
'stayTypeLiving',
|
||||
'stayTypeAccomodation',
|
||||
'stayTypeOnetime',
|
||||
'stayTypeService'
|
||||
])->findOrFail($id);
|
||||
$data['fee'] = Program::where('id', $request->program_id)->first();
|
||||
$data['title'] = 'View Cost Calculation';
|
||||
$data['cost'] = $cost;
|
||||
])->find($id);
|
||||
|
||||
if (!$cost) {
|
||||
return view("client.raffles.errors.404");
|
||||
}
|
||||
$program = Program::find($request->program_id);
|
||||
|
||||
if (!$program) {
|
||||
return view("client.raffles.errors.404");
|
||||
}
|
||||
|
||||
$getBreakdown = function ($stayTypeTitle) use ($cost) {
|
||||
$living = optional($cost->stayTypeLiving->firstWhere('title', $stayTypeTitle))->pivot;
|
||||
$living = optional($cost->stayTypeLiving->firstWhere('title', $stayTypeTitle))->pivot;
|
||||
$accomodation = optional($cost->stayTypeAccomodation->firstWhere('title', $stayTypeTitle))->pivot;
|
||||
$onetime = optional($cost->stayTypeOnetime->firstWhere('title', $stayTypeTitle))->pivot;
|
||||
$service = optional($cost->stayTypeService->firstWhere('title', $stayTypeTitle))->pivot;
|
||||
$onetime = optional($cost->stayTypeOnetime->firstWhere('title', $stayTypeTitle))->pivot;
|
||||
$service = optional($cost->stayTypeService->firstWhere('title', $stayTypeTitle))->pivot;
|
||||
|
||||
return [
|
||||
'living' => [
|
||||
'monthly' => $living->monthly ?? 0,
|
||||
'yearly' => $living->yearly ?? 0,
|
||||
'yearly' => $living->yearly ?? 0,
|
||||
],
|
||||
'accomodation' => [
|
||||
'monthly' => $accomodation->monthly ?? 0,
|
||||
'yearly' => $accomodation->yearly ?? 0,
|
||||
'yearly' => $accomodation->yearly ?? 0,
|
||||
],
|
||||
'onetime' => [
|
||||
'visa' => $onetime->visa ?? 0,
|
||||
'biometrics' => $onetime->biometrics ?? 0,
|
||||
'sevis' => $onetime->sevis ?? 0,
|
||||
'visa' => $onetime->visa ?? 0,
|
||||
'biometrics' => $onetime->biometrics ?? 0,
|
||||
'sevis' => $onetime->sevis ?? 0,
|
||||
'application' => $onetime->application ?? 0,
|
||||
'total' => ($onetime->visa ?? 0) + ($onetime->biometrics ?? 0) + ($onetime->sevis ?? 0) + ($onetime->application ?? 0),
|
||||
'total' => ($onetime->visa ?? 0) + ($onetime->biometrics ?? 0) + ($onetime->sevis ?? 0) + ($onetime->application ?? 0),
|
||||
],
|
||||
'service' => [
|
||||
'flight_ticket' => $service->flight_ticket ?? 0,
|
||||
'insurance' => $service->insurance ?? 0,
|
||||
'extra' => $service->extra ?? 0,
|
||||
'total' => ($service->flight_ticket ?? 0) + ($service->insurance ?? 0) + ($service->extra ?? 0),
|
||||
'insurance' => $service->insurance ?? 0,
|
||||
'extra' => $service->extra ?? 0,
|
||||
'total' => ($service->flight_ticket ?? 0) + ($service->insurance ?? 0) + ($service->extra ?? 0),
|
||||
]
|
||||
];
|
||||
};
|
||||
|
||||
$data['breakdowns'] = [
|
||||
'alone' => $getBreakdown('Alone'),
|
||||
'with_spouse' => $getBreakdown('With Spouse'),
|
||||
'with_spouse_and_child' => $getBreakdown('With Spouse and Child'),
|
||||
$data = [
|
||||
'costs' => $costs,
|
||||
'fee' => $program,
|
||||
'title' => 'View Cost Calculation',
|
||||
'cost' => $cost,
|
||||
'breakdowns' => [
|
||||
'alone' => $getBreakdown('Alone'),
|
||||
'with_spouse' => $getBreakdown('With Spouse'),
|
||||
'with_spouse_and_child' => $getBreakdown('With Spouse and Child'),
|
||||
],
|
||||
];
|
||||
|
||||
return view('client.raffles.pages.cost-result', $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function thankyouPage(Request $r)
|
||||
{
|
||||
$data = new \stdClass();
|
||||
|
Reference in New Issue
Block a user