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.
99 righe
4.9 KiB
99 righe
4.9 KiB
<?php |
|
if (!empty($input) && !empty($name) && isset($this) && is_a($this,"FormManager") && isset($_SESSION["utente"])) { |
|
$_element_id = $this->element_id; |
|
$_element_type = $this->element_type; |
|
$allowed_type = ["albo_fornitori","oe"]; |
|
$_showSOA = false; |
|
$years = []; |
|
for($i = 5;$i>0;$i--) { |
|
$years[] = (int)date("Y") - $i; |
|
} |
|
if (!empty($_element_type)) { |
|
if (strpos($_element_type,"-") !== false) { |
|
$_element_type = explode("-",$_element_type)[0]; |
|
} |
|
if (in_array($_element_type,$allowed_type)) { |
|
if (empty($this->element_id) && !empty($_SESSION["utente"]->oe)) { |
|
$codice_oe = $_SESSION["utente"]->oe["codice"]; |
|
} else { |
|
if ($_element_type == "albo_fornitori") { |
|
$tmp = $this->pdo->go("SELECT codice_operatore FROM r_partecipanti_albo WHERE codice = :codice",[":codice"=>$_element_id]); |
|
if ($tmp->rowCount() === 1) { |
|
$codice_oe = $tmp->fetch(PDO::FETCH_COLUMN); |
|
} |
|
} else if ($_element_type == "oe") { |
|
$codice_oe = $_element_id; |
|
} |
|
} |
|
if (!empty($codice_oe)) { |
|
if ($_SESSION["utente"]->gerarchia < 99 || (!empty($_SESSION["utente"]->oe) && $codice_oe == $_SESSION["utente"]->oe["codice"])) { |
|
$_showSOA = true; |
|
$soa = oeManager::getSOA($codice_oe); |
|
$fatturati = oeManager::getFatturatiSOA($codice_oe); |
|
$categorieSOA = getCategorieSOA(); |
|
$classificheSOA = getClassificheSOA(); |
|
|
|
if (!empty($soa)) { |
|
?> |
|
<table class="table table-striped"> |
|
<thead> |
|
<tr> |
|
<th colspan="2"><?= __("Attestazione SOA") ?></th> |
|
</tr> |
|
<tr> |
|
<th><?= __("Categoria") ?></th> |
|
<th><?= __("Classifica") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<?php foreach($soa AS $categoria) : |
|
$cat = $categorieSOA[$categoria["codice_categoria"]]; |
|
$cl = $classificheSOA[$categoria["codice_classifica"]]; |
|
?> |
|
<tr> |
|
<td><?= $cat["id"] ?> - <?= $cat["descrizione"] ?></td> |
|
<td><?= $cl["id"] ?></td> |
|
</tr> |
|
<?php endforeach ?> |
|
</tbody> |
|
</table> |
|
<? |
|
} |
|
|
|
if (!empty($fatturati)) { |
|
?> |
|
<table class="table table-striped"> |
|
<thead> |
|
<tr> |
|
<th colspan="<?= count($years) + 1 ?>"><?= __("Fatturati") ?></th> |
|
</tr> |
|
<tr> |
|
<th><?= __("Categoria") ?></th> |
|
<?php foreach ($years AS $year) : ?> |
|
<th><?= $year ?></th> |
|
<?php endforeach ?> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<?php foreach($fatturati AS $categoria => $fatturato) : |
|
$cat = $categorieSOA[$categoria]; |
|
?> |
|
<tr> |
|
<td><?= $cat["id"] ?> - <?= $cat["descrizione"] ?></td> |
|
<?php foreach ($years AS $year) : ?> |
|
<th><?= $fatturato[$year] ?? "" ?></th> |
|
<?php endforeach ?> |
|
</tr> |
|
<?php endforeach ?> |
|
</tbody> |
|
</table> |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (!$_showSOA) { |
|
alertManager::printInfoCompact(__("Riepilogo non disponibile")); |
|
} |
|
}
|