Browse Source

added default search: search 'all' sort by 'relevance'

main
Simon Bowie 2 years ago
parent
commit
678f8ab203
2 changed files with 8 additions and 18 deletions
  1. +0
    -18
      site/public/index.php
  2. +8
    -0
      site/public/search.php

+ 0
- 18
site/public/index.php View File

@@ -38,24 +38,6 @@ $cores = array("active", "expanding", "invisible", "multispecies", "pissing", "s
<div class="col-sm-6 text-center">
<form action="search.php" method="POST">
<input type="text" name="search" placeholder="search for a patent record">
<select name="searchopt" id="searchopt">
<option value="all">all</option>
<option value="active">active</option>
<option value="expanding">expanding</option>
<option value="invisible">invisible</option>
<option value="multispecies">multi-species</option>
<option value="pissing">pissing & leaking</option>
<option value="secret">secret</option>
<option value="defending">self-defending</option>
<option value="surviving">surviving</option>
<option value="working">working</option>
</select>
sort by:
<select name="sort" id="sort">
<option value="relevance">relevance</option>
<option value="year desc">year descending</option>
<option value="year asc">year ascending</option>
</select>
<input type="submit" id="submit" value="search">
</form>
</div>

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

@@ -28,6 +28,14 @@ include '../text_functions.php';

<div class="row p-3">
<form action="search.php" method="POST">
<?php
if (!isset($_POST["searchopt"])) {
$_POST["searchopt"] = 'all';
}
if (!isset($_POST["sort"])) {
$_POST["sort"] = 'relevance';
}
?>
<input type="hidden" name="search" value="<?php echo $_POST["search"]?>">
<input type="hidden" name="searchopt" value="<?php echo $_POST["searchopt"]?>">
sort by:

Loading…
Cancel
Save