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.
 
 
 
 
 

105 righe
4.5 KiB

<?
use Google\Protobuf\Value;
if (isset($this) && is_a($this,"anac")) {
$simogMethod = "Pubblica";
if ($operation == "get") {
$dati = $this->getDati();
$return = [];
$return["method"] = $simogMethod;
$return["data"] = [];
$return["data"]["cig"] = $this->info["id_gara"];
$return["data"]["dataPubblicazione"] = date("Ymd",strtotime(date2mysql($dati["dataPubblicazione"])));
$return["data"]["dataScadenzaPag"] = date("Ymd",strtotime(date2mysql($dati["dataScadenzaPag"])));
$return["data"]["oraScadenza"] = $dati["oraScadenza"];
$showDateInvito = $this->showDateInvito();
if ($showDateInvito) {
$return["data"]["dataScadenzaRichiestaInvito"] = date("Ymd",strtotime(date2mysql($dati["dataScadenzaRichiestaInvito"])));
$return["data"]["dataLetteraInvito"] = date("Ymd",strtotime(date2mysql($dati["dataLetteraInvito"])));
}
$return["data"]["tipoOperazione"] = 1;
$datiPubblicazione = [];
if ((!empty(date2mysql($dati["DATA_ALBO"])))) {
$date = new DateTime(date2mysql($dati["DATA_ALBO"]));
$value = $date->format(DateTime::ATOM);
$datiPubblicazione["DATA_ALBO"] = $value;
}
$datiPubblicazione["QUOTIDIANI_NAZ"] = $dati["QUOTIDIANI_NAZ"];
$datiPubblicazione["QUOTIDIANI_REG"] = $dati["QUOTIDIANI_REG"];
$datiPubblicazione["PERIODICI"] = $dati["PERIODICI"];
$datiPubblicazione["LINK_SITO"] = $dati["LINK_SITO"];
$datiPubblicazione["PROFILO_COMMITTENTE"] = empty($dati["LINK_SITO"]) ? "N" : "S";
$datiPubblicazione["SITO_MINISTERO_INF_TRASP"] = $dati["SITO_MINISTERO_INF_TRASP"];
$datiPubblicazione["SITO_OSSERVATORIO_CP"] = $dati["SITO_OSSERVATORIO_CP"];
if ((!empty(date2mysql($dati["DATA_GUCE"])))) {
$date = new DateTime(date2mysql($dati["DATA_GUCE"]));
$value = $date->format(DateTime::ATOM);
$datiPubblicazione["DATA_GUCE"] = $value;
}
if ((!empty(date2mysql($dati["DATA_GURI"])))) {
$date = new DateTime(date2mysql($dati["DATA_GURI"]));
$value = $date->format(DateTime::ATOM);
$datiPubblicazione["DATA_GURI"] = $value;
}
if ((!empty(date2mysql($dati["DATA_BORE"])))) {
$date = new DateTime(date2mysql($dati["DATA_BORE"]));
$value = $date->format(DateTime::ATOM);
$datiPubblicazione["DATA_BORE"] = $value;
}
$datiPubblicazione["NUMERO_GUCE"] = $dati["NUMERO_GUCE"];
$datiPubblicazione["NUMERO_GURI"] = $dati["NUMERO_GURI"];
$datiPubblicazione["NUMERO_BORE"] = $dati["NUMERO_BORE"];
foreach($datiPubblicazione AS $key => $value) {
if (empty($value)) { unset($datiPubblicazione[$key]); }
}
$return["data"]["datiPubblicazione"]["Pubblicazione"] = $datiPubblicazione;
$lotti = $this->getLotti();
foreach($lotti AS $rec_lotti) {
if (!empty($rec_lotti["cup"])) {
$cuplotto = array();
$cuplotto["CIG"] = $rec_lotti["cig"];
$cuplotto["CODICICUP"][] = array("CUP" => !empty($rec_lotti["cup"]) ? $rec_lotti["cup"] : "", "VALIDO" => "S", "OK_UTENTE" => "S");
$return["data"]["CUPLOTTO"][] = $cuplotto;
}
}
$types = ["bando","disciplinare"];
foreach($types AS $type) {
$files = filesManager::listFiles($this->info["codice"],"anac-{$type}");
if (!empty($files)) {
$file = reset($files);
$file = filesManager::fileInfo($file["codice"],$file["name"],$this->info["codice"],"anac-{$type}",true);
if (!empty($file["content"])) {
$return["data"]["allegato"][] = array(
"documento" => $file["content"],
"nomeFile" => $file["name"],
"note" => $file["titolo"],
"tipoDocumento" => ($type == "bando") ? 1 : 2
);
}
}
}
if ($this->info["stato"] >= 20) {
$return["data"]["tipoOperazione"] = 5;
}
} else if ($operation == "put" && !empty($response)) {
if (!empty($response->return->success)) {
$this->updateSimogLog($simogMethod,1,"");
$this->updateStato("20");
alertManager::printSuccessBox(__("Operazione effettuata con successo"));
$return = true;
} else if (!empty($response->return->error)) {
$errors = $response->return->error;
} else {
$errors = __("Errore nella risposta");
}
} else {
$errors = __("Operazione sconosciuta");
}
if (!empty($errors)) {
$this->updateSimogLog($simogMethod,2,$errors);
alertManager::printAlertBox($errors);
}
}
?>