gestione gare pubbliche
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.
 
 
 
 
 

48 righe
1.4 KiB

<?
$error = true;
$configPath = substr(__DIR__, 0, strpos(__DIR__, "public_html")) . "/config.php";
include_once($configPath);
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission('programmazione-art21') && tokenVerify()) {
if (!empty($_POST["codice"])) {
$programma = Programma::init($_POST["codice"]);
$operazione = "UPDATE";
if (!empty($programma)) {
$continua = true;
if ($programma->info["stato"] == 50) {
$_POST["stato"] = 10;
}
}
} else {
$operazione = "INSERT";
$continua = true;
$_POST["timestamp_creazione"] = date("d/m/Y H:i:s");
$_POST["utente_creazione"] = $_SESSION["utente"]->codice;
}
if (!empty($continua)) {
$error = false;
$_POST["extraInfo"] = json_encode($_POST["extraInfo"]);
$salva = new salva();
$salva->debug = false;
$salva->nome_tabella = "b_programmi_art21";
$salva->operazione = $operazione;
$salva->oggetto = $_POST;
$codice = $salva->save();
if (!empty($codice)) {
?>
swal({title:js_dict["success-msg"],type:"success"}).then(function(){
window.location.reload();
});
<?
} else {
?>
swal({title:js_dict.error,html:js_dict["error-generic"],type:"error"});
<?
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}
?>