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.
122 righe
4.8 KiB
122 righe
4.8 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
$id_modulo = "progettazione"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && !empty($_GET["codice_lotto"])) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$gara = gara::init($_GET["codice"],$codice_round); |
|
if (!empty($gara) && $gara->setLotto($_GET["codice_lotto"])) { |
|
$error = false; |
|
$record = $gara->info; |
|
$round = $gara->round; |
|
$lotto = $gara->lotto; |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
|
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/".$radice."/panel.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Pannello"); |
|
if (count($gara->getLotti()) > 1) { |
|
$breadcrumb["/".$radice."/progettazione/index.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Scelta lotto"); |
|
} |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
?> |
|
<h1> |
|
<?= $titolo_modulo ?> |
|
</h1> |
|
<h3><?= __("Lotto") . " " . $lotto["numero"] ?> - <?= $lotto["oggetto"] ?></h3> |
|
<? if (empty($lock)) { ?> |
|
<form rel="validate" method="post" action="save.php" id="edit-form"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice" type="hidden" name="codice" value="<?= $record["codice"] ?>"> |
|
<input id="codice_lotto" type="hidden" name="codice_lotto" value="<?= $lotto["codice"] ?>"> |
|
<? } else { ?><div id="edit-form"><?} ?> |
|
<div class="card"> |
|
<div class="card-body m-0 p-0"> |
|
<table class="table table-striped table-hover"> |
|
<thead> |
|
<tr> |
|
<th><?= __("Categoria") ?></th> |
|
<th width="10%"><?= __("Importo") ?></th> |
|
<th width="1%"></th> |
|
</tr> |
|
</thead> |
|
<tbody id="categorie-body"> |
|
<? |
|
$somma = 0; |
|
$categorie = $gara->getProgettazione(); |
|
if (!empty($categorie)) { |
|
foreach($categorie AS $categoria) { |
|
$somma += $categoria["importo"]; |
|
include(__DIR__."/tr-categoria.php"); |
|
} |
|
} else { |
|
$categoria = get_campi("b_gare_progettazione"); |
|
$categoria["codice"] = $id = "i_"; |
|
$categoria["prevalente"] = "S"; |
|
include(__DIR__."/tr-categoria.php"); |
|
} |
|
?> |
|
</tbody> |
|
<tfoot> |
|
<tr> |
|
<td class="text-right"><?= __("Totale") ?></td> |
|
<td id="sommaTotale" class="text-right">€ <?= number_format($somma,2,",",".") ?></td> |
|
<td></td> |
|
</tr> |
|
<tr> |
|
<td class="text-right"><?= __("Importo lotto") ?></td> |
|
<td class="text-right">€ <?= number_format($lotto["importoBase"]+$lotto["importoManodopera"]+$lotto["oneriNoRibasso"],2,",",".") ?></td> |
|
<td></td> |
|
</tr> |
|
<tr> |
|
<td colspan="3"> |
|
<button type="button" onClick="aggiungi('/backend/gare/progettazione/tr-categoria.php','#categorie-body');" class="btn btn-primary btn-block"> |
|
<span class="fa fa-plus"></span> <?= __("Aggiungi categoria") ?> |
|
</button> |
|
</td> |
|
</tr> |
|
</tfoot> |
|
</table> |
|
</div> |
|
<div class="card-footer"> |
|
<? if (empty($lock)) { ?> |
|
<button type="submit" class="btn btn-block btn-success" > |
|
<span class="fa fa-save"></span> <?= __("Salva") ?> |
|
</button> |
|
<? } ?> |
|
</div> |
|
</div> |
|
<? if (empty($lock)) { ?> |
|
</form> |
|
<script> |
|
function updateSomma() { |
|
var somma = 0; |
|
$(".importo").each(function() { |
|
msg = valida($(this)); |
|
if (msg.length == 0) { |
|
somma += parseFloat($(this).val()); |
|
} |
|
}); |
|
$("#sommaTotale").html("€ "+ number_format(somma,2,",",".")); |
|
} |
|
</script> |
|
<? |
|
} else { |
|
?> |
|
<script>$(":input","#edit-form").not(".ignore-lock").attr("disabled","disabled").trigger("chosen:updated");</script> |
|
<? |
|
} |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} |
|
} |
|
if ($error) { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?> |
|
|