forked from dacendej/SW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verJuego.php
33 lines (29 loc) · 988 Bytes
/
verJuego.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
<?php
require_once 'config.php';
require_once 'vistas/helpers/juegos.php';
$tituloPagina = 'Detalles del juego';
$mensaje = '';
$contenidoPrincipal = '';
if (isset($_GET['id'])) {
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
if ($id) {
$detallesJuego = mostrarDetallesJuego($id);
if ($detallesJuego) {
$contenidoPrincipal .= $detallesJuego;
if (estaLogado()) {
$contenidoPrincipal .= buildFormularioValorarJuego($id);
}
else{
$contenidoPrincipal .= "<div class='mensaje-registro'><br>Regístrate para poder valorar este juego!</div>";
}
} else {
$mensaje = "El juego solicitado no fue encontrado.";
}
} else {
$mensaje = "Identificador de juego inválido.";
}
} else {
$mensaje = "No se proporcionó un identificador de juego.";
}
$contenidoPrincipal .= $mensaje;
require 'vistas/comun/layout.php';