-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
77 lines (71 loc) · 2.37 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
@session_start();
if(!isset($_SESSION['contador'])){
$_SESSION['contador'] = 0;
}
//header('Content-Type: text/html; charset=UTF-8');
define('DS', "/");
define('ROOT', realpath(dirname(__FILE__)) . DS);
define('APP_PATH', ROOT . 'application' . DS);
define('CONFIG', APP_PATH . DS . 'config' . DS);
error_reporting(E_ALL);
ini_set("display_errors", "1");
require_once(CONFIG . 'config_app.php');
require_once(CONTROLLERS . 'ControllerMain.php');
require_once(MODELS . 'ModelMain.php');
require_once(CONFIG . 'DataBase.php');
$_controlMain = new ControllerMain();
$_controlMain->libreriasbasicas($objeFramework);
$_objvista = new ControllerVista();
$lang = isset($_GET['lang']) ? $_GET['lang'] : "es";
if($lang != "es" && $lang != "it" && $lang != "en"){
$lang ="es";
}
$view = isset($_GET['vista']) ? $_GET['vista'] : "home"; //remplazar por el archivo inicial
$vectorFuncion = array();
$operation = isset($_REQUEST['operation']) ? $_REQUEST['operation']:"";
$render_fancy =isset($_GET['fancy']) ? $_GET['fancy'] : "";
if(isset($_REQUEST['controller'])){
$controller=$_REQUEST['controller'];
require_once(CONTROLLERS."Controller".trim($controller).".php");
if(file_exists(MODELS."Model".trim($controller).".php")){
require_once(MODELS."Model".trim($controller).".php");
}
$controlle ="Controller".trim($controller);
$_control = new $controlle;
$vectorFuncion = array(
'1' => $_control,
'2' => $operation,
'post' => $_REQUEST);
}
if(!isset($_GET['id_pago']) && empty($_GET['id_pago'])){
$swpasarella = 0;
}else{
$obje = ControllerMain::makeObjects("Pasarella",1);
$obje->guardarPago($_GET['id_pago']);
}
if(TYPE_APP == 1){
if($operation !=""){
$_control->verificarFuncion($vectorFuncion);
}else{
if(!empty($render_fancy)){
$_objvista->renderizarFancy($render_fancy);
}else{
$_objvista->renderizarVista($view,$lang,true);
}
}
}//else if (TYPE_APP == 2){
// if($operation !=""){
// $_control->verificarFuncion($vectorFuncion);
// }else{
// if(!empty($render_fancy)){
// $_objvista->renderizarFancy($render_fancy);
// }else{
// if(!empty($view)){
// $_objvista->renderizarVista($view);
// }else{
// $_objvista->renderizarVista();
// }
// }
// }
// }