gestione gare pubbliche
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

59 righe
2.0 KiB

<?
$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) {
?>
<div class="text-right mb-2">
<a target="_blank" class="btn btn-sm btn-danger" href="/backend/albo/showEstrazione.php?codice=<?= $estrazione["codice"] ?>&pdf=true">
<span class="far fa-file-pdf"></span> <?= __("Download Report") ?>
</a>
</div>
<?
echo $report;
} else {
ob_start();
?>
<html>
<style>
body { font-size:10px; }
td, th { padding:5px; border: 1px solid #AAA }
th { background-color: #DDD }
tr.odd { background-color: #DDD; }
table { width:100% }
</style>
<body>
<? echo $report ?>
</body>
</html>
<?
$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();
}
?>