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.
51 righe
1.3 KiB
51 righe
1.3 KiB
<?php |
|
ob_start(); |
|
|
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once $configPath; |
|
|
|
|
|
$codice = $_POST["codice"] ?? $_GET["codice"]; |
|
$id_scheda = $_POST["id_scheda"] ?? $_GET["scheda"]; |
|
|
|
$npa = NuovaPiattaformaAppalti::init(null, $codice, $id_scheda); |
|
// Verifica utente |
|
if(!$npa->verifyUtente()) { |
|
die_forbidden(); |
|
} |
|
|
|
if(! empty($npa->fascicolo)) { |
|
$npa->verifyDelega(); |
|
|
|
$result = $npa->publish($message); |
|
|
|
// Catturiamo eventuali notice da PHP |
|
$notices = ob_get_clean(); |
|
if(!empty($notices)) { |
|
?> |
|
swal({ |
|
title: js_dict.attenzione , |
|
html: `<?= htmlspecialchars($notices) ?>`, |
|
type: "error" |
|
}).then(function(){ |
|
window.location.reload(); |
|
}); |
|
<?php |
|
exit; |
|
} |
|
|
|
?> |
|
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(); |
|
}); |
|
<? |
|
exit; |
|
|
|
} |
|
|
|
HTTPStatus(403); |
|
exit;
|