Log Entries

= 5) { // Add valid log entries to an array $log_entries[] = [ 'date' => htmlspecialchars($data[0]), 'ip' => htmlspecialchars($data[1]), 'type' => htmlspecialchars($data[2]), 'username' => htmlspecialchars($data[3]), 'info' => htmlspecialchars($data[4]) ]; } } fclose($fp); } // Reverse the log entries to display the latest first $log_entries = array_reverse($log_entries); // Filter log entries by type and username $filtered_entries = array_filter($log_entries, function ($entry) use ($type_filter, $user_filter) { $type_match = ($type_filter === "All_types" || $entry['type'] === $type_filter); $user_match = ($user_filter === "All_usernames" || $entry['username'] === $user_filter); return $type_match && $user_match; }); // Calculate total pages and slice the log entries for the current page $total_entries = count($filtered_entries); $total_pages = ceil($total_entries / $items_per_page); $paged_entries = array_slice($filtered_entries, $offset, $items_per_page); // Display the filtered entries for the current page foreach ($paged_entries as $entry) { echo ""; } if (empty($paged_entries)) { echo ""; } ?>
Date & Time IP Address Type Username Info
--- ---
{$entry['date']} {$entry['ip']} {$entry['type']} {$entry['username']} {$entry['info']}
No log entries found.