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.
63 righe
1.6 KiB
63 righe
1.6 KiB
<?php |
|
ob_start(); |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "/public_html")) . "/config.php"; |
|
include_once $configPath; |
|
|
|
$codice = $_POST["codice"] ?? null; |
|
|
|
if($codice == null) { |
|
die_forbidden(); |
|
} |
|
|
|
|
|
|
|
$npa = NuovaPiattaformaAppalti::init(null, $codice); |
|
?> |
|
|
|
<?php |
|
// Verifica utente |
|
if(!$npa->verifyUtente()) { |
|
die_forbidden(); |
|
} |
|
?> |
|
|
|
<?php if (!empty($npa->fascicolo) && !empty($npa->scheda) && $npa->scheda["stato"] < 90 && !empty($npa->scheda["codice_modifica"])) : ?> |
|
<?php |
|
|
|
$codice_modifica = $npa->scheda["codice_modifica"]; |
|
$result = $npa->updateScheda( |
|
[ |
|
"codice_modifica" => NULL, |
|
"codice_rettifica" => $codice_modifica, |
|
"stato" => 0, |
|
"errore" => "NO", |
|
] |
|
); |
|
// Catturiamo eventuali notice da PHP |
|
$notices = trim(ob_get_clean()); |
|
if (!empty($notices)) : |
|
?> |
|
swal({ |
|
title: js_dict.attenzione ?>, |
|
html: `<?= htmlspecialchars($notices) ?>`, |
|
type: "error" |
|
}).then(function(){ |
|
window.location.reload(); |
|
}); |
|
<?php exit; ?> |
|
<?php endif; ?> |
|
|
|
swal({ |
|
title: <?= $result ? 'js_dict["success-msg"]' : (str_starts_with($message, "INFO -") ? "`Informazione`" : "js_dict.attenzione") ?>, |
|
html: <?= $result ? 'js_dict["success-msg"]' : "`{$message}`" ?>, |
|
type: "<?= $result ? "success" : (str_starts_with($message, "INFO -") ? "info" : "error") ?>" |
|
}).then(function(){ |
|
window.location.reload() |
|
|
|
}); |
|
<?php exit; ?> |
|
<?php endif;?> |
|
<?php |
|
ob_get_clean(); |
|
HTTPStatus(403); |
|
exit;
|
|
|