EventController, TicketController + Model + essenzielle Funktionen
This commit is contained in:
52
Controller/EventController.php
Normal file
52
Controller/EventController.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Blog\Controller;
|
||||
|
||||
use Blog\Model\EventModel;
|
||||
|
||||
class EventController {
|
||||
|
||||
protected $view;
|
||||
protected $eventModel;
|
||||
|
||||
public function __construct($view) {
|
||||
$this->eventModel = new EventModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function updateEvent() {
|
||||
$event = array(
|
||||
"ausstellungid" => $_POST['ausstellungid'],
|
||||
"standortid" => $_POST['standortid'],
|
||||
"datum_von" => $_POST['datumVon'],
|
||||
"datum_bis" => $_POST['datumBis'],
|
||||
"name" => $_POST['name'],
|
||||
"beschreibung" => $_POST['beschreibung'],
|
||||
"max_tickets" => $_POST['max_tickets'],
|
||||
"preis" => $_POST['preis'],
|
||||
);
|
||||
|
||||
$this->eventModel->updateEvent($event);
|
||||
$this->view->setVars([
|
||||
"ausstellungid" => $_POST['ausstellungid'],
|
||||
]);
|
||||
}
|
||||
|
||||
public function createEvent() {
|
||||
$event = array(
|
||||
"standortid" => $_POST['standortid'],
|
||||
"datum_von" => $_POST['datumVon'],
|
||||
"datum_bis" => $_POST['datumBis'],
|
||||
"name" => $_POST['name'],
|
||||
"beschreibung" => $_POST['beschreibung'],
|
||||
"max_tickets" => $_POST['max_tickets'],
|
||||
"preis" => $_POST['preis'],
|
||||
);
|
||||
|
||||
$this->eventModel->createEvent($event);
|
||||
$this->view->setVars([
|
||||
"name" => $_POST['name'],
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user