".__('Pandora audit')." > ".__('Review Logs')."";
$offset = get_parameter ("offset", 0);
$tipo_log = get_parameter ("tipo_log", 'all');
echo '
';
echo '
'.__('Filter').'
';
// generate select
$rows = get_db_all_rows_sql ("SELECT DISTINCT(accion) FROM tsesion");
if (empty ($rows)) {
$rows = array ();
}
$actions = array ();
foreach ($rows as $row) {
$actions[$row["accion"]] = $row["accion"];
}
echo '';
echo '';
echo '
';
echo '
';
$filter = '';
if ($tipo_log != 'all') {
$filter = sprintf (" WHERE accion = '%s'", $tipo_log);
}
$sql = "SELECT COUNT(*) FROM tsesion".$filter;
$count = get_db_sql ($sql);
$url = "index.php?sec=godmode&sec2=godmode/admin_access_logs&tipo_log=".$tipo_log;
pagination ($count, $url, $offset);
$sql = sprintf ("SELECT * FROM tsesion%s ORDER BY fecha DESC LIMIT %d, %d", $filter, $offset, $config["block_size"]);
$result = get_db_all_rows_sql ($sql);
if (empty ($result)) {
$result = array ();
}
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->width = 700;
$table->class = "databox";
$table->size = array ();
$table->data = array ();
$table->head = array ();
$table->head[0] = __('User');
$table->head[1] = __('Action');
$table->head[2] = __('Date');
$table->head[3] = __('Source IP');
$table->head[4] = __('Comments');
$table->size[0] = 80;
$table->size[2] = 130;
$table->size[3] = 100;
$table->size[4] = 200;
// Get data
foreach ($result as $row) {
$data = array ();
$data[0] = $row["ID_usuario"];
$data[1] = $row["accion"];
$data[2] = $row["fecha"];
$data[3] = $row["IP_origen"];
$data[4] = $row["descripcion"];
array_push ($table->data, $data);
}
print_table ($table);
?>