Bib-Arts/Views/Tickets/showTickets.phtml
2025-07-11 23:33:11 +02:00

53 lines
2.3 KiB
PHTML

<div class="inhalt">
<div class="content-container">
<div class="event-header">
<h2>Meine Tickets</h2>
</div>
<?php if (!empty($tickets)): ?>
<div class="event-container-inhalt">
<table>
<thead>
<tr>
<th>Event</th>
<th>Datum</th>
<th>Standort</th>
<th>Preis</th>
<th>Kaufdatum</th>
<th>Gültig bis</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<?php foreach ($tickets as $ticket): ?>
<tr>
<td><?= htmlspecialchars($ticket['event_name']) ?></td>
<td><?= date('d.m.Y', strtotime($ticket['start_date'])) ?> - <?= date('d.m.Y', strtotime($ticket['end_date'])) ?></td>
<td><?= htmlspecialchars($ticket['location_street'] . ' ' . $ticket['location_house_number'] . ', ' . $ticket['location_city']) ?></td>
<td><?= number_format($ticket['ticket_price'], 2, ',', '.') ?></td>
<td><?= date('d.m.Y', strtotime($ticket['purchase_date'])) ?></td>
<td><?= date('d.m.Y', strtotime($ticket['valid_until'])) ?></td>
<td>
<a href="?controller=Ticket&do=deleteTicket&ticket_id=<?= $ticket['ticket_id'] ?>"
class="admin-btn"
onclick="return confirm('Ticket wirklich löschen?')">Löschen</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php else: ?>
<div class="status-box">
<p>Sie haben noch keine Tickets gekauft.</p>
<a href="?controller=Event&do=showEvents" class="admin-btn">Events anzeigen</a>
</div>
<?php endif; ?>
</div>
</div>
<?php if (isset($redirect)): ?>
<script>
window.location.href = '<?= $redirect ?>';
</script>
<?php endif; ?>