-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
54 lines (46 loc) · 1.35 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
<?php
session_start();
define('PATH_VIEWS','views/');
define('SESSION_ID',session_id());
$date = date("j/m/Y");
#Upload
function uploadClass($class){
require_once 'models/' . $class . '.class.php';
}
spl_autoload_register('uploadClass');
require_once(PATH_VIEWS . 'header.php');
#Redirection
$action = (isset($_GET['action'])) ? htmlentities($_GET['action']) : 'default';
switch ($action) {
case 'login':
require_once('controllers/LoginController.php');
$controller = new LoginController();
break;
case 'bloc' :
require_once ('controllers/BlocController.php');
$controller = new BlocController ();
break;
case 'student':
require_once('controllers/StudentController.php');
$controller = new StudentController();
break;
case 'teacher':
require_once('controllers/TeacherController.php');
$controller = new TeacherController();
break;
case 'admin':
require_once('controllers/AdminController.php');
$controller = new AdminController();
break;
case 'logout':
require_once('controllers/LogoutController.php');
$controller = new LogoutController();
break;
default:
require_once 'controllers/LoginController.php';
$controller = new LoginController();
break;
}
$controller->run();
require_once(PATH_VIEWS . 'footer.php');
?>