-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
82 lines (67 loc) · 2.31 KB
/
index.php
File metadata and controls
82 lines (67 loc) · 2.31 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
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
<?php
session_start();
error_reporting(E_ALL);
ob_start();
require_once 'Data/Config.class.php';
Config::init();
//require_once 'Data/Database.class.php';
require_once 'Data/User.class.php';
$user = new User();
$beheer = null;
//require_once 'Data/Docent/Beheer.class.php';
if ($user->isDocent())
$beheer = new Beheer();
//Get $_Post Request
if (isset($_POST['inloggen']))
$user->userLogin ($_POST['username'], md5($_POST['password']));
if (isset($_POST['uitloggen']))
$user->userLogOff();
if (isset($_POST['submitMathQuestion']))
$beheer->insertMathQuestions ($_POST);
if (isset($_POST['cancelMathQuestion']))
header('location: index.php?Page=BeheerRekenen');
//Get $_Get requests
$page = (!isset($_GET['Page'])) ? "Home" : $_GET['Page'];
//Get Content
require_once 'template/Main/header.template.php';
switch ($page){
case 'Home':
require_once 'template/Content/Homepage.template.php';
break;
case 'Games':
if (User::isLoggedIn())
require_once 'template/Content/Games.template.php';
else
require_once 'template/Content/Error.template.php';
break;
case 'Test':
if (User::isLoggedIn())
require_once 'index_temp.php';
else
require_once 'template/Content/Error.template.php';
break;
case 'BeheerRekenen':
if (User::isLoggedIn() && User::isDocent())
require_once 'template/Docent/BeheerRekenen.template.php';
else
require_once 'template/Content/Error.template.php';
break;
case 'BeheerTaal':
if (User::isLoggedIn() && User::isDocent())
require_once 'template/Docent/BeheerTaal.template.php';
else
require_once 'template/Content/Error.template.php';
break;
case 'BeheerRekenenEdit':
if (User::isLoggedIn() && User::isDocent())
require_once 'template/Docent/BeheerRekenenEdit.template.php';
else
require_once 'template/Content/Error.template.php';
break;
default:
require_once 'template/Content/Error.template.php';
break;
}
require_once 'template/Main/footer.template.php';
ob_end_flush();
?>