Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- //http://semantic-ui.com/collections/table.html
- // Configuration
- $hostname = 'projectpactscripting.com';
- $username = 'ProjectPact';
- $password = 'password';
- $database = 'AIO_Hunter';
- function formatTime($time){
- $time_seconds = $time / 1000;
- $time_minutes = $time_seconds / 60;
- $time_hours = $time_minutes / 60;
- $time_days = floor($time_hours / 24);
- $seconds = $time_seconds % 60;
- $minutes = $time_minutes % 60;
- $hours = $time_hours % 24;
- $days = floor($time_days % 365);
- $years = floor($time_days / 365);
- return $years . "y " . $days . "d " .$hours . "h " . $minutes . "m ";
- }
- try {
- $dbh = new PDO('mysql:host='. $hostname .';dbname='. $database, $username, $password);
- } catch(PDOException $e) {
- echo '<h1>An error has occurred.</h1><pre>', $e->getMessage() ,'</pre>';
- }
- $sth = $dbh->query('SELECT * FROM Data ORDER BY timeran DESC');
- $sth->setFetchMode(PDO::FETCH_ASSOC);
- $result = $sth->fetchAll();
- ?>
- <html>
- <head>
- <title>Highscores</title>
- <link rel="stylesheet" type="text/css" href="http://projectpactscripting.com/src/semanticui/semantic.min.css">
- <script src="http://code.jquery.com/jquery-latest.min.js"></script>
- <script src="http://projectpactscripting.com/src/scripts/stupidtable.min.js"></script>
- <script src="http://projectpactscripting.com/src/semanticui/semantic.min.js"></script>
- </head>
- <body>
- <br>
- <div style="text-align:center;"><img src="http://i.imgur.com/e9RmCeC.png"></div>
- <br>
- <p style="text-align: center;"><span style="font-size:24px;"><a href="http://www.projectpactscripting.com/AIO_Hunter.php">Home</a></span></p>
- <br>
- <br>
- <div class="ui container">
- <table class="ui fluid selectable celled sortable green table" id="table">
- <thead>
- <tr>
- <th data-sort="int" id="rank">
- Rank
- <i class="caret down icon" id="rankUp"></i>
- <i class="caret up icon" id="rankDown"></i>
- </th>
- <th data-sort="int" id="user">
- Username
- <i class="caret down icon" id="userUp"></i>
- <i class="caret up icon" id="userDown"></i>
- </th>
- <th data-sort="int" id="time">
- Time Ran
- <i class="caret down icon" id="timeUp"></i>
- <i class="caret up icon" id="timeDown"></i>
- </th>
- <th data-sort="int" id="xp">
- Exp Gained
- <i class="caret down icon" id="xpUp"></i>
- <i class="caret up icon" id="xpDown"></i>
- </th>
- <th data-sort="int" id="npc">
- NPCs Caught
- <i class="caret down icon" id="npcUp"></i>
- <i class="caret up icon" id="npcDown"></i>
- </th>
- <th data-sort="int" id="profit">
- Profit
- <i class="caret down icon" id="profitUp"></i>
- <i class="caret up icon" id="profitDown"></i>
- </th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(count($result) > 0) {
- $rank = 1;
- foreach($result as $r) {
- echo '<tr>';
- echo '<td data-sort-value"'.$rank.'">'.$rank.'</td>';
- echo '<td data-sort-value"'.$r['Username'].'">'.$r['Username'].'</td>';
- echo '<td data-sort-value"'.$r['timeran'].'">'.formatTime($r['timeran']).'</td>';
- echo '<td data-sort-value"'.$r['expgained'].'">'.number_format($r['expgained']).'</td>';
- echo '<td data-sort-value"'.$r['NPC_Caught'].'">'.number_format($r['NPC_Caught']).'</td>';
- echo '<td data-sort-value"'.$r['profit'].'">'.number_format($r['profit']).'</td>';
- echo '</tr>';
- $rank++;
- }
- }
- ?>
- </tbody>
- <tfoot class="full-width">
- <tr>
- <th></th>
- <th colspan="6">
- </th>
- </tr>
- </tfoot>
- </table>
- </body>
- <br>
- <div id="footer">
- <p style="text-align: center;"><span style="color:#000000;">Made by: ProjectPact | Copyright ©. All Rights Reserved.</span></p>
- <br>
- </div>
- <script>
- $('#table').stupidtable();
- $('#rank,#user,#time,#xp,#npc,#profit').click(function(event) {
- console.log(event);
- if($('#'+event.target.id+'Down').is(':visible')) {
- $('#'+event.target.id+'Down').hide();
- $('#'+event.target.id+'Up').show();
- } else {
- $('.caret').hide();
- $('#'+event.target.id+'Down').show();
- }
- });
- $('#rank').click();
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement