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.
42 righe
1.6 KiB
42 righe
1.6 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_POST) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && tokenVerify()) { |
|
$ente = Ente::getInfoFromID($_POST["codice"])[0] ?? null; |
|
if (!empty($ente)) { |
|
$error = false; |
|
|
|
$_POST["conservazione"] = json_decode($ente["conservazione"], TRUE); |
|
$_POST["conservazione"]["connettore"] = $_POST["connettore_conservazione"] ?? ""; |
|
$_POST["conservazione"]["tipologia"] = in_array($_POST["connettore_tipologia"], ['only', 'all']) ? $_POST["connettore_tipologia"] : 'all'; |
|
$_POST["conservazione"] = json_encode($_POST["conservazione"], JSON_PRETTY_PRINT); |
|
unset($_POST["connettore_conservazione"]); |
|
unset($_POST["connettore_tipologia"]); |
|
|
|
$salva = new salva(); |
|
$salva->debug = false; |
|
if (empty($_POST["tipoRichiesteArt80"])) { |
|
unset($_POST["tipoRichiesteArt80"]); |
|
} |
|
$salva->nome_tabella = "b_enti"; |
|
$salva->operazione = empty($_POST["codice"]) ? "INSERT" : "UPDATE"; |
|
$salva->oggetto = $_POST; |
|
$salva->ignore = ["token","logo"]; |
|
$codice = $salva->save(); |
|
if (!empty($codice)) { |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.href="/backend/enti/edit.php?codice=<?= $ente["codice"] ?>"; }); |
|
<? |
|
} else { |
|
?> |
|
swal({title:js_dict.error,text:js_dict["error-generic"],html:true,type:"error"}); |
|
<? |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|