Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'functions.php';
- $sql = getSQL();
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>BadgerStaffPanel v1.0 ALPHA</title>
- <link rel="stylesheet" href="css/webReset.css" />
- <link rel="stylesheet" href="css/style.css" />
- <script
- src="https://code.jquery.com/jquery-3.4.1.min.js"
- integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
- crossorigin="anonymous"></script>
- <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
- <script rel="script" src="js/myJavaScript.js"></script>
- <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">
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
- </head>
- <body>
- <!--
- SQL Tables:
- Notes:
- steamIdStaff, steamIdPlayer, note, uid
- Warns:
- steamIdStaff, steamIdPlayer, reason, uid
- Kicks:
- steamIdStaff, steamIdPlayer, reason, uid
- Tempbans:
- steamIdStaff, steamIdPlayer, reason, endDate, uid
- Bans:
- steamIdStaff, steamIdPlayer, reason, uid
- Users:
- steamID, lastPlayerName
- -->
- <!-- Players with Searchbar: -->
- <div class="panel panel-default float-right w-100">
- <div class="panel-body">
- <input type="search" class="form-control text-right" id="searchPlayers" placeholder="Search Users" onkeyup="autoComplete($(this))" autocomplete='on'>
- </div>
- </div>
- <div id="players-div">
- <img style="display: inline;" src="logo.png" alt="logo" height="50" width="50"/>
- <datalist id="searchPlayersData"></datalist>
- <table id="players">
- <tr class="skip">
- <th scope="col" class="text-left align-bottom"></th>
- <th scope="col" class="text-left align-bottom">PlayerName</th>
- <th scope="col" class="text-left align-bottom">SteamID</th>
- <th scope="col" class="text-left align-bottom">Notes</th>
- <th scope="col" class="text-left align-bottom">Warns</th>
- <th scope="col" class="text-left align-bottom">Kicks</th>
- <th scope="col" class="text-left align-bottom">Tempbans</th>
- <th scope="col" class="text-left align-bottom">Bans</th>
- </tr>
- <!-- Use AJAX below: -->
- <?php
- /**/
- // STEAM KEY: [REDACTED]
- require_once 'functions.php';
- $page = $_GET['page'];
- $limitByStart = 10 * $page;
- $limitEnd = $limitByStart + 10;
- $query = $sql->query('SELECT * FROM `Users` LIMIT 0, 10;');
- $alt = 0;
- while ($row = $query->fetch_assoc()) {
- if ($alt === 0) {
- echo '<tr onclick="">';
- $alt = 1;
- } else {
- $alt = 0;
- echo '<tr class="alt" onclick="">';
- }
- $regSteamID = $row['steamID'];
- $steamI = str_replace("steam:", "", $row['steamID']);
- $steamID = bchexdec($steamI);
- $avatar = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=[REDACTED]&steamids=' . $steamID);
- $avatarLink = json_decode($avatar)->response->players[0]->avatarmedium;
- $lastName = $row['lastPlayerName'];
- $profilePic = '<img src="' . $avatarLink . '" height="" width="" />';
- echo '<td class="img" scope="row" class="text-left align-top">' . $profilePic . '</td>';
- echo '<td class="text-left align-top">' . $lastName . "</td>";
- echo '<td class="text-left align-top">' . $steamID . '</td>';
- /**/
- $tables = ['`Notes`', '`Warns`', '`Kicks`', '`Tempbans`', '`Bans`'];
- for ($i = 0; $i < sizeof($tables); $i++) {
- $queryy = 'SELECT * FROM ' . $tables[$i] . ' WHERE steamIdPlayer = "' . $regSteamID . '";';
- $countSt = $sql->query($queryy);
- $data = $countSt->num_rows;
- echo '<td>' . strval($data) . '</td>';
- }
- echo '<td><button class="note" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Note</button></td>';
- echo '<td><button class="warn" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Warn</button></td>';
- echo '<td><button class="kick" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Kick</button></td>';
- echo '<td><button class="tempban" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Tempban</button></td>';
- echo '<td><button class="ban" class="btn btn-primary btn-sm" value=' . $regSteamID . '>Ban</button></td>';
- echo '</tr>';
- /**/
- }
- /**/
- ?>
- </table>
- <?php
- if($page === null || $page === 0) {
- $page = 1;
- }
- $response = '<button id="load-btn" page="1" onclick="$(this).prop(\'disabled\', true); $.get(\'getUsers.php\', {page: $(\'#load-btn\').attr(\'page\')}, function(data) {
- $(\'#players tbody\').append(data);
- $(\'#load-btn\').attr(\'page\', parseInt($(\'#load-btn\').attr(\'page\')) + 1).prop(\'disabled\', false);
- })">Load more users</button>';
- echo $response;
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement