<?php
$ruta = "../";
require_once "../class/c_login.php";

// check if the session is started
if (!isset($_SESSION['user']))
    die(json_encode(['error' => 'No se ha iniciado sesión']));

$user = unserialize($_SESSION['user']);
$ruta = "../";
require_once "../include/bd_pdo.php";
global $pdo;
$params = [':id' => $_POST['id']];
if ($_POST['periodo'] == 0) {
    $sql = "SELECT * FROM fs_diasfestivos(:id, null)";
} else {
    $sql = "SELECT * FROM fs_diasfestivos(null, :id, null, null)";
}
echo json_encode(query($sql, $params, true));
