52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
<?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'],
|
|
]);
|
|
}
|
|
|
|
} |