motorradig2027/motorradig/views/admin/applications.php

57 lines
3 KiB
PHP

<?php $count = count($applications); ?>
<div class="container text-light mt-5">
<div class="row justify-content-center">
<div class="col-lg-11">
<div class="d-flex justify-content-between align-items-center mb-3">
<h1 class="mb-0">Anträge</h1>
<a href="/" class="btn btn-sm btn-outline-light">Zur Startseite</a>
</div>
<div class="card text-dark">
<div class="card-body">
<p class="text-muted mb-3">
<?= $count === 1 ? '1 eingereichter Antrag' : $count . ' eingereichte Anträge' ?>
</p>
<div class="table-responsive">
<table class="table table-hover table-sm align-middle mb-0">
<thead class="thead-light">
<tr>
<th scope="col">Eingang</th>
<th scope="col">Name</th>
<th scope="col">E-Mail</th>
<th scope="col">Telefon</th>
<th scope="col" class="text-right">Aktion</th>
</tr>
</thead>
<tbody>
<?php if ($applications === []): ?>
<tr>
<td colspan="5" class="text-muted">Es sind noch keine Anträge eingegangen.</td>
</tr>
<?php else: ?>
<?php foreach ($applications as $application): ?>
<tr>
<td class="text-nowrap">
<?= e($application->created_at ? date('d.m.Y H:i', strtotime($application->created_at)) : '') ?>
</td>
<td><?= e(trim($application->vorname . ' ' . $application->nachname)) ?></td>
<td><?= e($application->email) ?></td>
<td><?= e($application->telefon) ?></td>
<td class="text-right">
<a href="/admin/antraege/<?= e($application->id) ?>" class="btn btn-sm btn-primary">
Ansehen
</a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>