tieneAcceso() || !$objSesion->puedeEditar()){ header("Location: main.php"); exit; } $pag = "avisos.php"; if(!isset($_GET["id"])){ header("Location: ".$pag."?error=0"); exit; } $id = filter_input(INPUT_GET, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto $stmt = $pdo->prepare('Select * from fs_aviso(:id, NULL, 0, NULL)'); $stmt->bindParam(":id", $id); if(!$stmt->execute()){ //print_r($stmt->errorInfo()); header("Location: ".$pag."?error=5"); exit(); } $aviso_rs = $stmt->fetch(); $stmt->closeCursor(); if(count($aviso_rs) == 0 || $aviso_rs["Aviso_id"] == ""){ header("Location: ".$pag."?error=4"); exit(); } //Obtiene nombres de usuario $stmt = $pdo->prepare('Select * from fs_avisousuario(:id)'); $stmt->bindParam(":id", $id); if(!$stmt->execute()){ //print_r($stmt->errorInfo()); header("Location: ".$pag."?error=5"); exit(); } $usuario_rs = $stmt->fetchAll(); $stmt->closeCursor(); ?>