Browse Source

added sort to top of search page

main
Simon Bowie 2 years ago
parent
commit
973e5fc811
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      site/public/search.php

+ 16
- 0
site/public/search.php View File

@@ -26,6 +26,22 @@ include '../text_functions.php';

<div class="container">

<div class="row p-3">
<form action="search.php" method="POST">
<input type="hidden" name="search" value="<?php echo $_POST["search"]?>">
<input type="hidden" name="searchopt" value="<?php echo $_POST["searchopt"]?>">
sort by:
<select name="sort" id="sort" onchange="this.form.submit()">
<option value="relevance" <?php if($_POST["sort"] == 'relevance') echo "selected"; ?>>relevance</option>
<option value="year" <?php if($_POST["sort"] == 'year') echo "selected"; ?>>year</option>
</select>
<noscript>
<input type="submit" class="btn btn-default" value="Set" />
</noscript>
</form>
</div>
<hr>

<?php

$search_results = solr_search($_POST["search"], $_POST["searchopt"], $_POST["sort"]);

Loading…
Cancel
Save