
Übersicht, Erstellen & Bearbeiten im einheitlichen Card-Design Routing-Fehler nach Aktionen gefixt (Redirects & Erfolgsseiten) Gutscheine-Link in Navigation nur für Admins
35 lines
1.4 KiB
PHTML
35 lines
1.4 KiB
PHTML
<div class="inhalt" style="flex-direction:column;align-items:center;">
|
|
<div class="gutschein-header-block">
|
|
<h2>Alle Gutscheine</h2>
|
|
<a href="?controller=Gutschein&do=createGutscheinForm" class="admin-btn">Neuen Gutschein anlegen</a>
|
|
</div>
|
|
<?php if (!empty($gutscheine)): ?>
|
|
<table class="gutschein-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Code</th>
|
|
<th>Rabatt (%)</th>
|
|
<th>Event-ID</th>
|
|
<th>Gültig bis</th>
|
|
<th>Aktionen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($gutscheine as $g): ?>
|
|
<tr>
|
|
<td><?php echo htmlspecialchars($g['code']); ?></td>
|
|
<td><?php echo (int)$g['discount']; ?></td>
|
|
<td><?php echo (int)$g['event_id']; ?></td>
|
|
<td><?php echo htmlspecialchars($g['valid_until']); ?></td>
|
|
<td>
|
|
<a href="?controller=Gutschein&do=editGutscheinForm&gutscheinid=<?php echo $g['voucher_id']; ?>" class="admin-btn">Bearbeiten</a>
|
|
<a href="?controller=Gutschein&do=deleteGutschein&gutscheinid=<?php echo $g['voucher_id']; ?>" class="admin-btn" onclick="return confirm('Wirklich löschen?');">Löschen</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else: ?>
|
|
<p>Keine Gutscheine vorhanden.</p>
|
|
<?php endif; ?>
|
|
</div>
|