-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
28 lines (22 loc) · 853 Bytes
/
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
<?php
require_once './Controller/loginController.php';
require_once './Controller/userController.php';
require_once './Controller/vehicleController.php';
require_once './Controller/cityController.php';
require_once './Controller/routeController.php';
require_once './Controller/ticketsController.php';
require_once './View/menuView.php';
$url = isset($_GET['url']) ? $_GET['url'] : '';
$urlArray = explode('/', $url);
$classe = !empty($urlArray[0]) ? $urlArray[0] . 'Controller' : 'loginController';
$metodo = !empty($urlArray[1]) ? $urlArray[1] : 'fillLogin';
if (class_exists($classe) && method_exists($classe, $metodo)) {
$obj = new $classe();
$obj->$metodo();
} else {
$loginController = new loginController();
$loginController->fillLogin();
}
if ($_SERVER['REQUEST_URI'] == '/logout') {
require_once './logout.php';
}