-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
55 lines (55 loc) · 1.38 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
<?php
include 'config/application.php';
$path = ltrim($_SERVER['REQUEST_URI'], '/');
$elements = explode('/', $path);
$link = array_filter($elements);
if (count($link[1]) == 0){
$utility->location("home");
}
else {
switch ($link[1]) {
case 'content':
include "./isi.php";
break;
case 'process':
include "./aksi.php";
break;
case 'logout':
include "./logout.php";
break;
case 'home':
$view[] = "./view/include/head.php";
$view[] = "./view/homeIndex.php";
cekandgo($view, $utility, $home);
break;
case 'dekon':
$view[] = "./view/include/head.php";
$view[] = "./view/homeDekon.php";
cekandgo($view, $utility, $home);
break;
case 'review':
$view[] = "./view/include/head.php";
$view[] = "./view/homeReview.php";
cekandgo($view, $utility, $home);
break;
case 'login':
$view[] = "./view/include/head.php";
$view[] = "./view/homeLogin.php";
cekandgo($view, $utility);
break;
default:
$utility->location(".");
break;
}
}
function cekandgo($data, $utility, $home=null) {
if ($_SESSION['username'] != '') {
$utility->location("content/home");
}
else {
for ($i=0; $i < count($data) ; $i++) {
include $data[$i];
}
}
}
?>