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.
114 righe
4.5 KiB
114 righe
4.5 KiB
<? |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "public_html")) . "/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "buste"; |
|
$cmd_info = concorso::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"], $_GET["codice"], $id_modulo)) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$concorso = concorso::init($_GET["codice"], $codice_round); |
|
if (!empty($concorso)) { |
|
$record = $concorso->info; |
|
$round = $concorso->round; |
|
$lock = $concorso->checkLock($cmd_info["id"]); |
|
$lotti = $concorso->getLotti(); |
|
$multiLotto = (count($concorso->getLotti()) > 1); |
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
$printSelect = true; |
|
if (isset($_GET["codice_lotto"])) { |
|
$printSelect = false; |
|
if (!empty($_GET["codice_lotto"])) { |
|
$concorso->setLotto($_GET["codice_lotto"]); |
|
$lotto = $concorso->lotto; |
|
} |
|
} |
|
if (!empty($round)) { $titolo_modulo .= " - " . $round["numero"]; } |
|
|
|
|
|
$breadcrumb = array(); |
|
$breadcrumb["/" . $radice . "/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/" . $radice . "/panel.php?codice=" . $record["codice"] . "&codice_round=" . $round["codice"]] = __("Pannello"); |
|
if (isset($_GET["codice_lotto"]) && $multiLotto) { |
|
$breadcrumb["/".$radice."/buste/index.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Selezione lotto"); |
|
} |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once($beRoot . "/layout/top.php"); |
|
if ($printSelect) { |
|
$concorso->printSelectLotto("{$_SERVER["PHP_SELF"]}?codice=".$record["codice"]."&codice_round=".$round["codice"],true); |
|
} else { |
|
|
|
?> |
|
<h1> |
|
<?= $titolo_modulo ?> |
|
</h1> |
|
<?= (!empty($lotto)) ? "<h4><span class='fa fa-list'></span> {$lotto["oggetto"]}</h4>" : "" ?> |
|
<? if (!empty($lotto) && !$lock && ($lotto["stato"] == 95 || $lotto["stato"] == 99)) { |
|
alertManager::printAlertBox(__("Lotto incompatibile")); |
|
} else { |
|
?> |
|
<div class="row mb-2"> |
|
<? |
|
$buste = $concorso->busteDisponibili(); |
|
$col = 12 / count($buste); |
|
foreach ($buste as $id_busta => $busta) { |
|
?> |
|
<div class="col-12 col-lg-<?= $col ?>"> |
|
<div class="card"> |
|
<div class="card-header text-center"> |
|
<span class="fa fa-folder fa-2x"></span><br> |
|
<strong><?= __($busta["titolo"]) ?></strong> |
|
</div> |
|
<div class="card-body" id="richieste-<?= $id_busta ?>"> |
|
<? |
|
$richieste = $concorso->getRichieste($id_busta); |
|
if (!empty($richieste)) { |
|
foreach ($richieste as $input) { |
|
$id = $input["codice"]; |
|
include("tr-edit.php"); |
|
} |
|
} else { |
|
$printAuto = true; |
|
} |
|
?> |
|
</div> |
|
<? if (!$lock) { ?> |
|
<div class="card-footer"> |
|
<button onclick="showModalWithURL('edit.php?codice_concorso=<?= $record["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?? null ?>&codice_round=<?= $round["codice"] ?>&busta=<?= $id_busta ?>'); return false" class="btn btn-sm btn-info btn-block"><span class="fa fa-plus-circle"></span> <?= __("Aggiungi nuovo") ?></button> |
|
</div> |
|
<? } ?> |
|
</div> |
|
</div> |
|
<? if (!$lock) { ?> |
|
<script> |
|
$("#richieste-<?= $id_busta ?>").sortable({ |
|
handle: ".handle", |
|
update: function(event, ui) { |
|
$(".input-edit", "#richieste-<?= $id_busta ?>").each(function(index, el) { |
|
$(this).find(".ordinamento").val(index); |
|
}); |
|
$.ajax({ |
|
type: "POST", |
|
url: '/backend/concorsi/buste/save-order.php', |
|
data: $('.ordinamento').serialize(), |
|
async: true |
|
}); |
|
} |
|
}); |
|
// $( "#sortable" ).disableSelection(); |
|
</script> |
|
<? } ?> |
|
<? } ?> |
|
</div> |
|
<? |
|
} |
|
} |
|
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(); |
|
} |
|
?>
|