new_document.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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-select" 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-select" 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-select" name="location_id" id="new-document-location-id">
  42. <option value=""><?=htmlspecialchars(__("Select Location"))?></option>
  43. <?php
  44. foreach(Customer::getAll() as $customer) {
  45. foreach($customer->getLocations() as $location) {
  46. ?>
  47. <option value="<?=$location->id?>">
  48. <?=htmlspecialchars($location->getDisplayName())?>
  49. </option>
  50. <?php
  51. }
  52. }
  53. ?>
  54. </select>
  55. </div>
  56. <section id="new-document-aru-section">
  57. <h5><?=htmlspecialchars(__("ARU Item"))?></h5>
  58. <p><?=htmlspecialchars(__("Enter details of the part that is being returned if known."))?></p>
  59. <div class="mb-3">
  60. <label class="form-label" for="new-document-item-description">
  61. <?=htmlspecialchars(__("Description"))?>
  62. </label>
  63. <input class="form-control" type="text" name="item_description" id="new-document-item-description" maxlength="255" placeholder="<?=htmlspecialchars(__("Type description"))?>" />
  64. </div>
  65. <div class="mb-3">
  66. <label class="form-label" for="new-document-item-serial-number">
  67. <?=htmlspecialchars(__("Serial Numbers"))?>
  68. </label>
  69. <textarea class="form-control" type="text" name="item_serial_number" id="new-document-item-serial-number" maxlength="64000" placeholder="<?=htmlspecialchars(__("Type serial numbers"))?>"></textarea>
  70. </div>
  71. </section>
  72. </div>
  73. <div class="modal-footer">
  74. <button type="submit" class="btn btn-success">
  75. <?= htmlspecialchars(__("Submit")) ?>
  76. </button>
  77. </div>
  78. </form>
  79. </div>
  80. </div>