Advertisement
Guest User

Untitled

a guest
Nov 14th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.24 KB | None | 0 0
  1. <?php
  2. $db_link = serverConnect();
  3.  
  4. $max = 'LIMIT ' . ($pageNum - 1) * $_SESSION['items'] . ',' . $_SESSION['items'];
  5.  
  6. if (isset($search)) {
  7. $sql = "SELECT `uid` FROM `players` WHERE `uid` LIKE '" . $search . "' OR `name` LIKE '%" . $search . "%' OR `playerid` LIKE '" . $search . "';";
  8. $result_of_query = $db_link->query($sql);
  9. $total_records = mysqli_num_rows($result_of_query);
  10. if ($pageNum > $total_records) $pageNum = $total_records;
  11. $sql = "SELECT `pid`,`name`,`bankacc`,`cash`,`coplevel`,`mediclevel`,`adminlevel`,`uid` FROM `players` WHERE `uid` LIKE '" . $search . "' OR `name` LIKE '%" . $search . "%' OR `playerid` LIKE '" . $search . "'" . $max . " ;";
  12. logAction($_SESSION['user_name'], $lang['searched'] . ' (' . $search . ') ' . $lang['in'] . ' ' . $lang['players'], 1);
  13. } else {
  14. $sql = "SELECT `uid` FROM `players`;";
  15. $result_of_query = $db_link->query($sql);
  16. $total_records = mysqli_num_rows($result_of_query);
  17. if ($pageNum > $total_records) $pageNum = $total_records;
  18. $sql = "SELECT `pid`,`name`,`bankacc`,`cash`,`coplevel`,`mediclevel`,`adminlevel`,`uid` FROM `players` " . $max . " ;";
  19. }
  20.  
  21. $result_of_query = $db_link->query($sql);
  22. if ($result_of_query->num_rows > 0) {
  23. while ($row = mysqli_fetch_assoc($result_of_query)) {
  24. $pids[] = $row['pid'];
  25. }
  26. $pids = implode(',', $pids);
  27. if ($settings['steamAPI'] && $_SESSION['permissions']['view']['steam'] && !$settings['performance'] && $settings['vacTest']) {
  28. $api = "http://api.steampowered.com/ISteamUser/GetPlayerBans/v1/?key=" . $settings['steamAPI'] . "&steamids=" . $pids;
  29. $bans = get_object_vars(json_decode(file_get_contents($api)));
  30. $bans = $bans['players'];
  31. $steamPlayers = count($bans);
  32. } else {
  33. $steamPlayers = 0;
  34. }
  35.  
  36. $result_of_query = $db_link->query($sql);
  37. ?>
  38. <h1 class="page-header">
  39. <?php echo $lang['players']; ?>
  40. <small><?php echo $lang['overview']; ?></small>
  41. </h1>
  42. <div class="content-panel">
  43. <table class="table table-striped table-advance table-hover">
  44. <h4>
  45. <i class="fa fa-user"></i>
  46. <?php echo $lang['players'];
  47. include("views/templates/search.php"); ?>
  48. </h4>
  49. <hr class="hidden-xs">
  50. <thead>
  51. <tr>
  52. <th><i class="fa fa-user"></i> <?php echo $lang['name']; ?></th>
  53. <th><i class="fa fa-eye"></i> <?php echo $lang['playerID']; ?></th>
  54. <th class="hidden-xs"><i class="fa fa-money"></i> <?php echo $lang['cash']; ?></th>
  55. <th class="hidden-xs"><i class="fa fa-bank"></i> <?php echo $lang['bank']; ?></th>
  56. <th class="hidden-xs"><i class="fa fa-taxi"></i> <?php echo $lang['cop']; ?></th>
  57. <th class="hidden-xs"><i class="fa fa-ambulance"></i> <?php echo $lang['medic']; ?></th>
  58. <th class="hidden-xs"><i class="fa fa-cogs"></i> <?php echo $lang['admin']; ?></th>
  59. <?php if ($_SESSION['permissions']['edit']['player']) {
  60. echo '<th class="hidden-xs"><i class="fa fa-pencil"></i> ' . $lang['edit'] . '</th>';
  61. } else {
  62. echo '<th class="hidden-xs"><i class="fa fa-eye"></i>' . $lang['view'] . '</th>';
  63. }
  64. if ($_SESSION['permissions']['view']['steam'] && $steamPlayers > 0) {
  65. echo '<th class="hidden-xs"><i class="fa fa-fw fa-steam"></i> Steam</th>';
  66. } ?>
  67. </tr>
  68. </thead>
  69. <tbody>
  70. <?php
  71. while ($row = mysqli_fetch_assoc($result_of_query)) {
  72. $playersID = $row["pid"];
  73. echo "<tr>";
  74. echo "<td>" . $row["name"] . "</td>";
  75. echo "<td>" . $playersID . "</td>";
  76. echo "<td class='hidden-xs'>" . $row["cash"] . "</td>";
  77. echo "<td class='hidden-xs'>" . $row["bankacc"] . "</td>";
  78. echo "<td class='hidden-xs'>" . $row["coplevel"] . "</td>";
  79. echo "<td class='hidden-xs'>" . $row["mediclevel"] . "</td>";
  80. echo "<td class='hidden-xs'>" . $row["adminlevel"] . "</td>";
  81. if ($_SESSION['permissions']['edit']['player']) {
  82. echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editPlayer/" . $row["uid"] . "'>";
  83. echo "<i class='fa fa-pencil'></i></a></td>";
  84. } else {
  85. echo "<td><a class='btn btn-primary btn-xs' href='" . $settings['url'] . "editPlayer/" . $row["uid"] . "'>";
  86. echo "<i class='fa fa-eye'></i></a></td>";
  87. }
  88. if ($_SESSION['permissions']['view']['steam'] && $steamPlayers > 0) {
  89. echo "<td><a href='http://steamcommunity.com/profiles/" . $row["playerid"] . "' ";
  90. for ($player = 0; $player <= $steamPlayers; $player++) {
  91. if ($bans[$player]->SteamId == $row['playerid']) {
  92. if ($bans[$player]->VACBanned == true) {
  93. echo "<td><a href='http://steamcommunity.com/profiles/" . $row["playerid"] . "' ";
  94. echo "class='btn btn-danger btn-xs hidden-xs' target='_blank'><i class='fa fa-steam'></i></a>";
  95.  
  96. } else {
  97. echo "<td><a href='http://steamcommunity.com/profiles/" . $row["playerid"] . "' ";
  98. echo "class='btn btn-primary btn-xs hidden-xs' target='_blank'><i class='fa fa-steam'></i></a>"; }
  99. }
  100. }
  101. echo '</td>';
  102. }
  103. echo "</tr>";
  104. }
  105. echo "</tbody></table>";
  106. include("views/templates/page.php");
  107. ?>
  108. </div>
  109. <?php
  110. } else echo '<h3>' . errorMessage(36, $lang) . '</h3>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement