forked from fsi-tue/eei
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevent.php
More file actions
55 lines (49 loc) · 1.41 KB
/
event.php
File metadata and controls
55 lines (49 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require_once('config.php');
require_once('utils.php');
require_once('event_data.php');
# If event id is not set, redirect to main page.
if (!isset($_GET["e"])) {
header("Location:/");
die();
}
$event_id = filter_input(INPUT_GET, "e", FILTER_SANITIZE_ENCODED);
# If event id is unknown, redirect to main page.
if (!array_key_exists($event_id, $events)) {
header("Location:/");
die();
}
$E = $events[$event_id];
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="../css/style.css">
<title> <?php echo "{$E['name']} - {$CONFIG_TERM}"; ?></title>
</head>
<body>
<div id="center">
<div class="block">
<h1><?php echo "{$E['name']} - {$CONFIG_TERM}"; ?></h1>
<h2 class="description icon clock"><?php echo $E['date'];?></h2>
<h2 class="description icon marker"><?php echo $E['location'];?></h2>
<?php
echo "<h2 class=\"description\">Verbleibende Plätze:".(string)(getNumberOfRemainingSpots($E))."</h2>";
echo $E["text"];
echo "<br>";
echo ($E['info'] == '' ? '' : "<div class='block info'>{$E['info']}</div>");
echo '<div class="block>">';
if($_SERVER['REQUEST_METHOD'] === 'POST') {
register($E);
}
else {
showRegistration($E);
}
?>
</div>
</div>
</body>
</html>