ticket.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. namespace App;
  3. /**
  4. * @var Customer $customer
  5. */
  6. $default_customer_id = $customer->id ?? null;
  7. use App\Helpers\HtmlHelper;
  8. ?>
  9. <div class="modal fade" role="dialog" tabindex="-1" data-bs-backdrop="static" id="ticket-modal">
  10. <div class="modal-dialog modal-lg">
  11. <form class="modal-content" method="post">
  12. <?php
  13. View::include("modals/header", ["title" => __("New Ticket")]);
  14. ?>
  15. <div class="modal-body">
  16. <div class="mb-3">
  17. <label class="form-label" for="ticket-subject"><?=htmlspecialchars(__("Subject"))?></label>
  18. <input class="form-control" type="text" name="subject" id="ticket-subject" maxlength="255" placeholder="<?=htmlspecialchars(__("Type subject"))?>" required />
  19. </div>
  20. <div class="mb-3">
  21. <label class="form-label" for="ticket-content"><?=htmlspecialchars(__("Content"))?></label>
  22. <textarea class="form-control" name="content" id="ticket-content" rows="8" placeholder="<?=htmlspecialchars(__("Type content"))?>" required></textarea>
  23. </div>
  24. <div class="mb-3">
  25. <label class="form-label" for="ticket-contact-name"><?=htmlspecialchars(__("Contact Name"))?></label>
  26. <input class="form-control" name="contact_name" id="ticket-contact-name" type="text" maxlength="255" placeholder="<?=htmlspecialchars(__("Type contact name"))?>" />
  27. </div>
  28. <div id="location-row" class="mb-3">
  29. <label class="form-label" for="ticket-location">
  30. <?=htmlspecialchars(__("Location"))?>
  31. </label>
  32. <select class="form-select" name="location_id" id="ticket-location" required>
  33. <option value=""><?=htmlspecialchars(__("Select Location"))?></option>
  34. </select>
  35. <a id="no-location-action" href="#"><?=htmlspecialchars(__("Click here if the location is not listed."))?></a>
  36. </div>
  37. <div id="no-location-row" class="row" style="display: none;">
  38. <div class="col-lg-4">
  39. <div class="mb-3">
  40. <label class="form-label" for="ticket-customer-id">
  41. <?=htmlspecialchars(__("Customer"))?>
  42. </label>
  43. <select class="form-select" name="customer_id" id="ticket-customer-id">
  44. <option value=""><?=htmlspecialchars(__("Select Customer"))?></option>
  45. <?php
  46. HtmlHelper::renderOptions(Customer::getOptions(), $default_customer_id);
  47. ?>
  48. </select>
  49. </div>
  50. </div>
  51. <div class="col-lg-4">
  52. <div class="mb-3">
  53. <label class="form-label" for="ticket-location-name">
  54. <?=htmlspecialchars(__("Location Name"))?>
  55. </label>
  56. <input class="form-control" type="text" name="location_name" id="ticket-location-name" maxlength="255" placeholder="<?=htmlspecialchars(__("Type location name"))?>" />
  57. </div>
  58. </div>
  59. <div class="col-lg-4">
  60. <div class="mb-3">
  61. <label class="form-label" for="ticket-postal-code">
  62. <?=htmlspecialchars(__("Location Postcode"))?>
  63. </label>
  64. <input class="form-control" type="text" name="postal_code" id="ticket-postal-code" maxlength="255" placeholder="<?=htmlspecialchars(__("Type postcode"))?>" />
  65. </div>
  66. </div>
  67. </div>
  68. <div class="mb-3">
  69. <label class="form-label" for="ticket-attachments"><?=htmlspecialchars(__("Attachments"))?></label>
  70. <input class="form-control" type="file" name="attachments[]" multiple />
  71. </div>
  72. <div class="row">
  73. <div class="col-6">
  74. <div class="mb-3">
  75. <label class="form-label" for="ticket-sale-number"><?=htmlspecialchars(__("Lead No."))?></label>
  76. <input class="form-control" type="number" name="sale_number" id="ticket-sale-number" min="0" placeholder="<?=htmlspecialchars(__("Type lead number"))?>" />
  77. </div>
  78. </div>
  79. <div class="col-6">
  80. <div class="mb-3">
  81. <label class="form-label" for="ticket-aru-number"><?=htmlspecialchars(__("ARU No."))?></label>
  82. <input class="form-control" type="number" name="aru_number" id="ticket-aru-number" min="0" placeholder="<?=htmlspecialchars(__("Type ARU number"))?>" />
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="modal-footer">
  88. <button type="submit" class="btn btn-success">
  89. <?= htmlspecialchars(__("Save")) ?>
  90. </button>
  91. </div>
  92. </form>
  93. </div>
  94. </div>