Log Entries
Date & Time
IP Address
Type
Username
Info
---
---
All Types
PRINT::UPLOAD::PRINTER
PRINT:JOB:START:FAILED
PRINT::UPLOAD::QUEUE
PRINT::UPLOAD::FILE::FAILED
JOB::PRINTERCTRL::FREE
JOB::QUEUECTRL::REMOVE
JOB::PRINTERCTRL::CANCEL::FAILED
JOB::PRINTERCTRL::CANCEL
All Users
' . htmlspecialchars($uname) . ''; } mysqli_stmt_close($stmt); ?>
Apply Filter
= 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 "
{$entry['date']}
{$entry['ip']}
{$entry['type']}
{$entry['username']}
{$entry['info']}
"; } if (empty($paged_entries)) { echo "
No log entries found.
"; } ?>
1): ?>
Previous
= $page ?>
Next