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.
193 righe
9.3 KiB
193 righe
9.3 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
include_once "{$beRoot}/layout/top.php"; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { |
|
?> |
|
<div class="container-fluid pt-5"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<p class="d-block display-4"> |
|
<?= Modulo::header($radice) ?> |
|
</p> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
$bind = array(); |
|
$sql = "SELECT codice FROM b_log "; |
|
if (!empty($_SESSION["ente"])) { |
|
$bind[":codice_ente"] = $_SESSION["ente"]->codice; |
|
$sql .= "WHERE b_log.codice_ente = :codice_ente "; |
|
} |
|
$ris_log = $pdo->go($sql,$bind); |
|
if ($ris_log->rowCount() > 0) { |
|
$postFilters = []; |
|
if (isset($_POST["filter"])) { |
|
$postFilters = $_SESSION["log-filter"] = $_POST["filter"]; |
|
} |
|
?> |
|
<div id="modal-log" class="modal" tabindex="-1" role="dialog"> |
|
<div class="modal-dialog modal-lg" role="document"> |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<div class="modal-body"></div> |
|
<div class="modal-footer"> |
|
<button class="btn btn-block" data-dismiss="modal">Close</button> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="row"> |
|
<div class="col-12 text-right"> |
|
<button class="btn btn-warning" data-toggle="collapse" href="#filtri" aria-expanded="false" aria-controls="filtri"><span class="fa fa-filter"></span> <?= __("filtra") ?></button> |
|
<?php if ($_SESSION["utente"]->isSupportoOrRoot()) : ?> |
|
<a class="ml-2 btn btn-primary" href="/backend/log-viewer/filesystem.php" aria-expanded="false"><span class="fa fa-folder"></span> <?= __("File system") ?></a> |
|
<?php endif; ?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="container-fluid collapse mb-3" id="filtri"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<div class="card"> |
|
<form action="index.php" target="_self" method="post" rel="validate"> |
|
<div class="card-body"> |
|
<div class="row"> |
|
<div class="form-group col-sm-2"> |
|
<label for="filter-nometab">Tabella:</label> |
|
<input class="input form-control" id="filter-nometab" title="Tabella" name="filter[nometab]" size="3" value="<?= (!empty($postFilters["nometab"])) ? $postFilters["nometab"] : "" ?>"> |
|
</div> |
|
<div class="form-group col-sm-2"> |
|
<label>Operazione:</label> |
|
<input class="input form-control" id="filter-operazione" title="Operazione" name="filter[operazione]" size="3" value="<?= (!empty($postFilters["operazione"])) ? $postFilters["operazione"] : "" ?>"> |
|
</div> |
|
<div class="form-group col-sm-1"> |
|
<label>Row:</label> |
|
<input class="input form-control" id="filter-id_record" title="Row" name="filter[id_record]" size="3" value="<?= (!empty($postFilters["id_record"])) ? $postFilters["id_record"] : "" ?>"> |
|
</div> |
|
<div class="form-group col-sm-2"> |
|
<label>IP:</label> |
|
<input class="input form-control" id="filter-ip" title="IP" name="filter[ip]" value="<?= (!empty($postFilters["ip"])) ? $postFilters["ip"] : "" ?>"> |
|
</div> |
|
<div class="form-group col-sm-2"> |
|
<label>User:</label> |
|
<input class="input form-control" id="filter-user" title="User" name="filter[user]" value="<?= (!empty($postFilters["user"])) ? $postFilters["user"] : "" ?>"> |
|
</div> |
|
<? |
|
if (empty($_SESSION["ente"])) { |
|
?> |
|
<div class="form-group col-sm-3"> |
|
<label>ente:</label> |
|
<select name="filter[codice_ente]" class="form-control" id="filter-codice_ente" title="<?= __('ente') ?>"> |
|
<option value="">All</option> |
|
<option value="0">None</option> |
|
<? |
|
$sql = "SELECT codice, denominazione FROM b_enti WHERE attivo = 'S' ORDER BY denominazione"; |
|
$ris_filter = $pdo->go($sql); |
|
if ($ris_filter->rowCount() > 0) { |
|
?> |
|
|
|
<? while ($option = $ris_filter->fetch(PDO::FETCH_ASSOC)) { ?> |
|
<option value="<?= $option["codice"] ?>"><?= $option["denominazione"] ?></option> |
|
<? } ?> |
|
<? |
|
} |
|
?> |
|
</select> |
|
<? |
|
if (!empty($postFilters["codice_ente"])) { |
|
?> |
|
<script> |
|
$("#filter-codice_ente").val('<?= $postFilters["codice_ente"] ?>'); |
|
</script> |
|
<? |
|
} |
|
?> |
|
</div> |
|
<? |
|
} |
|
?> |
|
<div class="form-group col-sm-2"> |
|
<label>From:</label> |
|
<input class="input form-control datetimepick" id="filter-from" title="From" name="filter[from]" rel="N;0;0;DT;filter-to;<" value="<?= (!empty($postFilters["from"])) ? $postFilters["from"] : "" ?>"> |
|
</div> |
|
<div class="form-group col-sm-2"> |
|
<label>To:</label> |
|
<input class="input form-control datetimepick" id="filter-to" title="To" name="filter[to]" rel="N;0;0;DT;filter-from;>" value="<?= (!empty($postFilters["to"])) ? $postFilters["to"] : "" ?>"> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="card-footer"> |
|
<button type="submit" class="btn btn-primary btn-block">Apply</button> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<div class="container-fluid"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<div class="table-responsive"> |
|
<table class="table table-striped table-hover table-condensed" id="log" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10">ID</th> |
|
<th width="70">Tab</th> |
|
<th width="100">Operation</th> |
|
<th width="10">Row</th> |
|
<th width="100">IP</th> |
|
<th width="200">User</th> |
|
<th width="200"><?= __("ente") ?></th> |
|
<th width="100">Timestamp</th> |
|
<th width="10"></th> |
|
<th></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
</tbody> |
|
</table> |
|
</div> |
|
<a href="export.php" class="btn btn-danger form-control mt-3" target="_blank"><span class="fa fa-cloud-download-alt"></span> Export</a> |
|
<script> |
|
$("#log").DataTable({ |
|
"ordering": false, |
|
"searching": false, |
|
"info": false, |
|
"processing": true, |
|
"serverSide": true, |
|
"columnDefs": [ |
|
{"targets": [0,1,2,3,4,5,7,8], "searchable": false, className: "d-none d-sm-table-cell d-md-table-cell d-lg-table-cell py-2 text-truncate"}, |
|
{"targets": 6, className: "<?= empty($_SESSION["ente"]) ? 'd-none d-sm-table-cell d-md-table-cell d-lg-table-cell py-2 text-truncate' : 'd-none' ?> ?>"}, |
|
{"targets": 9, className: "d-sm-none d-md-none d-lg-none p-2 w-100"} |
|
], |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"ajax": "table.php", |
|
"lengthMenu": [[25, 50, 100], [25, 50, 100]] |
|
}); |
|
</script> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|