permission("simog")) { $printScript = false; if (isset($_POST["cig"])) { $_GET = $_POST; } else { $printScript = true; } if (empty($_GET["cig"]) || empty($_GET["anno"]) || empty($_GET["codice_ente"])) { $enti = $_SESSION["utente"]->getEntiBeneficiari(false); if ($enti !== false) { $error = false; ?>
">
">
"; } include($beRoot."/anac/ws/simog.class.php"); $error = false; $bind = [":gestore"=>$_SESSION["ente"]->codice,":cig"=>$_GET["cig"]]; $check = $pdo->go("SELECT b_simog_lotti.codice FROM b_simog_lotti JOIN b_simog ON b_simog_lotti.codice_simog = b_simog.codice WHERE codice_gestore = :gestore AND cig = :cig",$bind); if ($check->rowCount() === 0) { if (empty($_SESSION["simog"]["collaborazione"])) { ?> modalURL = []; showModalWithURL('/backend/anac/ws/views/login.php?action='); index = $_SESSION["simog"]["collaborazione"]["index"]; $simog->ticket = $_SESSION["simog"]["ticket"]; $return = $simog->sendData("consultaComunicazione",["cig"=>$_GET["cig"]]); $found = false; $smart = false; if (!empty($return->comunicazione)) { $found = true; $smart = true; $return = $return->comunicazione; } else { $return = $simog->sendData("consultaGara",["CIG"=>$_GET["cig"],"schede"=>anac::getVersion()]); if (!empty($return->return->GaraXML)) { $found = true; $return = $return->return; $id_gara = $return->GaraXML->DatiGara->Gara->ID_GARA ?? ""; if (!empty($id_gara)) { $error = false; $bind = [":gestore"=>$_SESSION["ente"]->codice,":id_gara"=>$id_gara]; $check = $pdo->go("SELECT b_simog.codice FROM b_simog WHERE codice_gestore = :gestore AND id_gara = :id_gara",$bind); if ($check->rowCount() > 0) { $idInit = $check->fetch(PDO::FETCH_ASSOC)["codice"]; } } } } if ($found) { if (isset($idInit)) { $anac = anac::init($idInit); } else { $anac = new anac(); } if (!empty($anac)) { $esito = $anac->createFromSIMOG($return,$_GET["anno"],$_GET["codice_ente"],$smart); if (!empty($esito["codice"])) { ?> swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.href="/backend/anac/panel.php?codice=";}); ",$esito["errori"]); } else{ $msg = $esito["errori"]; } } ?> swal({title:js_dict.error,html:,type:"error"}); swal({title:js_dict.error,html:"CIG ",type:"error"}); swal({title:js_dict.error,html:"CIG ",type:"error"}); "; } } } } if ($error) { header('HTTP/1.0 403 Forbidden'); die(); } ?>