Files
fotobox-webspite/views/admin/requests.php
T
2026-05-05 12:30:45 +02:00

56 lines
2.2 KiB
PHP

<section class="admin-section">
<div class="section-header">
<div>
<p class="eyebrow">Anfragen</p>
<h1>Offene und reservierte Anfragen</h1>
</div>
<a class="button-primary" href="<?= h(url('admin/create')) ?>">Manuelle Buchung anlegen</a>
</div>
<?php if (!empty($flashSuccess)): ?>
<div class="flash flash-success"><?= h((string) $flashSuccess) ?></div>
<?php endif; ?>
<?php if (!empty($flashError)): ?>
<div class="flash flash-error"><?= h((string) $flashError) ?></div>
<?php endif; ?>
<section class="table-card">
<div class="table-card-header">
<h2>Zu bearbeitende Einträge</h2>
<span><?= h((string) count($requests)) ?> Einträge</span>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Referenz</th>
<th>Kunde</th>
<th>Zeitraum</th>
<th>Leistung</th>
<th>Status</th>
<th>Preis</th>
</tr>
</thead>
<tbody>
<?php foreach ($requests as $booking): ?>
<tr>
<td><a href="<?= h(url('admin/order?id=' . urlencode($booking['id']))) ?>"><?= h($booking['reference']) ?></a></td>
<td><?= h($booking['customer']['name']) ?></td>
<td><?= h(formatDate($booking['start_date'])) ?> bis <?= h(formatDate($booking['end_date'])) ?></td>
<td><?= h($booking['delivery_mode_label']) ?></td>
<td><span class="<?= h(statusPillClass((string) $booking['status'])) ?>"><?= h($booking['status_label']) ?></span></td>
<td><?= h(formatCurrency((int) $booking['subtotal_cents'])) ?></td>
</tr>
<?php endforeach; ?>
<?php if ($requests === []): ?>
<tr>
<td colspan="6">Keine offenen Anfragen vorhanden.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</section>
</section>