Skip to content

Commit

Permalink
Show saved search in search form
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwins committed Jan 5, 2015
1 parent 54eb3e4 commit af672c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion item-searchform.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
id="search" name="search" data-bind="value: search"
placeholder="Enter keywords or scan barcode"
autocorrect="off" autocapitalize="off"
value="<?=ashtml($_REQUEST['search'])?>">
value="<?=ashtml($search)?>">
<span class="input-group-addon">
<label>
<input type="checkbox" value="1" name="all" data-bind="checked: all"
Expand Down
2 changes: 2 additions & 0 deletions item.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

$item= item_load($db, $id);

$search= "";

head("Item: " . ashtml($item['name']). " @ Scat", true);

include 'item-searchform.php';
Expand Down
4 changes: 2 additions & 2 deletions items.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

ob_start();

head("Items @ Scat", true);

$search= $_GET['search'];

if (($saved= (int)$_GET['saved']) && !$search) {
$search= $db->get_one("SELECT search FROM saved_search WHERE id = $saved");
}

head("Items @ Scat", true);

?>
<div style="float: right">
<button id="add-item" class="btn btn-default">Add New Item</button>
Expand Down

0 comments on commit af672c2

Please sign in to comment.