daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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>Date</b></td>';
  22.     echo '  <td><b>Command</b></td>';
  23.     echo '  <td><b>AdminName</b></td>';
  24.         echo '  <td><b>User</b></td>';
  25.         echo '  <td><b>Reason</b></td>';
  26.     echo '</tr>';
  27.  
  28.     $result = mysql_query("SELECT * FROM `AdminLog` ORDER BY `AdminLog`.`ID` DESC LIMIT ".$start_from.", 50");
  29.     while ($x = mysql_fetch_assoc($result))
  30.     {
  31.         ?>
  32.         <tr>
  33.                 <td><?=$x['Date']; ?></td>
  34.                 <td><?=$x['Action']; ?></td>
  35.                 <td><?=$x['Admin']; ?></td>
  36.                 <td><?=$x['User']; ?></td>
  37.                 <td><?=$x['Reason']; ?></td>
  38.         </tr>
  39.         <?php
  40.         $i++;
  41.     }
  42.     $rs_result = mysql_query("SELECT COUNT(Date) FROM `AdminLog`");
  43.     $row1 = mysql_fetch_row($rs_result);
  44.     $total_records = $row1[0];
  45.     $total_pages = ceil($total_records / 50);
  46.    
  47.     echo "Page: ";
  48.     for ($i=1; $i<=$total_pages; $i++) {
  49.             if ($i != $_GET["page"])
  50.             {
  51.                 echo "<a href='4-AdminLog.php?page=".$i."'>[".$i."]</a> ";
  52.             }
  53.             else
  54.             {
  55.                 echo '<a style="color: black;text-decoration:none">['.$i.']</a> ';
  56.             }
  57.     }
  58. }
  59. else
  60. {
  61.     echo '
  62.         You need to be an Adminstrator to enter this Page';
  63. }
  64. ?>
  65. </table>
  66.  
  67. <?php
  68. include("footer.php");
  69. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top