diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-08-31 01:55:05 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2018-08-31 03:24:54 +0200 |
commit | ac48332166ce28fcb1a2fc130c7f5adbc760e42d (patch) | |
tree | 1ff076a6a1c5a35b4ad73477d60cbcb77ebfd922 /includes/pages/admin_log.php | |
parent | 9d9aa71eb736885f23c069a75c7a047b06434178 (diff) |
Models: Added LogEntry model
Diffstat (limited to 'includes/pages/admin_log.php')
-rw-r--r-- | includes/pages/admin_log.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php index f80f59d2..2a736aa5 100644 --- a/includes/pages/admin_log.php +++ b/includes/pages/admin_log.php @@ -1,5 +1,7 @@ <?php +use Engelsystem\Models\LogEntry; + /** * @return string */ @@ -17,10 +19,14 @@ function admin_log() if (request()->has('keyword')) { $filter = strip_request_item('keyword'); } - $log_entries = LogEntries_filter($filter); - foreach ($log_entries as &$log_entry) { - $log_entry['date'] = date('d.m.Y H:i', $log_entry['timestamp']); + $log_entries = LogEntry::filter($filter); + + $entries = []; + foreach ($log_entries as $entry) { + $data = $entry->toArray(); + $data['created_at'] = date_format($entry->created_at, 'd.m.Y H:i'); + $entries[] = $data; } return page_with_title(admin_log_title(), [ @@ -30,9 +36,9 @@ function admin_log() form_submit(__('Search'), 'Go') ]), table([ - 'date' => 'Time', - 'level' => 'Type', - 'message' => 'Log Entry' - ], $log_entries) + 'created_at' => 'Time', + 'level' => 'Type', + 'message' => 'Log Entry' + ], $entries) ]); } |