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.
42 righe
1.6 KiB
42 righe
1.6 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (isset($_SESSION["utente"]) && isset($_GET["draw"]) && isset($_GET["modulo"]) && isset($_GET["codice_elemento"]) && $_SESSION["utente"]->permission($_GET["modulo"],$_GET["codice_elemento"])) { |
|
|
|
$return = array(); |
|
$return["draw"] = (int)$_GET["draw"]; |
|
$return["recordsTotal"] = (int)0; |
|
$return["recordsFiltered"] = (int)0; |
|
$manager = new registriManager($_GET["modulo"],$_GET["codice_elemento"]); |
|
$total = $manager->getLog(); |
|
$_cacheUtenti = []; |
|
if (!empty($total)) { |
|
$return["recordsTotal"] = (int)count($total); |
|
$risultati = $manager->getLog($_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) { |
|
$utente = $_cacheUtenti[$record["utente_modifica"]] ?? Utente::getInfoFromID($record["utente_modifica"]); |
|
$_cacheUtenti[$record["utente_modifica"]] = $utente; |
|
$row = array(); |
|
$row[] = strtoupper($record["operazione"]); |
|
$row[] = $record["oggetto"]; |
|
$row[] = (!empty($utente)) ? ($utente["cognome"] . " " . $utente["nome"]) : ""; |
|
$row[] = $record["timestamp"]; |
|
$return["data"][] = $row; |
|
} |
|
} else { |
|
$return["data"] = array(); |
|
} |
|
} else { |
|
$return["data"] = array(); |
|
} |
|
|
|
echo json_encode($return); |
|
} |
|
?>
|
|
|