5 Commits

Author SHA1 Message Date
v.rodriguezcamacho a2c068cdc0 carpetaas subias 2026-10-02 13:29:47 +02:00
v.rodriguezcamacho ead0555d00 carpetas subias 2026-10-02 13:29:30 +02:00
dbvictor2002 139b97737e Eliminar PartidaModelo.php 2026-10-02 13:07:42 +02:00
dbvictor2002 9a01939bf2 Eliminar vistaResultados.php 2026-10-02 13:07:32 +02:00
jorge d0b45e8a88 Merge pull request 'Resultados definitivos' (#40) from resultados_definitivos into main
Reviewed-on: #40
2026-10-02 12:41:56 +02:00
4 changed files with 1 additions and 109 deletions
-37
View File
@@ -1,37 +0,0 @@
<?php
// modelos/PartidaModelo.php
class PartidaModelo {
private $conexion;
public function __construct($conexion) {
$this->conexion = $conexion;
}
// Obtiene los jugadores mapeados en la partida actual
public function obtenerJugadoresPartida($idPartida) {
$stmt = $this->conexion->prepare("
SELECT u.idUsuario, u.nombreUsuario, e.idEquipo, e.nombreEquipo
FROM equipoxpartida exp
INNER JOIN equipoxusuario exu ON exp.idEquipo = exu.idEquipo
INNER JOIN usuario u ON exu.idUsuario = u.idUsuario
INNER JOIN equipo e ON exu.idEquipo = e.idEquipo
WHERE exp.idPartida = :idPartida
");
$stmt->execute([':idPartida' => $idPartida]);
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
// Obtiene las respuestas guardadas por un usuario específico
public function obtenerRespuestasUsuario($idPartida, $idUsuario) {
$stmtRespuestas = $this->conexion->prepare("
SELECT ra.idPartidaxPregunta, r.correcta
FROM respuestaalmacenada ra
INNER JOIN respuesta r ON ra.idRespuesta = r.idRespuesta
INNER JOIN partidaxpregunta pxp ON ra.idPartidaxPregunta = pxp.idPartidaxPregunta
WHERE pxp.idPartida = :idPartida AND ra.idUsuario = :idUsuario
");
$stmtRespuestas->execute([':idPartida' => $idPartida, ':idUsuario' => $idUsuario]);
return $stmtRespuestas->fetchAll(PDO::FETCH_ASSOC);
}
}
View File
+1
View File
@@ -0,0 +1 @@
aa
-72
View File
@@ -1,72 +0,0 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Resultados - Trivial</title>
<link rel="stylesheet" href="css/resultados.css">
<script src="js/jquery-4.0.0.min.js"></script>
</head>
<body data-id-partida="<?php echo $idPartida; ?>">
<div id="pantalla-espera" class="contenedor">
<h2>⌛ Esperando a que todos los jugadores terminen...</h2>
<p>Calculando estadísticas de velocidad y actualizando perfiles históricos en el servidor.</p>
<div class="loader"></div>
</div>
<div id="pantalla-resultados" class="contenedor" style="display:none;">
<h1>🏆 Resultados de la Partida 🏆</h1>
<h2>Clasificación por Equipos</h2>
<table class="tabla-ranking">
<thead>
<tr>
<th>Posición</th>
<th>Equipo</th>
<th>Puntos Totales</th>
</tr>
</thead>
<tbody>
<?php foreach ($equiposFinales as $index => $eq): ?>
<tr class="<?php echo $index === 0 ? 'top-team' : ''; ?>">
<td>#<?php echo $index + 1; ?></td>
<td><?php echo htmlspecialchars($eq['nombre']); ?></td>
<td><strong><?php echo $eq['puntos']; ?> pts</strong></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<h2>Rendimiento Individual</h2>
<table class="tabla-ranking">
<thead>
<tr>
<th>Posición</th>
<th>Jugador</th>
<th>Equipo</th>
<th>Aciertos</th>
<th>Puntos Logrados</th>
</tr>
</thead>
<tbody>
<?php foreach ($jugadoresFinales as $index => $jug): ?>
<tr class="<?php echo $index === 0 ? 'top-player' : ''; ?>">
<td>#<?php echo $index + 1; ?></td>
<td><?php echo htmlspecialchars($jug['nombre']); ?></td>
<td><?php echo htmlspecialchars($jug['equipo']); ?></td>
<td><?php echo $jug['aciertos']; ?> / 10</td>
<td><strong><?php echo $jug['puntos']; ?> pts</strong></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="contenedor-boton">
<a href="/triviagmatico/" id="btnVolverInicio" data-id="<?php echo $idPartida; ?>" class="btn-inicio">Volver al Inicio 🏠</a>
</div>
</div>
<script src="js/resultados.js"></script>
</body>
</html>