-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
66 lines (49 loc) · 2.2 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
<?php
/*======================================
= LÓGICA INICIAL =
======================================*/
session_start();
if (isset($_SESSION['activa'])) header('location: dashboard.php');
include 'templates/head.php';
if (!empty($_SESSION['userID']))$_SESSION['userID'] = $admin['id'];
setRegistro('TRUNCATE TABLE carrito_venta');
setRegistro('TRUNCATE TABLE carrito_compra');
function verificarCopiaDeSeguridad() {
global $script;
if (file_exists('backup/backup.sql'))
$script .= '<script src="assets/js/restaurarBD.js"></script>';
}
/*===== End of LÓGICA INICIAL ======*/
/*---------- Si no hay negocios, solicita registro ----------*/
if (!isset($mostrarLoader) and !$negocios):
verificarCopiaDeSeguridad();
$mostrarRegistro = true;
include 'templates/registrarNegocio.php';
$script .= '<script src="assets/js/registrarNegocio.js"></script>';
/*---------- Si no hay administrador, solicita registro ----------*/
elseif (!isset($mostrarLoader) and !$admin):
verificarCopiaDeSeguridad();
$mostrarRegistro = true;
include 'templates/registrarAdmin.php';
$script .= '<script src="assets/js/registrarAdmin.js"></script>';
/*---------- Si el administrador no tiene preguntas secretas, solicita registro ----------*/
elseif (!isset($mostrarLoader) and !$admin['pre1']):
verificarCopiaDeSeguridad();
$mostrarRegistro = true;
include 'templates/registroPreguntasRespuestas.php';
$script .= '<script src="assets/js/registrarPreguntasRespuestas.js"></script>';
/*---------- Muestra el login ----------*/
elseif (!isset($mostrarLoader)):
$mostrarLogin = true;
include 'templates/login.php';
include 'templates/consultarPreguntasRespuestas.php';
if (isset($_SESSION['showQuestions']))
include 'templates/preguntasRespuestas.php';
if (isset($_SESSION['changePassword']))
include 'templates/cambiarClave.php';
$script .= '<script src="assets/js/reloj.js"></script>';
$script .= '<script src="assets/libs/typedjs/typed.min.js"></script>';
$script .= '<script src="assets/js/login.js"></script>';
$script .= '<script src="assets/js/recuperarClave.js"></script>';
endif;
include 'templates/footer.php';