53 lines
2.1 KiB
PHP
53 lines
2.1 KiB
PHP
<?php require __DIR__ . '/../partials/layout-top.php'; ?>
|
|
|
|
<section class="page-head">
|
|
<span class="eyebrow">Kaffee und Produkte</span>
|
|
<h1>Produkte und Preise</h1>
|
|
<p>Legen Sie fest, was gebucht werden kann: Kaffee, Getränke, Snacks oder Pauschalen. Preisänderungen gelten nur für neue Buchungen.</p>
|
|
</section>
|
|
|
|
<div class="two-column">
|
|
<form class="card form-card" method="post" action="<?= e(tenant_url($tenant['slug'], 'products')) ?>">
|
|
<?= csrf_field($csrf) ?>
|
|
<label>
|
|
<span>Produktname</span>
|
|
<input type="text" name="name" value="<?= e((string) old('name')) ?>" required>
|
|
</label>
|
|
<label>
|
|
<span>Preis in EUR</span>
|
|
<input type="number" name="price_eur" min="0.10" step="0.05" value="<?= e((string) old('price_eur', '1.20')) ?>" required>
|
|
</label>
|
|
<button class="button button-primary" type="submit">Produkt anlegen</button>
|
|
</form>
|
|
|
|
<section class="table-card">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Produkt</th>
|
|
<th>Kurzkennung</th>
|
|
<th>Preis</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if ($products === []): ?>
|
|
<tr>
|
|
<td class="table-empty" colspan="4">Noch keine Produkte. Legen Sie zuerst z. B. Kaffee, Espresso oder Tee an.</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<?php foreach ($products as $product): ?>
|
|
<tr>
|
|
<td><?= e($product['name']) ?></td>
|
|
<td><?= e((string) $product['sku']) ?></td>
|
|
<td><?= e(money_from_cents((int) ($product['price_cents'] ?? 0))) ?></td>
|
|
<td><?= $product['is_active'] ? 'aktiv' : 'inaktiv' ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
</div>
|
|
|
|
<?php require __DIR__ . '/../partials/layout-bottom.php'; ?>
|