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 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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<?php
  55. if (!empty($_SESSION['cart'])) {
  56. echo ' (' . count($_SESSION['cart']) . ')';
  57. }
  58. ?>
  59. </a>
  60. </li>
  61. <li class="nav-item">
  62. <a class="nav-link" href="./?page=account">
  63. <i class="fas fa-user-circle"></i> Account
  64. </a>
  65. </li>
  66. </ul>
  67. </div>
  68. </div>
  69. </nav>
  70. <nav class="navbar navbar-expand navbar-dark bg-dark d-md-none">
  71. <div class="collapse navbar-collapse justify-content-between">
  72. <ul class="navbar-nav">
  73. <li class="nav-item dropdown">
  74. <a class="nav-link dropdown-toggle" href="#" id="categorydropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  75. Categories
  76. </a>
  77. <div class="dropdown-menu" aria-labelledby="categorydropdown">
  78. <?php
  79. foreach ($categories as $c) {
  80. ?>
  81. <a class="dropdown-item" href="./?page=browse&cat=<?php echo $c['id']; ?>"><?php echo $c['name']; ?></a>
  82. <?php
  83. }
  84. ?>
  85. </div>
  86. </li>
  87. </ul>
  88. <ul class="navbar-nav ml-auto">
  89. <li class="nav-item">
  90. <a class="nav-link" href="./?page=cart">
  91. <i class="fas fa-shopping-cart"></i> Cart
  92. </a>
  93. </li>
  94. <li class="nav-item">
  95. <a class="nav-link" href="./?page=account">
  96. <i class="fas fa-user-circle"></i> Account
  97. </a>
  98. </li>
  99. </ul>
  100. </div>
  101. </nav>