59 lines
2.2 KiB
PHP
59 lines
2.2 KiB
PHP
<section class="admin-section">
|
|
<div class="section-header">
|
|
<div>
|
|
<p class="eyebrow">Kunden</p>
|
|
<h1>Kundenhistorie aus allen Aufträgen</h1>
|
|
</div>
|
|
<a class="button-secondary" href="<?= h(url('admin/create')) ?>">Neuen Kundenauftrag 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>Kundenübersicht</h2>
|
|
<span><?= h((string) count($customers)) ?> Kunden</span>
|
|
</div>
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Kontakt</th>
|
|
<th>Ort</th>
|
|
<th>Aufträge</th>
|
|
<th>Umsatz</th>
|
|
<th>Letzter Auftrag</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($customers as $customer): ?>
|
|
<tr>
|
|
<td>
|
|
<strong><?= h($customer['name']) ?></strong><br>
|
|
<span><?= h($customer['company'] ?: '-') ?></span>
|
|
</td>
|
|
<td><?= h($customer['email']) ?><br><?= h($customer['phone']) ?></td>
|
|
<td><?= h($customer['city']) ?></td>
|
|
<td><?= h((string) $customer['booking_count']) ?></td>
|
|
<td><?= h(formatCurrency((int) $customer['revenue_cents'])) ?></td>
|
|
<td><?= h($customer['last_reference']) ?> · <?= h(formatDate($customer['last_booking_date'])) ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php if ($customers === []): ?>
|
|
<tr>
|
|
<td colspan="6">Es wurden noch keine Kunden gespeichert.</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
|