sale_item.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App;
  3. ?>
  4. <div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="sale-item-modal">
  5. <div class="modal-dialog modal-lg">
  6. <form class="modal-content" method="post">
  7. <?php
  8. View::include("modals/header", ["title" => __("Sale Item")]);
  9. ?>
  10. <input type="hidden" name="sale_item_id" value="" />
  11. <div class="modal-body">
  12. <div class="mb-2">
  13. <label for="sale-item-product-id" class="form-label"><?=htmlspecialchars(__("Product"))?></label>
  14. <select class="form-control" name="product_id" id="sale-item-product-id">
  15. <option value=""><?=htmlspecialchars(__("Select Product"))?></option>
  16. <?php
  17. foreach(Product::getAll() as $product) {
  18. ?>
  19. <option value="<?=$product->id?>" data-price="<?=$product->price?>" data-price-eur="">
  20. <?=htmlspecialchars($product->name)?>
  21. </option>
  22. <?php
  23. }
  24. ?>
  25. </select>
  26. </div>
  27. <div class="mb-2">
  28. <label for="sale-item-quantity" class="form-label">
  29. <?=htmlspecialchars(__("Quantity"))?>
  30. </label>
  31. <input class="form-control" type="number" name="quantity" id="sale-item-quantity" min="0" value="1" placeholder="<?=htmlspecialchars(__("Type quantity"))?>" required />
  32. </div>
  33. <div class="mb-2">
  34. <label for="sale-item-unit-price" class="form-label">
  35. <?=htmlspecialchars(__("Unit Price"))?>
  36. </label>
  37. <input class="form-control" type="number" name="unit_price" id="sale-item-unit-price" min="0.00" step="0.01" value="0.00" placeholder="<?=htmlspecialchars(__("Type unit price"))?>" required />
  38. </div>
  39. </div>
  40. <div class="modal-footer">
  41. <button type="submit" class="btn btn-success">
  42. <?= htmlspecialchars(__("Save")) ?>
  43. </button>
  44. </div>
  45. </form>
  46. </div>
  47. </div>