<?php 

session_start();

require_once "../env.inc.php";
require_once "../access.inc.php";
require_once "../conf.inc.php";
require_once DIR_PHP_LAYOUTS . "header.php";

if($_SERVER['HTTP_HOST'] == DOMAIN_EVENTS){
    if(session::isConnect("salarie")) {
        define("TITLE", "CSE Invent : Vos évènements");
        require_once DIR_PHP_VIEWS . "_events.head.php";
        require_once DIR_PHP_VIEWS . "_events.nav.php";
        get::page("list-events");
        require_once DIR_PHP_VIEWS . "_events.foot.php";
    } else {
        header("Location: /");
        exit();
    }
} elseif ($_SERVER['HTTP_HOST'] == DOMAIN_CONTROL) {
    if(session::isConnect()) {
        define("TITLE", "CSE Invent : Controle d'évènement");
        require_once DIR_PHP_VIEWS . "_events.head.php";
        require_once DIR_PHP_VIEWS . "_events.nav.php";
        get::page("validateQRCode");
        require_once DIR_PHP_VIEWS . "_events.foot.php";
    } else {
        header("Location: /");
        exit();
    }
}
