Subir archivos a "/"
This commit is contained in:
+8
-8
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/conexionBD.php';
|
require_once __DIR__ . '/includes/conexionBD.php';
|
||||||
|
|
||||||
$idPartida = intval($_GET['idPartida'] ?? 0);
|
$idPartida = intval($_GET['idPartida'] ?? 0);
|
||||||
if ($idPartida <= 0) {
|
if ($idPartida <= 0) {
|
||||||
@@ -29,7 +29,7 @@ $primerosEnAcertar = $_SESSION['primeros_en_acertar'][$idPartida] ?? [];
|
|||||||
$jugadoresFinales = [];
|
$jugadoresFinales = [];
|
||||||
$equiposFinales = [];
|
$equiposFinales = [];
|
||||||
|
|
||||||
// Respuestas de velocidad (+2 o +1)
|
// Respuestas de velocidad (+2 o +1) procesadas en la capa de la vista
|
||||||
foreach ($listaJugadoresRaw as $jugador) {
|
foreach ($listaJugadoresRaw as $jugador) {
|
||||||
$idU = (int)$jugador['idUsuario'];
|
$idU = (int)$jugador['idUsuario'];
|
||||||
$idE = (int)$jugador['idEquipo'];
|
$idE = (int)$jugador['idEquipo'];
|
||||||
@@ -52,7 +52,6 @@ foreach ($listaJugadoresRaw as $jugador) {
|
|||||||
$aciertos++;
|
$aciertos++;
|
||||||
$idPxp = $resp['idPartidaxPregunta'];
|
$idPxp = $resp['idPartidaxPregunta'];
|
||||||
|
|
||||||
// Si el ID de usuario coincide con el primero guardado de esa pregunta se lleva 2 puntos
|
|
||||||
if (isset($primerosEnAcertar[$idPxp]) && $primerosEnAcertar[$idPxp] === $idU) {
|
if (isset($primerosEnAcertar[$idPxp]) && $primerosEnAcertar[$idPxp] === $idU) {
|
||||||
$puntosTotalesJugador += 2;
|
$puntosTotalesJugador += 2;
|
||||||
} else {
|
} else {
|
||||||
@@ -77,7 +76,6 @@ foreach ($listaJugadoresRaw as $jugador) {
|
|||||||
$equiposFinales[$idE]['puntos'] += $puntosTotalesJugador;
|
$equiposFinales[$idE]['puntos'] += $puntosTotalesJugador;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ordenar según la puntuación final de mayor a menor
|
|
||||||
usort($jugadoresFinales, function($a, $b) { return $b['puntos'] <=> $a['puntos']; });
|
usort($jugadoresFinales, function($a, $b) { return $b['puntos'] <=> $a['puntos']; });
|
||||||
usort($equiposFinales, function($a, $b) { return $b['puntos'] <=> $a['puntos']; });
|
usort($equiposFinales, function($a, $b) { return $b['puntos'] <=> $a['puntos']; });
|
||||||
?>
|
?>
|
||||||
@@ -89,7 +87,7 @@ usort($equiposFinales, function($a, $b) { return $b['puntos'] <=> $a['puntos'];
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Resultados - Trivial</title>
|
<title>Resultados - Trivial</title>
|
||||||
<link rel="stylesheet" href="css/resultados.css">
|
<link rel="stylesheet" href="css/resultados.css">
|
||||||
<script src="https://jquery.com"></script>
|
<script src="js/jquery-4.0.0.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body data-id-partida="<?php echo $idPartida; ?>">
|
<body data-id-partida="<?php echo $idPartida; ?>">
|
||||||
|
|
||||||
@@ -146,9 +144,11 @@ usort($equiposFinales, function($a, $b) { return $b['puntos'] <=> $a['puntos'];
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="contenedor-boton">
|
|
||||||
<a href="/triviagmatico/buscadorSala.php" class="btn-inicio">Volver al Inicio 🏠</a>
|
<div class="contenedor-boton">
|
||||||
</div>
|
<a href="/triviagmatico/" id="btnVolverInicio" data-id="<?php echo $idPartida; ?>" class="btn-inicio">Volver al Inicio 🏠</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="js/resultados.js"></script>
|
<script src="js/resultados.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user