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.
100 righe
2.8 KiB
100 righe
2.8 KiB
<? |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "/public_html")) . "/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && !empty($_GET["tokenEsportazione"])) { |
|
if (!empty($_SESSION["exportoperatori"][$_GET["tokenEsportazione"]])) { |
|
$alloperatori = $_SESSION["exportoperatori"][$_GET["tokenEsportazione"]]; |
|
$enteInfo = $_SESSION["ente"]->getInfo(); |
|
session_write_close(); |
|
ob_start(); |
|
?> |
|
<html> |
|
<style> |
|
body { |
|
font-size: 10px; |
|
} |
|
|
|
td, |
|
th { |
|
padding: 5px; |
|
} |
|
|
|
tr.odd { |
|
background-color: #DDD; |
|
} |
|
|
|
table { |
|
width: 100% |
|
} |
|
</style> |
|
|
|
<body> |
|
<table> |
|
<tr> |
|
<td style="width:150px"><img src="<?= $config["link_sito"] ?>/documenti/enti/<?= $enteInfo["logo"] ?>" style="width:150px"></td> |
|
<td> |
|
<h1><?= $enteInfo["denominazione"] ?></h1> |
|
<strong><?= $enteInfo["indirizzo"] . " - " . $enteInfo["citta"] . " (" . $enteInfo["provincia"] . ")" ?></strong><br> |
|
<h2 style="margin:5px;padding:0px"><?= __("Esportazione OOEE al") ?> <?= date("d/m/Y") ?></h2> |
|
</td> |
|
</tr> |
|
</table> |
|
<?php |
|
if (!empty($_COOKIE["appliedFilters{$_GET["tokenEsportazione"]}"])) : |
|
$filters = base64_decode($_COOKIE["appliedFilters{$_GET["tokenEsportazione"]}"]); |
|
if (!empty($filters)) : |
|
?> |
|
<div style="border:1px solid #000; padding: 10px"> |
|
<strong><?= __("Filtri applicati") ?></strong> |
|
<?= $filters; ?> |
|
</div><br> |
|
<?php |
|
endif; |
|
endif; |
|
?> |
|
<table width="100%"> |
|
<tr style="background-color: #AAA; color: #FFF; font-weight:bold"> |
|
<th style="width:10%"><?= __("Codice Fiscale") ?></th> |
|
<th style="width:40%"><?= __("Denominazione") ?></th> |
|
<th style="width:20%"><?= __("PEC") ?></th> |
|
<th style="width:10%"><?= __("Qualifica") ?></th> |
|
</tr> |
|
<? |
|
$i = 0; |
|
foreach ($alloperatori as $record) { |
|
$i++; |
|
$class = "even"; |
|
if ($i % 2 != 0) $class = "odd"; |
|
?> |
|
<tr class="<?= $class ?>"> |
|
<td style="width:10%"><?= strtoupper($record["codice_fiscale_impresa"]) ?></td> |
|
<td style="width:40%"><strong><?= strtoupper($record["ragione_sociale"]) ?></strong></td> |
|
<td style="width:20%"><?= strtolower($record["pec"]) ?></td> |
|
<td style="width:10%; text-align:center;"><?= ($record["albi"] == 1) ? __("Si") : __("No"); ?></td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</table> |
|
</body> |
|
|
|
</html> |
|
<? |
|
$html = ob_get_clean(); |
|
$pdf = documentConverter::getPDFWithWKHTML($html, "A3", "landscape"); |
|
if (!empty($pdf)) { |
|
$error = false; |
|
header("Content-type: application/pdf"); |
|
header("Content-Disposition: inline; filename=export.pdf"); |
|
echo $pdf; |
|
} |
|
} else { |
|
$error = false; |
|
echo "<h1>Troppi record da esportare</h1>"; |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
}
|
|
|