$error = true; $configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; include_once($configPath); if (isset($_SESSION["utente"]) && $_SESSION["utente"]->permission("albo",$_GET["codice"]) && !empty($_GET["codice"])) { $estrazione = $pdo->go("SELECT * FROM b_estrazioni WHERE codice = :codice AND contesto = 'albo'",[":codice"=>$_GET["codice"]])->fetch(PDO::FETCH_ASSOC); if (!empty($estrazione)) { $pdf = false; if (!empty($_GET["pdf"])) { $pdf = true; } $relazioni = oeManager::getRelazioniEstrazione($estrazione["codice"]); ob_start(); oeManager::printReportEstrazione($estrazione,$relazioni,$pdf); $report = ob_get_clean(); if (!empty($report)) { $error = false; if (!$pdf) { ?>
echo $report; } else { ob_start(); ?> echo $report ?> $report = ob_get_clean(); $pdf = documentConverter::getPDFWithWKHTML($report,"A4","landscape"); if (!empty($pdf)) { $error = false; header("Content-type: application/pdf"); header("Content-Disposition: inline; filename=extract.pdf"); echo $pdf; } } } } } if ($error) { header('HTTP/1.0 403 Forbidden'); die(); } ?>