PageRenderTime 99ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/echelon/b3kicks.php

https://github.com/xlr8or/echelon
PHP | 251 lines | 246 code | 4 blank | 1 comment | 25 complexity | 223beed2936c02450ff1a2da9a1bfb11 MD5 | raw file
  1. <?php
  2. include "ctracker.php";
  3. error_reporting( E_ERROR ^ E_WARNING );
  4. // Next line sets the echelon userlevel for this page. 1=superadmins - 2=admins - 3=moderators
  5. $requiredlevel = 3;
  6. require_once('Connections/b3connect.php');
  7. require_once('Connections/functions.php');
  8. require_once('login/inc_authorize.php');
  9. $currentPage = $_SERVER["PHP_SELF"];
  10. $maxRows_rs_activebans = 25;
  11. $pageNum_rs_activebans = 0;
  12. if (isset($_GET['pageNum_rs_activebans'])) {
  13. $pageNum_rs_activebans = $_GET['pageNum_rs_activebans'];
  14. }
  15. $startRow_rs_activebans = $pageNum_rs_activebans * $maxRows_rs_activebans;
  16. $xlorderby_rs_activebans = "id";
  17. if (isset($_GET['orderby'])) {
  18. $xlorderby_rs_activebans = (get_magic_quotes_gpc()) ? $_GET['orderby'] : addslashes($_GET['orderby']);
  19. }
  20. $xlorder_rs_activebans = "DESC";
  21. if (isset($_GET['order'])) {
  22. $xlorder_rs_activebans = (get_magic_quotes_gpc()) ? $_GET['order'] : addslashes($_GET['order']);
  23. }
  24. mysql_select_db($database_b3connect, $b3connect);
  25. $query_rs_activebans = sprintf("SELECT penalties.id, penalties.type, penalties.time_add, penalties.time_expire, penalties.keyword, penalties.reason, penalties.inactive, penalties.duration, penalties.admin_id, target.id as target_id, target.name as target_name FROM penalties, clients as target WHERE penalties.type != 'Warning' AND inactive = 0 AND penalties.client_id = target.id AND penalties.admin_id = 0 ORDER BY %s %s", $xlorderby_rs_activebans,$xlorder_rs_activebans);
  26. $query_limit_rs_activebans = sprintf("%s LIMIT %d, %d", $query_rs_activebans, $startRow_rs_activebans, $maxRows_rs_activebans);
  27. $rs_activebans = mysql_query($query_limit_rs_activebans, $b3connect) or die(mysql_error());
  28. $row_rs_activebans = mysql_fetch_assoc($rs_activebans);
  29. if (isset($_GET['totalRows_rs_activebans'])) {
  30. $totalRows_rs_activebans = $_GET['totalRows_rs_activebans'];
  31. } else {
  32. $all_rs_activebans = mysql_query($query_rs_activebans);
  33. $totalRows_rs_activebans = mysql_num_rows($all_rs_activebans);
  34. }
  35. $totalPages_rs_activebans = ceil($totalRows_rs_activebans/$maxRows_rs_activebans)-1;
  36. $queryString_rs_activebans = "";
  37. if (!empty($_SERVER['QUERY_STRING'])) {
  38. $params = explode("&", $_SERVER['QUERY_STRING']);
  39. $newParams = array();
  40. foreach ($params as $param) {
  41. if (stristr($param, "pageNum_rs_activebans") == false &&
  42. stristr($param, "totalRows_rs_activebans") == false) {
  43. array_push($newParams, $param);
  44. }
  45. }
  46. if (count($newParams) != 0) {
  47. $queryString_rs_activebans = "&" . implode("&", $newParams);
  48. }
  49. }
  50. $queryString_rs_activebans = sprintf("&totalRows_rs_activebans=%d%s", $totalRows_rs_activebans, $queryString_rs_activebans);
  51. ?>
  52. <html>
  53. <head>
  54. <title>
  55. Echelon - B3 Repository Tool (by xlr8or)
  56. </title>
  57. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  58. <style type="text/css">
  59. <!--
  60. @import url("css/default.css");
  61. -->
  62. </style>
  63. </head>
  64. <body>
  65. <div id="wrapper">
  66. <?php require_once('login/inc_loggedin.php'); ?>
  67. <?php include('Connections/inc_codnav.php'); ?>
  68. <table width="100%" class="tabeluitleg" cellspacing="0" cellpadding="0">
  69. <tr>
  70. <td align="center">
  71. <strong>B3 auto kicks/bans</strong>
  72. <br>
  73. You are viewing the kicks/tempbans generated by B3. Thesecontain all teamkill-kicks and kicks based on warningcount.
  74. <br>
  75. If a moderator or
  76. admin issues
  77. several warnings the kicking/tempbanningwill be handled by B3 and thus be visible inhere.
  78. </td>
  79. </tr>
  80. </table>
  81. <table width="100%" border="0" cellpadding="1" cellspacing="1">
  82. <tr>
  83. <td class="tabelkop">
  84. client&nbsp;
  85. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=target_name&order=ASC">
  86. <img src="img/asc.gif" alt="ascending" width="11" height="9" border="0" align="absmiddle"></a>
  87. &nbsp;
  88. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=target_name&order=DESC">
  89. <img src="img/desc.gif" alt="descending" width="11" height="9" border="0" align="absmiddle"></a>
  90. </td>
  91. <td class="tabelkop">
  92. type&nbsp;
  93. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=type&order=ASC">
  94. <img src="img/asc.gif" alt="ascending" width="11" height="9" border="0" align="absmiddle"></a>
  95. &nbsp;
  96. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=type&order=DESC">
  97. <img src="img/desc.gif" alt="descending" width="11" height="9" border="0" align="absmiddle"></a>
  98. </td>
  99. <td class="tabelkop">
  100. duration&nbsp;
  101. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=duration&order=ASC">
  102. <img src="img/asc.gif" alt="ascending" width="11" height="9" border="0" align="absmiddle"></a>
  103. &nbsp;
  104. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=duration&order=DESC">
  105. <img src="img/desc.gif" alt="descending" width="11" height="9" border="0" align="absmiddle"></a>
  106. </td>
  107. <td class="tabelkop">
  108. added&nbsp;
  109. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=time_add&order=ASC">
  110. <img src="img/asc.gif" alt="ascending" width="11" height="9" border="0" align="absmiddle"></a>
  111. &nbsp;
  112. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=time_add&order=DESC">
  113. <img src="img/desc.gif" alt="descending" width="11" height="9" border="0" align="absmiddle"></a>
  114. </td>
  115. <td class="tabelkop">
  116. expires&nbsp;
  117. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=time_expire&order=ASC">
  118. <img src="img/asc.gif" alt="ascending" width="11" height="9" border="0" align="absmiddle"></a>
  119. &nbsp;
  120. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=time_expire&order=DESC">
  121. <img src="img/desc.gif" alt="descending" width="11" height="9" border="0" align="absmiddle"></a>
  122. </td>
  123. <td class="tabelkop">
  124. keyword&nbsp;
  125. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=keyword&order=ASC">
  126. <img src="img/asc.gif" alt="ascending" width="11" height="9" border="0" align="absmiddle"></a>
  127. &nbsp;
  128. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=keyword&order=DESC">
  129. <img src="img/desc.gif" alt="descending" width="11" height="9" border="0" align="absmiddle"></a>
  130. </td>
  131. <td class="tabelkop">
  132. reason&nbsp;
  133. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=reason&order=ASC">
  134. <img src="img/asc.gif" alt="ascending" width="11" height="9" border="0" align="absmiddle"></a>
  135. &nbsp;
  136. <a href="<?php echo $navThisPage; ?>?game=<?php echo $game; ?>&orderby=reason&order=DESC">
  137. <img src="img/desc.gif" alt="descending" width="11" height="9" border="0" align="absmiddle"></a>
  138. </td>
  139. </tr>
  140. <?php do { ?>
  141. <tr class="tabelinhoud">
  142. <td title="penalty id : <?=$row_rs_activebans['id']?>">
  143. <a href="clientdetails.php?game=<?php echo $game; ?>&id=<?php echo $row_rs_activebans['target_id']; ?>">
  144. <?php echo htmlspecialchars($row_rs_activebans['target_name']); ?></a>
  145. </td>
  146. <td>
  147. <?php echo $row_rs_activebans['type']; ?>
  148. </td>
  149. <td>
  150. <?php if ($row_rs_activebans['duration']!=0) echo humanReadableDuration($row_rs_activebans['duration']*60) ; ?>
  151. </td>
  152. <td>
  153. <?php echo date('l, d/m/Y (H:i)',$row_rs_activebans['time_add']); ?>
  154. </td>
  155. <td>
  156. <?php
  157. if ($row_rs_activebans['type'] == 'Notice'){
  158. echo "<span class=\"inactive\">Notice added by Admin</span>";
  159. } elseif ($row_rs_activebans['type'] == 'Ban') {
  160. echo "<span class=\"permanent\">permanent</span>";
  161. } elseif ($row_rs_activebans['type'] == 'TempBan') {
  162. if ($row_rs_activebans['time_expire'] <= time()) {
  163. echo "<span class=\"expired\">".date('l, d/m/Y (H:i)',$row_rs_activebans['time_expire'])."</span>";
  164. } else {
  165. echo "<span class=\"active\">".date('l, d/m/Y (H:i)',$row_rs_activebans['time_expire'])."</span>";
  166. }
  167. }
  168. ?>
  169. </td>
  170. <td>
  171. <?php echo $row_rs_activebans['keyword']; ?>
  172. </td>
  173. <td>
  174. <?php echo preg_replace('/\\^([0-9])/ie', '', $row_rs_activebans['reason']); ?>
  175. </td>
  176. </tr>
  177. <?php } while ($row_rs_activebans = mysql_fetch_assoc($rs_activebans)); ?>
  178. <tr class="tabelonderschrift">
  179. <td>
  180. click client to see details
  181. </td>
  182. <td>
  183. &nbsp;
  184. </td>
  185. <td>
  186. &nbsp;
  187. </td>
  188. <td>
  189. &nbsp;
  190. </td>
  191. <td>
  192. <span class="expired">
  193. [expired ban]
  194. </span>
  195. <span class="active">
  196. [active ban]
  197. </span>
  198. <span class="permanent">
  199. [permban]
  200. </span>
  201. </td>
  202. <td>
  203. &nbsp;
  204. </td>
  205. </tr>
  206. </table>
  207. <table border="0" width="100%" cellspacing="0" cellpadding="0" align="center" class="recordnavigatie">
  208. <tr class="tabelkop">
  209. <td width="100%" colspan="4" align="center">
  210. Records:&nbsp;
  211. <?php echo ($startRow_rs_activebans + 1) ?>
  212. &nbsp;to&nbsp;
  213. <?php echo min($startRow_rs_activebans + $maxRows_rs_activebans, $totalRows_rs_activebans) ?>
  214. &nbsp;from&nbsp;
  215. <?php echo $totalRows_rs_activebans ?>
  216. </td>
  217. </tr>
  218. <tr>
  219. <td align="center" width="25%">
  220. <?php if ($pageNum_rs_activebans > 0) { // Show if not first page ?>
  221. <a href="<?php printf("%25s?pageNum_rs_activebans=%25d%25s", $currentPage, 0, $queryString_rs_activebans); ?>">First</a>
  222. <?php } // Show if not first page ?>
  223. </td>
  224. <td align="center" width="25%">
  225. <?php if ($pageNum_rs_activebans > 0) { // Show if not first page ?>
  226. <a href="<?php printf("%25s?pageNum_rs_activebans=%25d%25s", $currentPage, max(0, $pageNum_rs_activebans - 1), $queryString_rs_activebans); ?>">Previous</a>
  227. <?php } // Show if not first page ?>
  228. </td>
  229. <td align="center" width="25%">
  230. <?php if ($pageNum_rs_activebans < $totalPages_rs_activebans) { // Show if not last page ?>
  231. <a href="<?php printf("%25s?pageNum_rs_activebans=%25d%25s", $currentPage, min($totalPages_rs_activebans, $pageNum_rs_activebans + 1), $queryString_rs_activebans); ?>">Next</a>
  232. <?php } // Show if not last page ?>
  233. </td>
  234. <td align="center" width="25%">
  235. <?php if ($pageNum_rs_activebans < $totalPages_rs_activebans) { // Show if not last page ?>
  236. <a href="<?php printf("%25s?pageNum_rs_activebans=%25d%25s", $currentPage, $totalPages_rs_activebans, $queryString_rs_activebans); ?>">Last</a>
  237. <?php } // Show if not last page ?>
  238. </td>
  239. </tr>
  240. </table>
  241. <?php include "footer.php"; ?>
  242. </div>
  243. </body>
  244. </html>
  245. <?php
  246. mysql_free_result($rs_activebans);
  247. ?>