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.
35 righe
1.1 KiB
35 righe
1.1 KiB
<? |
|
$error = true; |
|
if (!empty($_POST["contesto"]) && $_POST["contesto"] == "gare") { |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "/public_html")) . "/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "inviti"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice, $_POST["codice_elemento"], $id_modulo)) { |
|
$gara = gara::init($_POST["codice_elemento"]); |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
if (!empty($gara) && !$lock) { |
|
try { |
|
$gara->sorteggiaInvitati($_POST["managerToken"],$_POST["sub_elemento"],$_POST["numero_partecipanti"], $_POST["descrizione"],$_POST["esclusioni"] ?? []); |
|
} catch (\Throwable $th) { |
|
$errore = $th->getMessage(); |
|
} |
|
$error = false; |
|
if (empty($errore)) { |
|
?> |
|
window.location.reload(); |
|
<? |
|
} else { |
|
?> |
|
swal({title:"<?= __("Errore nel sorteggio") ?>",html:"<?= __($errore) ?>",type:"error"}); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
|
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|