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.
691 righe
24 KiB
691 righe
24 KiB
<? |
|
$content = false; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
$error = true; |
|
if (isset($_SESSION["utente"]) && $_SESSION["utente"]->gerarchia < 100 && tokenVerify($_GET["token"]) && !empty($_GET['oe_codice']) && !empty($_SESSION['ente']->codice)) { |
|
|
|
$oe = oeManager::getOE($_GET["oe_codice"]); |
|
|
|
$enteInfo = $_SESSION["ente"]->getInfo(); |
|
|
|
if(!empty($oe)){ |
|
$utente = oeManager::getUser($oe["codice"]); |
|
if(!empty($utente)){ |
|
|
|
|
|
$cpvs = oeManager::getCpvs($oe["codice"]); |
|
if($cpvs === false) $cpvs = []; |
|
$cpvs = cpvManager::getInfo($cpvs); |
|
$codice_ente = 0; |
|
if (isset($_SESSION["ente"])) { |
|
$codice_ente = $_SESSION["ente"]->codice; |
|
} |
|
|
|
$forms = oeManager::getStandardForms($oe["tipo"],$codice_ente); |
|
$formsObjects = []; |
|
|
|
if (!empty($forms)) { |
|
foreach($forms AS $form) { |
|
$form = FormManager::getInfoFromID($form,$codice_ente); |
|
if (!empty($form)) { |
|
$formManager = new FormManager; |
|
$formManager->init($form["codice"],"oe",$oe["codice"]); |
|
$validation = $formManager->validateData(); |
|
|
|
$formsObjects[$form["codice"]] = ["info"=>$form,"manager"=>$formManager,"validation"=>$validation]; |
|
unset($formManager); |
|
$titolo = json_decode($form["titolo"],true); |
|
$titolo = $titolo[$_SESSION["language"]]; |
|
} |
|
} |
|
} |
|
|
|
|
|
if ($oe["tipo"] == "IMP") { |
|
$form = FormManager::getInfoFromID("soa",$codice_ente); |
|
$status_soa = "fa fa-exclamation-triangle text-danger"; |
|
if (!empty($form)) { |
|
$soaManager = new FormManager; |
|
$soaManager->init($form["codice"],"oe",$oe["codice"]); |
|
$validationSoa = $soaManager->validateData(); |
|
} |
|
} else { |
|
$serviziTecnici = oeManager::getServiziTecnici($oe["codice"]); |
|
} |
|
|
|
$error = false; |
|
$html = ob_get_clean(); |
|
ob_start(); |
|
?> |
|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
|
<title><?= __('export.pdf') ?></title> |
|
<style type="text/css"> |
|
@page { |
|
margin: 0cm; |
|
margin-top: 0.5cm; |
|
margin-left: 1.3cm; |
|
margin-right: 1.3cm; |
|
margin-bottom: 0.5cm; |
|
} |
|
.page-break { |
|
page-break-after: always; |
|
} |
|
* { |
|
margin: 0; |
|
padding: 0; |
|
box-sizing: border-box; |
|
} |
|
body { |
|
padding: 30px 40px; |
|
} |
|
body * { |
|
font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; |
|
} |
|
|
|
/* MARGIN E PADDING */ |
|
|
|
.p-2{ |
|
padding: .5rem |
|
} |
|
|
|
.mt-3{ |
|
margin-top: 1rem |
|
} |
|
|
|
.mt-4{ |
|
margin-top: 1.5rem |
|
} |
|
|
|
.mt-5{ |
|
margin-top: 3rem |
|
} |
|
|
|
.mb-1{ |
|
margin-bottom: .25rem; |
|
} |
|
|
|
.mb-2{ |
|
margin-bottom: .5rem |
|
} |
|
|
|
.mb-3{ |
|
margin-bottom: 1rem |
|
} |
|
|
|
.mb-4{ |
|
margin-bottom: 1.5rem |
|
} |
|
|
|
.mb-5{ |
|
margin-bottom: 3rem |
|
} |
|
|
|
.pb-1{ |
|
margin-bottom: .25rem; |
|
} |
|
|
|
.pb-2{ |
|
margin-bottom: .5rem |
|
} |
|
|
|
.pb-3{ |
|
margin-bottom: 1rem |
|
} |
|
|
|
.pb-4{ |
|
margin-bottom: 1.5rem |
|
} |
|
|
|
.pb-5{ |
|
margin-bottom: 3rem |
|
} |
|
|
|
/* width & height */ |
|
|
|
.w-20{ |
|
width: 20%; |
|
} |
|
|
|
.w-25{ |
|
width: 25%; |
|
} |
|
|
|
.w-30{ |
|
width: 30%; |
|
} |
|
|
|
|
|
.w-40{ |
|
width: 40%; |
|
} |
|
|
|
.w-50{ |
|
width: 50%; |
|
} |
|
|
|
.w-60{ |
|
width: 60%; |
|
} |
|
|
|
.w-70{ |
|
width: 70%; |
|
} |
|
|
|
.w-100{ |
|
width: 100%; |
|
} |
|
|
|
|
|
/* variable */ |
|
.d-block{ |
|
display: block; |
|
} |
|
|
|
.f-13_5 { |
|
font-size: 13.5px; |
|
} |
|
|
|
.f-18{ |
|
font-size: 18px; |
|
} |
|
|
|
.text-center{ |
|
text-align: center; |
|
} |
|
|
|
.text-bold{ |
|
font-weight: bold; |
|
} |
|
|
|
.title{ |
|
background-color: white; |
|
} |
|
|
|
.table { |
|
font-family: Arial, Helvetica, sans-serif; |
|
border-collapse: collapse; |
|
width: 100%; |
|
border: 1px solid #dee2e6 !important; |
|
} |
|
|
|
.table td, |
|
.table th{ |
|
padding: 7px; |
|
border: 1px solid #dee2e6 !important; |
|
} |
|
|
|
.table tr:nth-child(odd){ |
|
background-color: white; |
|
} |
|
|
|
.table tr:nth-child(even){ |
|
background-color: #DDD; |
|
} |
|
|
|
|
|
/* Adattamento css */ |
|
.collapse{ |
|
display: none; |
|
} |
|
.form-group > span { |
|
padding-left: 15px; |
|
} |
|
|
|
.form-group > label::after { |
|
content:":"; |
|
} |
|
|
|
.card-header{ |
|
width: 100%; |
|
text-align: center; |
|
padding: 7px; |
|
border: 1px solid #dee2e6 !important; |
|
font-weight: bold; |
|
margin-top: 3rem; |
|
margin-bottom: 10px; |
|
/* page-break-before:always; */ |
|
} |
|
a{ |
|
pointer-events: none; |
|
cursor: default; |
|
text-decoration: none; |
|
color: black; |
|
} |
|
|
|
/* GROUP panel*/ |
|
|
|
div[id^="group-panel-"] .card-body .row .col-12, |
|
div[id^="group-panel-"] .card-body > .row > .col-lg-12, |
|
div[id^="group-panel-"] .card-body > .row > .col-12 > .form-group, |
|
div[id^="group-panel-"] .card-body > .row > .col-12 > .row > .col-12 { |
|
border: 1px solid #dee2e6 !important; |
|
padding: 7px; |
|
width: 100% |
|
} |
|
|
|
div[id^="group-panel-"] .card-body > .row > .col-12 > .form-group, |
|
div[id^="group-panel-"] .card-body > .row > .col-12 > .row > .col-12:nth-last-of-type(2){ |
|
background-color: #DDD; |
|
} |
|
|
|
div[id^="group-panel-"] label:after{ |
|
content: ":"; |
|
} |
|
|
|
div[id^="group-panel-"] .col-12 span{ |
|
padding-left: 15px; |
|
} |
|
|
|
div[id^="group-panel-"] .card-body .row .col-12:nth-child(odd){ |
|
background-color: #DDD; |
|
} |
|
div[id^="group-panel-"] .card-body .row .col-12:nth-child(even){ |
|
background-color: white; |
|
} |
|
div[id^="group-panel-"] .card-body > .row > .col-12:nth-last-child(n) .form-group, |
|
div[id^="group-panel-"] .card-body > .row > .col-12:nth-last-child(n) .row .col-12{ |
|
background-color: white; |
|
} |
|
|
|
/* GROUP Body*/ |
|
div[id^="group-body-"] > span { |
|
padding: 7px; |
|
border: 1px solid #dee2e6 !important; |
|
font-size: 16px; |
|
font-weight: bold; |
|
} |
|
|
|
div[id^="group-body-"] > .row { |
|
padding: 7px; |
|
border: 1px solid #dee2e6 !important; |
|
background-color: #DDD; |
|
} |
|
div[id^="group-body-"] > .row .col-12:first-child { |
|
width: 91%; |
|
float: left; |
|
box-sizing: border-box; |
|
} |
|
div[id^="group-body-"] > .row .col-12:last-child { |
|
width: 9%; |
|
float: left; |
|
box-sizing: border-box; |
|
/* max-height: 10px; */ |
|
text-align: center; |
|
} |
|
div[id^="group-body-"] > .row:after { |
|
content:""; |
|
display:block; |
|
clear:both; |
|
} |
|
|
|
/* GROUP CONTENT */ |
|
div[id^="group-content-"] .conditional .row .col-12{ |
|
border: 1px solid #dee2e6 !important; |
|
padding: 7px; |
|
width: 100%; |
|
} |
|
div[id^="group-content-"] .conditional .row .col-12:nth-child(even){ |
|
background-color: #DDD; |
|
} |
|
|
|
/* Group */ |
|
div[id^="group-"] > .row { |
|
padding: 7px; |
|
border: 1px solid #dee2e6 !important; |
|
background-color: #DDD; |
|
} |
|
div[id^="group-"] > .row > .col-12:first-child { |
|
width: 91%; |
|
float: left; |
|
box-sizing: border-box; |
|
} |
|
div[id^="group-"] > .row > .col-12:last-child { |
|
width: 9%; |
|
float: left; |
|
box-sizing: border-box; |
|
text-align: center; |
|
} |
|
|
|
div[id^="group-"] > .row:after { |
|
content:""; |
|
display:block; |
|
clear:both; |
|
} |
|
|
|
/* DA QUI IN POI SI DEVONO SPECIFICARE LE CLASSI */ |
|
#body-fatturato-soa > .card > .form-group{ |
|
border: 1px solid #dee2e6 !important; |
|
padding: 7px; |
|
width: 100%; |
|
} |
|
|
|
#body-fatturato-soa .d-flex .flex-fill{ |
|
border: 1px solid #dee2e6 !important; |
|
padding: 7px; |
|
width: 100%; |
|
text-align: left; |
|
} |
|
|
|
#body-fatturato-soa .d-flex .flex-fill:nth-child(odd){ |
|
background-color: #DDD; |
|
} |
|
|
|
#body-servizi-tecnici .col-12{ |
|
border: 1px solid #dee2e6 !important; |
|
padding: 7px; |
|
width: 100%; |
|
text-align: left; |
|
} |
|
|
|
#body-servizi-tecnici .col-12:nth-child(odd){ |
|
background-color: #DDD; |
|
} |
|
|
|
</style> |
|
</head> |
|
|
|
<body> |
|
<table width="100%"> |
|
<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> |
|
|
|
<!-- Dati Generali --> |
|
<div class="mt-4"> |
|
<table class="table"> |
|
<tr> |
|
<th colspan="3" class=" title"> |
|
<?= __('Dati Generali:') ?> |
|
</th> |
|
</tr> |
|
<tr> |
|
<td colspan="3"> |
|
<?= __("Denominazione:") ?> <?= $oe["ragione_sociale"] ?> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td class="w-20"><?= __('Stato:') ?> <?= $oe["stato_legale"] ?></td> |
|
<td class="w-40"><?= __('Codice Fiscale Impresa:') ?> <?= $oe["codice_fiscale_impresa"] ?></td> |
|
<td class="w-40"><?= __('Partita IVA:') ?> <?= $oe["partita_iva"] ?> </td> |
|
</tr> |
|
<tr> |
|
<td colspan="3"><?= __('Indirizzo PEC:') ?> <?= $oe["pec"] ?> </td> |
|
</tr> |
|
<tr> |
|
<td colspan="3"><?= __('Indirizzo E-mail:') ?> <?= $utente['email'] ?></td> |
|
</tr> |
|
</table> |
|
</div> |
|
|
|
<!-- Anagrafica --> |
|
<div class="mt-3"> |
|
<table class="table"> |
|
<tr> |
|
<th colspan="3" class="title"> |
|
<?= __('Anagrafica:') ?> |
|
</th> |
|
</tr> |
|
<tr> |
|
<td class="w-50"><?= __('Cognome:') ?> <?= $utente["cognome"] ?></td> |
|
<td class="w-50"><?= __('Nome:') ?> <?= $utente["nome"] ?> </td> |
|
</tr> |
|
<tr> |
|
<td colspan="3"> |
|
<?= __("Codice Fiscale:") ?> <?= $utente["cf"] ?> |
|
</td> |
|
</tr> |
|
</table> |
|
</div> |
|
|
|
<!-- Residenza --> |
|
<div class="mt-3"> |
|
<table class="table"> |
|
<tr> |
|
<th colspan="3" class=" title"> |
|
<?= __('Residenza:') ?> |
|
</th> |
|
</tr> |
|
<tr> |
|
<td colspan="3"> |
|
<?= __("Indirizzo:") ?> <?= $utente["indirizzo"] ?> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td class="w-50"><?= __('Città:') ?> <?= $utente["citta"] ?> </td> |
|
<td class="w-25"><?= __('Provincia:') ?> <?= $utente["provincia"] ?></td> |
|
<td class="w-25"><?= __('C.A.P:') ?> <?= $utente["cap"] ?></td> |
|
</tr> |
|
<tr> |
|
<td colspan="3"><?= __('Telefono:') ?> <?= $utente["telefono"] ?> </td> |
|
</tr> |
|
<tr> |
|
<td colspan="3"><?= __('Cellulare:') ?> <?= $utente['cellulare'] ?></td> |
|
</tr> |
|
</table> |
|
</div> |
|
|
|
<!-- CPV --> |
|
<? if(!empty($cpvs)){ ?> |
|
<div class="mt-5"> |
|
<table class="table"> |
|
<tr> |
|
<td colspan="3" class=" title text-center text-bold f-18"> |
|
<?= __('Categorie CPV:') ?> |
|
</td> |
|
</tr> |
|
<? foreach($cpvs as $cpv){ ?> |
|
<tr> |
|
<td class="w-20"> <?= $cpv["codice"] ?> </td> |
|
<td class="w-80"> <?= $cpv["IT"] ?></td> |
|
</tr> |
|
<? } ?> |
|
</table> |
|
</div> |
|
<? } ?> |
|
|
|
<!-- Da qui in poi adattare l'html tramite css --> |
|
<? foreach($formsObjects AS $formID => $formInfo) {?> |
|
<? $formInfo["manager"]->printForm(false);?> |
|
<? }?> |
|
|
|
|
|
<? |
|
if(!empty($soaManager)){ |
|
$categorie = getCategorieSOA(); |
|
$classifiche = getClassificheSOA(); |
|
$years = []; |
|
for($i = 5;$i>0;$i--) { |
|
$years[] = (int)date("Y") - $i; |
|
} |
|
|
|
$soaManager->printForm(false); |
|
$soa = oeManager::getSOA($oe["codice"]); |
|
|
|
if(!empty($soa)){ |
|
?> |
|
<div> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<h3 class="card-title m-0"><?= __("Categorie") ?></h3> |
|
</div> |
|
<div class="card-body p-0"> |
|
<table class="table table-striped table-hover"> |
|
<thead> |
|
<tr> |
|
<th><?= __("Categoria") ?></th> |
|
<th><?= __("Classifica") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody id="body-categorie-soa"> |
|
<? |
|
foreach($soa AS $id => $categoria) { |
|
$elemento = $categorie[$categoria["codice_categoria"]]; |
|
$classifica = $classifiche[$categoria["codice_classifica"]]; |
|
?> |
|
<tr> |
|
<td width="70%"> |
|
<?= $elemento["id"] ?> - <?= $elemento["descrizione"] ?> |
|
</td> |
|
<td> |
|
<?= $classifica["id"] ?> <?= $classifica["descrizione"] ?> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
|
|
$fatturatoSoa = oeManager::getFatturatiSOA($oe["codice"]); |
|
if (!empty($fatturatoSoa)) { |
|
?> |
|
<div> |
|
<div class="card mt-2"> |
|
<div class="card-header"> |
|
<h3 class="card-title m-0"><?= __("Fatturati") ?></h3> |
|
</div> |
|
<div id="body-fatturato-soa" class="card-body"> |
|
<? |
|
if (!empty($fatturatoSoa)) { |
|
foreach($fatturatoSoa AS $codice_categoria => $fatturati) { |
|
$elemento = $categorie[$codice_categoria]; |
|
?> |
|
<div class="card card-body mb-1"> |
|
<div class="form-group"> |
|
<?= $elemento["descrizione"] ?> |
|
</div> |
|
<div class="d-flex"> |
|
<? |
|
foreach($years AS $anno) { |
|
?> |
|
<div class="flex-fill px-2 text-center form-group"> |
|
<label class="value-label"><?= $anno ?></label> |
|
<?= (!empty($fatturati[$anno])) ? number_format($fatturati[$anno],2,",",".") : "n.d." ?> |
|
</div> |
|
<? |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
?> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
|
|
$serviziTecnici = oeManager::getServiziTecnici($oe["codice"]); |
|
$categorieST = getCategorieServiziTecnici(); |
|
|
|
if(!empty($serviziTecnici)){ |
|
?> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<h3 class="card-title m-0"><?= __("Servizi Tecnici") ?></h3> |
|
</div> |
|
<div class="card-body" id="body-servizi-tecnici"> |
|
<? |
|
foreach($serviziTecnici AS $id => $servizio) { |
|
?> |
|
<div class="col-12"> |
|
<label class="value-label"><?= __("Committente") ?>*</label> |
|
<?= $servizio["committente"] ?> |
|
</div> |
|
<div class="col-12"> |
|
<label class="value-label"><?= __("Atto") ?></label> |
|
<?= $servizio["atto"] ?> |
|
</div> |
|
<div class="col-12"> |
|
<label class="value-label"><?= __("Inizio servizio") ?>*</label> |
|
<?= mysql2date($servizio["inizio"]) ?> |
|
</div> |
|
<div class="col-12"> |
|
<label class="value-label"><?= __("fine servizio") ?></label> |
|
<?= mysql2date($servizio["fine"]) ?> |
|
</div> |
|
<div class="col-12"> |
|
<label class="value-label"><?= __("Descrizione") ?>*</label> |
|
<?= $servizio["descrizione"] ?> |
|
</div> |
|
|
|
|
|
<table class="table mt-3"> |
|
<tr> |
|
<th class="w-60 title"><?= __("Categoria") ?></th> |
|
<th class="w-20 title"><?= __("Importo del servizio/lavoro") ?></th> |
|
<th class="w-20 title"><?= __("Percentuale di partecipazione") ?></th> |
|
</tr> |
|
<? |
|
foreach($servizio["servizi"] AS $categoriaServizio) { |
|
?> |
|
<tr> |
|
<td > |
|
<? |
|
$elemento = $categorieST[$categoriaServizio["codice_categoria"]]; |
|
echo $elemento["id"] . " - " . $elemento["descrizione"]; |
|
?> |
|
</td> |
|
<td class="text-center"> |
|
<?= number_format($categoriaServizio["importo"],2,",",".") ?> |
|
</td> |
|
<td class="text-center"> |
|
<?= $categoriaServizio["percentuale"] ?>% |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
|
|
</table> |
|
<? |
|
} |
|
?> |
|
</div> |
|
|
|
</div> |
|
<? |
|
} |
|
?> |
|
|
|
</body> |
|
</html> |
|
<? |
|
$html = ob_get_clean(); |
|
$pdf = documentConverter::getPDFWithWKHTML($html, 'A4', 'portrait', false); |
|
} |
|
|
|
} |
|
} |
|
|
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
echo __("Errore download allegato"); |
|
die(); |
|
} else { |
|
header("Content-type: application/pdf"); |
|
header("Content-Disposition: inline; filename=export.pdf"); |
|
echo $pdf; |
|
} |
|
|
|
|
|
?>
|
|
|