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.
 
 
 
 
 

107 righe
5.1 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"public_html/"))."config.php";
include_once($configPath);
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice_simog"])) {
$anac = anac::init($_GET["codice_simog"]);
if (!empty($anac)) {
if (isset($_GET["draw"])) {
$return = array();
$return["draw"] = (int)$_GET["draw"];
$return["recordsTotal"] = (int)0;
$return["recordsFiltered"] = (int)0;
$bind = array(":codice_simog"=>$_GET["codice_simog"]);
$sql = "SELECT b_simog_lotti.codice, b_simog_lotti.cig, b_simog_lotti.codice_simog,
b_simog_lotti.ordinamento, b_simog_lotti.oggetto,
b_simog_lotti.190data_inizio, b_simog_lotti.190data_fine, b_simog_lotti.190importoAggiudicato, b_simog_lotti.190liquidazioni
FROM b_simog_lotti
WHERE b_simog_lotti.codice_simog = :codice_simog AND b_simog_lotti.eliminato = 'N' ";
$risultati = $pdo->go($sql,$bind);
if ($risultati->rowCount() > 0) {
$return["recordsTotal"] = (int)$risultati->rowCount();
if (!empty($_GET["search"]["value"])) {
$sql .= " AND ( ";
$suddivisione = suddivisione_pdo($_GET["search"]["value"],"b_simog_lotti.oggetto");
$sql .= "(" . $suddivisione["sql"] . ") OR ";
$bind = array_merge($bind,$suddivisione["bind"]);
$suddivisione = suddivisione_pdo($_GET["search"]["value"],"b_simog_lotti.cig");
$sql .= "(" . $suddivisione["sql"] . ") ";
$bind = array_merge($bind,$suddivisione["bind"]);
$sql .= ") ";
}
$order = "b_simog_lotti.ordinamento ";
switch($_GET["order"][0]["column"]) {
case "1": $order = "b_simog_lotti.ordinamento "; break;
case "2": $order = "b_simog_lotti.cig "; break;
case "3": $order = "b_simog_lotti.oggetto "; break;
}
if ($_GET["order"][0]["dir"] == "desc") {
$order.= "DESC ";
} else {
$order.= "ASC ";
}
$sql .= "ORDER BY " . $order . ", b_simog_lotti.ordinamento ASC ";
$risultatiBeforLimit = $pdo->go($sql,$bind);
if ($_GET["length"] !== "-1") { $sql.= "LIMIT ". (int)$_GET["start"] .", " . (int)$_GET["length"]; }
$risultati = $pdo->go($sql,$bind);
if ($risultati->rowCount() > 0) {
if (!empty($_GET["search"]["value"])) {
$return["recordsFiltered"] = (int)$risultatiBeforLimit->rowCount();
} else {
$return["recordsFiltered"] = $return["recordsTotal"];
}
$return["data"] = array();
$i = 0;
while($record = $risultati->fetch(PDO::FETCH_ASSOC)) {
$i++;
$codice_lotto = $record["codice"];
$status = "";
include(__DIR__."/_status.php");
$row = array();
$row[] = '<div class="status_flag bg-'.str_replace("status-border-","",$status).'"></div>';
ob_start();
echo (!empty($record["cig"])) ? $record["cig"] : ("<div class='badge badge-warning'>" . __("CIG MANCANTE") . "</div>");
$row[] = ob_get_clean();
ob_start();
?>
<input class="ordinamento" type="hidden" name="ordinamento-lotti[<?= $record["codice"] ?>]" value="<?= $record["ordinamento"] ?>">
<strong><?= $record["oggetto"] ?></strong>
<?
$row[] = ob_get_clean();
ob_start();
$tooltip = "";
$missing = $anac->check190Lotto($record);
$redirectPartecipanti = true;
if (!empty($missing)) {
$icon = "fa fa-exclamation-triangle";
$btnStatus = "btn-danger";
foreach($missing AS $id) {
if (strpos($id,"190") !== false) { $redirectPartecipanti = false; }
$tooltip .= "<br>" . anac::labels190()[$id];
}
}
if (!empty($tooltip)) { ?>
<a href="/backend/anac/lotti/<?= ($redirectPartecipanti) ? "partecipanti/index" : "190/edit" ?>.php?codice_simog=<?= $record["codice_simog"] ?>&codice_lotto=<?= $record["codice"] ?>" class='btn btn-danger btn-block btn-sm' data-toggle='tooltip' data-placement='top' data-html='true' title='<strong>L.190/2012</strong><?= $tooltip ?>'><span class='fa fa-exclamation-triangle'></span> L. 190/2012</a>
<? }
$row[] = ob_get_clean();
$row[] = "<a href='/backend/anac/lotti/panel.php?codice_simog=".$record["codice_simog"]."&codice_lotto=".$record["codice"]."' title='".__("gestisci")."' class='btn btn-info btn-sm btn-block'><span class='fa fa-th'></span> " . __("Pannello lotto") . "</a>";
$return["data"][] = $row;
}
} else {
$return["data"] = array();
}
} else {
$return["data"] = array();
}
echo json_encode($return);
}
}
}
?>