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

if (!isset($_SESSION['user'])) {
    header('Location: index.php');
    exit;
} else
    $user = unserialize($_SESSION['user']);

$params = array(':id' => $user->user['id'], ':per' => $_POST['id']);
$user->print_to_log('Actualizando periodo from ' . $user->periodo_id . ' to ' . $_POST['id']);

query("SELECT FU_UPDATEPERIODO(:id, :per)", $params);

$_SESSION['user'] = serialize($user);
header("Location: {$_POST["target"]}");
