예제 #1
0
<?php

session_start();
require 'helpers/adminManager.php';
require 'PropertiesDatabase.php';
require 'UsersDatabase.php';
$error;
if (isset($_SESSION['username']) && isAdmin($_SESSION['username'])) {
    $propertiesDatabase = new PropertiesDatabase('data/properties.json');
    $usersDatabase = new UsersDatabase('data/users.json');
    $allProperties = $propertiesDatabase->dataArray();
    $soldProperties = $propertiesDatabase->soldProperties();
    $unsoldProperties = $propertiesDatabase->unsoldProperties();
} else {
    // unauthorised accces
    $error = "You are not authorized to access this content, please login with an admin account.";
}
?>

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Sales Report</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">