An easy point of sale system with automatic inventory tracking. https://netsyms.biz/apps/nickelbox/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

search.php 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. */
  7. if (!defined('NICKELBOX')) {
  8. die("Direct access denied.");
  9. }
  10. $query = $_GET['q'];
  11. $dbitems = $binstack->select('items', 'itemid', [
  12. 'AND' => [
  13. 'price[>]' => 0,
  14. 'OR' => [
  15. 'name[~]' => $query,
  16. 'code1' => $query,
  17. 'code2' => $query,
  18. 'text1[~]' => $query
  19. ]
  20. ], 'LIMIT' => 20]);
  21. $items = [];
  22. foreach ($dbitems as $i) {
  23. $items[] = new Item($i);
  24. }
  25. ?>
  26. <div class="container mt-4">
  27. <h1 class="display-4">Search <span class="h3 ml-3 d-none"><?php echo htmlspecialchars($query); ?></span></h1>
  28. <div class="list-group list-group-flush">
  29. <?php
  30. if (count($items) > 0) {
  31. foreach ($items as $i) {
  32. echo RenderItem::line($i);
  33. }
  34. } else {
  35. ?>
  36. <p>No results found for <?php echo htmlspecialchars($query); ?>.</p>
  37. <?php
  38. }
  39. ?>
  40. </div>
  41. </div>