-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
50 lines (37 loc) · 1.16 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
<?php
require_once "./config/app.php";
require_once "./autoload.php";
require_once "./app/views/inc/session_start.php";
if(isset($_GET['views'])){
$url = explode("/", $_GET['views']);
}else{
$url = ["login"];
}
?>
<!DOCTYPE html>
<html lang="es">
<head>
<?php require_once "./app/views/inc/head.php";?>
</head>
<body>
<?php
use app\controllers\viewsController;
use app\controllers\loginController;
$insLogin = new loginController();
$viewsController = new viewsController();
$vista=$viewsController->obtenerVistasControlador($url[0]);
if($vista == "login" || $vista == "404"){
require_once "./app/views/content/".$vista."-view.php";
}else{
# Cerrar sesión #
if(!isset($_SESSION['id']) || !isset($_SESSION['nombre']) || !isset($_SESSION['usuario']) || $_SESSION['id'] == ""|| $_SESSION['nombre'] == "" || $_SESSION['usuario'] == "" ){
$insLogin->cerrarSesionControlador();
exit();
}
require_once "./app/views/inc/navbar.php";
require_once $vista;
}
require_once "./app/views/inc/script.php";
?>
</body>
</html>