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.
 
 
 
 
 

91 righe
4.0 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$id_modulo = "criteri";
$cmd_info = gara::getInfoModulo($id_modulo);
$error = true;
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_GET["codice_gara"],$id_modulo)) {
$codice_round = $_GET["codice_round"] ?? NULL;
$gara = gara::init($_GET["codice_gara"],$codice_round);
if (!empty($gara)) {
$record = $gara->info;
$round = $gara->round;
$lock = $gara->checkLock($cmd_info["id"]);
$hasSub = false;
$criterio = $gara->getCriteri($_GET["codice"])[0];
if (!empty($criterio) && empty($criterio["codice_padre"])) {
$lotti = $gara->getLotti();
if (!empty($lotti)) {
$all = false;
$selezionati = $gara->getLottiFromCriterio($criterio["codice"]);
if (!empty($selezionati) && empty($selezionati[0])) {
$all = true;
}
$error = false;
if (empty($lock)) { ?>
<form rel="validate" method="post" action="bind.php" id="edit-form">
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>">
<input id="codice" type="hidden" name="codice" value="<?= $criterio["codice"] ?>">
<input id="codice_gara" type="hidden" name="codice_gara" value="<?= $record["codice"] ?>">
<input id="codice_round" type="hidden" name="codice_round" value="<?= $round["codice"] ?>">
<? } else { ?><div id="edit-form"><?} ?>
<strong class="h5"><?= $criterio["denominazione"] ?></strong><br>
<div class="card card-body">
<table class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th width="10">#</th>
<th><?= __("Lotto") ?></th>
<th width="200" class="text-center"><input type="checkbox" name="all" <?= ($all) ? "checked" : "" ?> onchange="$('.checkBoxLotto').slideToggle()"></th>
</tr>
</thead>
<tbody>
<? foreach($lotti as $lotto) { ?>
<tr>
<td class="text-center"><?= $lotto["numero"] ?></td>
<td><?= $lotto["oggetto"] ?></td>
<td class="text-center">
<? if ($criterio["economico"] == "S" || $lotto["criterio"] != 'prezzo') { ?>
<div class="checkBoxLotto <?= ($all) ? "collapse" : "" ?>">
<input type="checkbox" <?= (in_array($lotto["codice"],$selezionati) !== false) ? "checked" : "" ?> name="lotti[]" value="<?= $lotto["codice"] ?>" class="checkLotto">
</div>
<div class="checkBoxLotto <?= (!$all) ? "collapse" : "" ?>">
<span class="fa fa-check text-success"></span>
</div>
<? } else { ?>
<span class="text-danger"><?= __("Criterio incompatibile") ?></span>
<? } ?>
</td>
</tr>
<? } ?>
</tbody>
</table>
</div>
<? if (empty($_GET["_disableRefresh"])) { ?>
<script>
$('#modal-helper').on('hidden.bs.modal', function (e) {
modalURL = [];
window.location.reload();
})
</script>
<? } ?>
<? if (empty($lock)) { ?>
<button class="btn btn-success btn-block mt-2"><span class="fa fa-save"></span> <?= __("Salva") ?></button>
</form>
<?
} else {
?>
<script>
$(":input","#edit-form").not(".ignore-lock").attr("disabled","disabled").trigger("chosen:updated");
</script>
<?
}
}
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}
?>