-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
93 lines (89 loc) · 2.14 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
<?php
## Debug script (system-wide)
require('system/debug.php');
## Required scripts
require_once('system/functions.php');
## ROUTER
if(empty($Segment[0])) {
GetTemplate('index');
} else {
switch($Segment[0]) {
case 'images':
$File = $BaseUrl . '/uploads/' . $Segment[1];
$Size = $Segment[2];
ResizeImg($File, $Size);
break;
case 'ajax':
switch($Segment[1]) {
case 'extra_form':
AddForm($Mysqli, $_POST);
break;
case 'request':
SendRequest($Mysqli, $_POST);
break;
case 'contact':
SendContact($Mysqli, $_POST);
break;
case 'phone':
SendPhone($Mysqli, $_POST);
break;
default:
header("Location:/");
}
break;
case '':
GetTemplate('index');
break;
case 'zoeken':
if(!empty($Segment[2])) {
header("Location:/zoeken");
} else {
if(isset($_POST['Search'])) {
$SearchValue = htmlspecialchars($_POST['Search']);
header("Location:/zoeken/" . $SearchValue);
} else {
GetTemplate('search');
}
}
break;
case 'probleem_melden':
if(empty($Segment[2])) {
GetTemplate('form_page');
} else {
header("Location:/probleem_melden/");
}
break;
case 'studenten':
if(empty($Segment[1])) {
GetTemplate('student_page');
//}else if($Segment[1] == 'solliciteer'){
// GetTemplate('apply_page');
} elseif($Segment[1] == 'zoeken') {
if(empty($Segment[3])) {
if(isset($_POST['Search'])) {
$SearchValue = htmlspecialchars($_POST['Search']);
header("Location:/studenten/zoeken/" . $SearchValue);
} else {
GetTemplate('search');
}
} else {
GetTemplate('search');
}
} else {
$LastSegment = end($Segment);
$Count = 0;
$PrevSegment = "";
$SementMemory = "";
CheckFullUrl($Mysqli, $Segment, $Count, $PrevSegment, $SementMemory);
}
break;
default:
// $LastSegmentNumber = $TotalSegments - 1;
$LastSegment = end($Segment);
$Count = 0;
$PrevSegment = "";
$SementMemory = "";
CheckFullUrl($Mysqli, $Segment, $Count, $PrevSegment, $SementMemory);
}
}
?>