<?php 
session_start();
$settings = json_decode(file_get_contents("../files/config/config.json"), true);
require('../module/controller.php');

if(isset($_SESSION['granted']) == false){
	header("location: login");
}
include('pages/header.php');

$route = !empty($_GET['route']) ? $_GET['route'] : "dashboard";

if($route == "dashboard"){
	include('pages/main_dashboard.php');
}elseif($route == "visitor"){
	include('pages/main_visitor.php');
}elseif($route == "bot"){
	include('pages/main_bot.php');
}elseif($route == "settings"){
	include('pages/main_settings.php');
}else{
	include('pages/main_dashboard.php');
}

include('pages/footer.php');