2018-12-30 17:41:15 +01:00
|
|
|
<?php
|
2019-01-02 18:00:16 +01:00
|
|
|
define('SITE_ROOT', dirname(__FILE__));
|
|
|
|
ini_set('display_errors', 1);
|
|
|
|
ini_set('display_startup_errors', 1);
|
|
|
|
error_reporting(E_ALL);
|
2018-12-30 17:41:15 +01:00
|
|
|
|
2019-01-02 18:00:16 +01:00
|
|
|
session_start();
|
2019-01-02 10:43:38 +01:00
|
|
|
|
2019-01-02 19:50:36 +01:00
|
|
|
if(!isset($_SESSION["sl"]))
|
|
|
|
{
|
|
|
|
$_SESSION["sl"] = "1";
|
|
|
|
$_SESSION["login"] = "";
|
|
|
|
}
|
|
|
|
|
2019-01-02 18:00:16 +01:00
|
|
|
require_once SITE_ROOT.'/vendor/autoload.php';
|
2018-12-30 17:41:15 +01:00
|
|
|
|
2019-01-02 18:00:16 +01:00
|
|
|
$loader = new Twig_Loader_Filesystem( SITE_ROOT.'/views');
|
|
|
|
$twig = new Twig_Environment($loader, array(
|
|
|
|
'cache' => /*SITE_ROOT.'/twig/compilation_cache'*/false,
|
|
|
|
));
|
2019-01-02 10:43:38 +01:00
|
|
|
|
2019-01-02 18:00:16 +01:00
|
|
|
if(isset($_GET["page"]))
|
|
|
|
{
|
|
|
|
switch ($_GET["page"]) {
|
|
|
|
case 'table':
|
|
|
|
include './control/table.php';
|
|
|
|
break;
|
|
|
|
case 'login':
|
|
|
|
include './control/login.php';
|
|
|
|
break;
|
|
|
|
default:
|
2019-01-02 19:50:36 +01:00
|
|
|
include './control/login.php';
|
2019-01-02 18:00:16 +01:00
|
|
|
break;
|
2019-01-02 13:23:07 +01:00
|
|
|
}
|
|
|
|
}
|
2019-01-02 18:00:16 +01:00
|
|
|
else {
|
2019-01-02 19:50:36 +01:00
|
|
|
if(isset($_SESSION["sl"]))
|
|
|
|
switch ($_SESSION["sl"]) {
|
|
|
|
case '5':
|
|
|
|
case '10':
|
|
|
|
include './control/table.php';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if(!empty($_SESSION["login"]))
|
|
|
|
include './control/table.php';
|
|
|
|
else
|
|
|
|
include './control/login.php';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
include './control/login.php';
|
2019-01-02 18:00:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|