<?php

//include Config File
include($_SERVER['DOCUMENT_ROOT'].'/config.inc.php');

//open PHP Session
session_start();

if (!isset($_SESSION['user'])){

//if login has not been completed send user to login form.else
$site_url=$config['URL'];

echo "<meta http-equiv='refresh' content='0;url=$site_url/login.php' />";
echo "You Must be logged in to view this page";
}

//Check if login has been completed and display content
if (isset($_SESSION['user'])) {


if ($_SESSION['access'] == 1) {
                $_SESSION["access_level"] ="User";
}

if ($_SESSION['access'] == 2) {
                $_SESSION["access_level"] = "Admin";
}
}
?>
<html>
<head>
  <title><?php echo $config['SiteName'];?></title>
  
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" type="text/css" href="../assets/css/vendor.css">
  <link rel="stylesheet" type="text/css" href="../assets/css/flat-admin.css">

  <!-- Theme -->
  <link rel="stylesheet" type="text/css" href="../assets/css/theme/blue-sky.css">
  <link rel="stylesheet" type="text/css" href="../assets/css/theme/blue.css">
  <link rel="stylesheet" type="text/css" href="../assets/css/theme/red.css">
  <link rel="stylesheet" type="text/css" href="../assets/css/theme/yellow.css">

</head>
<body>

