new_document.php 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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-company-id"><?= htmlspecialchars(__("Company")) ?></label>
  14. <select class="form-control" name="company_id" id="new-document-company-id">
  15. <option value=""><?=htmlspecialchars(__("Select Company"))?></option>
  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="new-document-supplier-id"><?= htmlspecialchars(__("Supplier")) ?></label>
  29. <select class="form-control" name="supplier_id" id="new-document-supplier-id">
  30. <option value=""><?=htmlspecialchars(__("Select Supplier"))?></option>
  31. <?php
  32. foreach(Supplier::getAll() as $supplier) {
  33. ?>
  34. <option value="<?=$supplier->id?>">
  35. <?=htmlspecialchars($supplier->name)?>
  36. </option>
  37. <?php
  38. }
  39. ?>
  40. </select>
  41. </div>
  42. <div class="mb-3">
  43. <label class="form-label" for="new-document-location-id"><?= htmlspecialchars(__("Location")) ?></label>
  44. <select class="form-control" name="location_id" id="new-document-location-id">
  45. <option value=""><?=htmlspecialchars(__("Select Location"))?></option>
  46. <?php
  47. foreach(Customer::getAll() as $customer) {
  48. ?>
  49. <optgroup label="<?=htmlspecialchars($customer->name)?>">
  50. <?php
  51. foreach($customer->getLocations() as $location) {
  52. ?>
  53. <option value="<?=$location->id?>">
  54. <?=htmlspecialchars($location->name)?>
  55. </option>
  56. <?php
  57. }
  58. ?>
  59. </optgroup>
  60. <?php
  61. }
  62. ?>
  63. </select>
  64. </div>
  65. <section id="new-document-aru-section">
  66. <h5><?=htmlspecialchars(__("ARU Item"))?></h5>
  67. <p><?=htmlspecialchars(__("Enter details of the part that is being returned if known."))?></p>
  68. <div class="mb-3">
  69. <label class="form-label" for="new-document-item-description">
  70. <?=htmlspecialchars(__("Description"))?>
  71. </label>
  72. <input class="form-control" type="text" name="item_description" id="new-document-item-description" maxlength="255" placeholder="<?=htmlspecialchars(__("Type description"))?>" />
  73. </div>
  74. <div class="mb-3">
  75. <label class="form-label" for="new-document-item-serial-number">
  76. <?=htmlspecialchars(__("Serial Number"))?>
  77. </label>
  78. <input class="form-control" type="text" name="item_serial_number" id="new-document-item-serial-number" maxlength="255" placeholder="<?=htmlspecialchars(__("Type serial number"))?>" />
  79. </div>
  80. </section>
  81. </div>
  82. <div class="modal-footer">
  83. <button type="submit" class="btn btn-success">
  84. <?= htmlspecialchars(__("Submit")) ?>
  85. </button>
  86. </div>
  87. </form>
  88. </div>
  89. </div>