v0.10.10f - You can no longer see your own reservations if they're an hour past due (Samt with admin)
This commit is contained in:
@@ -4,23 +4,32 @@
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<?php
|
||||
date_default_timezone_set('Europe/Copenhagen');
|
||||
$washingreservations = 0;
|
||||
?>
|
||||
<main style="min-height: calc(100% - 61.34px);">
|
||||
<h2 class="text-center sde-blue mb-0">{{__('msg.dinereservationer')}}</h2>
|
||||
@foreach($reservations as $reservation)
|
||||
<div class="reservation" style="margin: 0 32px 1.75rem 32px;">
|
||||
<h3>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h3>
|
||||
<div class="row align-items-center">
|
||||
<span style="font-size: 4vw"><b>{{__('msg.tid')}}:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y \k\l\. H:i') }}</span>
|
||||
<form class="ml-auto" method="post" action="{{ route("washing-reservations.destroy", [ "washing_reservation" => $reservation ]) }}">
|
||||
@csrf
|
||||
@method("delete")
|
||||
<input type="hidden" name="id" value="{{ $reservation->id }}">
|
||||
<button class="btn btn-sde-blue mb-0" type="submit" onclick="return confirm('Are you sure you want to remove this reservation?');">{{__('msg.fjern')}}</button>
|
||||
</form>
|
||||
@if(date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time)
|
||||
<div class="reservation" style="margin: 0 32px 1.75rem 32px;">
|
||||
<h3>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h3>
|
||||
<div class="row align-items-center">
|
||||
<span style="font-size: 4vw"><b>{{__('msg.tid')}}:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y \k\l\. H:i') }}</span>
|
||||
<form class="ml-auto" method="post" action="{{ route("washing-reservations.destroy", [ "washing_reservation" => $reservation ]) }}">
|
||||
@csrf
|
||||
@method("delete")
|
||||
<input type="hidden" name="id" value="{{ $reservation->id }}">
|
||||
<button class="btn btn-sde-blue mb-0" type="submit" onclick="return confirm('Are you sure you want to remove this reservation?');">{{__('msg.fjern')}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$washingreservations++;
|
||||
?>
|
||||
@endif
|
||||
@endforeach
|
||||
@if(count($reservations) < 1)
|
||||
@if(count($reservations) < 1 || $washingreservations == 0)
|
||||
<p style="margin: 0 18px;">{{__('msg.duharingenreservationer')}}.</p>
|
||||
@else
|
||||
{{ $reservations->links() }}
|
||||
|
||||
Reference in New Issue
Block a user