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.

nav.php 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. $cats = $binstack->select('categories', ['catid (id)', 'catname (name)']);
  11. $categories = [];
  12. foreach ($cats as $c) {
  13. if ($binstack->has('items', ['AND' => ['catid' => $c['id'], 'price[>]' => 0]])) {
  14. $categories[] = $c;
  15. }
  16. }
  17. ?>
  18. <nav class="navbar navbar-expand navbar-dark bg-dark">
  19. <a class="navbar-brand" href="./"><?php echo $settings['sitename']; ?></a>
  20. <div class="collapse navbar-collapse">
  21. <ul class="navbar-nav d-none d-md-inline">
  22. <li class="nav-item dropdown">
  23. <a class="nav-link dropdown-toggle" href="#" id="categorydropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  24. Categories
  25. </a>
  26. <div class="dropdown-menu" aria-labelledby="categorydropdown">
  27. <?php
  28. foreach ($categories as $c) {
  29. ?>
  30. <a class="dropdown-item" href="./?page=browse&cat=<?php echo $c['id']; ?>"><?php echo $c['name']; ?></a>
  31. <?php
  32. }
  33. ?>
  34. </div>
  35. </li>
  36. </ul>
  37. <form class="form-inline ml-3" method="GET">
  38. <div class="input-group">
  39. <input type="hidden" name="page" value="search" />
  40. <input name="q" class="form-control" type="search" placeholder="Search" aria-label="Search" value="<?php
  41. if (isset($_GET['q'])) {
  42. echo htmlspecialchars($_GET['q']);
  43. }
  44. ?>">
  45. <div class="input-group-addon">
  46. <button class="btn btn-success" type="submit"><i class="fas fa-search"></i> <span class="d-none d-md-inline">Search</span></button>
  47. </div>
  48. </div>
  49. </form>
  50. <div class="d-none d-md-inline ml-auto">
  51. <ul class="navbar-nav">
  52. <li class="nav-item">
  53. <a class="nav-link" href="./?page=cart">
  54. <i class="fas fa-shopping-cart"></i> Cart
  55. </a>
  56. </li>
  57. <li class="nav-item">
  58. <a class="nav-link" href="./?page=account">
  59. <i class="fas fa-user-circle"></i> Account
  60. </a>
  61. </li>
  62. </ul>
  63. </div>
  64. </div>
  65. </nav>
  66. <nav class="navbar navbar-expand navbar-dark bg-dark d-md-none">
  67. <div class="collapse navbar-collapse justify-content-between">
  68. <ul class="navbar-nav">
  69. <li class="nav-item dropdown">
  70. <a class="nav-link dropdown-toggle" href="#" id="categorydropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  71. Categories
  72. </a>
  73. <div class="dropdown-menu" aria-labelledby="categorydropdown">
  74. <?php
  75. foreach ($categories as $c) {
  76. ?>
  77. <a class="dropdown-item" href="./?page=browse&cat=<?php echo $c['id']; ?>"><?php echo $c['name']; ?></a>
  78. <?php
  79. }
  80. ?>
  81. </div>
  82. </li>
  83. </ul>
  84. <ul class="navbar-nav ml-auto">
  85. <li class="nav-item">
  86. <a class="nav-link" href="./?page=cart">
  87. <i class="fas fa-shopping-cart"></i> Cart
  88. </a>
  89. </li>
  90. <li class="nav-item">
  91. <a class="nav-link" href="./?page=account">
  92. <i class="fas fa-user-circle"></i> Account
  93. </a>
  94. </li>
  95. </ul>
  96. </div>
  97. </nav>