-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
85 lines (68 loc) · 2.5 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
76
77
78
79
80
81
82
83
84
85
<?php
if(!empty($_GET['url'])){
if($_GET['url'] == '/'){
$url = 'home';
}else{
$url = $_GET['url'];
// echo $url;
}
}else{
$url = 'home';
}
$arr_url = explode("/", $url);
// print_r($arr_url);
$cantidad_elementos_url_json = count($arr_url);
if($cantidad_elementos_url_json == 1){
if($arr_url[0] == 'home'){
require_once 'home.php';
}
elseif($arr_url[0] == 'tienda'){
require_once 'home_tienda.php';
}elseif($arr_url[0] == 'contacto'){
require_once 'contacto.php';
}
elseif($arr_url[0] == 'nosotros'){
require_once 'nosotros.php';
}
elseif($arr_url[0] == 'galeria'){
require_once 'galeria.php';
}
else{
require_once '404.html';
}
}elseif($cantidad_elementos_url_json == 2){
if($arr_url[0] == 'tienda' && $arr_url[1] == 'categoria'){
header('location: http://localhost/asonaema/tienda');
}
elseif($arr_url[0] == 'tienda' && $arr_url[1] == 'producto'){
header('location: http://localhost/asonaema/tienda');
}
elseif($arr_url[0] == 'admin' && $arr_url[1] ==''){
require_once 'admin_files/home.admin.php';
}
elseif($arr_url[0] == 'admin' && $arr_url[1] =='productos'){
require_once 'admin_files/productos.admin.php';
}
elseif($arr_url[0] == 'admin' && $arr_url[1] =='categorias'){
require_once 'admin_files/categorias.admin.php';
}
elseif($arr_url[0] == 'admin' && $arr_url[1] =='carousels'){
require_once 'admin_files/carousels.admin.php';
}
elseif($arr_url[0] == 'admin' && $arr_url[1] =='vendedores'){
require_once 'admin_files/vendedores.admin.php';
}
elseif($arr_url[0] == 'admin' && $arr_url[1] =='comite'){
require_once 'admin_files/comite.admin.php';
}
}
elseif($cantidad_elementos_url_json == 3){
if($arr_url[0] == 'tienda' && $arr_url[1] == 'categoria'){
require_once 'categoria.php';
}elseif($arr_url[0] == 'tienda' && $arr_url[1] == 'producto' && !empty($arr_url[2])){
require_once 'producto.php';
}
}
// $id = uniqid();
// echo ($id);
?>