Daniel J. Summers 6dc264d34c Completed result/option migration
- Change casing on exposed constants
- Add file-level phpdoc
2024-07-25 21:14:57 -04:00

48 lines
1.2 KiB
PHP

<?php
/**
* Item Search Page
*
* Search for items across all feeds
*
* @author Daniel J. Summers <daniel@bitbadger.solutions>
* @license MIT
*/
declare(strict_types=1);
include '../start.php';
FeedReaderCentral\Security::verifyUser();
$search = $_GET['search'] ?? '';
$items = $_GET['items'] ?? 'all';
if ($search !== '') {
$list = FeedReaderCentral\ItemList::matchingSearch($search, $items === 'bookmarked');
}
page_head('Item Search'); ?>
<h1>Item Search</h1>
<article>
<form method=GET action=/search>
<label>
Search Criteria
<input type=text name=search required autofocus value="<?=htmlspecialchars($search)?>">
</label>
<label>
Items to Search
<select name=items>
<option value=all <?=$items === 'all' ? ' selected' : ''?>>All</option>
<option value=bookmarked <?=$items === 'bookmarked' ? ' selected' : ''?>>Bookmarked</option>
</select>
</label>
<span class=break></span>
<button type=submit>Search</button>
</form><?php
if (isset($list)) { ?>
<hr><?php
$list->render();
} ?>
</article><?php
page_foot();