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.
59 righe
2.3 KiB
59 righe
2.3 KiB
<? |
|
|
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
$id_modulo = "lotti"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
|
|
if (!empty($_POST) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_POST["codice_gara"],$id_modulo) && tokenVerify() && $_SESSION["utente"]->unlockSupporto()) { |
|
$gara = gara::init($_POST["codice_gara"]); |
|
if (!empty($gara)) { |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
if ($lock) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
$codice = $gara->saveLotto($_POST); |
|
if ($codice !== false) { |
|
$error = false; |
|
$action = (empty($_POST["codice"])) ? "INSERT" : "UPDATE"; |
|
$canAdd = $gara->canAddOrRemoveLotti(); |
|
if($action == "INSERT" && !$canAdd) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
$gara->addToLog($action,__("Lotto") . " #" . $codice . ": " . $_POST["oggetto"]); |
|
if (empty($_POST["codice"]) && $gara->getProcedura()["multiLotto"]) { |
|
if(!empty($_POST['marketplace']) && $_POST['marketplace'] == true){ |
|
return ['save' => true, 'codice' => $codice]; |
|
}else{ |
|
?> |
|
swal({title:js_dict["success-msg"],html:'<?= __("Vuoi creare un altro lotto?") ?>',type:"info",showCancelButton:true,confirmButtonText: '<?= __("Si") ?>',cancelButtonText: '<?= __("No") ?>'}).then((result) => { |
|
refreshURL = "/backend/gare/panel.php?codice=<?= $gara->info["codice"] ?>"; |
|
if (result.value) { |
|
refreshURL = "/backend/gare/lotti/index.php?codice=<?= $gara->info["codice"] ?>&createLotto=1"; |
|
} |
|
window.location.href=refreshURL; |
|
}); |
|
<? |
|
} |
|
} else { |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ |
|
<? if (count($gara->getLotti()) > 1) { ?> |
|
window.location.reload(); |
|
<? } else { ?> |
|
window.location.href="/backend/gare/panel.php?codice=<?= $gara->info["codice"] ?>"; |
|
<? } ?> |
|
}); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|