Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getTime($tiempo)
- {
- $dias = 0; $horas = 0; $minutos = 0; $segundos = 0;
- while ($tiempo>86400)
- {
- $tiempo -= 86400;
- $dias ++;
- }
- while ($tiempo>3600)
- {
- $tiempo -= 3600;
- $horas ++;
- }
- while ($tiempo>60)
- {
- $tiempo -= 60;
- $minutos++;
- }
- $resultado = $dias." dias, ".$horas." horas, ".$minutos." minutos y ".$tiempo." segundos.";
- return $resultado;
- }
- mysqli_connect("127.0.0.1","root","","unturned") or DIE ("No se pudo establecer conexion con el servidor.");
- $query = mysqli_query("Select * from ranks order by points Desc limit 10");
- $colores = array("0" => "#DDDDDD", "1" => "#008800");
- $contador = 0;
- echo "<FONT FACE='courier'>";
- echo "<table border='1'>";
- echo "<tr><td>Name</td><td>Points</td><td>Balance</td><td>Total Play Time</td></tr>";
- while ($a=mysqli_fetch_array($query))
- {
- // Player info
- $playerInfo = mysqli_fetch_array(mysqli_query("Select * from playerinfo where SteamID=".$a['steamId']));
- // Uconomy
- $uconomy = mysqli_fetch_array(mysqli_query("Select * from uconomy where SteamID=".$a['steamId']));
- echo "<tr><td bgcolor=".$colores[($contador%2)].">".$a['lastDisplayName']."</td><td>".$a['points']."</td><td>".$uconomy['balance']."€</td><td>".getTime($playerInfo['TotalPlayTime'])."</td></tr>";
- $contador++;
- }
- echo "</table>";
- echo "</font>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement