Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'autoloader.php';
- if(!$_GET == null) { $rank = $_GET["rank"]; } else { $rank = 0; }
- if(!$_GET == null) { $quote = $_GET["quote"]; } else { $quote = 0; }
- if(!$_GET == null) { $login = $_GET["login"]; } else { $login = 0; }
- session_start();
- if(!isset($_SESSION['userId'])){
- header("Location: ../index.php");
- }
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Secured!</title>
- <link rel="stylesheet" href="../css/stylesheet.css" type="text/css">
- </head>
- <body>
- <div class="signs">
- <a href="../logOut.php"> <button>Logout</button> </a>
- </div>
- <div id="wrapper">
- <div class="allQuote">
- <?php
- if($quote >= 2) { ?>
- <table class="tbQuote">
- <tr>
- <th>Id</th>
- <th>Quote</th>
- </tr>
- <?php
- $aQuoteManager = new quoteManagers();
- $getAllQuotes = $aQuoteManager->getAll();
- if ($rank >= 2) {
- foreach ($getAllQuotes as $quotes) {
- echo "<tr>";
- echo "<td>$quotes->id</td>";
- echo "<td>$quotes->quote</td>";
- echo "<td><a href='delQuote.php?id=$quotes->id'>Del</a></td>";
- echo "<td><a href='editQuote.php?id=$quotes->id'>Edit</a></td>";
- echo "</tr>";
- }
- } else {
- foreach ($getAllQuotes as $quotes) {
- echo "<tr>";
- echo "<td>$quotes->id</td>";
- echo "<td>$quotes->quote</td>";
- echo "</tr>";
- } } ?>
- </table>
- <br/> <hr id="hr">
- <?php } ?>
- </div>
- <div class="allLogin">
- <?php
- if($login >= 2) { ?>
- <table class="tbLogin">
- <tr>
- <th>Id</th>
- <th>Username</th>
- <th>Rank</th>
- </tr>
- <?php
- $aLoginManager = new loginManagers();
- $getAllLogins = $aLoginManager->getAll();
- if ($rank >= 2) {
- foreach ($getAllLogins as $login) {
- echo "<tr>";
- echo "<td>$login->id</td>";
- echo "<td>$login->username</td>";
- echo "<td>$login->rank</td>";
- echo "<td><a href='delLogin.php?id=$login->id'>Del</a></td>";
- echo "<td><a href='editLogin.php?id=$login->id'>Edit</a></td>";
- echo "</tr>";
- }
- } else {
- foreach ($getAllLogins as $login) {
- echo "<tr>";
- echo "<td>$login->id</td>";
- echo "<td>$login->username</td>";
- echo "<td>$login->rank</td>";
- echo "</tr>";
- } } ?>
- </table>
- <br/> <hr id="hr">
- <?php } ?>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment