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.
 
 
 
 
 

200 righe
9.1 KiB

<?
$configPath = substr(__DIR__, 0, strpos(__DIR__, "public_html")) . "/config.php";
include_once($configPath);
$id_modulo = "lotti";
$cmd_info = gara::getInfoModulo($id_modulo);
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"], $_GET["codice"], $id_modulo)) {
$codice_round = $_GET["codice_round"] ?? NULL;
$gara = gara::init($_GET["codice"], $codice_round);
if (!empty($gara)) {
$procedura = $gara->getProcedura();
if (!$procedura["multiLotto"]) {
$cmd_info["titolo"] = "Informazioni affidamento";
}
$record = $gara->info;
$round = $gara->round;
$lock = $gara->checkLock($cmd_info["id"]);
$canAddOrRemoveLotti = $gara->canAddOrRemoveLotti();
$titolo_modulo = __($cmd_info["titolo"]);
$lotti = $gara->getLotti();
$breadcrumb = array();
$breadcrumb["/" . $radice . "/"] = Modulo::getInfo($radice)["titolo"];
$breadcrumb["/" . $radice . "/panel.php?codice=" . $record["codice"] . "&codice_round=" . $round["codice"]] = __("Pannello");
$breadcrumb[""] = $titolo_modulo;
include_once($beRoot . "/layout/top.php");
?><h1><?= $titolo_modulo ?></h1>
<div id="commands" class="mb-5">
<div class="commands container-fluid">
<div class="row">
<div class="col-12 text-right">
<?php if($canAddOrRemoveLotti) : ?>
<? if (!$lock && $procedura["multiLotto"]) { ?>
<button onClick="showModalWithURL('massive/form.php?codice_gara=<?= $record["codice"] ?>')" class="btn btn-warning" title="<?= __('Importazione massiva') ?>"><span class="fa fa-upload"></span> <?= __('Importazione massiva') ?></button>
<? if (!empty($lotti)) { ?>
<button id="createLotto" onClick="showModalWithURL('edit.php?codice_gara=<?= $record["codice"] ?>&codice=0')" class="btn btn-success" title="<?= __('Aggiungi nuovo') ?>"><span class="fa fa-plus-circle"></span> <?= __('Aggiungi nuovo') ?></button>
<? } ?>
<? } ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?
if (!empty($lotti)) {
if (count($lotti) > 1) {
?>
<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"></th>
<th width="10">#</th>
<th width="10"><?= __("CIG") ?></th>
<th><?= __("descrizione") ?></th>
<th width="200"><?= __("Criterio") ?></th>
<th width="200"><?= __(getTipologieAffidamento(false, $gara->info["timestamp_creazione"])[$gara->info["tipologia"]]["titolo"]) ?></th>
<th width="200"><?= __("Costo manodopera") ?></th>
<th width="200"><?= __("Oneri non soggetti a ribasso") ?></th>
<th width="200"><?= __("Opzioni e rinnovi") ?></th>
<th width="10"></th>
<th width="10"></th>
</tr>
</thead>
<tbody id="listlotti">
<?
$base = 0;
$manodopera = 0;
$noribasso = 0;
foreach ($lotti as $index => $lotto) {
$base += $lotto["importoBase"];
$manodopera += $lotto["importoManodopera"];
$noribasso += $lotto["oneriNoRibasso"];
$noribasso += $lotto["importoOpzioni"];
$lotto = gara::formatLotto($lotto,true);
$status = "bg-danger";
?>
<tr class="rowlotti">
<td width="10" class="handle"><span class="text-disabled fa fa-bars"></span></td>
<td width="10" class="numeroLotto"><?= $lotto["numero"] ?></td>
<td width="10"><?= $lotto["cig"] ?></td>
<td>
<input class="ordinamento" type="hidden" name="ordinamento-lotti[<?= $lotto["codice"] ?>]" value="<?= $lotto["ordinamento"] ?? $index ?>">
<strong><?= $lotto["oggetto"] ?></strong>
</td>
<td><?= getCriteri(false,$gara->info["timestamp_creazione"])[$lotto["criterio"]]["titolo"] ?></td>
<td class="text-right">&euro; <?= $lotto["importoBase"] ?></td>
<td class="text-right">&euro; <?= $lotto["importoManodopera"] ?></td>
<td class="text-right">&euro; <?= $lotto["oneriNoRibasso"] ?></td>
<td class="text-right">&euro; <?= $lotto["importoOpzioni"] ?? "0,00" ?></td>
<td width="10">
<button onClick="showModalWithURL('edit.php?codice_gara=<?= $record["codice"] ?>&codice=<?= $lotto["codice"] ?>')" class="btn btn-block btn-sm btn-info" title="<?= $lock ? __('visualizza') : __('modifica') ?>"><span class="fa fa-<?= $lock ? "search" : "edit" ?>"></span></button>
</td>
<td width="10">
<?php if($canAddOrRemoveLotti) : ?>
<? if (!$lock) { ?><button title="<?= __("elimina") ?>" class="btn btn-sm btn-danger" onclick="elimina('<?= $lotto["codice"] ?>','gare/lotti','codice_gara=<?= $lotto["codice_gara"] ?>');"><span class='fa fa-times'></span></button><? } ?>
<?php endif; ?>
</td>
</tr>
<?
}
if ($gara->normaRiferimento == "2016-50") {
$totaleLotti = $base+$noribasso;
} else {
$totaleLotti = $base+$manodopera+$noribasso;
}
$totaleGara = $gara->getTotaleImporti();
$differenza = $totaleGara - $totaleLotti;
$differenza = number_format($differenza, 2, '.', '');
?>
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-right"><?= __("Totali") ?></td>
<td class="text-right">&euro; <?= number_format($base,2,",",".") ?></td>
<td class="text-right">&euro; <?= number_format($manodopera,2,",",".") ?></td>
<td colspan="2" class="text-right">&euro; <?= number_format($noribasso,2,",",".") ?></td>
<td></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">&euro; <?= number_format($totaleLotti,2,",",".") ?></td>
<td class="text-center">&euro; <?= number_format($totaleGara,2,",",".") ?></td>
<td class="text-center <?= ($differenza >= 1 || $differenza <= -1) ? "text-danger" : "text-success" ?>">&euro; <?= number_format($differenza,2,",",".") ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<?
if (!$lock && $canAddOrRemoveLotti) {
?>
<script>
$("#listlotti").sortable({
handle: ".handle",
update: function(event, ui) {
$(".rowlotti", "#listlotti").each(function(index, el) {
$(this).find('.ordinamento').val(index);
$(this).find('.numeroLotto').html(index + 1);
});
let data = $('.ordinamento').serialize();
data += "&codice=<?= $gara->info["codice"] ?>";
$.ajax({
type: "POST",
url: '/backend/gare/lotti/save-order.php',
data: data,
async: true
});
}
});
</script>
<?
}
} else {
$lotto = reset($lotti);
include(__DIR__."/edit.php");
}
if (!$lock && !empty($_GET["createLotto"])) { ?>
<script>$("#createLotto").trigger('click');</script>
<? }
} else {
if (!$lock && empty($lotti)) {
$lotto = get_campi("b_gare_lotti");
$lotto["oggetto"] = strip_tags($gara->info["oggetto"]);
include(__DIR__."/edit.php");
} else {
alertManager::printWarningBox(__("Nessun risultato"));
}
}
$gara->alertModifichePericolose($id_modulo);
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();
}
?>