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.
94 righe
4.1 KiB
94 righe
4.1 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"]); |
|
$criterio = $gara->getCriteri($_GET["codice"])[0] ?? false; |
|
} |
|
if (!empty($criterio)) { |
|
$error = false; |
|
if (!$lock) { |
|
?> |
|
<div class="text-right mb-3"> |
|
<button class="btn btn-warning" onclick="showModalWithURL('elencoPrezzi/massiveForm.php?codice_gara=<?= $record["codice"] ?>&codice_round=<?= $round["codice"] ?>&codice=<?= $criterio["codice"] ?>')"><span class="fa fa-table"></span> <?= __("Caricamento massivo") ?></button> |
|
</div> |
|
<form rel="validate" method="post" action="elencoPrezzi/save.php" id="edit-ep"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice" type="hidden" name="codice_criterio" 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-ep"> |
|
<? } ?> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<span class="card-title"><?= __("Voci") ?></span> |
|
</div> |
|
<div class="card-body"> |
|
<table class="table table-striped table-condensed" > |
|
<thead> |
|
<tr> |
|
<th width="10"></th> |
|
<th><?= __("Voce") ?></th> |
|
<th width="10%"><?= __("Unità di misura") ?></th> |
|
<th width="10%"><?= __("Tipologia") ?></th> |
|
<th width="10%"><?= __("Quantita") ?></th> |
|
<th width="10"></th> |
|
</tr> |
|
</thead> |
|
<tbody id="list-ep"> |
|
<? |
|
$elencoPrezzi = $gara->getElencoPrezzi($criterio["codice"]); |
|
$showSave = false; |
|
if (!empty($elencoPrezzi)) { |
|
$showSave = true; |
|
foreach($elencoPrezzi AS $input) { |
|
$id = $input["codice"]; |
|
include("elencoPrezzi/tr-edit.php"); |
|
} |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
<? if (empty($lock)) { ?> |
|
<script> |
|
$( "#list-ep" ).sortable({ |
|
handle: ".handle", |
|
update: function( event, ui ) { |
|
$(".voce-edit","#list-ep").each(function(index, el) { |
|
$(this).find(".ordinamento").val(index); |
|
}); |
|
} |
|
}); |
|
// $( "#sortable" ).disableSelection(); |
|
</script> |
|
<div class="card-footer"> |
|
<button onclick="aggiungi('elencoPrezzi/tr-edit.php','#list-ep'); $('#ep-save').slideDown(); return false" class="btn btn-sm btn-info btn-block"><span class="fa fa-plus-circle"></span> <?= __("Aggiungi nuovo") ?></button> |
|
</div> |
|
</div> |
|
<button id="ep-save" class="btn <?= ($showSave) ? "" :"collapse" ?> btn-success btn-block mt-2"><span class="fa fa-save"></span> <?= __("Salva") ?></button> |
|
</form> |
|
<? |
|
} else { |
|
?> |
|
</div> |
|
</div> |
|
<script>$(":input","#edit-ep").not(".ignore-lock").attr("disabled","disabled").trigger("chosen:updated");</script> |
|
<? |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|