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.
 
 
 
 
 

50 righe
1.7 KiB

<?
$unpurified = $_POST['pec'];
$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()) {
if (!empty($_POST["pec"])) {
$error_pec = array();
$correct = array();
foreach($_POST["pec"] AS $id => $pec) {
$titolo_pec = $pec["pec"];
$pec["codice_ente"] = $_SESSION["ente"]->codice;
$pec["password"] = simple_encrypt($unpurified[$id]["password"],$_SESSION["ente"]->getInfo()["cf"]);
$salva = new salva();
$salva->debug = false;
$salva->nome_tabella = "b_pec";
$salva->operazione = empty($pec["codice"]) ? "INSERT" : "UPDATE";
$salva->oggetto = $pec;
$codice = $salva->save();
if ($codice === false) {
$error_pec[] = $titolo_pec;
} else {
$correct[$id] = $codice;
}
}
if (count($error_pec) === 0) {
?>
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.reload(); });
<?
} else {
$html = "";
foreach($error_pec AS $errore) $html .= __("Errore") . " - " . $errore;
foreach ($correct as $id => $codice) { ?>
$("#row-<?= $id ?>").attr("id","row-<?= $codice ?>").load('view-row.php?codice=<?= $codice ?>');
<? } ?>
f_ready();
swal({title:js_dict.error,html:"<?= $html ?>" + "<br>Error: # 1",type:"error"});
<?
}
} else {
?>
swal({title:js_dict.error,html:"<?= __("no-record-modify") ?><br>Error: # 0",type:"warning"});
<?
}
} else {
header('HTTP/1.0 403 Forbidden');
die();
}
?>