Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <META HTTP-EQUIV="REFRESH" CONTENT="20">
- <title>CrayoNetwork » SG Leaderboards</title>
- <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
- <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
- <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
- </head>
- <body>
- <?php
- $username = "user";
- $password = "pass";
- $host = "host";
- $connector = mysql_connect($host,$username,$password)
- or die("Unable to connect");
- echo "";
- $selected = mysql_select_db("db", $connector)
- or die("Unable to connect");
- //execute the SQL query and return records
- $result = mysql_query("SELECT * FROM Stats ");
- $result = mysql_query("SELECT * FROM Stats ORDER BY KILLS DESC");
- ?>
- <input type="submit" class="btn btn-info" onclick="alert('Website still in development.')" value="Click me for information.">
- <table class="table table-striped table-hover ">
- <thead>
- <tr>
- <th>Ranking</th>
- <th>Player</th>
- <th>UUID</th>
- <th>Points</th>
- <th>Wins</th>
- <th>Kills</th>
- <th>Deaths</th>
- <th>Crystals</th>
- </tr>
- </thead>
- <tbody>
- <?php
- function username($uuid) {
- $username = file_get_contents("https://us.mc-api.net/v3/name/$uuid/json");
- $data = json_decode($username, true);
- print_r($data);
- return $data['name'];
- $numbers=array(1,2,3,4,5,6,7,8,9,10);
- sort($numbers);
- $arrlength=count($numbers);
- for($x=0;$x<$arrlength;$x++)
- while( $row = mysql_fetch_assoc( $result ) ){
- $uuid = $row['UUID'];
- $kills = $row['KILLS'];
- $deaths = $row['DEATHS'];
- $wins = $row['WINS'];
- $points = $row['POINTS'];
- $crystals = $row['CRYSTALS'];
- echo
- "<tr>
- <td>$numbers</td>
- <td>
- <img src='http://cravatar.eu/head/$uuid/64.png'/>
- " . username($uuid) . "</td>
- <td>$uuid</td>
- <td>$points</td>
- <td>$wins</td>
- <td>$kills</td>
- <td>$deaths</td>
- <td>$crystals</td>
- </tr>\n";
- ?>
- </tbody>
- </table>
- <?php mysql_close($connector); ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement