Merge branch 'pruebasJorge'
This commit is contained in:
+47
-153
@@ -4,25 +4,20 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Trivial - Lobby</title>
|
<title>Trivial - Lobby</title>
|
||||||
<link rel="icon" type="image/svg+xml" href="img/favicon/favicon.svg">
|
<link rel="icon" type="image/svg+xml" href="img/favicon/favicon.svg">
|
||||||
<link
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
||||||
rel="stylesheet">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/index.css">
|
<link rel="stylesheet" href="css/index.css">
|
||||||
<link rel="stylesheet" href="css/buscadorSala.css">
|
<link rel="stylesheet" href="css/buscadorSala.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<?php
|
<?php include_once("cabecera.php"); ?>
|
||||||
include_once("cabecera.php");
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main class="container py-5">
|
<main class="container py-4">
|
||||||
<!-- Botón Volver -->
|
|
||||||
|
<!-- Botón Volver -->
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<a href="index.php" class="btn btn-outline-secondary d-inline-flex align-items-center gap-2">
|
<a href="index.php" class="btn btn-outline-secondary d-inline-flex align-items-center gap-2">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
|
||||||
@@ -31,181 +26,80 @@
|
|||||||
Volver al Inicio
|
Volver al Inicio
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Botón Crear Sala -->
|
||||||
<div id="contenedorCrearSala" class="text-center mb-5">
|
<div id="contenedorCrearSala" class="text-center mb-5">
|
||||||
|
<button type="button" class="btn btn-play-kahoot btn-crear-sala" data-bs-toggle="modal" data-bs-target="#modalCrearSala">
|
||||||
|
<span>+</span> Crear sala
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-play-kahoot btn-crear-sala"
|
|
||||||
data-bs-toggle="modal"
|
|
||||||
data-bs-target="#modalCrearSala">
|
|
||||||
|
|
||||||
<span>+</span>
|
|
||||||
Crear sala
|
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<!-- Contenedor Principal de Salas -->
|
||||||
id="contenedorSalas"
|
<div id="contenedorSalas" class="row justify-content-center g-4">
|
||||||
class="row justify-content-center g-4">
|
<div id="cargandoSalas" class="col-12 text-center">
|
||||||
|
<div class="spinner-border text-primary" role="status">
|
||||||
<div
|
<span class="visually-hidden">Cargando...</span>
|
||||||
id="cargandoSalas"
|
|
||||||
class="col-12 text-center">
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="spinner-border text-primary"
|
|
||||||
role="status">
|
|
||||||
|
|
||||||
<span class="visually-hidden">
|
|
||||||
Cargando...
|
|
||||||
</span>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<p class="mt-3 text-muted">Cargando salas...</p>
|
||||||
<p class="mt-3 text-muted">
|
|
||||||
Cargando salas...
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- Modal Crear Sala -->
|
<!-- Modal Crear Sala -->
|
||||||
<div
|
<div class="modal fade" id="modalCrearSala" tabindex="-1" aria-labelledby="modalCrearSalaLabel" aria-hidden="true">
|
||||||
class="modal fade"
|
|
||||||
id="modalCrearSala"
|
|
||||||
tabindex="-1"
|
|
||||||
aria-labelledby="modalCrearSalaLabel"
|
|
||||||
aria-hidden="true">
|
|
||||||
|
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
|
||||||
<div class="modal-content modal-kahoot">
|
<div class="modal-content modal-kahoot">
|
||||||
|
|
||||||
<div class="modal-header modal-kahoot-header">
|
<div class="modal-header modal-kahoot-header">
|
||||||
|
<h5 class="modal-title" id="modalCrearSalaLabel">Crear sala</h5>
|
||||||
<h5
|
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Cerrar"></button>
|
||||||
class="modal-title"
|
|
||||||
id="modalCrearSalaLabel">
|
|
||||||
|
|
||||||
Crear sala
|
|
||||||
|
|
||||||
</h5>
|
|
||||||
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn-close btn-close-white"
|
|
||||||
data-bs-dismiss="modal"
|
|
||||||
aria-label="Cerrar">
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-body p-4">
|
<div class="modal-body p-4">
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
<label for="nombreSala" class="form-label">Nombre de la sala</label>
|
||||||
<label
|
<input type="text" id="nombreSala" class="form-control input-kahoot" name="nombreSala" placeholder="Ej. Noche de Trivial" maxlength="100">
|
||||||
for="nombreSala"
|
|
||||||
class="form-label">
|
|
||||||
|
|
||||||
Nombre de la sala
|
|
||||||
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="nombreSala"
|
|
||||||
class="form-control input-kahoot"
|
|
||||||
name="nombreSala"
|
|
||||||
placeholder="Ej. Noche de Trivial"
|
|
||||||
maxlength="100">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
<label for="nombreEquipo1" class="form-label">Nombre del equipo 1</label>
|
||||||
<label
|
<input type="text" id="nombreEquipo1" name="nombreEquipo1" class="form-control input-kahoot" placeholder="Ej. Los cerebritos" maxlength="50">
|
||||||
for="nombreEquipo1"
|
|
||||||
class="form-label">
|
|
||||||
|
|
||||||
Nombre del equipo 1
|
|
||||||
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="nombreEquipo1"
|
|
||||||
name="nombreEquipo1"
|
|
||||||
class="form-control input-kahoot"
|
|
||||||
placeholder="Ej. Los cerebritos"
|
|
||||||
maxlength="50">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
<label for="nombreEquipo2" class="form-label">Nombre del equipo 2</label>
|
||||||
<label
|
<input type="text" id="nombreEquipo2" name="nombreEquipo2" class="form-control input-kahoot" placeholder="Ej. Los campeones" maxlength="50">
|
||||||
for="nombreEquipo2"
|
|
||||||
class="form-label">
|
|
||||||
|
|
||||||
Nombre del equipo 2
|
|
||||||
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="nombreEquipo2"
|
|
||||||
name="nombreEquipo2"
|
|
||||||
class="form-control input-kahoot"
|
|
||||||
placeholder="Ej. Los campeones"
|
|
||||||
maxlength="50">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
|
||||||
<button
|
<button type="button" class="btn btn-kahoot-login" id="btnCrearSala">Crear sala</button>
|
||||||
type="button"
|
</div>
|
||||||
class="btn btn-secondary"
|
</div>
|
||||||
data-bs-dismiss="modal">
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--MODAL ABANDONAR SALA -->
|
||||||
|
<!-- Modal Confirmar Abandonar Sala -->
|
||||||
|
<div class="modal fade" id="modalAbandonarSala" tabindex="-1" aria-labelledby="modalAbandonarSalaLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content modal-kahoot text-center p-3">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-3 fs-1">⚠️</div>
|
||||||
|
<h4 class="modal-title mb-2 fw-bold text-white" id="modalAbandonarSalaLabel">¿Abandonar la sala?</h4>
|
||||||
|
<p class="text-white-50">Si sales de la sala, perderás tu lugar en el equipo.</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer justify-content-center border-0 gap-2">
|
||||||
|
<button type="button" class="btn btn-secondary px-4 py-2" data-bs-dismiss="modal">
|
||||||
Cancelar
|
Cancelar
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
<button type="button" id="btnConfirmarAbandonar" class="btn btn-danger px-4 py-2">
|
||||||
<button
|
Sí, salir
|
||||||
type="button"
|
|
||||||
class="btn btn-kahoot-login"
|
|
||||||
id="btnCrearSala">
|
|
||||||
|
|
||||||
Crear sala
|
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script src="js/jquery-4.0.0.min.js"></script>
|
||||||
<script
|
|
||||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js">
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script src="js/jquery.min.js"></script>
|
|
||||||
|
|
||||||
<script src="js/buscadorSala.js"></script>
|
<script src="js/buscadorSala.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -118,8 +118,6 @@ class EquipoxUsuario
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function salirDeSala($idUsuario)
|
public static function salirDeSala($idUsuario)
|
||||||
{
|
{
|
||||||
$conexion = conexionBD();
|
$conexion = conexionBD();
|
||||||
@@ -147,6 +145,3 @@ public static function salirDeSala($idUsuario)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ switch ($_POST['orden']) {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'salirDeSala':
|
case 'salirDeSala':
|
||||||
if (!isset($_SESSION['idUsuario'])) {
|
if (!isset($_SESSION['idUsuario'])) {
|
||||||
echo json_encode(['error' => 'Usuario no autenticado']);
|
echo json_encode(['error' => 'Usuario no autenticado']);
|
||||||
@@ -86,5 +87,4 @@ switch ($_POST['orden']) {
|
|||||||
|
|
||||||
echo json_encode($respuesta);
|
echo json_encode($respuesta);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
+115
-223
@@ -4,6 +4,7 @@ $(document).ready(function () {
|
|||||||
comprobarSalaUsuario();
|
comprobarSalaUsuario();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 1. Comprobar si el usuario actual ya pertenece a una sala
|
||||||
function comprobarSalaUsuario() {
|
function comprobarSalaUsuario() {
|
||||||
$("#cargandoSalas").remove();
|
$("#cargandoSalas").remove();
|
||||||
|
|
||||||
@@ -11,101 +12,64 @@ function comprobarSalaUsuario() {
|
|||||||
url: "controladores/ControladorEquipoxUsuario.php",
|
url: "controladores/ControladorEquipoxUsuario.php",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
data: { orden: "obtenerSalaUsuario" },
|
||||||
data: {
|
|
||||||
orden: "obtenerSalaUsuario",
|
|
||||||
},
|
|
||||||
|
|
||||||
success: function (respuesta) {
|
success: function (respuesta) {
|
||||||
console.log("Sala del usuario:", respuesta);
|
if (respuesta.error || !respuesta.asociado) {
|
||||||
|
|
||||||
if (respuesta.error) {
|
|
||||||
console.error(respuesta.error);
|
|
||||||
|
|
||||||
usuarioYaEstaEnEquipo = false;
|
usuarioYaEstaEnEquipo = false;
|
||||||
|
$("#contenedorCrearSala").show();
|
||||||
cargarSalas();
|
cargarSalas();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (respuesta.asociado) {
|
|
||||||
usuarioYaEstaEnEquipo = true;
|
|
||||||
|
|
||||||
$("#contenedorCrearSala").hide();
|
|
||||||
|
|
||||||
cargarSalaUsuario(respuesta.idPartida);
|
|
||||||
} else {
|
} else {
|
||||||
usuarioYaEstaEnEquipo = false;
|
usuarioYaEstaEnEquipo = true;
|
||||||
|
$("#contenedorCrearSala").hide(); // Ocultar "Crear Sala" si ya pertenece a una
|
||||||
cargarSalas();
|
cargarSalaUsuario(respuesta.idPartida);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error("Error al comprobar la sala del usuario:", error);
|
console.error("Error al comprobar la sala del usuario:", error);
|
||||||
|
|
||||||
usuarioYaEstaEnEquipo = false;
|
usuarioYaEstaEnEquipo = false;
|
||||||
|
|
||||||
cargarSalas();
|
cargarSalas();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2. Cargar únicamente la sala en la que está metido el usuario
|
||||||
function cargarSalaUsuario(idPartida) {
|
function cargarSalaUsuario(idPartida) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "controladores/controladorPartida.php",
|
url: "controladores/controladorPartida.php",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
data: { orden: "buscar", idPartida: idPartida },
|
||||||
data: {
|
|
||||||
orden: "buscar",
|
|
||||||
idPartida: idPartida,
|
|
||||||
},
|
|
||||||
|
|
||||||
success: function (partida) {
|
success: function (partida) {
|
||||||
if (partida.error) {
|
if (partida.error) {
|
||||||
console.error(partida.error);
|
console.error(partida.error);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#contenedorSalas").empty();
|
$("#contenedorSalas").empty();
|
||||||
|
|
||||||
cargarInformacionSala(partida);
|
cargarInformacionSala(partida);
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error("Error al obtener la sala del usuario:", error);
|
console.error("Error al obtener la sala del usuario:", error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 3. Cargar la lista completa de todas las salas
|
||||||
function cargarSalas() {
|
function cargarSalas() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "controladores/controladorPartida.php",
|
url: "controladores/controladorPartida.php",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
data: { orden: "listar" },
|
||||||
data: {
|
|
||||||
orden: "listar",
|
|
||||||
},
|
|
||||||
|
|
||||||
success: function (partidas) {
|
success: function (partidas) {
|
||||||
const contenedor = $("#contenedorSalas");
|
const contenedor = $("#contenedorSalas");
|
||||||
|
|
||||||
contenedor.empty();
|
|
||||||
contenedor.empty();
|
contenedor.empty();
|
||||||
|
|
||||||
if (!Array.isArray(partidas) || partidas.length === 0) {
|
if (!Array.isArray(partidas) || partidas.length === 0) {
|
||||||
contenedor.html(`
|
contenedor.html(`
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<p class="text-muted">
|
<p class="text-muted">No hay salas disponibles actualmente.</p>
|
||||||
No hay salas disponibles.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,54 +77,42 @@ function cargarSalas() {
|
|||||||
cargarInformacionSala(partida);
|
cargarInformacionSala(partida);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error("Error al obtener las partidas:", error);
|
console.error("Error al obtener las partidas:", error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 4. Obtener equipos y jugadores asociados a una sala concreta
|
||||||
function cargarInformacionSala(partida) {
|
function cargarInformacionSala(partida) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "controladores/controladorPartida.php",
|
url: "controladores/controladorPartida.php",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
data: { orden: "getEquipos", idPartida: partida.idPartida },
|
||||||
data: {
|
|
||||||
orden: "getEquipos",
|
|
||||||
idPartida: partida.idPartida,
|
|
||||||
},
|
|
||||||
|
|
||||||
success: function (equipos) {
|
success: function (equipos) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "controladores/controladorPartida.php",
|
url: "controladores/controladorPartida.php",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
data: { orden: "getJugadores", idPartida: partida.idPartida },
|
||||||
data: {
|
|
||||||
orden: "getJugadores",
|
|
||||||
idPartida: partida.idPartida,
|
|
||||||
},
|
|
||||||
|
|
||||||
success: function (jugadores) {
|
success: function (jugadores) {
|
||||||
mostrarSala(partida, equipos, jugadores);
|
mostrarSala(partida, equipos, jugadores);
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error("Error al obtener jugadores:", error);
|
console.error("Error al obtener jugadores:", error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error("Error al obtener equipos:", error);
|
console.error("Error al obtener equipos:", error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 5. Renderizar el HTML de la sala y botones según estado
|
||||||
function mostrarSala(partida, equipos, jugadores) {
|
function mostrarSala(partida, equipos, jugadores) {
|
||||||
const contenedor = $("#contenedorSalas");
|
const contenedor = $("#contenedorSalas");
|
||||||
|
|
||||||
let equiposHTML = "";
|
let equiposHTML = "";
|
||||||
|
|
||||||
equipos.forEach(function (equipo) {
|
equipos.forEach(function (equipo) {
|
||||||
@@ -169,229 +121,194 @@ function mostrarSala(partida, equipos, jugadores) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let jugadoresHTML = "";
|
let jugadoresHTML = "";
|
||||||
|
|
||||||
if (jugadoresEquipo.length > 0) {
|
if (jugadoresEquipo.length > 0) {
|
||||||
jugadoresEquipo.forEach(function (jugador) {
|
jugadoresEquipo.forEach(function (jugador) {
|
||||||
jugadoresHTML += `
|
jugadoresHTML += `
|
||||||
<div class="jugador">
|
<div class="jugador">
|
||||||
|
<span class="avatar">👤</span>
|
||||||
<span class="avatar">
|
|
||||||
👤
|
|
||||||
</span>
|
|
||||||
|
|
||||||
${escapeHTML(jugador.nombreUsuario)}
|
${escapeHTML(jugador.nombreUsuario)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
jugadoresHTML = `
|
jugadoresHTML = `<div class="text-muted small">Sin jugadores</div>`;
|
||||||
<div class="text-muted small">
|
|
||||||
Sin jugadores
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Botón "Unirse" solo visible si NO pertenece a ningún equipo
|
||||||
let botonUnirseHTML = "";
|
let botonUnirseHTML = "";
|
||||||
|
|
||||||
if (!usuarioYaEstaEnEquipo) {
|
if (!usuarioYaEstaEnEquipo) {
|
||||||
botonUnirseHTML = `
|
botonUnirseHTML = `
|
||||||
<button
|
<button type="button" class="btn btn-unirse w-100 btn-unirse-equipo mt-2"
|
||||||
type="button"
|
|
||||||
class="btn btn-unirse w-100 btn-unirse-equipo"
|
|
||||||
data-id-partida="${partida.idPartida}"
|
data-id-partida="${partida.idPartida}"
|
||||||
data-id-equipo="${equipo.idEquipo}">
|
data-id-equipo="${equipo.idEquipo}">
|
||||||
|
|
||||||
Unirse
|
Unirse
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
equiposHTML += `
|
equiposHTML += `
|
||||||
<div class="equipo">
|
<div class="equipo me-2 ms-2 p-3 border rounded">
|
||||||
|
<h6>${escapeHTML(equipo.nombreEquipo)}</h6>
|
||||||
<h6>
|
<div class="jugadores mb-2">
|
||||||
${escapeHTML(equipo.nombreEquipo)}
|
|
||||||
</h6>
|
|
||||||
|
|
||||||
<div class="jugadores">
|
|
||||||
|
|
||||||
${jugadoresHTML}
|
${jugadoresHTML}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
${botonUnirseHTML}
|
${botonUnirseHTML}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Acciones disponibles si el usuario YA ESTÁ dentro de esta sala
|
||||||
|
let accionesSalaHTML = "";
|
||||||
|
if (usuarioYaEstaEnEquipo) {
|
||||||
|
accionesSalaHTML = `
|
||||||
|
<div class="sala-acciones text-center mt-4 pt-3 border-top d-flex justify-content-center gap-3">
|
||||||
|
<button type="button" class="btn btn-outline-danger btn-abandonar-sala" data-id-partida="${partida.idPartida}">
|
||||||
|
Abandonar sala
|
||||||
|
</button>
|
||||||
|
<a href="juego.php?idPartida=${partida.idPartida}" class="btn btn-success btn-lg px-4">
|
||||||
|
🎮 ¡Iniciar Partida!
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
const salaHTML = `
|
const salaHTML = `
|
||||||
<div class="col-12 col-md-10 col-lg-8">
|
<div class="col-12 col-md-10 col-lg-8">
|
||||||
|
<div class="sala card p-3 shadow-sm mb-4">
|
||||||
<div class="sala">
|
<div class="sala-header h4 text-center mb-3">
|
||||||
|
|
||||||
<div class="sala-header">
|
|
||||||
|
|
||||||
${escapeHTML(partida.nombrePartida)}
|
${escapeHTML(partida.nombrePartida)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sala-body">
|
<div class="sala-body">
|
||||||
|
<div class="equipos d-flex justify-content-around">
|
||||||
<div class="equipos">
|
|
||||||
|
|
||||||
${equiposHTML}
|
${equiposHTML}
|
||||||
|
</div>
|
||||||
|
${accionesSalaHTML}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
`;
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
contenedor.append(salaHTML);
|
contenedor.append(salaHTML);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================================
|
// 6. Evento: Unirse a un Equipo
|
||||||
// UNIRSE A UN EQUIPO
|
|
||||||
// ======================================================
|
|
||||||
|
|
||||||
$(document).on("click", ".btn-unirse-equipo", function () {
|
$(document).on("click", ".btn-unirse-equipo", function () {
|
||||||
const boton = $(this);
|
const boton = $(this);
|
||||||
|
|
||||||
const idEquipo = boton.data("id-equipo");
|
const idEquipo = boton.data("id-equipo");
|
||||||
|
|
||||||
const idPartida = boton.data("id-partida");
|
const idPartida = boton.data("id-partida");
|
||||||
|
|
||||||
boton.prop("disabled", true);
|
boton.prop("disabled", true).text("Uniéndose...");
|
||||||
|
|
||||||
boton.text("Uniéndose...");
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "controladores/ControladorEquipoxUsuario.php",
|
url: "controladores/ControladorEquipoxUsuario.php",
|
||||||
|
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
orden: "registrarUsuarioEnEquipo",
|
orden: "registrarUsuarioEnEquipo",
|
||||||
idEquipo: idEquipo,
|
idEquipo: idEquipo,
|
||||||
},
|
},
|
||||||
|
|
||||||
success: function (respuesta) {
|
success: function (respuesta) {
|
||||||
console.log("Respuesta al unirse:", respuesta);
|
|
||||||
|
|
||||||
if (respuesta.error) {
|
if (respuesta.error) {
|
||||||
alert(respuesta.error);
|
alert(respuesta.error);
|
||||||
|
boton.prop("disabled", false).text("Unirse");
|
||||||
boton.prop("disabled", false);
|
|
||||||
|
|
||||||
boton.text("Unirse");
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================
|
|
||||||
// UNIÓN CORRECTA
|
|
||||||
// ==========================================
|
|
||||||
|
|
||||||
usuarioYaEstaEnEquipo = true;
|
usuarioYaEstaEnEquipo = true;
|
||||||
|
|
||||||
// Ocultamos el botón "Crear sala"
|
|
||||||
|
|
||||||
$("#contenedorCrearSala").hide();
|
$("#contenedorCrearSala").hide();
|
||||||
|
|
||||||
// Eliminamos las salas actuales
|
|
||||||
|
|
||||||
$("#contenedorSalas").empty();
|
$("#contenedorSalas").empty();
|
||||||
|
|
||||||
// Cargamos directamente la sala
|
|
||||||
// donde acaba de entrar el usuario
|
|
||||||
|
|
||||||
cargarSalaUsuario(idPartida);
|
cargarSalaUsuario(idPartida);
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error("Error al unirse al equipo:", error);
|
console.error("Error al unirse al equipo:", error);
|
||||||
|
|
||||||
console.error("Respuesta del servidor:", xhr.responseText);
|
|
||||||
|
|
||||||
alert("No se ha podido unir al equipo.");
|
alert("No se ha podido unir al equipo.");
|
||||||
|
boton.prop("disabled", false).text("Unirse");
|
||||||
boton.prop("disabled", false);
|
|
||||||
|
|
||||||
boton.text("Unirse");
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// ======================================================
|
// 7. Evento: Abandonar Sala
|
||||||
// ESCAPAR HTML
|
// Guardamos temporalmente el botón presionado
|
||||||
// ======================================================
|
let botonAbandonarReferencia = null;
|
||||||
|
|
||||||
function escapeHTML(texto) {
|
// A. Al hacer clic en el botón "Abandonar sala" de la tarjeta, abrimos el modal
|
||||||
return $("<div>")
|
$(document).on("click", ".btn-abandonar-sala", function () {
|
||||||
.text(texto ?? "")
|
botonAbandonarReferencia = $(this);
|
||||||
.html();
|
const modal = new bootstrap.Modal(document.getElementById('modalAbandonarSala'));
|
||||||
}
|
modal.show();
|
||||||
|
});
|
||||||
|
|
||||||
// ======================================================
|
// B. Al hacer clic en "Sí, salir" dentro del modal Kahoot
|
||||||
// CREAR SALA
|
$(document).on("click", "#btnConfirmarAbandonar", function () {
|
||||||
// ======================================================
|
const modalEl = document.getElementById('modalAbandonarSala');
|
||||||
|
const modalInstance = bootstrap.Modal.getInstance(modalEl);
|
||||||
|
|
||||||
|
const btnConfirmar = $(this);
|
||||||
|
btnConfirmar.prop("disabled", true).text("Saliendo...");
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "controladores/ControladorEquipoxUsuario.php",
|
||||||
|
type: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
data: { orden: "salirDeSala" },
|
||||||
|
success: function (respuesta) {
|
||||||
|
btnConfirmar.prop("disabled", false).text("Sí, salir");
|
||||||
|
|
||||||
|
if (modalInstance) {
|
||||||
|
modalInstance.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (respuesta.error) {
|
||||||
|
alert(respuesta.error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restablecemos la interfaz a la lista completa de salas
|
||||||
|
usuarioYaEstaEnEquipo = false;
|
||||||
|
$("#contenedorCrearSala").show();
|
||||||
|
cargarSalas();
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error al salir de la sala:", error);
|
||||||
|
alert("No se pudo salir de la sala.");
|
||||||
|
btnConfirmar.prop("disabled", false).text("Sí, salir");
|
||||||
|
if (modalInstance) {
|
||||||
|
modalInstance.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// 8. Evento: Crear Sala
|
||||||
$("#btnCrearSala").on("click", function () {
|
$("#btnCrearSala").on("click", function () {
|
||||||
const nombreSala = $("#nombreSala").val().trim();
|
const nombreSala = $("#nombreSala").val().trim();
|
||||||
|
|
||||||
const nombreEquipo1 = $("#nombreEquipo1").val().trim();
|
const nombreEquipo1 = $("#nombreEquipo1").val().trim();
|
||||||
|
|
||||||
const nombreEquipo2 = $("#nombreEquipo2").val().trim();
|
const nombreEquipo2 = $("#nombreEquipo2").val().trim();
|
||||||
|
|
||||||
let valido = true;
|
let valido = true;
|
||||||
|
|
||||||
$(".mensaje-error-sala").remove();
|
$(".mensaje-error-sala").remove();
|
||||||
|
|
||||||
$(".input-kahoot").removeClass("is-invalid");
|
$(".input-kahoot").removeClass("is-invalid");
|
||||||
|
|
||||||
if (nombreSala === "") {
|
if (nombreSala === "" || nombreSala.length < 3) {
|
||||||
mostrarError("#nombreSala", "El nombre de la sala es obligatorio.");
|
|
||||||
|
|
||||||
valido = false;
|
|
||||||
} else if (nombreSala.length < 3) {
|
|
||||||
mostrarError(
|
mostrarError(
|
||||||
"#nombreSala",
|
"#nombreSala",
|
||||||
"El nombre de la sala debe tener al menos 3 caracteres.",
|
"El nombre de la sala debe tener al menos 3 caracteres.",
|
||||||
);
|
);
|
||||||
|
|
||||||
valido = false;
|
valido = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nombreEquipo1 === "") {
|
if (nombreEquipo1 === "" || nombreEquipo1.length < 2) {
|
||||||
mostrarError("#nombreEquipo1", "El nombre del equipo 1 es obligatorio.");
|
|
||||||
|
|
||||||
valido = false;
|
|
||||||
} else if (nombreEquipo1.length < 2) {
|
|
||||||
mostrarError(
|
mostrarError(
|
||||||
"#nombreEquipo1",
|
"#nombreEquipo1",
|
||||||
"El nombre del equipo debe tener al menos 2 caracteres.",
|
"El nombre del equipo debe tener al menos 2 caracteres.",
|
||||||
);
|
);
|
||||||
|
|
||||||
valido = false;
|
valido = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nombreEquipo2 === "") {
|
if (nombreEquipo2 === "" || nombreEquipo2.length < 2) {
|
||||||
mostrarError("#nombreEquipo2", "El nombre del equipo 2 es obligatorio.");
|
|
||||||
|
|
||||||
valido = false;
|
|
||||||
} else if (nombreEquipo2.length < 2) {
|
|
||||||
mostrarError(
|
mostrarError(
|
||||||
"#nombreEquipo2",
|
"#nombreEquipo2",
|
||||||
"El nombre del equipo debe tener al menos 2 caracteres.",
|
"El nombre del equipo debe tener al menos 2 caracteres.",
|
||||||
);
|
);
|
||||||
|
|
||||||
valido = false;
|
valido = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,22 +321,16 @@ $("#btnCrearSala").on("click", function () {
|
|||||||
"#nombreEquipo2",
|
"#nombreEquipo2",
|
||||||
"Los dos equipos deben tener nombres diferentes.",
|
"Los dos equipos deben tener nombres diferentes.",
|
||||||
);
|
);
|
||||||
|
|
||||||
valido = false;
|
valido = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!valido) {
|
if (!valido) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deshabilitamos el botón mientras se crea la sala
|
|
||||||
const boton = $("#btnCrearSala");
|
const boton = $("#btnCrearSala");
|
||||||
|
boton.prop("disabled", true).text("Creando sala...");
|
||||||
boton.prop("disabled", true);
|
|
||||||
boton.text("Creando sala...");
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "controladores/controladorPartida.php", // <-- cambia esto por la ruta de tu controlador
|
url: "controladores/controladorPartida.php",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
@@ -428,16 +339,10 @@ $("#btnCrearSala").on("click", function () {
|
|||||||
nombreEquipo1: nombreEquipo1,
|
nombreEquipo1: nombreEquipo1,
|
||||||
nombreEquipo2: nombreEquipo2,
|
nombreEquipo2: nombreEquipo2,
|
||||||
},
|
},
|
||||||
|
|
||||||
success: function (respuesta) {
|
success: function (respuesta) {
|
||||||
console.log("Respuesta del servidor:", respuesta);
|
|
||||||
|
|
||||||
if (respuesta.error) {
|
if (respuesta.error) {
|
||||||
alert(respuesta.error);
|
alert(respuesta.error);
|
||||||
|
boton.prop("disabled", false).text("Crear sala");
|
||||||
boton.prop("disabled", false);
|
|
||||||
boton.text("Crear sala");
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,43 +351,30 @@ $("#btnCrearSala").on("click", function () {
|
|||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
console.error("Error al crear la sala:", error);
|
console.error("Error al crear la sala:", error);
|
||||||
console.error("Respuesta:", xhr.responseText);
|
|
||||||
|
|
||||||
alert("No se ha podido crear la sala.");
|
alert("No se ha podido crear la sala.");
|
||||||
|
boton.prop("disabled", false).text("Crear sala");
|
||||||
boton.prop("disabled", false);
|
|
||||||
boton.text("Crear sala");
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// ======================================================
|
// Auxiliares
|
||||||
// MOSTRAR ERROR
|
function escapeHTML(texto) {
|
||||||
// ======================================================
|
return $("<div>")
|
||||||
|
.text(texto ?? "")
|
||||||
|
.html();
|
||||||
|
}
|
||||||
|
|
||||||
function mostrarError(selector, mensaje) {
|
function mostrarError(selector, mensaje) {
|
||||||
const input = $(selector);
|
const input = $(selector);
|
||||||
|
|
||||||
input.addClass("is-invalid");
|
input.addClass("is-invalid");
|
||||||
|
input.after(
|
||||||
input.after(`
|
`<div class="mensaje-error-sala text-danger mt-1 small">${mensaje}</div>`,
|
||||||
<div class="mensaje-error-sala text-danger mt-1 small">
|
);
|
||||||
|
|
||||||
${mensaje}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================================================
|
$(document).on("input", ".input-kahoot", function () {
|
||||||
// QUITAR ERROR AL ESCRIBIR
|
|
||||||
// ======================================================
|
|
||||||
|
|
||||||
$(".input-kahoot").on("input", function () {
|
|
||||||
$(this).removeClass("is-invalid");
|
$(this).removeClass("is-invalid");
|
||||||
|
|
||||||
$(this).next(".mensaje-error-sala").remove();
|
$(this).next(".mensaje-error-sala").remove();
|
||||||
});
|
});
|
||||||
|
|||||||
+16
-40
@@ -1,13 +1,11 @@
|
|||||||
// Función de escape colocada arriba para evitar el ReferenceError
|
|
||||||
function escapeHTML(str) {
|
|
||||||
return $("<div>").text(str ?? "").html();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Comprobar estado de sesión al cargar la página
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
comprobarSesion();
|
comprobarSesion();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Función auxiliar para escapar texto HTML y evitar XSS
|
||||||
|
function escapeHTML(str) {
|
||||||
|
return $("<div>").text(str ?? "").html();
|
||||||
|
}
|
||||||
|
|
||||||
// Comprobar estado de sesión al cargar la página
|
// Comprobar estado de sesión al cargar la página
|
||||||
function comprobarSesion() {
|
function comprobarSesion() {
|
||||||
@@ -25,7 +23,7 @@ function comprobarSesion() {
|
|||||||
contenedor.empty();
|
contenedor.empty();
|
||||||
|
|
||||||
if (respuesta.activa && respuesta.usuario) {
|
if (respuesta.activa && respuesta.usuario) {
|
||||||
// 1. Renderizar Menú de Usuario en la Cabecera
|
// Usuario autenticado: Mostrar Menú Dropdown
|
||||||
const htmlUsuario = `
|
const htmlUsuario = `
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="btn user-dropdown-btn dropdown-toggle d-flex align-items-center gap-2"
|
<button class="btn user-dropdown-btn dropdown-toggle d-flex align-items-center gap-2"
|
||||||
@@ -50,12 +48,14 @@ function comprobarSesion() {
|
|||||||
`;
|
`;
|
||||||
contenedor.html(htmlUsuario);
|
contenedor.html(htmlUsuario);
|
||||||
|
|
||||||
// 2. Muestra el botón JUGAR y ajusta columnas
|
// Si estamos en la página principal, mostramos el botón JUGAR
|
||||||
|
if ($("#colBotonJugar").length) {
|
||||||
$("#colBotonJugar").removeClass("d-none");
|
$("#colBotonJugar").removeClass("d-none");
|
||||||
$("#colRanking").removeClass("col-lg-8").addClass("col-lg-7 col-xl-8");
|
$("#colRanking").removeClass("col-lg-8").addClass("col-lg-7 col-xl-8");
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 1. Renderizar Botones de Invitado
|
// No hay sesión: Mostrar botones de Login y Registro
|
||||||
const htmlInvitado = `
|
const htmlInvitado = `
|
||||||
<button type="button" class="btn btn-kahoot-login rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#modalLogin">
|
<button type="button" class="btn btn-kahoot-login rounded-pill px-4" data-bs-toggle="modal" data-bs-target="#modalLogin">
|
||||||
<i class="fa-solid fa-right-to-bracket me-1"></i> Iniciar Sesión
|
<i class="fa-solid fa-right-to-bracket me-1"></i> Iniciar Sesión
|
||||||
@@ -66,19 +66,22 @@ function comprobarSesion() {
|
|||||||
`;
|
`;
|
||||||
contenedor.html(htmlInvitado);
|
contenedor.html(htmlInvitado);
|
||||||
|
|
||||||
// 2. Ocultar el botón JUGAR y expandir ranking
|
// Si estamos en la página principal, ocultamos el botón JUGAR
|
||||||
|
if ($("#colBotonJugar").length) {
|
||||||
$("#colBotonJugar").addClass("d-none");
|
$("#colBotonJugar").addClass("d-none");
|
||||||
$("#colRanking").removeClass("col-lg-7 col-xl-8").addClass("col-lg-8");
|
$("#colRanking").removeClass("col-lg-7 col-xl-8").addClass("col-lg-8");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error al procesar la respuesta de la sesión:", e);
|
console.error("Error al procesar la respuesta de la sesión:", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Registro
|
// Evento Registro
|
||||||
$("#botonAceptarRegistro").click(function (event) {
|
$("#botonAceptarRegistro").click(function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
let nombreUsuario = $("#regNombre").val().trim();
|
let nombreUsuario = $("#regNombre").val().trim();
|
||||||
let email = $("#regEmail").val().trim();
|
let email = $("#regEmail").val().trim();
|
||||||
let contrasena = $("#regPassword").val();
|
let contrasena = $("#regPassword").val();
|
||||||
@@ -128,7 +131,7 @@ $("#botonAceptarRegistro").click(function (event) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Login
|
// Evento Login
|
||||||
$("#botonAceptarLogin").click(function (event) {
|
$("#botonAceptarLogin").click(function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@@ -167,7 +170,7 @@ $("#botonAceptarLogin").click(function (event) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Cerrar sesión
|
// Evento Cerrar sesión (usa delegación de eventos por crearse dinámicamente)
|
||||||
$(document).on("click", "#botonCerrarSesion", function (event) {
|
$(document).on("click", "#botonCerrarSesion", function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
@@ -256,31 +259,6 @@ $("#botonAceptarLogin").click(function (event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
method: "POST",
|
|
||||||
url: "controladores/controladorUsuario.php",
|
|
||||||
data: {
|
|
||||||
email: email,
|
|
||||||
contrasena: contrasena,
|
|
||||||
orden: "comprobarUsuario",
|
|
||||||
},
|
|
||||||
}).done(function (respuesta) {
|
|
||||||
if (typeof respuesta === "string") respuesta = JSON.parse(respuesta);
|
|
||||||
|
|
||||||
if (respuesta.error) {
|
|
||||||
$("#loginEmail").addClass("is-invalid");
|
|
||||||
$("#loginPassword").addClass("is-invalid");
|
|
||||||
$("#errorLogin").text(respuesta.error);
|
|
||||||
} else {
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Cerrar sesión (Usa delegación de eventos por si el botón se crea dinámicamente)
|
|
||||||
$(document).on("click", "#botonCerrarSesion", function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "controladores/controladorUsuario.php",
|
url: "controladores/controladorUsuario.php",
|
||||||
@@ -295,5 +273,3 @@ $(document).on("click", "#botonCerrarSesion", function (event) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+48
-205
@@ -1,3 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Redirección si el usuario no ha iniciado sesión
|
||||||
|
if (!isset($_SESSION['idUsuario'])) {
|
||||||
|
header('Location: login.php');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$nombreUsuario = htmlspecialchars($_SESSION['nombreUsuario'] ?? 'Usuario');
|
||||||
|
$avatarUsuario = htmlspecialchars($_SESSION['avatar'] ?? 'img/avatars/defaultProfile.jpeg');
|
||||||
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="es">
|
<html lang="es">
|
||||||
|
|
||||||
@@ -9,151 +23,99 @@
|
|||||||
<title>Perfil</title>
|
<title>Perfil</title>
|
||||||
|
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
<link
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
||||||
rel="stylesheet">
|
|
||||||
|
|
||||||
<!-- Bootstrap Icons -->
|
<!-- Bootstrap Icons -->
|
||||||
<link
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||||
rel="stylesheet"
|
|
||||||
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
||||||
|
|
||||||
<!-- Google Font: Fredoka -->
|
<!-- Google Font: Fredoka -->
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap"
|
|
||||||
rel="stylesheet">
|
|
||||||
|
|
||||||
<!-- Tu CSS -->
|
<!-- Tu CSS -->
|
||||||
<link rel="stylesheet" href="css/index.css">
|
<link rel="stylesheet" href="css/index.css">
|
||||||
<link rel="stylesheet" href="css/perfil.css">
|
<link rel="stylesheet" href="css/perfil.css">
|
||||||
<script src="js/jquery-4.0.0.min.js"></script>
|
<script src="js/jquery-4.0.0.min.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<?php
|
<?php include_once 'cabecera.php'; ?>
|
||||||
include_once 'cabecera.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="perfil-container">
|
<div class="perfil-container">
|
||||||
|
|
||||||
<div class="perfil-card">
|
<div class="perfil-card">
|
||||||
|
|
||||||
<!-- ========================= -->
|
|
||||||
<!-- CABECERA -->
|
<!-- CABECERA -->
|
||||||
<!-- ========================= -->
|
|
||||||
|
|
||||||
<div class="perfil-header">
|
<div class="perfil-header">
|
||||||
<i class="bi bi-person-circle"></i>
|
<i class="bi bi-person-circle"></i>
|
||||||
Mi perfil
|
Mi perfil
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="perfil-content">
|
<div class="perfil-content">
|
||||||
|
|
||||||
<div class="row align-items-center g-5">
|
<div class="row align-items-center g-5">
|
||||||
|
|
||||||
|
|
||||||
<!-- ========================= -->
|
|
||||||
<!-- PERFIL -->
|
<!-- PERFIL -->
|
||||||
<!-- ========================= -->
|
|
||||||
|
|
||||||
<div class="col-md-6 text-center">
|
<div class="col-md-6 text-center">
|
||||||
|
|
||||||
<!-- Nombre -->
|
<!-- Nombre -->
|
||||||
|
|
||||||
<h1 id="nombre" class="nombre">
|
<h1 id="nombre" class="nombre">
|
||||||
<?php echo $_SESSION['nombreUsuario'] ?>
|
<?= $nombreUsuario ?>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
|
||||||
<!-- ========================= -->
|
|
||||||
<!-- FOTO DE PERFIL -->
|
<!-- FOTO DE PERFIL -->
|
||||||
<!-- ========================= -->
|
|
||||||
|
|
||||||
<div class="foto-container">
|
<div class="foto-container">
|
||||||
|
|
||||||
<img
|
<img id="fotoPerfil"
|
||||||
id="fotoPerfil"
|
src="<?= $avatarUsuario ?>"
|
||||||
src="<?= htmlspecialchars($_SESSION['avatar'] ?? '') ?>"
|
|
||||||
alt="Foto de perfil"
|
alt="Foto de perfil"
|
||||||
class="avatar rounded-circle">
|
class="avatar rounded-circle">
|
||||||
|
|
||||||
|
|
||||||
<!-- Botón lápiz -->
|
<!-- Botón lápiz -->
|
||||||
|
<button type="button"
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn-foto"
|
class="btn-foto"
|
||||||
onclick="seleccionarFoto()"
|
onclick="seleccionarFoto()"
|
||||||
title="Cambiar foto de perfil"
|
title="Cambiar foto de perfil"
|
||||||
aria-label="Cambiar foto de perfil">
|
aria-label="Cambiar foto de perfil">
|
||||||
|
|
||||||
<i class="bi bi-pencil-fill"></i>
|
<i class="bi bi-pencil-fill"></i>
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
<!-- Input oculto -->
|
<!-- Input oculto -->
|
||||||
|
<input type="file"
|
||||||
<input
|
|
||||||
type="file"
|
|
||||||
id="inputFoto"
|
id="inputFoto"
|
||||||
accept="image/*"
|
accept="image/*"
|
||||||
hidden>
|
hidden>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- ========================= -->
|
|
||||||
<!-- CAMBIAR NOMBRE -->
|
<!-- CAMBIAR NOMBRE -->
|
||||||
<!-- ========================= -->
|
|
||||||
|
|
||||||
<div class="formulario-nombre">
|
<div class="formulario-nombre">
|
||||||
|
|
||||||
<label
|
<label for="nuevoNombre" class="form-label">
|
||||||
for="nuevoNombre"
|
|
||||||
class="form-label">
|
|
||||||
|
|
||||||
Cambia tu nombre
|
Cambia tu nombre
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="nuevoNombre"
|
id="nuevoNombre"
|
||||||
class="form-control mb-3"
|
class="form-control mb-3"
|
||||||
placeholder="Escribe tu nuevo nombre">
|
placeholder="Escribe tu nuevo nombre">
|
||||||
|
|
||||||
|
|
||||||
<div class="d-flex justify-content-center gap-2">
|
<div class="d-flex justify-content-center gap-2">
|
||||||
|
|
||||||
<button
|
<button type="button"
|
||||||
type="button"
|
|
||||||
class="btn-perfil-cambiar"
|
class="btn-perfil-cambiar"
|
||||||
onclick="cambiarNombre()">
|
onclick="cambiarNombre()">
|
||||||
|
|
||||||
<i class="bi bi-check-lg"></i>
|
<i class="bi bi-check-lg"></i>
|
||||||
Cambiar nombre
|
Cambiar nombre
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button type="button"
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn-perfil-borrar"
|
class="btn-perfil-borrar"
|
||||||
onclick="borrarNombre()">
|
onclick="borrarNombre()">
|
||||||
|
|
||||||
<i class="bi bi-x-lg"></i>
|
<i class="bi bi-x-lg"></i>
|
||||||
Borrar
|
Borrar
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -162,11 +124,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- ========================= -->
|
|
||||||
<!-- ESTADÍSTICAS -->
|
<!-- ESTADÍSTICAS -->
|
||||||
<!-- ========================= -->
|
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|
||||||
<div class="estadisticas">
|
<div class="estadisticas">
|
||||||
@@ -176,60 +134,33 @@
|
|||||||
Estadísticas
|
Estadísticas
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<div class="estadistica estadistica-victorias">
|
<div class="estadistica estadistica-victorias">
|
||||||
|
|
||||||
<i class="bi bi-trophy-fill"></i>
|
<i class="bi bi-trophy-fill"></i>
|
||||||
Victorias:
|
Victorias:
|
||||||
|
<strong id="victorias">0</strong>
|
||||||
<strong id="victorias">
|
|
||||||
|
|
||||||
</strong>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="estadistica estadistica-derrotas">
|
<div class="estadistica estadistica-derrotas">
|
||||||
|
|
||||||
<i class="bi bi-x-circle-fill"></i>
|
<i class="bi bi-x-circle-fill"></i>
|
||||||
Derrotas:
|
Derrotas:
|
||||||
|
<strong id="derrotas">0</strong>
|
||||||
<strong id="derrotas">
|
|
||||||
|
|
||||||
</strong>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="estadistica estadistica-aciertos">
|
<div class="estadistica estadistica-aciertos">
|
||||||
|
|
||||||
<i class="bi bi-bullseye"></i>
|
<i class="bi bi-bullseye"></i>
|
||||||
Aciertos:
|
Aciertos:
|
||||||
|
<strong id="aciertos">0</strong>
|
||||||
<strong id="aciertos">
|
|
||||||
|
|
||||||
</strong>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- ========================= -->
|
|
||||||
<!-- CREAR PREGUNTA -->
|
<!-- CREAR PREGUNTA -->
|
||||||
<!-- ========================= -->
|
|
||||||
|
|
||||||
<div class="text-center mt-4">
|
<div class="text-center mt-4">
|
||||||
|
<button type="button"
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-play-kahoot"
|
class="btn btn-play-kahoot"
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
data-bs-target="#modalCrearPregunta">
|
data-bs-target="#modalCrearPregunta">
|
||||||
|
|
||||||
<i class="bi bi-plus-circle-fill"></i>
|
<i class="bi bi-plus-circle-fill"></i>
|
||||||
Crear pregunta
|
Crear pregunta
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -245,12 +176,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- ================================================= -->
|
|
||||||
<!-- MODAL CREAR PREGUNTA -->
|
<!-- MODAL CREAR PREGUNTA -->
|
||||||
<!-- ================================================= -->
|
<div class="modal fade"
|
||||||
|
|
||||||
<div
|
|
||||||
class="modal fade"
|
|
||||||
id="modalCrearPregunta"
|
id="modalCrearPregunta"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
aria-labelledby="modalCrearPreguntaLabel"
|
aria-labelledby="modalCrearPreguntaLabel"
|
||||||
@@ -260,186 +187,107 @@
|
|||||||
|
|
||||||
<div class="modal-content modal-kahoot">
|
<div class="modal-content modal-kahoot">
|
||||||
|
|
||||||
|
|
||||||
<!-- CABECERA DEL MODAL -->
|
|
||||||
|
|
||||||
<div class="modal-header modal-kahoot-header">
|
<div class="modal-header modal-kahoot-header">
|
||||||
|
<h5 class="modal-title" id="modalCrearPreguntaLabel">
|
||||||
<h5
|
|
||||||
class="modal-title"
|
|
||||||
id="modalCrearPreguntaLabel">
|
|
||||||
|
|
||||||
<i class="bi bi-question-circle-fill me-2"></i>
|
<i class="bi bi-question-circle-fill me-2"></i>
|
||||||
Crear pregunta
|
Crear pregunta
|
||||||
|
|
||||||
</h5>
|
</h5>
|
||||||
|
<button type="button"
|
||||||
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn-close btn-close-white"
|
class="btn-close btn-close-white"
|
||||||
data-bs-dismiss="modal"
|
data-bs-dismiss="modal"
|
||||||
aria-label="Cerrar">
|
aria-label="Cerrar">
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- CUERPO DEL MODAL -->
|
|
||||||
|
|
||||||
<div class="modal-body p-4">
|
<div class="modal-body p-4">
|
||||||
|
|
||||||
<form id="formCrearPregunta">
|
<form id="formCrearPregunta">
|
||||||
|
|
||||||
|
|
||||||
<!-- PREGUNTA -->
|
<!-- PREGUNTA -->
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
|
<label for="pregunta" class="form-label fw-semibold">
|
||||||
<label
|
|
||||||
for="pregunta"
|
|
||||||
class="form-label fw-semibold">
|
|
||||||
|
|
||||||
<i class="bi bi-question-lg me-1"></i>
|
<i class="bi bi-question-lg me-1"></i>
|
||||||
Pregunta
|
Pregunta
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
<textarea id="pregunta"
|
||||||
<textarea
|
|
||||||
id="pregunta"
|
|
||||||
name="pregunta"
|
name="pregunta"
|
||||||
class="form-control input-kahoot"
|
class="form-control input-kahoot"
|
||||||
rows="3"
|
rows="3"
|
||||||
placeholder="Escribe aquí la pregunta..."
|
placeholder="Escribe aquí la pregunta..."
|
||||||
required></textarea>
|
required></textarea>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- CATEGORÍA -->
|
<!-- CATEGORÍA -->
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
|
<label for="idCategoria" class="form-label fw-semibold">
|
||||||
<label
|
|
||||||
for="idCategoria"
|
|
||||||
class="form-label fw-semibold">
|
|
||||||
|
|
||||||
<i class="bi bi-folder-fill me-1"></i>
|
<i class="bi bi-folder-fill me-1"></i>
|
||||||
Categoría
|
Categoría
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
<select id="idCategoria"
|
||||||
<select
|
|
||||||
id="idCategoria"
|
|
||||||
name="idCategoria"
|
name="idCategoria"
|
||||||
class="form-select input-kahoot"
|
class="form-select input-kahoot"
|
||||||
required>
|
required>
|
||||||
|
<option value="">Selecciona una categoría</option>
|
||||||
<option value="">
|
|
||||||
Selecciona una categoría
|
|
||||||
</option>
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- RESPUESTA CORRECTA -->
|
<!-- RESPUESTA CORRECTA -->
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
<label for="respuestaCorrecta" class="form-label fw-semibold text-success">
|
||||||
<label
|
|
||||||
for="respuestaCorrecta"
|
|
||||||
class="form-label fw-semibold text-success">
|
|
||||||
|
|
||||||
<i class="bi bi-check-circle-fill me-1"></i>
|
<i class="bi bi-check-circle-fill me-1"></i>
|
||||||
Respuesta correcta
|
Respuesta correcta
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
<input type="text"
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="respuestaCorrecta"
|
id="respuestaCorrecta"
|
||||||
name="respuestaCorrecta"
|
name="respuestaCorrecta"
|
||||||
class="form-control input-kahoot"
|
class="form-control input-kahoot"
|
||||||
placeholder="Escribe la respuesta correcta..."
|
placeholder="Escribe la respuesta correcta..."
|
||||||
required>
|
required>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- RESPUESTAS INCORRECTAS -->
|
<!-- RESPUESTAS INCORRECTAS -->
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
<label class="form-label fw-semibold text-danger">
|
||||||
<label
|
|
||||||
class="form-label fw-semibold text-danger">
|
|
||||||
|
|
||||||
<i class="bi bi-x-circle-fill me-1"></i>
|
<i class="bi bi-x-circle-fill me-1"></i>
|
||||||
Respuestas incorrectas
|
Respuestas incorrectas
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="respuestaIncorrecta1"
|
id="respuestaIncorrecta1"
|
||||||
name="respuestaIncorrecta1"
|
name="respuestaIncorrecta1"
|
||||||
class="form-control input-kahoot mb-2"
|
class="form-control input-kahoot mb-2"
|
||||||
placeholder="Respuesta incorrecta 1"
|
placeholder="Respuesta incorrecta 1"
|
||||||
required>
|
required>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="respuestaIncorrecta2"
|
id="respuestaIncorrecta2"
|
||||||
name="respuestaIncorrecta2"
|
name="respuestaIncorrecta2"
|
||||||
class="form-control input-kahoot mb-2"
|
class="form-control input-kahoot mb-2"
|
||||||
placeholder="Respuesta incorrecta 2"
|
placeholder="Respuesta incorrecta 2"
|
||||||
required>
|
required>
|
||||||
|
|
||||||
|
<input type="text"
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="respuestaIncorrecta3"
|
id="respuestaIncorrecta3"
|
||||||
name="respuestaIncorrecta3"
|
name="respuestaIncorrecta3"
|
||||||
class="form-control input-kahoot"
|
class="form-control input-kahoot"
|
||||||
placeholder="Respuesta incorrecta 3"
|
placeholder="Respuesta incorrecta 3"
|
||||||
required>
|
required>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- PIE DEL MODAL -->
|
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class="btn btn-secondary"
|
|
||||||
data-bs-dismiss="modal">
|
|
||||||
|
|
||||||
<i class="bi bi-x-lg me-1"></i>
|
<i class="bi bi-x-lg me-1"></i>
|
||||||
Cancelar
|
Cancelar
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button type="submit" form="formCrearPregunta" class="btn btn-kahoot-login" id="btnCrearPregunta">
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
form="formCrearPregunta"
|
|
||||||
class="btn btn-kahoot-login"
|
|
||||||
id="btnCrearPregunta">
|
|
||||||
|
|
||||||
<i class="bi bi-check-lg me-1"></i>
|
<i class="bi bi-check-lg me-1"></i>
|
||||||
Crear pregunta
|
Crear pregunta
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -449,14 +297,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Bootstrap JS -->
|
<!-- Bootstrap JS -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<script
|
|
||||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js">
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Tu JavaScript -->
|
<!-- Tu JavaScript -->
|
||||||
|
|
||||||
<script src="js/perfil.js"></script>
|
<script src="js/perfil.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user