| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- namespace App;
- use App\Helpers\HtmlHelper;
- /**
- * @var array $results
- * @var string $term
- */
- $core = Core::getInstance();
- $user = $core->getUser();
- ?>
- <form class="mb-3" method="get">
- <label for="term" class="sr-only"><?=htmlspecialchars(__("Search Term"))?></label>
- <div class="input-group input-group-lg">
- <input class="form-control" type="search" name="term" id="term" value="<?=htmlspecialchars($term)?>" minlength="3" placeholder="<?=htmlspecialchars(__("Type search term"))?>" />
- <button type="submit" class="btn btn-primary">
- <i class="fa fa-fw fa-search"></i>
- </button>
- </div>
- </form>
- <?php
- if($term) {
- ?>
- <div class="row mb-3">
- <div class="col">
- <h3><?=htmlspecialchars(__("Search Results"))?></h3>
- </div>
- </div>
- <?php
- if(!$results) {
- HtmlHelper::renderInfoAlert(__("No search results to display."));
- }
- else {
- ?>
- <table class="table table-bordered table-hover mb-3">
- <thead>
- <tr>
- <th><?=htmlspecialchars(__("Type"))?></th>
- <th><?=htmlspecialchars(__("Result"))?></th>
- <th><?=htmlspecialchars(__("Match Reason"))?></th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach($results as $result) {
- ?>
- <tr>
- <td>
- <?=htmlspecialchars($result["type"])?>
- </td>
- <td>
- <a href="<?=htmlspecialchars($result["url"])?>"><?=htmlspecialchars($result["name"])?></a>
- </td>
- <td>
- <?=htmlspecialchars($result["match_reason"])?>
- </td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- <?php
- }
- }
|