implement history actions tray, add history search feature

This commit is contained in:
yggverse 2024-04-14 21:18:42 +03:00
parent 5927f00437
commit 970f8f6497
3 changed files with 225 additions and 12 deletions

View file

@ -74,17 +74,26 @@ class Database
}
public function getHistory(
string $search = '',
int $start = 0,
int $limit = 1000
): array
{
$query = $this->_database->query(
$query = $this->_database->prepare(
sprintf(
'SELECT * FROM `history` ORDER BY `id` DESC LIMIT %d,%d',
'SELECT * FROM `history` WHERE `url` LIKE :search ORDER BY `id` DESC LIMIT %d,%d',
$start,
$limit
)
);
$query->execute(
[
':search' => sprintf(
'%%%s%%',
$search
)
]
);
return $query->fetchAll();