Beispiel #1
0
      <!-- page content -->
      <div class="content-wrap">
        <div class="content">
          <?php 
if (login_check($mysqli) == true) {
    ?>
              <p>Welcome <span style="color: #5B9DDE; font-weight: bold;"><?php 
    echo htmlentities($_SESSION['username']);
    ?>
</span>!</p><br>

              <article> <?php 
    $data = new reviewsFormation();
    $username = $_SESSION["username"];
    $temp = true;
    $existing = $data->getUsersDetails($username);
    $reviewEntries = $data->joinTables();
    if (isset($_SESSION["role"])) {
        if ($_SESSION["role"] == 1) {
            echo '<p class="notice">You are logged in as an administrator.</p><br>';
            echo '<div class="admin-panel"><h3>Admin Panel</h3><br><ul>' . '<li class="button"><a href="reviewsAdmin.php">Manage Reviews</a></li>' . '<li class="button"><a href="adminUsers.php">Manage Users</a></li>' . '<li class="button"><a href="flightsAdmin.php">Manage Flights</a></li>' . '</ul></div><br>';
        }
    }
    if (isset($_SESSION["role"])) {
        if ($_SESSION["role"] == 0 || $_SESSION["role"] == 1) {
            echo '<p><a href="title_content_uploader.php"><span style="font-weight:bold">Submit a new Review</span></a></p><br>';
            echo '<p>My Review History:</p><br>';
        }
    }
    if ($existing != false && $existing != null && ($_SESSION["role"] == 0 || $_SESSION["role"] == 1)) {
        if (count($reviewEntries) != 0) {
Beispiel #2
0
    }
    if ($airportName == 2) {
        $airport_id = 2;
    }
    if ($airportName == 3) {
        $airport_id = 3;
    }
    if ($airportName == 4) {
        $airport_id = 4;
    }
    if ($airportName == 5) {
        $airport_id = 5;
    }
    sec_session_start();
    $username = $_SESSION['username'];
    $userDetails = $data->getUsersDetails($username);
    $userID = $userDetails[0];
    if (isset($userID["id"])) {
        $succeeded = $data->addBlogEntry($title, $content, $rank, $airport_id, $userID["id"]);
    }
    if (!$succeeded) {
        echo "Failure adding a new review!!!";
    }
}
echo '<form id = "back_login" action = "protected_page.php" method = "POST">';
echo '<input type = "submit" value="Back to Account">';
echo '</form>';
echo '<form id = "sign_off" action = "includes/logout.php" method = "POST">';
echo '<input type = "submit" value="Sign Off">';
echo '</form>';
?>