-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
executable file
·46 lines (33 loc) · 1001 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
require_once 'classes/Portada.class.php';
require_once 'classes/LoginView.class.php';
require_once 'classes/SessionVars.class.php';
require_once 'classes/LoginController.class.php';
require_once 'classes/DbConfig.class.php';
require_once 'classes/resultController.class.php';
DbConfig::setup();
SessionVars::start();
$view = $_GET['view'];
$action = $_GET['action'];
$controller = new resultController();
if( !(isset($action))){
// acciones para la vista
$portada = new Portada();
if( SessionVars::isUserLogged() ){
$content = $controller->getView($view);
} else {
$login = new LoginView();
$login->setDisplayOptions();
$content = $login->getDisplay();
}
$portada->setDisplayOptions($content);
echo $portada->getDisplay();
} else{
if( SessionVars::isUserLogged() ){
echo $controller->asynAction($action);
} else {
$controller = new LoginController();
echo $controller->makeAsyncRequest($action);
}
}
?>