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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. ];
  15. foreach ($config as $c) {
  16. $settings[$c['key']] = $c['value'];
  17. }
  18. $page = "home";
  19. if (isset($_GET['page'])) {
  20. switch ($_GET['page']) {
  21. case "browse":
  22. if (isset($_GET['cat']) && $binstack->has('categories', ['catid' => $_GET['cat']])) {
  23. $page = "browse";
  24. } else {
  25. $page = "404";
  26. }
  27. break;
  28. case "search":
  29. $page = "search";
  30. break;
  31. case "item":
  32. if (isset($_GET['id']) && $binstack->has('items', ['itemid' => $_GET['id']])) {
  33. $page = "item";
  34. } else {
  35. $page = "404";
  36. }
  37. break;
  38. case "home":
  39. default:
  40. $page = "home";
  41. }
  42. }
  43. require __DIR__ . "/parts/head.php";
  44. require __DIR__ . "/parts/nav.php";
  45. require __DIR__ . "/parts/$page.php";
  46. require __DIR__ . "/parts/footer.php";