Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("header.php");
- ?>
- <h3><b>Adminstrator log.</b></h3>
- <?php
- require_once('Database1.php');
- $level = mysql_query("SELECT Level FROM `Users` WHERE `Username` = '".$_SESSION['SESS_USERNAME']."' LIMIT 1");
- $lev = mysql_fetch_assoc($level);
- $i=1;
- if($lev['Level'] >= 4)
- {
- if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }
- $start_from = ($page-1) * 50;
- echo '<table width="100%" bgcolor="white" border="1" cellspacing="0">';
- echo '<tr>';
- echo ' <td><b>Date</b></td>';
- echo ' <td><b>Command</b></td>';
- echo ' <td><b>AdminName</b></td>';
- echo ' <td><b>User</b></td>';
- echo ' <td><b>Reason</b></td>';
- echo '</tr>';
- $result = mysql_query("SELECT * FROM `AdminLog` ORDER BY `AdminLog`.`ID` DESC LIMIT ".$start_from.", 50");
- while ($x = mysql_fetch_assoc($result))
- {
- ?>
- <tr>
- <td><?=$x['Date']; ?></td>
- <td><?=$x['Action']; ?></td>
- <td><?=$x['Admin']; ?></td>
- <td><?=$x['User']; ?></td>
- <td><?=$x['Reason']; ?></td>
- </tr>
- <?php
- $i++;
- }
- $rs_result = mysql_query("SELECT COUNT(Date) FROM `AdminLog`");
- $row1 = mysql_fetch_row($rs_result);
- $total_records = $row1[0];
- $total_pages = ceil($total_records / 50);
- echo "Page: ";
- for ($i=1; $i<=$total_pages; $i++) {
- if ($i != $_GET["page"])
- {
- echo "<a href='4-AdminLog.php?page=".$i."'>[".$i."]</a> ";
- }
- else
- {
- echo '<a style="color: black;text-decoration:none">['.$i.']</a> ';
- }
- }
- }
- else
- {
- echo '
- You need to be an Adminstrator to enter this Page';
- }
- ?>
- </table>
- <?php
- include("footer.php");
- ?>
Add Comment
Please, Sign In to add comment