Advertisement
Guest User

bans

a guest
Sep 11th, 2013
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.84 KB | None | 0 0
  1. <style>
  2. body {
  3.     margin: 0;
  4.     background:#ddd;
  5. }
  6. h2 {
  7.     margin:5px;
  8. }
  9. table {
  10.     border-collapse:collapse;
  11.     background:#333;
  12.     color:#BBB;
  13. }
  14. th {
  15.     border-left:1px solid #000;
  16.     border-right:1px solid #000;
  17.     border-bottom:1px solid #000;
  18.     color:#fe5;
  19. }
  20. #border {
  21.     border-left:1px solid #000;
  22.     border-right:1px solid #000;
  23.     border-bottom:1px solid #000;
  24. }
  25. #border td {
  26.     border-left:1px solid #000;
  27.     border-right:1px solid #000;   
  28. }
  29. </style>
  30. <?php
  31. $host = 'localhost';
  32. $user = 'root';
  33. $pass = '';
  34. $rdb = 'auth';
  35.  
  36. $connect = mysql_connect($host,$user,$pass) or die('Нет подключения к базе данных');
  37. mysql_select_db ($rdb, $connect) or die(mysql_error());
  38. $ban_account = mysql_query("SET NAMES cp1251");
  39. $ban_account = mysql_query("SELECT * FROM `account_banned` WHERE `active` = 1 ORDER BY `bandate` DESC LIMIT 100", $connect) or die(mysql_error());
  40. print "<h2 align=\"center\">Забаненные аккаунты</h2>
  41. <table cellpadding=\"1\" cellspacing=\"1\" align=\"center\" width=\"800\"><tr>
  42. <th width=\"30\">№</th>
  43. <th width=\"100\">Аккаунт</th>
  44. <th width=\"100\">Бан установлен</th>
  45. <th width=\"100\">Забанил</th>
  46. <th>Причина</th>
  47. <th width=\"100\">Бан закончится</th>
  48. </tr></table>";
  49. $id = 1;
  50. while ($result_account = mysql_fetch_array($ban_account)){
  51.     $accout_id = $result_account['id'];
  52.     $username_sql = mysql_query("SELECT * FROM `account` WHERE `id` = $accout_id LIMIT 1", $connect) or die(mysql_error());
  53.     $result_username = mysql_fetch_array($username_sql);
  54.     $account = $result_username['username'];
  55.     $bandate = date("H:i:s d.m.Y", $result_account['bandate']);
  56.     $bannedby = $result_account['bannedby'];
  57.     $banreason = $result_account['banreason'];
  58.    
  59.     if ($result_account['bandate'] == $result_account['unbandate'])
  60.         $unbandate = 'Навсегда';
  61.     else
  62.         $unbandate = date("H:i:s d.m.Y", $result_account['unbandate']);
  63.        
  64.     if ($result_account['bannedby'] == '')
  65.         $bannedby = 'Консоль';
  66.        
  67.     print "<table cellpadding=\"1\" cellspacing=\"1\" align=\"center\" width=\"800\" id=\"border\"><tr>
  68.     <td width=\"30\" align=\"center\">$id</td>
  69.     <td width=\"100\" align=\"center\">$account</td>
  70.     <td width=\"100\" align=\"center\">$bandate</td>
  71.     <td width=\"100\" align=\"center\">$bannedby</td>
  72.     <td align=\"center\">$banreason</td>
  73.     <td width=\"100\" align=\"center\">$unbandate</td>
  74.     </tr></table>";
  75. $id++;
  76. }
  77. $ban_ip = mysql_query("SET NAMES cp1251");
  78. $ban_ip = mysql_query("SELECT * FROM `ip_banned` ORDER BY `bandate` DESC LIMIT 100", $connect) or die(mysql_error());
  79. print "<h2 align=\"center\">Забаненные адреса</h2>
  80. <table cellpadding=\"1\" cellspacing=\"1\" align=\"center\" width=\"800\"><tr>
  81. <th width=\"30\">№</th>
  82. <th width=\"100\">Адрес</th>
  83. <th width=\"100\">Бан установлен</th>
  84. <th width=\"100\">Забанил</th>
  85. <th>Причина</th>
  86. <th width=\"100\">Бан закончится</th>
  87. </tr></table>";
  88. $id = 1;
  89. while ($result_ip = mysql_fetch_array($ban_ip)){
  90.     $ip = $result_ip['ip'];
  91.     $bandate = date("H:i:s d.m.Y", $result_ip['bandate']);
  92.     $bannedby = $result_ip['bannedby'];
  93.     $banreason = $result_ip['banreason'];
  94.    
  95.     if ($result_ip['bandate'] == $result_ip['unbandate'])
  96.         $unbandate = 'Навсегда';
  97.     else
  98.         $unbandate = date("H:i:s d.m.Y", $result_ip['unbandate']);
  99.        
  100.     if ($result_ip['bannedby'] == '')
  101.         $bannedby = 'Консоль';
  102.        
  103.     print "<table cellpadding=\"1\" cellspacing=\"1\" align=\"center\" width=\"800\" id=\"border\"><tr>
  104.     <td width=\"30\" align=\"center\">$id</td>
  105.     <td width=\"100\" align=\"center\">$ip</td>
  106.     <td width=\"100\" align=\"center\">$bandate</td>
  107.     <td width=\"100\" align=\"center\">$bannedby</td>
  108.     <td align=\"center\">$banreason</td>
  109.     <td width=\"100\" align=\"center\">$unbandate</td>
  110.     </tr></table>";
  111. $id++;
  112. }
  113. mysql_close($connect);
  114. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement