new_sale.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace App;
  3. ?>
  4. <div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="new-sale-modal">
  5. <div class="modal-dialog modal-lg">
  6. <form class="modal-content" method="post" action="/sales/submit">
  7. <?php
  8. View::include("modals/header", ["title" => __("New Sale")]);
  9. ?>
  10. <div class="modal-body">
  11. <div class="mb-3">
  12. <label for="new-sale-company-id" class="form-label">
  13. <?=htmlspecialchars(__("Company"))?>
  14. </label>
  15. <select class="form-control" name="company_id" id="new-sale-company-id">
  16. <?php
  17. foreach(Company::getAll() as $company) {
  18. ?>
  19. <option value="<?=$company->id?>">
  20. <?=htmlspecialchars($company->name)?>
  21. </option>
  22. <?php
  23. }
  24. ?>
  25. </select>
  26. </div>
  27. <div class="mb-3">
  28. <label class="form-label" for="location-id"><?= htmlspecialchars(__("Location")) ?></label>
  29. <select class="form-control" name="location_id" id="location-id">
  30. <?php
  31. foreach(Customer::getAll() as $customer) {
  32. ?>
  33. <optgroup label="<?=htmlspecialchars($customer->name)?>">
  34. <?php
  35. foreach($customer->getLocations() as $location) {
  36. ?>
  37. <option value="<?=$location->id?>">
  38. <?=htmlspecialchars($location->name)?>
  39. </option>
  40. <?php
  41. }
  42. ?>
  43. </optgroup>
  44. <?php
  45. }
  46. ?>
  47. </select>
  48. </div>
  49. </div>
  50. <div class="modal-footer">
  51. <button type="submit" class="btn btn-success">
  52. <?= htmlspecialchars(__("Submit")) ?>
  53. </button>
  54. </div>
  55. </form>
  56. </div>
  57. </div>