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.
88 righe
3.9 KiB
88 righe
3.9 KiB
<?php |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "sorteggio-anomalia"; |
|
$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"])) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$gara = gara::init($_GET["codice"],$codice_round); |
|
if (!empty($gara)) { |
|
$record = $gara->info; |
|
$round = $gara->round; |
|
$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"); |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
?><h1><?= $titolo_modulo ?></h1><? |
|
if (!isset($_GET["codice_lotto"])) { |
|
$gara->printSelectLottiConditions = ["hasPartecipanti"]; |
|
$gara->printSelectLotto("index.php?codice=".$record["codice"]."&codice_round=".$round["codice"],false); |
|
} else { |
|
if ($gara->setLotto($_GET["codice_lotto"])) { |
|
$algoritmo = $gara->getAnomaliaSorteggiata(); |
|
if (empty($algoritmo)) { |
|
if (!$lock) { |
|
if (empty($gara->getAggiudicatari())) { |
|
$algoritmi = $gara->getAlgoritmoAnomalia(true); |
|
if (!empty($algoritmi)) { |
|
?> |
|
<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_lotto" value="<?= $gara->lotto["codice"] ?? 0 ?>"> |
|
<input id="codice_gara" type="hidden" name="codice_gara" value="<?= $record["codice"] ?>"> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<span class="card-title h3"><?= __("Algoritmi disponibili") ?></span> |
|
</div> |
|
<div class="card-body"> |
|
<table class="table table-striped"> |
|
<? foreach($algoritmi AS $algoritmo) { ?> |
|
<tr> |
|
<td><?= $algoritmo["riferimento"] ?></td> |
|
</tr> |
|
<? } ?> |
|
</table> |
|
</ul> |
|
</div> |
|
<div class="card-footer"> |
|
<button type="submit" class="btn btn-block btn-primary"><?= __("Sorteggia") ?></button> |
|
</div> |
|
</div> |
|
</form> |
|
<? |
|
} else { |
|
alertManager::printAlertBox(__("Nessun algoritmo disponibile")); |
|
} |
|
} else { |
|
alertManager::printAlertBox(__("Calcolo graduatoria già effettuato")); |
|
} |
|
} else { |
|
alertManager::printWarningBox(__("Effettua selezione da proposta di aggiudicazione")); |
|
} |
|
} else { |
|
$algoritmo = gara::algoritmiAnomalie()[$algoritmo] ?? null; |
|
if (isset($algoritmo)) { |
|
alertManager::printSuccessBox(__("Algoritmo sorteggiato"),$algoritmo["riferimento"]); |
|
} else { |
|
alertManager::printAlertBox(__("Algoritmo sconosciuto")); |
|
} |
|
} |
|
} else { |
|
alertManager::printAlertBox(__("Lotto sconosciuto")); |
|
} |
|
} |
|
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(); |
|
} |
|
?>
|
|
|