Guest User

Untitled

a guest
Jun 14th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. <?php
  2. include("header.php");
  3. ?>
  4.  
  5. <h3><b>Adminstrator log.</b></h3>
  6.  
  7. <?php
  8. require_once('Database1.php');
  9.  
  10. $level = mysql_query("SELECT Level FROM `Users` WHERE `Username` = '".$_SESSION['SESS_USERNAME']."' LIMIT 1");
  11. $lev = mysql_fetch_assoc($level);
  12.  
  13. $i=1;
  14.  
  15. if($lev['Level'] >= 4)
  16. {
  17. if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }
  18. $start_from = ($page-1) * 50;
  19. echo '<table width="100%" bgcolor="white" border="1" cellspacing="0">';
  20. echo '<tr>';
  21. echo ' <td><b>ID</b></td>';
  22. echo ' <td><b>Date</b></td>';
  23. echo ' <td><b>Command</b></td>';
  24. echo ' <td><b>AdminName</b></td>';
  25. echo ' <td><b>User</b></td>';
  26. echo ' <td><b>Reason</b></td>';
  27. echo '</tr>';
  28.  
  29. $result = mysql_query("SELECT * FROM `AdminLog` ORDER BY `AdminLog`.`ID` DESC LIMIT ".$start_from.", 50");
  30. while ($x = mysql_fetch_assoc($result))
  31. {
  32. ?>
  33. <tr>
  34. <td><?=$x['Date']; ?></td>
  35. <td><?=$x['Action']; ?></td>
  36. <td><?=$x['Admin']; ?></td>
  37. <td><?=$x['User']; ?></td>
  38. <td><?=$x['Reason']; ?></td>
  39. </tr>
  40. <?php
  41. $i++;
  42. }
  43. $rs_result = mysql_query("SELECT COUNT(Date) FROM `AdminLog`");
  44. $row1 = mysql_fetch_row($rs_result);
  45. $total_records = $row1[0];
  46. $total_pages = ceil($total_records / 50);
  47.  
  48. echo "Page: ";
  49. for ($i=1; $i<=$total_pages; $i++) {
  50. if ($i != $_GET["page"])
  51. {
  52. echo "<a href='4-AdminLog.php?page=".$i."'>[".$i."]</a> ";
  53. }
  54. else
  55. {
  56. echo '<a style="color: black;text-decoration:none">['.$i.']</a> ';
  57. }
  58. }
  59. }
  60. else
  61. {
  62. echo '
  63. You need to be an Adminstrator to enter this Page';
  64. }
  65. ?>
  66. </table>
  67.  
  68. <?php
  69. include("footer.php");
  70. ?>
Add Comment
Please, Sign In to add comment