funcionalidad de perfil (estadisticas y nombre)

This commit is contained in:
2026-09-25 10:30:54 +02:00
parent f729a54bc2
commit 859f86aeb1
4 changed files with 58 additions and 8 deletions
+34 -7
View File
@@ -28,6 +28,7 @@
<!-- Tu CSS -->
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/perfil.css">
<script src="js/jquery-4.0.0.min.js"></script>
</head>
@@ -67,7 +68,7 @@
<!-- Nombre -->
<h1 id="nombre" class="nombre">
tuNombre
<?php echo $_SESSION['nombreUsuario'] ?>
</h1>
@@ -180,8 +181,8 @@
<i class="bi bi-trophy-fill"></i>
&nbsp; Victorias:
<strong>
0
<strong id="victorias">
</strong>
</div>
@@ -192,8 +193,8 @@
<i class="bi bi-x-circle-fill"></i>
&nbsp; Derrotas:
<strong>
0
<strong id="derrotas">
</strong>
</div>
@@ -204,8 +205,8 @@
<i class="bi bi-bullseye"></i>
&nbsp; Aciertos:
<strong>
0
<strong id="aciertos">
</strong>
</div>
@@ -417,6 +418,32 @@
</div>
<script>
$(document).ready(function() {
$.ajax({
method: "POST",
url: "controladores/controladorUsuario.php",
data: {
'orden': 'mostrarEstadisticas'
}
}).done(function(respuesta) {
console.log(respuesta);
respuesta = JSON.parse(respuesta);
if (respuesta.error) {
console.log(respuesta.error);
} else {
$('#victorias').text(respuesta.victorias);
$('#derrotas').text(respuesta.derrotas);
$('#aciertos').text(respuesta.aciertos);
}
});
});
</script>
<!-- Bootstrap JS -->