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.
32 righe
1.1 KiB
32 righe
1.1 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("form",$_POST["codice"]) && tokenVerify()) { |
|
$_POST["titolo"] = json_encode($_POST["titolo"]); |
|
$_POST["descrizione"] = json_encode($_POST["descrizione"]); |
|
$_POST["codice_ente"] = 0; |
|
if (!empty($_SESSION["ente"]->codice)) { $_POST["codice_ente"] = $_SESSION["ente"]->codice; } |
|
$salva = new salva(); |
|
$salva->debug = false; |
|
|
|
$salva->nome_tabella = "b_form"; |
|
$salva->operazione = empty($_POST["codice"]) ? "INSERT" : "UPDATE"; |
|
$salva->oggetto = $_POST; |
|
$codice = $salva->save(); |
|
if ($codice !== false) { |
|
$error = false; |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.href="/backend/form/edit.php?codice=<?= $codice ?>"; }); |
|
<? |
|
} else { |
|
?> |
|
swal({title:js_dict.error,html:js_dict["error-generic"],type:"error"}); |
|
<? |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|