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.
 
 
 
 
 

99 righe
3.0 KiB

<?php
ob_start();
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once $configPath;
$codice = $_POST["codice_fascicolo"] ?? $_GET["codice_fascicolo"];
$npa = NuovaPiattaformaAppalti::init($codice);
if(! empty($npa->fascicolo) && $_SESSION["utente"]->permission("fvoe")) {
$codice_fiscale = $_POST["cf"] ?? $_GET["cf"];
$codice_lotto = $_POST["codice_lotto"] ?? $_GET["codice_lotto"];
$npa->setLotto($codice_lotto);
if(! empty($npa->lot["codice"]) && $npa->hasLockOnPartecipanti(false, true, $npa->lot["codice_lotto_npa"])) {
$aggiudicatari = false;
$cards = $npa->getCompletedCards(false);
$schede = array_column($cards, "id_scheda");
foreach ($schede as $scheda) {
if(strpos($scheda, "AD") === 0) {
$aggiudicatari = true;
break;
}
}
$participants = null;
$participants = $npa->getPartecipanti($aggiudicatari, true, true, true);
$participants = array_column($participants, null, 'codice_fiscale');
$npa->verifyDelega();
if(! empty($participants[$codice_fiscale])) {
$message = 'Non si dispone di un accesso valido al Fascicolo';
$participant = $participants[$codice_fiscale];
$fvoe = FVOE::init([$participant["codice_fiscale"], $npa->lot["codice_lotto_npa"]], FVOEInizializationType::CF_E_CODICE_LOTTO);
if($fvoe->isAccessible()) {
$authorizationEndDate = DateTime::createFromFormat("d/m/Y", $_POST["dataFineAutorizzazione"] ?? null);
$result = $fvoe->requestAccess(! empty($authorizationEndDate) ? $authorizationEndDate : null, $message);
$title = $result ? 'js_dict.attenzione' : (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");
echo <<<JAVASCRIPT
swal({
title: {$title},
html: {$html},
type: "{$type}"
}).then(function(){
backModalHelper();
});
JAVASCRIPT;
exit;
}
echo <<<JAVASCRIPT
swal({
title: js_dict.attenzione,
html: "<strong>Problema di autorizzazione.</strong> Si prega di controllare le deleghe ANAC e di aver effettuato l’accesso tramite SPID.",
type: "error"
});
JAVASCRIPT;
exit;
} else {
$text = empty($participants) ? "`Nessun partecipante trovato`" : "`Il partecipante non sembra essere stato trasmesso nelle schede ANAC.`";
echo <<<JAVASCRIPT
swal({
title: js_dict.attenzione,
html: {$text},
type: "error"
});
JAVASCRIPT;
exit;
}
}
echo <<<JAVASCRIPT
swal({
title: js_dict.attenzione,
html: js_dict["error-generic"],
type: "error"
}).then(function(){
refreshModalHelper();
});
JAVASCRIPT;
exit;
}
HTTPStatus(403);
exit;