fixed the redirect

to handle everything properly
This commit is contained in:
2025-07-11 22:55:51 +02:00
parent a881b3933d
commit f780888107
3 changed files with 40 additions and 17 deletions

View File

@@ -8,9 +8,10 @@ include dirname(__DIR__).'/header.phtml';
<?php if (isset($error)): ?>
<div class="error-box"><?= htmlspecialchars($error) ?></div>
<?php endif; ?>
<?php if (isset($event)): ?>
<div style="text-align:center; margin-top: 1.5em;">
<a href="?controller=Event&do=showEvents">Zurück zu den Events</a>
</div>
<?php elseif (isset($event)): ?>
<div class="event-details">
<h2><?= htmlspecialchars($event['name']) ?></h2>
<p><strong>Beschreibung:</strong> <?= nl2br(htmlspecialchars($event['description'])) ?></p>
@@ -33,7 +34,7 @@ include dirname(__DIR__).'/header.phtml';
<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">Ticket kaufen</button>
<button class="button-login" type="submit">Jetzt kaufen</button>
</form>
<div style="text-align:center; margin-top: 1.5em;">
@@ -49,4 +50,10 @@ include dirname(__DIR__).'/header.phtml';
</div>
</div>
<?php if (isset($redirect)): ?>
<script>
window.location.href = '<?= $redirect ?>';
</script>
<?php endif; ?>
<?php include dirname(__DIR__).'/footer.phtml'; ?>