funcionalidad de perfil (estadisticas y nombre)
This commit is contained in:
+34
-7
@@ -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>
|
||||
Victorias:
|
||||
|
||||
<strong>
|
||||
0
|
||||
<strong id="victorias">
|
||||
|
||||
</strong>
|
||||
|
||||
</div>
|
||||
@@ -192,8 +193,8 @@
|
||||
<i class="bi bi-x-circle-fill"></i>
|
||||
Derrotas:
|
||||
|
||||
<strong>
|
||||
0
|
||||
<strong id="derrotas">
|
||||
|
||||
</strong>
|
||||
|
||||
</div>
|
||||
@@ -204,8 +205,8 @@
|
||||
<i class="bi bi-bullseye"></i>
|
||||
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 -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user