tieneAcceso()){ $objSesion->terminaSesion(); //print_r($objSesion->getError()); } if(!$objSesion->puedeEditar()){ header("Location: ".$pag); exit(); } unset($objValida); if(!isset($_POST["id"]) || !isset($_POST["desc"]) || !isset($_POST["color"]) || !isset($_POST["nivel"])){ header("Location: ".$pag."?error=0"); exit(); } $id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto $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 fu_areaacademica(:id, :desc, :color, :nivel,'.$sql.')'); $stmt->bindParam(":id", $id); $stmt->bindParam(":desc", $desc); $stmt->bindParam(":color", $color); $stmt->bindParam(":nivel", $nivel); if(!$stmt->execute()){ //print_r($stmt->errorInfo()); header("Location:".$pag."?error=2"); exit(); } $stmt->closeCursor(); $stmt = null; $log = new LogActividad(); $desc_log = "Actualiza área académica ID[".$id."] Nombre[".$desc."] Color[".$color."] Nivel[".$nivel."]"; $log->appendLog($_SESSION["usuario_id"], $_SESSION["usuario_nombre"]." ".$_SESSION["usuario_apellidos"], $desc_log); header("Location: ".$pag); exit(); ?>