$error = true;
$configPath = substr(__DIR__,0,strpos(__DIR__,"public_html/"))."config.php";
include_once($configPath);
if (isset($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) {
$enti = $_SESSION["utente"]->getEntiBeneficiari(false);
if (!empty($enti[$_GET["ente"]])) {
$ente = $enti[$_GET["ente"]];
if (is_numeric($_GET["anno"])) {
$error = false;
$path = anac::getXMLPath($ente["codice"],$_GET["anno"],(empty($_GET["gestore"])) ? false : true);
$errori = anac::validateXML190($path);
$linea_attuale = "";
adaptMemoryLimitToFile($path);
$file_lines = preg_split("/((\r?\n)|(\r\n?))/", file_get_contents($path));
$messaggi = array();
foreach($errori AS $errore) {
if (!isset($messaggi[$errore->line])) { $messaggi[$errore->line] = array(); }
$messaggi[$errore->line][] = $errore->message;
}
$selectLotti = "SELECT b_simog_lotti.codice, b_simog_lotti.codice_simog, b_simog.smart_cig
FROM b_simog_lotti JOIN b_simog ON b_simog_lotti.codice_simog = b_simog.codice
WHERE b_simog.anno_riferimento = :anno AND b_simog_lotti.eliminato = 'N' AND b_simog.stato <> '90' AND cig = :cig ";
if (!empty($_GET["gestore"])) {
$selectLotti .= " AND b_simog.codice_gestore = :ente ";
} else {
$selectLotti .= " AND b_simog.codice_ente = :ente ";
}
$selectLotti .= " ORDER BY b_simog_lotti.codice ";
$lotto = $pdo->prepare($selectLotti);
$lotto->bindValue(":anno",$_GET["anno"]);
$lotto->bindValue(":ente",$ente["codice"]);
?>
| CIG |
= __("Errore") ?> |
foreach (array_keys($messaggi) AS $linea) {
$cig = "";
if (strpos($file_lines[$linea],"")!==false) {
$cig = substr($file_lines[$linea],strpos($file_lines[$linea],"")+5,10);
} else {
$continue=true;
$i = 0;
while($continue) {
$i++;
if (!empty($file_lines[$linea-$i])) {
if (strpos($file_lines[$linea-$i],"")!==false) {
$cig = substr($file_lines[$linea-$i],strpos($file_lines[$linea-$i],"")+5,10);
} else {
if ((strpos($file_lines[$linea-$i],"")!==false) || (strpos($file_lines[$linea-$i],"")!==false)) { $continue = false; }
}
} else {
$continue = false;
}
}
}
$href = "";
if(!empty($cig)) {
$lotto->bindValue(":cig",$cig);
$lotto->execute();
if ($lotto->rowCount() === 1) {
$lot = $lotto->fetch(PDO::FETCH_ASSOC);
if ($lot["smart_cig"] == "S") {
$href = "/backend/anac/panel.php?codice={$lot["codice_simog"]}";
} else {
$href = "/backend/anac/lotti/panel.php?codice_simog={$lot["codice_simog"]}&codice_lotto={$lot["codice"]}";
}
}
}
?>
|
if (!empty($href)) {
?>
= $cig ?>
} else {
echo $cig;
}
?>
|
$linea = $linea - 1;
for ($i = 3; $i > 0; $i--) {
if (!empty($file_lines[$linea-$i])) { ?>
| = $linea-$i ?> |
= htmlentities($file_lines[$linea-$i]); ?> |
}
} ?>
| = $linea ?> |
= htmlentities($file_lines[$linea]) ?> |
for ($i = 1; $i <= 3; $i++) {
if (!empty($file_lines[$linea+$i])) { ?>
| = $linea+$i ?> |
= htmlentities($file_lines[$linea+$i]); ?> |
}
} ?>
|
}
?>
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}