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.
 
 
 
 
 

51 righe
1.9 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$error = true;
$id_modulo = "allegati";
$cmd_info = gara::getInfoModulo($id_modulo);
if (!empty($_POST) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_POST["codice"],$id_modulo) && tokenVerify()) {
$errori_upload = array();
$codice_round = $_POST["codice_round"] ?? NULL;
$gara = gara::init($_POST["codice"],$codice_round);
if (!empty($gara)) {
$record = $gara->info;
$round = $gara->round;
$lock = $gara->checkLock($cmd_info["id"]);
$keys = ["public","reserved"];
if (!$gara->round["infoFase"]["aperta"]) {
$keys[] = "invitati";
}
if ($gara->accessoAttiAutomatico()) {
$keys[] = "accessoatti";
}
foreach($keys AS $key) {
if (isset($_POST["allegato-{$key}"])) {
foreach($_POST["allegato-{$key}"] as $allegato) {
if (filesManager::saveFile($allegato["filename"],$round["codice"],"gare-{$key}",$allegato["nome"] ?? "","A",$allegato["classificazione"] ?? "") === false) {
$errori_upload[] = $allegato["filename"];
} else {
$gara->addToLog("UPLOAD",$allegato["filename"]);
}
}
}
}
if (empty($errori_upload)) {
$error = false;
?>
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.href="/backend/gare/panel.php?codice=<?= $record["codice"] ?>&codice_round=<?= $round["codice"] ?>"; });
<?
} 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();
}
?>