tieneAcceso()){ $return["error"] = "Error! No tienes permisos para realizar esta acción."; }else if(!isset($_POST["id"])){ $return["error"] = "Error! No se recibió la información de la carrera."; }else{ $id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto $stmt = $pdo->prepare('Select * from fs_carrera(:id, NULL, NULL)'); $stmt->bindParam(":id", $id); if(!$stmt->execute()){ $return["error"] = "Ocurrió un error al leer los datos de la carrera."; }else{ $rs = $stmt->fetch(); $stmt->closeCursor(); $stmt = null; $return["id"] = $rs["Carrera_id"]; $return["desc"] = $rs["Carrera_desc"]; $return["nivel"] = $rs["Nivel_id"]; //if($_SESSION["nivel_id"] == 1) $return["prefijo"] = $rs["Carrera_prefijo"]; //else //$return["prefijo"] = ""; } } $return["json"] = json_encode($return); echo json_encode($return); ?>