diff --git a/Controller/TicketController.php b/Controller/TicketController.php index c41c246..33ae8b0 100644 --- a/Controller/TicketController.php +++ b/Controller/TicketController.php @@ -20,8 +20,7 @@ class TicketController { public function showTickets() { if (!isset($_SESSION['user_id'])) { - $this->view->setVars(['error' => 'Bitte melden Sie sich an, um Ihre Tickets zu sehen.']); - $this->view->setDoMethodName('showLoginForm'); + $this->view->setVars(['redirect' => 'index.php?controller=Auth&do=showLoginForm']); return; } @@ -31,22 +30,19 @@ class TicketController { public function showBuyTicketForm() { if (!isset($_SESSION['user_id'])) { - $this->view->setVars(['error' => 'Bitte melden Sie sich an, um Tickets zu kaufen.']); - $this->view->setDoMethodName('showLoginForm'); + $this->view->setVars(['redirect' => 'index.php?controller=Auth&do=showLoginForm']); return; } $event_id = $_GET['event_id'] ?? null; if (!$event_id) { - $this->view->setVars(['error' => 'Keine Event-ID angegeben.']); - $this->view->setDoMethodName('showEvents'); + $this->view->setVars(['redirect' => 'index.php?controller=Event&do=showEvents']); return; } $event = $this->eventModel->getEvent($event_id); if (!$event) { - $this->view->setVars(['error' => 'Event nicht gefunden.']); - $this->view->setDoMethodName('showEvents'); + $this->view->setVars(['redirect' => 'index.php?controller=Event&do=showEvents']); return; } @@ -111,8 +107,7 @@ class TicketController { public function deleteTicket() { if (!isset($_SESSION['user_id'])) { - $this->view->setVars(['error' => 'Bitte melden Sie sich an.']); - $this->view->setDoMethodName('showLoginForm'); + $this->view->setVars(['redirect' => 'index.php?controller=Auth&do=showLoginForm']); return; } diff --git a/Views/Event/showEvents.phtml b/Views/Event/showEvents.phtml index 0f99b3c..c11d2b5 100644 --- a/Views/Event/showEvents.phtml +++ b/Views/Event/showEvents.phtml @@ -7,6 +7,13 @@ Event erstellen + + +
Bitte melden Sie sich an, um Tickets zu kaufen.
+