45 lines
1.8 KiB
PHP
45 lines
1.8 KiB
PHP
<?php use Steuerkram\View; $h = fn($v) => View::h($v); ?>
|
|
|
|
<div class="toolbar">
|
|
<div class="toolbar-left">
|
|
</div>
|
|
<div class="toolbar-right">
|
|
<span class="text-muted text-sm"><?= count($suppliers) ?> Lieferanten</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Name</th>
|
|
<th>Angelegt am</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($suppliers as $s): ?>
|
|
<tr>
|
|
<td class="td-mono text-sm"><?= $h($s['id']) ?></td>
|
|
<td><?= $h($s['name']) ?></td>
|
|
<td class="td-muted text-sm"><?= View::formatDate($s['created_at']) ?></td>
|
|
<td>
|
|
<div style="display:flex;gap:.5rem">
|
|
<a href="/suppliers/<?= $h($s['id']) ?>/edit" class="btn btn-secondary btn-sm">Bearbeiten</a>
|
|
<form method="post" action="/suppliers/<?= $h($s['id']) ?>/delete" style="margin:0"
|
|
data-confirm="Lieferant "<?= $h($s['name']) ?>" wirklich löschen?">
|
|
<button type="submit" class="btn btn-danger btn-sm">Löschen</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php if (empty($suppliers)): ?>
|
|
<tr><td colspan="4" class="text-center text-muted" style="padding:2rem">Noch keine Lieferanten angelegt.</td></tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|