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.

item.php 3.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. $item = new Item($_GET['id']);
  11. ?>
  12. <div class="container">
  13. <div class="row">
  14. <div class="col-md-4">
  15. <?php
  16. $image = "";
  17. if ($item->getImageCount() > 0) {
  18. $primary = $item->getPrimaryImage();
  19. $image = '<div id="bigImageBox"><img class="mt-4 mb-2" id="bigImage" src="' . $primary->getAbsoluteUrl() . '" alt="" data-imgid="' . $primary->getID() . '" /></div>';
  20. echo $image;
  21. ?>
  22. <div class="d-flex flex-wrap justify-content-center">
  23. <?php
  24. foreach ($item->getImages() as $img) {
  25. ?>
  26. <div class="card m-1 item-picker<?php
  27. if ($img->getID() == $primary->getID()) {
  28. echo " border-primary";
  29. }
  30. ?>" data-imgid="<?php echo $img->getID(); ?>" data-imgurl="<?php echo $img->getAbsoluteUrl(); ?>">
  31. <img class="item-picker-img" src="<?php echo $img->getAbsoluteUrl(); ?>" />
  32. </div>
  33. <?php
  34. }
  35. ?>
  36. </div>
  37. <?php
  38. }
  39. ?>
  40. </div>
  41. <div class="col-md-8">
  42. <div class="row mt-4">
  43. <div class="col-sm-7 jumbotron py-4">
  44. <h2><?php echo $item->getName(); ?></h2>
  45. <p>in <a href="./?page=browse&cat=<?php echo $item->getCategoryId(); ?>"><?php echo $item->getCategoryName(); ?></a></p>
  46. <h3>$<?php echo $item->getPrice(); ?></h3>
  47. </div>
  48. <div class="col-sm-5">
  49. <form action="./action.php" method="POST">
  50. <input type="number" name="qty" class="form-control mb-2" placeholder="Quantity" value="1" />
  51. <button type="submit" class="btn btn-block btn-primary"><i class="fas fa-cart-plus"></i> Add to Cart</button>
  52. <input type="hidden" name="item" value="<?php echo $item->getId(); ?>" />
  53. <input type="hidden" name="action" value="addtocart" />
  54. </form>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="row mt-4 mt-sm-0">
  60. <div class="col-12">
  61. <div class="card mt-4">
  62. <div class="card-body">
  63. <h5 class="card-title">Description</h5>
  64. <p>
  65. <?php
  66. $desc = $item->getDescription();
  67. if (empty($desc)) {
  68. echo "No item information found.";
  69. } else {
  70. echo htmlspecialchars($desc);
  71. }
  72. ?>
  73. </p>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>