<?php
require_once '../bootstrap.php';

use SCF\Additionals\Carousel;
use SCF\Core\DI;

$c = new Carousel(ROOT . DS . 'web/Styles/sks-screens' . DS);

/**
 * AltoRouter INCLUSION
 */
require_once ROOT.DS.APP."/Config/router.php";

$tpl->assign('sksscreens', $c->getPicArray());
$match = $router->match();

$userReferer = (!isset($_SERVER['HTTP_REFERER']) ? 'direct' : $_SERVER['HTTP_REFERER']);

$tracking = DI::getInstance()->get('tracking');
$tracking->setCurrentUserIp($_SERVER['REMOTE_ADDR']);
$tracking->setCurrentUserAgent($_SERVER['HTTP_USER_AGENT']);
$tracking->setCurrentUserReferer($userReferer);
$tracking->checkUniqueUser();
if($match === false) {
    $tpl->display('errorpages/404.tpl');
}
else {
    try {
        require $match['target'];
    } catch(Exception $e) {
        return $e->getMessage();
    }
}