<?php

require 'LoginModel.php';
require 'DatabaseModule.php';
$dbMod = new DatabaseModule();
$connection = $dbMod->connect();
$loginModel = new LoginModel($connection);
// Prevents the user from manually going to the page
if (!$loginModel->IsUserLoggedIn()) {
    header("location: login.php?action=loginError");
} else {
    // Log the user out and clear any session variables
    $loginModel->LogoutUser();
    unset($_SESSION);
    session_destroy();
    session_write_close();
    header('Location: login.php');
}
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Discourse Analysis - Welcome!</title>
    <link rel="stylesheet" href="css/styles.css" type="text/css" />
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

</head>
<body>
    <div id="header">
        <img src="logo.jpg" height="200" width="80%" alt="Logo" />
        <div id="menu">
            <ul id="navigation">
                <li><a class="navButton" href="home.php">Home</a></li>
                <li><a class="navButton" href="myFiles.php">My Files</a></li>
				<?php 
if ($loginModel->IsUserLoggedIn() && $loginModel->IsAdmin()) {
    echo '<li>
								<a class="navButton" href="adminuser.php">Administrative Options</a>
							  </li>
						';
}
if (!$loginModel->IsUserLoggedIn()) {
    echo '<li>
                                <a class="navButton" href="">Login / Register</a>
                                <ul>
                                    <li><a class="navButton" href="login.php">Login</a></li>
                                    <li><a class="navButton" href="register.php">Register</a></li>
                              </li>
                        ';
} else {
    echo '<li>