v0.10.8 - Added - You can only see washingreservations for the day, and are maximum an hour after 'time' in column - Reloads the page after every 5 minutes (This needs a fix)
This commit is contained in:
parent
2430a6a381
commit
82ac44133b
|
@ -13,22 +13,27 @@
|
|||
<p class="text-white" style="margin-left: auto; padding-right: 24px; font-size: 1vw;">Lokation: {{ $location->name }}</p>
|
||||
</header>
|
||||
<main style="min-height: calc(100% - 72px); background-color: #ffffff;">
|
||||
<?php $i = 1; ?>
|
||||
<?php
|
||||
date_default_timezone_set('Europe/Copenhagen');
|
||||
$i = 1;
|
||||
?>
|
||||
<div class="row">
|
||||
@foreach(\App\WashingMachine::query()->where("location_id", "=", $location->id)->get() as $machine)
|
||||
@foreach(\App\WashingReservation::query()->where("machine_id", "=", $machine->id)->where("time", "LIKE", date("Y-m-d"). "%")->orderBy("time", "asc")->get() as $reservation)
|
||||
@if($i % 3 == 1)
|
||||
@if (date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time)
|
||||
@if($i % 3 == 1)
|
||||
</div>
|
||||
<div class="row w-100">
|
||||
@endif
|
||||
<div class="reservation col align-items-center" style="margin: 0 32px 1.75rem 32px; width: calc(33% - 64px);">
|
||||
<h2 style="font-size: 2vw">{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h2>
|
||||
<div class="col align-items-center">
|
||||
<span style="font-size: 1vw"><b>Dato:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y') }}</span>
|
||||
<span style="font-size: 2vw"><b>Tid:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('\k\l\. H:i') }} - {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_first }} {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_last }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row w-100">
|
||||
<?php $i++; ?>
|
||||
@endif
|
||||
<div class="reservation col align-items-center" style="margin: 0 32px 1.75rem 32px; width: calc(33% - 64px);">
|
||||
<h2 style="font-size: 2vw">{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h2>
|
||||
<div class="col align-items-center">
|
||||
<span style="font-size: 1vw"><b>Dato:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y') }}</span>
|
||||
<span style="font-size: 2vw"><b>Tid:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('\k\l\. H:i') }} - {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_first }} {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_last }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php $i++; ?>
|
||||
@endforeach
|
||||
@endforeach
|
||||
@if($i == 1)
|
||||
|
@ -38,6 +43,13 @@
|
|||
</main>
|
||||
|
||||
<script src="{{ mix("/js/app.js") }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
setTimeout(function(){
|
||||
location.reload(true);
|
||||
}, (60000*5));
|
||||
});
|
||||
</script>
|
||||
@yield("scripts")
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue