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[] = " XML"; $row[] = " PDF"; if (!empty($_GET["action"])) { $action = $_GET["action"] .= "&codice=" . $record["codice"]; $row[] = " " . __("Importa") . ""; } $row[] = ""; $return["data"][] = $row; } } else { $return["data"] = array(); } } else { $return["data"] = array(); } echo json_encode($return); } ?>