Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <div class="col-lg-6">
  2. <h3>
  3. Structures
  4. </h3>
  5. <?php
  6. $pf = "";
  7. if(!isset($_GET['period']) { $pf = "playerranksdb10x"; } else { $pf = mysql_real_escape_string($_GET['period']; }
  8. $sql = "SELECT `UserID`,`Name`,`StructuresBuilt`,`StructuresUpgraded` FROM $pf
  9. ORDER BY 3 desc limit 100";
  10.  
  11. $result = $conn->query($sql);
  12.  
  13. if ($result->num_rows > 0) {
  14. // output data of each row
  15. echo " <div class='table-responsive'>";
  16. echo "";
  17. echo "";
  18. echo "<table id='StructuresBuilt' class='display compact table table-hover table-striped results '>";
  19. echo "<thead>";
  20. echo "<tr>";
  21. echo "<th>#</th>";
  22. echo "<th>Name</th>";
  23. echo "<th>Built</th>";
  24. echo "<th>Upgraded</th>";
  25. echo "</tr>";
  26. echo "</thead>";
  27. echo "<tbody>";
  28.  
  29. $counter = 1;
  30.  
  31. while($row = $result->fetch_assoc()) {
  32.  
  33. $counter2 = $counter++;
  34.  
  35. echo "<tr>";
  36. echo "<th scope='row'>$counter2</th>";
  37. echo "<td><a href='http://steamcommunity.com/profiles/" . $row['UserID']. "' target='_blank'>" . $row['Name']. "</td>";
  38. echo "<td>" . $row['StructuresBuilt']. "</td>";
  39. echo "<td>" . $row['StructuresUpgraded']. "</td>";
  40. echo "</tr>";
  41.  
  42. }
  43. echo "</tbody>";
  44. echo "</table>";
  45. echo "</div>";
  46. }
  47.  
  48. ?>
  49. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement