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.
 
 
 
 
 

60 righe
2.6 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
if (isset($_SESSION["utente"]) && isset($_GET["draw"]) && !empty($_SESSION["utente"]->oe)) {
$return = array();
$return["draw"] = (int)$_GET["draw"];
$return["recordsTotal"] = (int)0;
$return["recordsFiltered"] = (int)0;
$total = DGUE::staticgetMyDGUE("","",[],[],0,-1);
if (!empty($total)) {
$return["recordsTotal"] = (int)count($total);
$filters = [];
if (!empty($_GET["search"]["value"])) {
$filters["*"] = $_GET["search"]["value"];
}
$order = [];
$orderKey = "timestamp";
switch($_GET["order"][0]["column"]) {
case "0": $orderKey = "cig"; break;
case "1": $orderKey = "oggetto"; break;
case "2": $orderKey = "timestamp"; break;
}
if ($_GET["order"][0]["dir"] == "desc") {
$order[$orderKey] = "DESC";
} else {
$order[$orderKey] = "ASC";
}
$risultati = DGUE::staticgetMyDGUE("","",$filters,$order,$_GET["start"],$_GET["length"]);
if (count($risultati) > 0) {
if (!empty($_GET["search"]["value"])) {
$return["recordsFiltered"] = (int)count($risultati);
} else {
$return["recordsFiltered"] = $return["recordsTotal"];
}
$return["data"] = array();
foreach($risultati AS $record) {
$row =[];
$row[] = $record["cig"];
$row[] = $record["oggetto"];
$row[] = mysql2datetime($record["timestamp"]);
$row[] = "<a target=\"_blank\" title='".__("XML")."' class='btn btn-block btn-sm btn-info' href='/dgue/getXML.php?codice={$record["codice"]}'><span class='fa fa-code'></span> XML</a>";
$row[] = "<a target=\"_blank\" title='".__("PDF")."' class='btn btn-block btn-sm btn-primary' href='/dgue/getPDF.php?codice={$record["codice"]}'><span class='fa fa-file-pdf'></span> PDF</a>";
if (!empty($_GET["action"])) {
$action = $_GET["action"] .= "&codice=" . $record["codice"];
$row[] = "<a title='".__("importa")."' class='btn btn-block btn-sm btn-warning' href='{$action}'><span class='fa fa-check'></span> " . __("Importa") . "</a>";
}
$row[] = "<button title='".__("elimina")."' class='btn btn-block btn-sm btn-danger' onclick='eliminaP(".$record["codice"].",\"dgue\");'><span class='fa fa-times'></span> " . __("Elimina") . "</button>";
$return["data"][] = $row;
}
} else {
$return["data"] = array();
}
} else {
$return["data"] = array();
}
echo json_encode($return);
}
?>