new_document.php 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. namespace App;
  3. use App\Helpers\HtmlHelper;
  4. $core = Core::getInstance();
  5. $settings = $core->getSettings();
  6. ?>
  7. <div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="new-document-modal">
  8. <div class="modal-dialog modal-lg">
  9. <form class="modal-content" method="post" action="/documents/submit">
  10. <?php
  11. View::include("modals/header", ["title" => __("New Document")]);
  12. ?>
  13. <input type="hidden" name="ticket_id" value="" />
  14. <div class="modal-body">
  15. <div class="mb-3">
  16. <label class="form-label" for="new-document-company-id"><?= htmlspecialchars(__("Company")) ?></label>
  17. <select class="form-control" name="company_id" id="new-document-company-id" required>
  18. <option value=""><?=htmlspecialchars(__("Select Company"))?></option>
  19. <?php
  20. HtmlHelper::renderOptions(Company::getOptions(), $settings->defaultCompanyId ?? null);
  21. ?>
  22. </select>
  23. </div>
  24. <div class="mb-3">
  25. <label class="form-label" for="new-document-supplier-id"><?= htmlspecialchars(__("Supplier")) ?></label>
  26. <select class="form-control" name="supplier_id" id="new-document-supplier-id">
  27. <option value=""><?=htmlspecialchars(__("Select Supplier"))?></option>
  28. <?php
  29. foreach(Supplier::getAll() as $supplier) {
  30. ?>
  31. <option value="<?=$supplier->id?>">
  32. <?=htmlspecialchars($supplier->name)?>
  33. </option>
  34. <?php
  35. }
  36. ?>
  37. </select>
  38. </div>
  39. <div class="mb-3">
  40. <label class="form-label" for="new-document-location-id"><?= htmlspecialchars(__("Location")) ?></label>
  41. <select class="form-control" name="location_id" id="new-document-location-id">
  42. <option value=""><?=htmlspecialchars(__("Select Location"))?></option>
  43. <?php
  44. foreach(Customer::getAll() as $customer) {
  45. ?>
  46. <optgroup label="<?=htmlspecialchars($customer->name)?>">
  47. <?php
  48. foreach($customer->getLocations() as $location) {
  49. ?>
  50. <option value="<?=$location->id?>">
  51. <?=htmlspecialchars($location->name)?>
  52. </option>
  53. <?php
  54. }
  55. ?>
  56. </optgroup>
  57. <?php
  58. }
  59. ?>
  60. </select>
  61. </div>
  62. <section id="new-document-aru-section">
  63. <h5><?=htmlspecialchars(__("ARU Item"))?></h5>
  64. <p><?=htmlspecialchars(__("Enter details of the part that is being returned if known."))?></p>
  65. <div class="mb-3">
  66. <label class="form-label" for="new-document-item-description">
  67. <?=htmlspecialchars(__("Description"))?>
  68. </label>
  69. <input class="form-control" type="text" name="item_description" id="new-document-item-description" maxlength="255" placeholder="<?=htmlspecialchars(__("Type description"))?>" />
  70. </div>
  71. <div class="mb-3">
  72. <label class="form-label" for="new-document-item-serial-number">
  73. <?=htmlspecialchars(__("Serial Number"))?>
  74. </label>
  75. <input class="form-control" type="text" name="item_serial_number" id="new-document-item-serial-number" maxlength="255" placeholder="<?=htmlspecialchars(__("Type serial number"))?>" />
  76. </div>
  77. </section>
  78. </div>
  79. <div class="modal-footer">
  80. <button type="submit" class="btn btn-success">
  81. <?= htmlspecialchars(__("Submit")) ?>
  82. </button>
  83. </div>
  84. </form>
  85. </div>
  86. </div>