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.
97 righe
2.4 KiB
97 righe
2.4 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
$error = true; |
|
|
|
if (!empty($_POST) && !empty($_SESSION["utente"]) && tokenVerify() && !$_SESSION["utente"]->isSupporto() && !empty(PublicProdotto::getBandiMercato())) { |
|
$error = false; |
|
|
|
if (!empty($_POST["cpv"])) { |
|
|
|
$prodotto = PublicProdotto::init($_POST['codice']); |
|
|
|
$operazione = "INSERT"; |
|
|
|
if(!empty($prodotto->info['confermato']) && $prodotto->info['confermato'] == 'N'){ |
|
$operazione = "UPDATE"; |
|
} |
|
|
|
if(!empty($prodotto)){ |
|
$error = false; |
|
|
|
$prodotto = $prodotto->salva($_POST); |
|
|
|
if(!empty($prodotto->info['codice'])){ |
|
|
|
if(!empty($_POST['cpv'])){ |
|
$cpv = $prodotto->salvaCPV($_POST['cpv']); |
|
if(!$cpv){ |
|
$error = true; |
|
} |
|
} |
|
|
|
if(!empty($_POST['spedizioni'])){ |
|
$spedizioni = $prodotto->salvaSpedizioni($operazione, $_POST); |
|
if(!$spedizioni){ |
|
$error = true; |
|
} |
|
} |
|
|
|
if(!empty($_POST['traduzione'])){ |
|
$traduzione = $prodotto->salvaTraduzioni($operazione, $_POST); |
|
if(!$traduzione){ |
|
$error = true; |
|
} |
|
} |
|
|
|
|
|
if(!empty($_POST['allegato'])){ |
|
$allegati = $prodotto->salvaAllegati($_POST['allegato'], "A"); |
|
|
|
if(!$allegati){ |
|
$error = true; |
|
} |
|
} |
|
|
|
if(!empty($_POST['allegato-multimedia'])){ |
|
$allegati = $prodotto->salvaAllegati($_POST['allegato-multimedia'], "M"); |
|
if(!$allegati){ |
|
$error = true; |
|
} |
|
} |
|
|
|
$error = false; |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.href="/catalogo/edit.php?codice=<?= $prodotto->info['codice'] ?>"; }); |
|
<? |
|
|
|
}else{ |
|
|
|
$error = false; |
|
?> |
|
swal({title:js_dict.error,html:js_dict["error-generic"],type:"error"}); |
|
<? |
|
|
|
} |
|
|
|
|
|
}else{ |
|
$error = false; |
|
?> |
|
swal({title:js_dict.error,html:js_dict["error-generic"],type:"error"}); |
|
<? |
|
} |
|
|
|
} else { |
|
|
|
?> |
|
swal({title:js_dict.error,html:"<?= __("categorie merceologiche") . " " . __("obbligatorio") ?>",type:"error"}); |
|
<? |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|