Dayz-Leaderboard-Web-Developer/stats.php

69 lines
2.9 KiB
PHP
Raw Normal View History

2019-09-04 21:20:19 +02:00
<?php
$connect = mysqli_connect("localhost", "User", "", "NombreDB");
$query ="SELECT * FROM NombreTabla ORDER BY id DESC";
$result = mysqli_query($connect, $query);
?>
<!DOCTYPE html>
<html>
<head>
<title>Base de datos Survivors RP</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />
2019-09-04 21:22:06 +02:00
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2019-09-04 21:20:19 +02:00
</head>
<body>
<br /><br />
<div class="container">
<h3 align="center">Base de datos Survivors RP</h3>
<br />
<div class="table-responsive">
<table id="employee_data" class="table table-striped table-bordered">
<thead>
<tr>
2019-09-04 21:22:06 +02:00
<td>Nombre</td>
2019-09-04 21:20:19 +02:00
<td>Z Matados</td>
<td>Animales Matados</td>
<td>Distancia Recorrida</td>
<td>Suicidios</td>
2019-09-04 21:22:06 +02:00
<td>Muertes Por Z</td>
<td>Muertes Nat.</td>
<td>Max T Sobrev.</td>
2019-09-04 21:20:19 +02:00
</tr>
</thead>
<?php
while($row = mysqli_fetch_array($result))
{
echo '
<tr>
2019-09-04 21:22:06 +02:00
<td>'.$row["name"].'</td>
2019-09-04 21:20:19 +02:00
<td>'.$row["zKilled"].'</td>
<td>'.$row["animalsKilled"].'</td>
<td>'.$row["distTrav"].'</td>
<td>'.$row["suicideCount"].'</td>
2019-09-04 21:22:06 +02:00
<td>'.$row["deathsToZCount"].'</td>
<td>'.$row["deathsToNaturalCauseCount"].'</td>
<td>'.$row["timeSurvived"].'</td>
2019-09-04 21:20:19 +02:00
</tr>
';
}
?>
</table>
</div>
</div>
</body>
</html>
<script>
$(document).ready(function() {
$('#employee_data').DataTable( {
"order": [[ 1, "desc" ]]
} );
} );
//$(document).ready(function(){
// $('#employee_data').DataTable();
//});
2019-09-04 21:22:06 +02:00
</script>