<?php
if(!isset($_SESSION)) {
    session_start();
}

require_once($_SERVER['DOCUMENT_ROOT'].'/varios/varios.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/clases/Varios.Class.php');

if( Varios::isActiveSession() 
    && Varios::hasModuleAccess(10)
) {
    $tituloSubPagina = "Modificar una Reserva";
    $contenidoHTML   = '';
    $JavaScript      = '';
    
    $resIdCod    = filter_var( $_GET['p'], FILTER_SANITIZE_STRING);
    $resId       = filter_var( Varios::decodifica($resIdCod), FILTER_SANITIZE_NUMBER_INT);    
    
    $resTokenCod = filter_var( $_GET['t'], FILTER_SANITIZE_STRING);
    $resToken    = filter_var( Varios::decodifica($resTokenCod), FILTER_SANITIZE_STRING);
    
    require_once($_SERVER['DOCUMENT_ROOT'].'/includes/layout/dashboard.php');    
    ?>
    
    <input value="<?php echo Varios::codifica($resId);?>" type="text" id="txt_modReservaId" name="txt_modReservaId">
    <input value="<?php echo Varios::codifica($resToken);?>" type="text" id="txt_modReservaToken" name="txt_modReservaToken">

    <link rel="stylesheet" href="/dist/css/personalizado.css">
    <script type="text/javascript" src="/js/gestionReservas/gestionReservasFuncionesComunes.js"></script>
    <script type="text/javascript" src="/js/gestionReservas/gestionReservasModificar.js"></script>
    <?php
    require_once($_SERVER['DOCUMENT_ROOT'].'/varios/modal/modal_gestionReservas.php');
    require_once($_SERVER['DOCUMENT_ROOT'].'/varios/modal/modal_gestionReservasNueva.php');
}else {
    header('location: /login/logout.php');
}
?>