Guest User

Untitled

a guest
Aug 16th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. <?
  2. $server = "localhost";
  3. $dbuser = "root";
  4. $dbpass = "";
  5. $dbname = "bandb";
  6.  
  7. mysql_connect($server, $dbuser, $dbpass);
  8. mysql_select_db($dbname);
  9.  
  10. $result = mysql_query("SELECT * FROM sandkassinn_bans ORDER BY id");
  11.  
  12. $rows = mysql_num_rows($result);
  13.  
  14. ?>
  15. <!DOCTYPE html>
  16.  
  17. <head>
  18. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  19. <link rel="stylesheet" type="text/css" href="style.css"/>
  20. <title>MultiCraft.Minecraft.Is</title>
  21. </head>
  22.  
  23. <body>
  24. <div id="page">
  25. <div id="header">
  26.  
  27. <ul>
  28. <li><a href="/index.html">Heim</a></li>
  29. <li><a href="/bannlistinn.php">Bannlistinn</a></li>
  30. <?
  31. echo "$rows eru bannaðir frá servernum!";
  32. ?>
  33. </ul>
  34. </div>
  35. </div>
  36.  
  37. </body>
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. <?php
  46.  
  47. mysql_connect($server, $dbuser, $dbpass);
  48. mysql_select_db($dbname);
  49.  
  50. $result = mysql_query("SELECT * FROM sandkassinn_bans ORDER BY id");
  51.  
  52. echo "<table width=70% border=2 cellpadding=7 cellspacing=7>";
  53.  
  54. echo "<tr style=\"font-weight:bold\">
  55. <td>Spilari</td>
  56. <td>Ástæða</td>
  57. <td>Admin</td>
  58. <td>Tegund</td>
  59. <td>Lok bans</td>
  60. </tr>";
  61.  
  62. while($row = mysql_fetch_assoc($result)){
  63.  
  64. $type = $row['type'];
  65.  
  66. if ($type == "tempban")
  67. {
  68. $tegund = 'Tímabundið';
  69. }
  70.  
  71. elseif ($type == "permaban")
  72.  
  73. {
  74. $tegund = 'Óendanlegt';
  75. }
  76.  
  77. $time1 = $row['date_expire'];
  78. $time2 = time();
  79. $username = $row['banned'];
  80.  
  81. if ($time1 < $time2)
  82. {
  83. $query2 = "DELETE FROM sandkassinn_bans WHERE banned = '$username'";
  84. $perform = mysql_query($query2);
  85. $perform = true;
  86. }
  87.  
  88.  
  89. echo '<tr bgcolor=$col>';
  90.  
  91. $timeexecuted = $row['date_expire'];
  92. $time_done = date("d-m-Y H:i", $timeexecuted);
  93.  
  94. echo "<td><font color='#A00000'>".$row['banned']."</td></font>";
  95. echo "<td><font color='#A00000'>".$row['reason']."</td></font>";
  96. echo "<td><font color='#A00000'>".$row['executor']."</td></font>";
  97. echo "<td><font color='#A00000'>".$tegund."</td></font>";
  98. echo "<td><font color='#A00000'>".$time_done."</td></font>";
  99.  
  100. }
  101.  
  102. ?>
Add Comment
Please, Sign In to add comment