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[] = '
'; ob_start(); echo (!empty($record["cig"])) ? $record["cig"] : ("
" . __("CIG MANCANTE") . "
"); $row[] = ob_get_clean(); ob_start(); ?> ]" value=""> 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 .= "
" . anac::labels190()[$id]; } } if (!empty($tooltip)) { ?> .php?codice_simog=&codice_lotto=" class='btn btn-danger btn-block btn-sm' data-toggle='tooltip' data-placement='top' data-html='true' title='L.190/2012'> L. 190/2012 " . __("Pannello lotto") . ""; $return["data"][] = $row; } } else { $return["data"] = array(); } } else { $return["data"] = array(); } echo json_encode($return); } } } ?>