engelsystem/includes/pages/admin_log.php

39 lines
760 B
PHP
Raw Normal View History

2011-06-03 14:44:01 +02:00
<?php
2017-01-03 03:22:48 +01:00
/**
* @return string
*/
2017-01-02 03:57:23 +01:00
function admin_log_title()
{
2017-01-03 14:12:17 +01:00
return _('Log');
2013-11-25 21:04:58 +01:00
}
2017-01-03 03:22:48 +01:00
/**
* @return string
*/
2017-01-02 03:57:23 +01:00
function admin_log()
{
2017-01-03 14:12:17 +01:00
$filter = '';
if (request()->has('keyword')) {
2017-01-02 03:57:23 +01:00
$filter = strip_request_item('keyword');
}
$log_entries = LogEntries_filter($filter);
2017-01-02 15:43:36 +01:00
foreach ($log_entries as &$log_entry) {
2017-01-03 14:12:17 +01:00
$log_entry['date'] = date('d.m.Y H:i', $log_entry['timestamp']);
2017-01-02 03:57:23 +01:00
}
2017-01-02 15:43:36 +01:00
2017-01-02 03:57:23 +01:00
return page_with_title(admin_log_title(), [
2017-01-02 15:43:36 +01:00
msg(),
form([
2017-01-03 14:12:17 +01:00
form_text('keyword', _('Search'), $filter),
form_submit(_('Search'), 'Go')
2017-01-02 15:43:36 +01:00
]),
table([
2017-01-03 14:12:17 +01:00
'date' => 'Time',
'level' => 'Type',
2017-01-03 14:12:17 +01:00
'message' => 'Log Entry'
2017-01-02 15:43:36 +01:00
], $log_entries)
]);
2011-06-03 14:44:01 +02:00
}