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.
116 righe
4.8 KiB
116 righe
4.8 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"public_html/"))."config.php"; |
|
include_once($configPath); |
|
$id_modulo = "lotti"; |
|
$cmd_info = attiCPN::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"])) { |
|
$cpn = attiCPN::init($_GET["codice"]); |
|
if (!empty($cpn)) { |
|
$lock = $cpn->checkLock($id_modulo); |
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/".$radice."/panel.php?codice=".$cpn->info["codice"]] = __("Pannello"); |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
?> |
|
<h1> |
|
<?= $titolo_modulo ?> |
|
</h1> |
|
<? |
|
$lotti = $cpn->getLotti(); |
|
?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid text-right"> |
|
<button onclick="showModalWithURL('edit.php?codice_cpn=<?= $cpn->info["codice"] ?>&codice=0');" class="btn btn-success" title="<?= __('Aggiungi nuovo') ?>"><span class="fa fa-plus-circle mr-2"></span> <?= __('Aggiungi nuovo') ?></button> |
|
</div> |
|
</div> |
|
<? |
|
if (!empty($lotti)) { |
|
?> |
|
<div class="card mb-2"> |
|
<div class="card-body"> |
|
<div class="table-responsive"> |
|
<table class="table table-striped table-hover m-0"> |
|
<thead> |
|
<tr> |
|
<th width="10"><?= __("CIG") ?></th> |
|
<th><?= __("descrizione") ?></th> |
|
<th width="200"><?= __("Importo") ?></th> |
|
<th width="10"></th> |
|
<th width="10"></th> |
|
</tr> |
|
</thead> |
|
<tbody id="listlotti"> |
|
<? |
|
$totaleLotti = 0; |
|
foreach ($lotti as $lotto) { |
|
$totaleLotti += $lotto["importo"]; |
|
$status = "bg-danger"; |
|
?> |
|
<tr class="rowlotti"> |
|
<td width="10"><?= $lotto["cig"] ?></td> |
|
<td> |
|
<strong><?= $lotto["oggetto"] ?></strong> |
|
</td> |
|
<td class="text-right">€ <?= number_format($lotto["importo"],2,",",".") ?></td> |
|
<td width="10"> |
|
<button onClick="showModalWithURL('edit.php?codice_cpn=<?= $cpn->info["codice"] ?>&codice=<?= $lotto["codice"] ?>')" class="btn btn-block btn-sm btn-info" title="<?= __('modifica') ?>"><span class="fa fa-edit"></span></button> |
|
</td> |
|
<td width="10"> |
|
<? if (!$lock) { ?><button title="<?= __("elimina") ?>" class="btn btn-sm btn-danger" onclick="elimina('<?= $lotto["codice"] ?>','cpn/lotti','codice_cpn=<?= $lotto["codice_cpn"] ?>');"><span class='fa fa-times'></span></button><? } ?> |
|
</td> |
|
</tr> |
|
<? |
|
} |
|
$totaleGara = json_decode($cpn->info["dati"],true)["importo"]; |
|
$differenza = $totaleGara - $totaleLotti |
|
?> |
|
</tbody> |
|
<tfoot> |
|
<tr> |
|
<td colspan="2"></td> |
|
<td class="text-right">€ <?= number_format($totaleLotti,2,",",".") ?></td> |
|
<td></td> |
|
</tr> |
|
</tfoot> |
|
</table> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="card mb-2"> |
|
<div class="card-body"> |
|
<table class="table"> |
|
<thead> |
|
<tr> |
|
<th class="text-center"><?= __("Totale lotti") ?></th> |
|
<th class="text-center"><?= __("Totale gara") ?></th> |
|
<th class="text-center"><?= __("Differenza") ?></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<tr> |
|
<td class="text-center">€ <?= number_format($totaleLotti,2,",",".") ?></td> |
|
<td class="text-center">€ <?= number_format($totaleGara,2,",",".") ?></td> |
|
<td class="text-center <?= ($differenza != 0) ? "text-danger" : "text-success" ?>">€ <?= number_format($differenza,2,",",".") ?></td> |
|
</tr> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<? |
|
} else { |
|
alertManager::printWarningBox(__("Nessun risultato")); |
|
} |
|
|
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|