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:
Anders 2020-08-20 12:18:30 +02:00
parent 4f9cf41656
commit a145c88e2c
2 changed files with 38 additions and 24 deletions

View File

@ -10,6 +10,9 @@
@endsection
@section("content")
<?php
date_default_timezone_set('Europe/Copenhagen');
?>
<table class="tbl mt-0">
<tr>
<th>Lokation</th>
@ -19,6 +22,7 @@
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
</tr>
@foreach($reservations as $reservation)
@if(date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time)
<tr>
<td>{{ \App\Location::query()->find(\App\WashingMachine::query()->find($reservation->machine_id)->location_id)->name }}</td>
<td>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</td>
@ -32,6 +36,7 @@
</form>
</td>
</tr>
@endif
@endforeach
</table>

View File

@ -4,9 +4,14 @@
@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)
@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">
@ -19,8 +24,12 @@
</form>
</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() }}