tieneAcceso()){ $objSesion->terminaSesion(); //print_r($objSesion->getError()); } if(!$objSesion->puedeEditar()){ header("Location: ".$pag); exit(); } unset($objValida); if(!isset($_POST["desc"]) || !isset($_POST["color"]) || !isset($_POST["nivel"])){ header("Location: ".$pag."?error=0"); exit(); } $desc = trim(filter_input(INPUT_POST, "desc", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto $color = trim(filter_input(INPUT_POST, "color", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto $nivel = filter_input(INPUT_POST, "nivel", FILTER_SANITIZE_NUMBER_INT);//limpia texto $alerta = filter_input(INPUT_POST, "alerta", FILTER_SANITIZE_NUMBER_INT);//limpia texto $curricular = filter_input(INPUT_POST, "curricular", FILTER_SANITIZE_NUMBER_INT);//limpia texto $sql = ""; if($alerta == 1){ $sql.="true,";}else{$sql.="false,";} if($curricular == 1){ $sql.="true";}else{$sql.="false";} $stmt = $pdo->prepare('Select * from fi_areaacademica(:desc, :color, :nivel, '.$sql.')'); $stmt->bindParam(":desc", $desc); $stmt->bindParam(":color", $color); $stmt->bindParam(":nivel", $nivel); if(!$stmt->execute()){ print_r($stmt->errorInfo()); //header("Location:".$pag."?error=1"); exit(); } $rs = $stmt->fetch(); $stmt->closeCursor(); $stmt = null; $log = new LogActividad(); $desc_log = "Inserta área académica nueva ID[".$rs["fi_areaacademica"]."] Nombre[".$desc."] Color[".$color."] Nivel[".$nivel."]"; $log->appendLog($_SESSION["usuario_id"], $_SESSION["usuario_nombre"]." ".$_SESSION["usuario_apellidos"], $desc_log); header("Location: ".$pag); exit(); ?>