112 lines
6.6 KiB
PHP
112 lines
6.6 KiB
PHP
<?php
|
||
use App\Models\Tour;
|
||
|
||
$current = auth_check() ? user() : null;
|
||
?>
|
||
|
||
<div class="container">
|
||
<div class="row justify-content-center">
|
||
<div class="col-md-8 mt-2">
|
||
<div class="card mt-4">
|
||
<div class="card-header"><h5><?= e($tour->name) ?></h5></div>
|
||
|
||
<div class="card-body">
|
||
<form style="background-color: #fff;" class="text-dark" method="post" action="" enctype="multipart/form-data">
|
||
<?= csrf_field() ?>
|
||
|
||
<div class="" style="display:flex;">
|
||
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="name">Name:</label>
|
||
<input class="mr-1 form-control" type="text" id="name" name="name" value="<?= e(old('name') ?? $tour->name) ?>" readonly>
|
||
</div>
|
||
|
||
<div class="mt-1" style="display:flex;">
|
||
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="start">Start:</label>
|
||
<input class="mr-1 form-control" type="text" id="start" name="start" value="<?= e(old('start') ?? $tour->start) ?>" readonly>
|
||
</div>
|
||
|
||
<div class="mt-1" style="display:flex;">
|
||
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="tour_guide">Tour Guide:</label>
|
||
<input class="mr-1 form-control" type="text" id="tour_guide" name="tour_guide" value="<?= e($guide ? $guide->name : '') ?>" readonly>
|
||
</div>
|
||
|
||
<div class="mt-1" style="display:flex;">
|
||
<label class="ml-2" style="width:180px; text-align:left;font-size:18px;" for="anmeldeschluss">Anmeldeschluss:</label>
|
||
<input class="mr-1 form-control" type="text" id="anmeldeschluss" style="font-size:16px;" name="start" value="<?= e(old('anmeldeschluss') ?? $tour->deadline) ?>" readonly>
|
||
</div>
|
||
|
||
<?php if ($current && Tour::hasParticipant((int) $tour->id, (int) $current->id)): ?>
|
||
<label>Du nimmst teil.</label>
|
||
<?php else: ?>
|
||
<label>Du nimmst nicht teil.</label>
|
||
<?php endif; ?>
|
||
|
||
<?php if ($tourImages !== []): ?>
|
||
<div class="tour-media-grid gallery-grid">
|
||
<?php foreach ($tourImages as $i => $image): ?>
|
||
<figure class="gallery-item" style="--i:<?= $i % 20 ?>">
|
||
<a class="gallery-item-link"
|
||
href="<?= e($image['large']) ?>?v=<?= e($image['version']) ?>"
|
||
data-lightbox="tour-bilder-<?= e($tour->id) ?>"
|
||
data-title="<?= e($tour->name) ?> – Bild <?= $i + 1 ?>">
|
||
<img src="<?= e($image['large']) ?>?v=<?= e($image['version']) ?>"
|
||
alt="<?= e($tour->name) ?> – Bild <?= $i + 1 ?>"
|
||
loading="lazy" decoding="async">
|
||
<span class="gallery-overlay" aria-hidden="true">
|
||
<span class="gallery-zoom">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"
|
||
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||
stroke-linejoin="round">
|
||
<circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/>
|
||
<path d="M11 8v6"/><path d="M8 11h6"/>
|
||
</svg>
|
||
</span>
|
||
</span>
|
||
</a>
|
||
</figure>
|
||
<?php endforeach; ?>
|
||
</div>
|
||
<?php else: ?>
|
||
<img src="/img/placeholder/tour128x100.jpg" class="mt-3 ml-3">
|
||
<?php endif; ?>
|
||
|
||
<div class="mt-1">
|
||
<label class="ml-2" style="width:140px; text-align:left;font-size:18px;" for="beschreibung">Beschreibung:</label>
|
||
<textarea class="col-12" name="beschreibung" rows="10" cols="50" readonly><?= e($tour->beschreibung) ?></textarea>
|
||
</div>
|
||
|
||
<div class="mt-1">
|
||
<label class="ml-2" style="width:140px; text-align:left;font-size:18px;" for="bericht">Bericht:</label>
|
||
<textarea class="col-12" name="bericht" rows="10" cols="50" readonly><?= e($tour->bericht) ?></textarea>
|
||
</div>
|
||
|
||
<?php if ($current && $canManage): ?>
|
||
<a href="/tour/<?= e($tour->id) ?>/edit"><div type="submit" class="btn btn-danger col-3 mb-2 float-left mr-2">Bearbeiten</div></a>
|
||
<?php endif; ?>
|
||
<a href="/tour" type="submit" class="btn btn-success col-3 mb-2 float-right mr-2">Ok</a>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-md-3 mt-2">
|
||
<div class="card mt-4">
|
||
<div class="card-header"><h5>Teilnehmer</h5></div>
|
||
|
||
<div class="card-body">
|
||
<ul>
|
||
<?php foreach ($users as $u): ?>
|
||
<li><?= e($u->name) ?>
|
||
<?php if ($canManage): ?>
|
||
<form action="/tour/<?= e($tour->id) ?>/cancelBookingAdmin/<?= e($u->id) ?>" method="POST" style="display:inline;">
|
||
<?= csrf_field() ?>
|
||
<button type="submit" class="text-primary" style="border:none;background:none;padding:0;cursor:pointer;">(X)</button>
|
||
</form>
|
||
<?php endif; ?>
|
||
</li>
|
||
<?php endforeach; ?>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|