Files
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">Buchungen</p>
<h1>Alle Aufträge im Überblick</h1>
</div>
<a class="button-primary" href="<?= h(url('admin/create')) ?>">Neuen Auftrag 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>Auftragsliste</h2>
<span><?= h((string) count($bookings)) ?> Einträge</span>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Referenz</th>
<th>Kunde</th>
<th>Zeitraum</th>
<th>Status</th>
<th>Zahlung</th>
<th>Preis</th>
</tr>
</thead>
<tbody>
<?php foreach ($bookings 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><span class="<?= h(statusPillClass((string) $booking['status'])) ?>"><?= h($booking['status_label']) ?></span></td>
<td><?= h($booking['payment_status_label']) ?></td>
<td><?= h(formatCurrency((int) $booking['subtotal_cents'])) ?></td>
</tr>
<?php endforeach; ?>
<?php if ($bookings === []): ?>
<tr>
<td colspan="6">Noch keine Buchungen vorhanden.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</section>
</section>