new_document.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App;
  3. ?>
  4. <div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="new-document-modal">
  5. <div class="modal-dialog modal-lg">
  6. <form class="modal-content" method="post" action="/documents/submit">
  7. <?php
  8. View::include("modals/header", ["title" => __("New Document")]);
  9. ?>
  10. <input type="hidden" name="type" value="" />
  11. <div class="modal-body">
  12. <div class="mb-3">
  13. <label class="form-label" for="new-document-supplier-id"><?= htmlspecialchars(__("Supplier")) ?></label>
  14. <select class="form-control" name="supplier_id" id="new-document-supplier-id">
  15. <option value=""><?=htmlspecialchars(__("Select Supplier"))?></option>
  16. <?php
  17. foreach(Supplier::getAll() as $supplier) {
  18. ?>
  19. <option value="<?=$supplier->id?>">
  20. <?=htmlspecialchars($supplier->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. <option value=""><?=htmlspecialchars(__("Select Location"))?></option>
  31. <?php
  32. foreach(Customer::getAll() as $customer) {
  33. ?>
  34. <optgroup label="<?=htmlspecialchars($customer->name)?>">
  35. <?php
  36. foreach($customer->getLocations() as $location) {
  37. ?>
  38. <option value="<?=$location->id?>">
  39. <?=htmlspecialchars($location->name)?>
  40. </option>
  41. <?php
  42. }
  43. ?>
  44. </optgroup>
  45. <?php
  46. }
  47. ?>
  48. </select>
  49. </div>
  50. </div>
  51. <div class="modal-footer">
  52. <button type="submit" class="btn btn-success">
  53. <?= htmlspecialchars(__("Submit")) ?>
  54. </button>
  55. </div>
  56. </form>
  57. </div>
  58. </div>