Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.73 KB | None | 0 0
  1.  
  2. <?php
  3. require_once 'functions.php';
  4. $sql = getSQL();
  5. ?>
  6. <!DOCTYPE html>
  7. <html lang="en">
  8. <head>
  9. <meta charset="UTF-8">
  10. <title>BadgerStaffPanel v1.0 ALPHA</title>
  11. <link rel="stylesheet" href="css/webReset.css" />
  12. <link rel="stylesheet" href="css/style.css" />
  13. <script
  14. src="https://code.jquery.com/jquery-3.4.1.min.js"
  15. integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
  16. crossorigin="anonymous"></script>
  17. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  18. <script rel="script" src="js/myJavaScript.js"></script>
  19.  
  20. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  21. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  22.  
  23. </head>
  24. <body>
  25. <!--
  26. SQL Tables:
  27. Notes:
  28. steamIdStaff, steamIdPlayer, note, uid
  29. Warns:
  30. steamIdStaff, steamIdPlayer, reason, uid
  31. Kicks:
  32. steamIdStaff, steamIdPlayer, reason, uid
  33. Tempbans:
  34. steamIdStaff, steamIdPlayer, reason, endDate, uid
  35. Bans:
  36. steamIdStaff, steamIdPlayer, reason, uid
  37.  
  38. Users:
  39. steamID, lastPlayerName
  40. -->
  41. <!-- Players with Searchbar: -->
  42. <div class="panel panel-default float-right w-100">
  43. <div class="panel-body">
  44. <input type="search" class="form-control text-right" id="searchPlayers" placeholder="Search Users" onkeyup="autoComplete($(this))" autocomplete='on'>
  45. </div>
  46. </div>
  47. <div id="players-div">
  48. <img style="display: inline;" src="logo.png" alt="logo" height="50" width="50"/>
  49. <datalist id="searchPlayersData"></datalist>
  50. <table id="players">
  51. <tr class="skip">
  52. <th scope="col" class="text-left align-bottom"></th>
  53. <th scope="col" class="text-left align-bottom">PlayerName</th>
  54. <th scope="col" class="text-left align-bottom">SteamID</th>
  55. <th scope="col" class="text-left align-bottom">Notes</th>
  56. <th scope="col" class="text-left align-bottom">Warns</th>
  57. <th scope="col" class="text-left align-bottom">Kicks</th>
  58. <th scope="col" class="text-left align-bottom">Tempbans</th>
  59. <th scope="col" class="text-left align-bottom">Bans</th>
  60. </tr>
  61. <!-- Use AJAX below: -->
  62. <?php
  63. /**/
  64. // STEAM KEY: [REDACTED]
  65. require_once 'functions.php';
  66. $page = $_GET['page'];
  67. $limitByStart = 10 * $page;
  68. $limitEnd = $limitByStart + 10;
  69. $query = $sql->query('SELECT * FROM `Users` LIMIT 0, 10;');
  70. $alt = 0;
  71. while ($row = $query->fetch_assoc()) {
  72. if ($alt === 0) {
  73. echo '<tr onclick="">';
  74. $alt = 1;
  75. } else {
  76. $alt = 0;
  77. echo '<tr class="alt" onclick="">';
  78. }
  79. $regSteamID = $row['steamID'];
  80. $steamI = str_replace("steam:", "", $row['steamID']);
  81. $steamID = bchexdec($steamI);
  82. $avatar = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=[REDACTED]&steamids=' . $steamID);
  83. $avatarLink = json_decode($avatar)->response->players[0]->avatarmedium;
  84. $lastName = $row['lastPlayerName'];
  85. $profilePic = '<img src="' . $avatarLink . '" height="" width="" />';
  86. echo '<td class="img" scope="row" class="text-left align-top">' . $profilePic . '</td>';
  87. echo '<td class="text-left align-top">' . $lastName . "</td>";
  88. echo '<td class="text-left align-top">' . $steamID . '</td>';
  89. /**/
  90. $tables = ['`Notes`', '`Warns`', '`Kicks`', '`Tempbans`', '`Bans`'];
  91. for ($i = 0; $i < sizeof($tables); $i++) {
  92. $queryy = 'SELECT * FROM ' . $tables[$i] . ' WHERE steamIdPlayer = "' . $regSteamID . '";';
  93. $countSt = $sql->query($queryy);
  94. $data = $countSt->num_rows;
  95. echo '<td>' . strval($data) . '</td>';
  96. }
  97. echo '<td><button class="note" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Note</button></td>';
  98. echo '<td><button class="warn" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Warn</button></td>';
  99. echo '<td><button class="kick" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Kick</button></td>';
  100. echo '<td><button class="tempban" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Tempban</button></td>';
  101. echo '<td><button class="ban" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Ban</button></td>';
  102. echo '</tr>';
  103. /**/
  104. }
  105. /**/
  106. ?>
  107. </table>
  108. <?php
  109. if($page === null || $page === 0) {
  110. $page = 1;
  111. }
  112. $response = '<button id="load-btn" page="1" onclick="$(this).prop(\'disabled\', true); $.get(\'getUsers.php\', {page: $(\'#load-btn\').attr(\'page\')}, function(data) {
  113. $(\'#players tbody\').append(data);
  114. $(\'#load-btn\').attr(\'page\', parseInt($(\'#load-btn\').attr(\'page\')) + 1).prop(\'disabled\', false);
  115. })">Load more users</button>';
  116. echo $response;
  117. ?>
  118. </div>
  119. </body>
  120. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement