-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
130 lines (118 loc) · 3.18 KB
/
index.php
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
define('DS', DIRECTORY_SEPARATOR);
define('WWW_ROOT', __DIR__ . DS);
$routes = array(
'home' => array(
'controller' => 'Dashboard',
'action' => 'dashboard'
),
'login' => array(
'controller' => 'Dashboard',
'action' => 'login'
),
'logout' => array(
'controller' => 'Dashboard',
'action' => 'logout'
),
'register' => array(
'controller' => 'Dashboard',
'action' => 'register'
),
'update' => array(
'controller' => 'Dashboard',
'action' => 'update'
),
'delete' => array(
'controller' => 'Dashboard',
'action' => 'delete'
),
'week' => array(
'controller' => 'Week',
'action' => 'week'
),
'dagen' => array(
'controller' => 'Week',
'action' => 'dagen'
),
'weken' => array(
'controller' => 'Week',
'action' => 'weken'
),
'fiscaal' => array(
'controller' => 'Week',
'action' => 'fiscaal'
),
'kinderen' => array(
'controller' => 'Kinderen',
'action' => 'gegevens'
),
'voegtoe' => array(
'controller' => 'Kinderen',
'action' => 'toevoegen'
),
'weizig' => array(
'controller' => 'Kinderen',
'action' => 'weizigen'
),
'ouders' => array(
'controller' => 'Kinderen',
'action' => 'ouders'
),
'downloadOuders' => array(
'controller' => 'Kinderen',
'action' => 'downloadOuders'
),
'zetActief' => array(
'controller' => 'Kinderen',
'action' => 'zetActief'
),
'verwijder' => array(
'controller' => 'Kinderen',
'action' => 'verwijder'
),
'uitstappen' => array(
'controller' => 'Uitstap',
'action' => 'index'
),
'uitstap_detail' => array(
'controller' => 'Uitstap',
'action' => 'detail'
),
'uitstap_edit' => array(
'controller' => 'Uitstap',
'action' => 'editAdd'
),
'uitstap_add_child' => array(
'controller' => 'Uitstap',
'action' => 'addChild'
)
// 'old_home' => array(
// 'controller' => 'Staf',
// 'action' => 'index'
// ),
// 'staf' => array(
// 'controller' => 'Staf',
// 'action' => 'staf'
// ),
// 'add' => array(
// 'controller' => 'Staf',
// 'action' => 'add'
// )
);
if(empty($_GET['page'])) {
$_GET['page'] = 'home';
}
if(empty($routes[$_GET['page']])) {
header('Location: index.php');
exit();
}
$route = $routes[$_GET['page']];
$controllerName = $route['controller'] . 'Controller';
require_once WWW_ROOT . 'controller' . DS . $controllerName . ".php";
$controllerObj = new $controllerName();
$controllerObj->route = $route;
$controllerObj->filter();
$controllerObj->render();