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.

index.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. require_once __DIR__ . "/required.php";
  8. define("NICKELBOX", true);
  9. require_once __DIR__ . "/lib/item.php";
  10. $config = $database->select("config", ['key', 'value']);
  11. $settings = [
  12. "sitename" => "Shop",
  13. "theme" => "default",
  14. "tax" => 8.5,
  15. ];
  16. foreach ($config as $c) {
  17. $settings[$c['key']] = $c['value'];
  18. }
  19. $page = "home";
  20. if (isset($_GET['page'])) {
  21. switch ($_GET['page']) {
  22. case "browse":
  23. if (isset($_GET['cat']) && $binstack->has('categories', ['catid' => $_GET['cat']])) {
  24. $page = "browse";
  25. } else {
  26. $page = "404";
  27. }
  28. break;
  29. case "search":
  30. $page = "search";
  31. break;
  32. case "item":
  33. if (isset($_GET['id']) && $binstack->has('items', ['itemid' => $_GET['id']])) {
  34. $page = "item";
  35. } else {
  36. $page = "404";
  37. }
  38. break;
  39. case "cart":
  40. $page = "cart";
  41. break;
  42. case "home":
  43. default:
  44. $page = "home";
  45. }
  46. }
  47. require __DIR__ . "/parts/head.php";
  48. require __DIR__ . "/parts/nav.php";
  49. require __DIR__ . "/parts/$page.php";
  50. require __DIR__ . "/parts/footer.php";