This commit is contained in:
2024-02-23 02:07:54 +09:00
4 changed files with 73 additions and 4 deletions
+15
View File
@@ -13,6 +13,9 @@ $asc = ($_GET['asc'] ?? 0) != 0;
$keyword = trim ($_GET['q'] ?? '');
$escaped = ($_GET['escaped'] ?? 0) != 0;
$date_start = ($_GET['start'] ?? null) ?: null;
$date_end = ($_GET['end'] ?? null) ?: null;
$f = fopen (LOG_PATH, 'r');
if ($f !== false)
@@ -41,6 +44,18 @@ if ($keyword != '')
!== false));
}
if ($date_start)
{
$log_data = array_filter ($log_data, fn ($row) => (
substr ($row['date_time'], 0, 10) >= $date_start));
}
if ($date_end)
{
$log_data = array_filter ($log_data, fn ($row) => (
substr ($row['date_time'], 0, 10) <= $date_end));
}
$pages_max = (int) ((count ($log_data) - 1) / $length) + 1;
if (!($asc))