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.
45 righe
1.6 KiB
45 righe
1.6 KiB
<? |
|
|
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"public_html/"))."config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
$id_modulo = "atti"; |
|
if (!empty($_POST) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_POST["codice_cpn"],$id_modulo) && tokenVerify() && $_SESSION["utente"]->unlockSupporto()) { |
|
$cpn = attiCPN::init($_POST["codice_cpn"]); |
|
if (!empty($cpn) && !$cpn->checkLock($id_modulo)) { |
|
$error = false; |
|
$atto = $cpn->getAtti($_POST["codice"])[0] ?? null; |
|
if (!empty($atto)) { |
|
|
|
if (!empty($_POST["suggerimento"])) { |
|
$cpn->linkAttoAllegato($atto["codice"],$_POST["suggerimento"]); |
|
} |
|
if (isset($_POST["allegato-public"])) { |
|
foreach($_POST["allegato-public"] as $allegato) { |
|
if (filesManager::saveFile($allegato["filename"],$atto["codice"],"cpn-public",$allegato["nome"] ?? "","A",$allegato["classificazione"] ?? "") === false) { |
|
$errori_upload[] = $allegato["filename"]; |
|
} |
|
} |
|
} |
|
if (empty($errori_upload)) { |
|
if (!empty($atto["idRicevuto"])) { |
|
$pdo->go("UPDATE b_cpn_atti SET stato = 50 WHERE codice = :codice",[":codice"=>$atto["codice"]]); |
|
} |
|
$error = false; |
|
?> |
|
window.location.reload(); |
|
<? |
|
} else { |
|
$error = false; |
|
?> |
|
swal({title:js_dict.error,html:"<?= __("Errore upload") ?>:<br><?= implode("<br>",$errori_upload) ?>",type:"error"}); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|