54 lines
2.4 KiB
PHTML
54 lines
2.4 KiB
PHTML
<?php
|
|
include dirname(__DIR__).'/header.phtml';
|
|
?>
|
|
|
|
<div class="inhalt">
|
|
<div class="form-container">
|
|
<h1>Ticket kaufen</h1>
|
|
|
|
<?php if (isset($event)): ?>
|
|
<div class="event-details">
|
|
<h2><?= htmlspecialchars($event['name']) ?></h2>
|
|
<p><strong>Beschreibung:</strong> <?= nl2br(htmlspecialchars($event['description'])) ?></p>
|
|
<p><strong>Datum:</strong> <?= date('d.m.Y', strtotime($event['start_date'])) ?> - <?= date('d.m.Y', strtotime($event['end_date'])) ?></p>
|
|
<p><strong>Preis:</strong> <?= number_format($event['ticket_price'], 2, ',', '.') ?> €</p>
|
|
<p><strong>Max. Tickets:</strong> <?= (int) $event['max_tickets'] ?></p>
|
|
</div>
|
|
|
|
<?php if ($hasTicket): ?>
|
|
<div class="status-box">
|
|
<p>Sie haben bereits ein Ticket für dieses Event gekauft.</p>
|
|
<a href="?controller=Ticket&do=showTickets" class="admin-btn">Meine Tickets anzeigen</a>
|
|
</div>
|
|
<?php else: ?>
|
|
<form class="form-horizontal" action="index.php" method="post">
|
|
<input type="hidden" name="controller" value="Ticket">
|
|
<input type="hidden" name="do" value="buyTicket">
|
|
<input type="hidden" name="event_id" value="<?= $event['event_id'] ?>">
|
|
|
|
<p>Möchten Sie ein Ticket für dieses Event kaufen?</p>
|
|
<p><strong>Preis:</strong> <?= number_format($event['ticket_price'], 2, ',', '.') ?> €</p>
|
|
|
|
<button class="button-login" type="submit">Jetzt kaufen</button>
|
|
</form>
|
|
|
|
<div style="text-align:center; margin-top: 1.5em;">
|
|
<a href="?controller=Event&do=showEvents">Zurück zu den Events</a>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php else: ?>
|
|
<div class="error-box">Event nicht gefunden.</div>
|
|
<div style="text-align:center; margin-top: 1.5em;">
|
|
<a href="?controller=Event&do=showEvents">Zurück zu den Events</a>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if (isset($redirect)): ?>
|
|
<script>
|
|
window.location.href = '<?= $redirect ?>';
|
|
</script>
|
|
<?php endif; ?>
|
|
|
|
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|