<?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;
$sql = "SELECT * FROM  fs_carreras(:idfacultad, :idcarrera, null)";
$params = [':idfacultad' => $_POST['idfacultad'], ':idcarrera' => $_POST['idcarrera']];
$user->print_to_log("Crea carrera", old: $params);
echo json_encode(query($sql, $params, true));
