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
50 righe
1.7 KiB
<?php |
|
ob_start(); |
|
$configPath = substr(__DIR__, 0, strpos(__DIR__, "/public_html")) . "/config.php"; |
|
include_once $configPath; |
|
|
|
$codice = intval($_POST["codice"] ?? 0); |
|
|
|
$npa = NuovaPiattaformaAppalti::init(null, $codice); |
|
// Verifica utente |
|
if(!$npa->verifyUtente()) { die_forbidden(); } |
|
if (!empty($npa->scheda) && $codice == ($npa->scheda["codice"] ?? 0)) { |
|
$return_url = "/"; |
|
if (!empty($npa->lot)) { |
|
$return_url = "/backend/npa/lotti/panel.php?codice_lotto={$npa->lot["codice_lotto_npa"]}&codice_fascicolo={$npa->fascicolo["codice"]}"; |
|
} elseif (!empty($npa->fascicolo["modulo_riferimento"]) && !empty($npa->fascicolo["id_riferimento"])) { |
|
$return_url = "/backend/{$npa->fascicolo["modulo_riferimento"]}/npa/index.php?codice={$npa->fascicolo["id_riferimento"]}"; |
|
} |
|
|
|
|
|
$result = $npa->deleteScheda($message); |
|
// Catturiamo eventuali notice da PHP |
|
$notices = ob_get_clean(); |
|
if (!empty($notices)) { |
|
?> |
|
swal({ |
|
title: js_dict.attenzione, |
|
html: `<?= str_replace("`", "", htmlspecialchars($notices)) ?>`, |
|
type: "error" |
|
}).then(function(){ |
|
window.location.href = `<?= $return_url ?>`; |
|
}); |
|
<?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(){ |
|
<?= $result ? "window.location.href = `{$return_url}`" : "window.location.reload()" ?>; |
|
}); |
|
<? |
|
exit; |
|
} |
|
|
|
die_forbidden(); |
|
exit;
|