/** @dataProvider provideKeys */ public function testBuildLevels(array $events) { foreach ($events as $key => $event) { $this->events->set($key, $event); } parent::assertEquals('first', $this->events->get('key')); parent::assertEquals('second', $this->events->get('key another')); }
if (isset($_SESSION['user'])) { $usr = new Users(); $usr = $usr->get($_SESSION['user']); if (!$usr) { header('HTTP/1.0 302 Found'); header("Location: index.php?map=login&page=index"); exit; } } if (!isset($_GET['id'])) { header('HTTP/1.0 302 Found'); header("Location: index.php?map=events&page=index"); exit; } $id = $_GET['id']; $events = new Events(); $event = $events->get($id); if (!$event) { header('HTTP/1.0 302 Found'); header("Location: index.php?map=events&page=index"); exit; } $events->delete($event['events_id']); ?> <script> $.notify("Evenement is succesvol verwijderd!", "success"); </script> <?php header('HTTP/1.0 302 Found'); header("Location: index.php?map=events&page=index"); exit;
$app->render('template.php', array('view' => "profile.html")); }); $app->get('/dinner/', function () use($app) { $app->render('template.php', array('view' => "dinner.html")); }); $app->get('/hunt/', function () use($app) { $app->render('template.php', array('view' => "hunt.html")); }); $app->get('/contact/', function () use($app) { $app->render('template.php', array('view' => "contact.html")); }); $app->get('/media/', function () use($app) { $app->render('template.php', array('view' => "media.php")); }); $app->get('/events/', function () use($app) { $events = Events::get(); $app->render('template.php', array('events' => $events, 'view' => "events.php")); }); $app->get('/directors/', function () use($app) { $app->render('template.php', array('view' => "directors.html")); }); $app->get('/sponsor/', function () use($app) { $app->render("template.php", array("view" => "donate.html")); }); $app->get("/store/", function () use($app) { $app->render("template.php", array("view" => "store.html")); }); $app->get("/thankyou/", function () use($app) { $app->render("template.php", array("view" => "thankyou.html")); }); $app->get("/thankyou2/", function () use($app) {
$landen = $landen->get_all(); $events = new Events(); //Check of er POST waarde is if ($_SERVER['REQUEST_METHOD'] === 'POST') { //Valideer post attr if ($_POST && isset($_POST['naam'], $_POST['omschrijving'], $_POST['datum'], $_POST['type'], $_POST['genre'], $_POST['plaatsnaam'], $_POST['land'])) { $naam = test_input($_POST['naam']); $omschrijving = test_input($_POST['omschrijving']); $datum = test_input($_POST['datum']); $type = test_input($_POST['type']); $genre = test_input($_POST['genre']); $plaatsnaam = test_input($_POST['plaatsnaam']); $land = test_input($_POST['land']); $event = $events->add($type, $genre, $land, $plaatsnaam, $naam, $omschrijving, $datum, $usr['id']); if ($event) { $event = $events->get($event); if ($event) { ?> <script> $.notify("Evenement is succesvol aangemaakt!", "success"); </script> <?php header('HTTP/1.0 302 Found'); header("Location: index.php?map=events&page=edit&id=" . $event['events_id']); } else { ?> <script> $.notify("Evenement kon niet worden aangemaakt", "error"); </script> <?php }