forked from iaguas/construyetupc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.bak.php
108 lines (100 loc) · 2.12 KB
/
index.bak.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
/**
* Fichero: index.php
* Descripcion: Archivo que contiene todo lo relacionado con el controlador del patrón MVC.
*/
require_once("models/model.php");
require_once("view.php");
require_once("models/sessions.php");
session_start();
sCheckSessionVar();
/**
* Control de la acción que se lleva a cabo.
*/
if (isset($_GET["action"])){
$action = $_GET["action"];
}
else {
if (isset($_POST["action"])){
$action = $_POST["action"];
}
else {
$action = "landing";
// Descomentar cuando quitemos la Landing Page
//$action = "main";
}
}
/**
* Control de la id.
*/
if (isset($_GET["id"])){
$id = $_GET["id"];
}
else {
if (isset($_POST["id"])) {
$id = $_POST["id"];
}
else {
$id = 1;
}
}
/**
* Cargamos la página principal
*/
switch($action) {
// Landing page
case 'landing':
switch ($id){
case 1:
vLandingPage();
break;
case 2:
vCreatorId();
break;
}
break;
// Main page
case 'main':
switch ($id){
case 1:
vMainPage();
break;
}
break;
// Selección de tipo de componente
case 'partList':
switch ($id){
case 1:
vShowPartList();
break;
case 2:
vShowComponentSelection();
break;
case 3:
sAddPart();
vShowPartList();
break;
case 4:
sRemovePart();
vShowPartList();
break;
}
break;
// Muestra los emails introducidos en MONGODB
case 'showEmails':
switch ($id){
case 1:
vShowEmails(mGetEmails());
break;
}
break;
// Muestra los emails introducidos en MONGODB
case 'validateRegister':
switch ($id){
case 1:
mResgiterEmail();
vShowValidateRegister();
break;
}
break;
}