Bib-Arts/Views/Voucher/showVouchers.phtml

37 lines
1.3 KiB
PHTML

<?php
include dirname(__DIR__).'/header.phtml';
?>
<h2>Alle Gutscheine</h2>
<a href="?controller=Voucher&do=createVoucherForm">Neuen Gutschein anlegen</a>
<?php if (!empty($vouchers)): ?>
<table border="1" cellpadding="8" cellspacing="0">
<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 ($vouchers as $v): ?>
<tr>
<td><?php echo htmlspecialchars($v['code']); ?></td>
<td><?php echo (int)$v['discount']; ?></td>
<td><?php echo (int)$v['event_id']; ?></td>
<td><?php echo htmlspecialchars($v['valid_until']); ?></td>
<td>
<a href="?controller=Voucher&do=editVoucherForm&id=<?php echo $v['voucher_id']; ?>">Bearbeiten</a> |
<a href="?controller=Voucher&do=deleteVoucher&id=<?php echo $v['voucher_id']; ?>" onclick="return confirm('Wirklich löschen?');">Löschen</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>Keine Gutscheine vorhanden.</p>
<?php endif; ?>
<?php
include dirname(__DIR__).'/footer.phtml';
?>