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.
104 righe
4.1 KiB
104 righe
4.1 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"public_html/"))."config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_GET) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"]) |
|
&& $_SESSION["utente"]->permission("simog") |
|
&& tokenVerify($_GET["token"]) && $_SESSION["utente"]->unlockSupporto()) { |
|
|
|
$anac = anac::init($_GET["codice"]); |
|
$errors = []; |
|
if (!empty($anac)) { |
|
$error = false; |
|
if (empty($anac->info["id_stazione_appaltante"])) { |
|
if (empty($_GET["fromSelectCollaborazione"])) { unset($_SESSION["simog"]["collaborazione"]); } |
|
} else { |
|
if (!empty($_SESSION["simog"])) { |
|
foreach($_SESSION["simog"]["collaborazioni"] AS $collaborazione) { |
|
if (!empty($collaborazione["ufficio_id"])) { |
|
if ($collaborazione["ufficio_id"] == $anac->info["id_stazione_appaltante"]) { |
|
$_SESSION["simog"]["collaborazione"] = $collaborazione; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (empty($_SESSION["simog"]["collaborazione"])) { |
|
?> |
|
<script> |
|
modalURL = []; |
|
<? $action = base64_encode("/backend/anac/massive.php?".http_build_query($_GET)); ?> |
|
showModalWithURL('/backend/anac/ws/views/login.php?action=<?= $action ?>'); |
|
</script> |
|
<? |
|
} else { |
|
ini_set('max_execution_time', 600); |
|
$lotti = $pdo->go("SELECT * FROM b_simog_lotti WHERE codice_simog = :codice AND eliminato = 'N' AND (cig = '' OR cig IS NULL) ORDER BY ordinamento, codice",[":codice"=>$anac->info["codice"]])->fetchAll(PDO::FETCH_ASSOC); |
|
if (!empty($lotti)) { |
|
if (empty($anac->info["id_gara"])) { |
|
$data = $anac->getRequestArray("sendRegularGara"); |
|
if (!empty($data)) { |
|
include_once($beRoot."/anac/ws/simog.class.php"); |
|
$simog = new simog(); |
|
$simog->codice_simog = $anac->info["codice"]; |
|
$simog->codice_lotto = 0; |
|
$simog->index = $_SESSION["simog"]["collaborazione"]["index"]; |
|
$simog->ticket = $_SESSION["simog"]["ticket"]; |
|
$return = $simog->sendData($data["method"],$data["data"]); |
|
if (!empty($return)) { |
|
$anac->manageResponse($return,"sendRegularGara",0,true); |
|
$anac = anac::init($anac->info["codice"]); |
|
} else { |
|
$errors = array_merge($errors,$simog->errors); |
|
} |
|
} else { |
|
$errors[] = "Impossibile costruire la richiesta"; |
|
} |
|
} |
|
if (empty($errors)) { |
|
foreach($lotti AS $lotto) { |
|
$data = $anac->getRequestArray("sendLotto",$lotto["codice"]); |
|
if (!empty($data)) { |
|
include_once($beRoot."/anac/ws/simog.class.php"); |
|
$simog = new simog(); |
|
$simog->codice_simog = $anac->info["codice"]; |
|
$simog->codice_lotto = $lotto["codice"]; |
|
$simog->index = $_SESSION["simog"]["collaborazione"]["index"]; |
|
$simog->ticket = $_SESSION["simog"]["ticket"]; |
|
$return = $simog->sendData($data["method"],$data["data"]); |
|
if (!empty($return)) { |
|
$anac->manageResponse($return,"sendLotto",$lotto["codice"],true); |
|
} else { |
|
$errors = array_merge($errors,$simog->errors); |
|
} |
|
} else { |
|
$errors[] = "Impossibile costruire la richiesta"; |
|
} |
|
} |
|
} |
|
} else { |
|
$errors[] = "Nessun CIG Mancante"; |
|
} |
|
} |
|
} |
|
if (!empty($errors)) { |
|
ob_start(); |
|
foreach($errors as $msg) { ?> |
|
<div class="border text-center p-1 m-1"><?= __($msg) ?></div> |
|
<? } |
|
$errors = ob_get_clean(); |
|
alertManager::printAlertBox(__("Si sono verificati degli errori"),$errors); |
|
} |
|
?> |
|
<script> |
|
$('#modal-helper').on('hidden.bs.modal', function (e) { |
|
window.location.reload(); |
|
}) |
|
</script> |
|
<? |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|