Starting teilnehmen modal

This commit is contained in:
Torsten 2022-06-17 16:25:57 +02:00
parent e80863fbaf
commit bbfceddbc4
2 changed files with 37 additions and 4 deletions

View file

@ -159,8 +159,10 @@ class TourController extends Controller
u.id as user_id,
u.name as user_name,
qry.capacity,
COALESCE(qry.room_name,'Ungebucht') room_name,
COALESCE(qry.room_name,'ZZZZZZZZZ') room_sort_order
qry.free_slots,
COALESCE(qry.room_name,'Ungebucht') as room_name,
COALESCE(qry.room_name,'ZZZZZZZZZ') as room_sort_order
FROM
(
SELECT
@ -168,7 +170,8 @@ class TourController extends Controller
tr.id as room_id,
tr.capacity,
tr.name as room_name,
b.user_id
b.user_id,
(SELECT tr.capacity - count(*) from bookings where tour_id=tr.tour_id and room_id=tr.id) as free_slots
FROM
tour_rooms tr
LEFT JOIN bookings as b
@ -188,6 +191,7 @@ class TourController extends Controller
b.user_id,
u.name as user_name,
tr.capacity,
'0' as free_slots,
COALESCE(tr.name,'Ungebucht') as room_name,
COALESCE(tr.name,'ZZZZZZZZZ') as room_sort_order
FROM

View file

@ -92,7 +92,34 @@
<!-- Modal content -->
<div class="modal-content">
<span class="close">&times;</span>
<p>Some text in the Modal..</p>
<h2>Bitte Zimmer auswählen</h2>
<!-- Teilnehmer+Raum Anzeige/Auswahl: Nur buchbare -->
<div class="card-body">
<ul>
<!-- Intentional Assignment ! -->
@if ($room_id="") @endif
@foreach($rooms as $room)
@if( $room->room_id != 0) <!-- Dont show "Ungebucht", room_id=0 -->
@if ($room_id != $room->room_id)
@if(strlen($room_id))
<hr/>
@endif
<li style="list-style-type: none;"><b>[{{$room->room_id}}] <a href="#">{{$room->room_name}}</a> {{$room->free_slots}}</b></li>
<!-- Intentional Assignment ! -->
@if ($room_id=$room->room_id) @endif
@endif
@if(strlen($room->user_name))
<li> {{ $room->user_name}}
</li>
@endif
@endif
@endforeach
</ul>
</div>
</div>
</div>
@ -106,6 +133,7 @@
<div class="card mt-4">
<div class="card-header"><h5>Teilnehmer</h5></div>
<!-- Teilnehmer+Raum Anzeige -->
<div class="card-body">
<ul>
<!-- Intentional Assignment ! -->
@ -132,6 +160,7 @@
@endforeach
</ul>
</div>
</div>
</div>