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.
 
 
 
 
 

136 righe
5.6 KiB

<?
$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"]);
?>
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>CIG</th>
<th><?= __("Errore") ?></th>
</tr>
</thead>
<tbody>
<?
foreach (array_keys($messaggi) AS $linea) {
$cig = "";
if (strpos($file_lines[$linea],"<cig>")!==false) {
$cig = substr($file_lines[$linea],strpos($file_lines[$linea],"<cig>")+5,10);
} else {
$continue=true;
$i = 0;
while($continue) {
$i++;
if (!empty($file_lines[$linea-$i])) {
if (strpos($file_lines[$linea-$i],"<cig>")!==false) {
$cig = substr($file_lines[$linea-$i],strpos($file_lines[$linea-$i],"<cig>")+5,10);
} else {
if ((strpos($file_lines[$linea-$i],"<data>")!==false) || (strpos($file_lines[$linea-$i],"</lotto>")!==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"]}";
}
}
}
?>
<tr>
<td class="text-center">
<?
if (!empty($href)) {
?>
<a href="<?= $href ?>"><?= $cig ?></a>
<?
} else {
echo $cig;
}
?>
</td>
<td>
<button class="btn btn-block btn-danger" onClick="$(this).next().slideToggle('fast');">
<?
foreach($messaggi[$linea] AS $messaggio) {
echo $messaggio . "<br>";
}
?>
</button>
<table class="table table-striped collapse">
<?
$linea = $linea - 1;
for ($i = 3; $i > 0; $i--) {
if (!empty($file_lines[$linea-$i])) { ?>
<tr>
<th width="10"><strong><?= $linea-$i ?></strong></th>
<td><?= htmlentities($file_lines[$linea-$i]); ?></td>
</tr>
<? }
} ?>
<tr>
<th width="10"><strong><?= $linea ?></strong></th>
<td><span class='alert alert-danger m-0 p-1'><?= htmlentities($file_lines[$linea]) ?></span></td>
</tr>
<?
for ($i = 1; $i <= 3; $i++) {
if (!empty($file_lines[$linea+$i])) { ?>
<tr>
<th width="10"><strong><?= $linea+$i ?></strong></th>
<td><?= htmlentities($file_lines[$linea+$i]); ?></td>
</tr>
<? }
} ?>
</table>
</td>
</tr>
<?
}
?>
</tbody>
</table>
<?
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}