new_sale.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace App;
  3. use App\Helpers\HtmlHelper;
  4. /**
  5. * @var Customer $customer
  6. */
  7. $customers = isset($customer) ? [$customer] : Customer::getAll();
  8. $core = Core::getInstance();
  9. $settings = $core->getSettings();
  10. $default_company_id = $settings->defaultCompanyId ?? null;
  11. ?>
  12. <div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="new-sale-modal">
  13. <div class="modal-dialog modal-lg">
  14. <form class="modal-content" method="post" action="/leads/submit">
  15. <?php
  16. View::include("modals/header", ["title" => __("New Lead")]);
  17. ?>
  18. <div class="modal-body">
  19. <div class="mb-3">
  20. <label for="new-sale-company-id" class="form-label">
  21. <?=htmlspecialchars(__("Company"))?>
  22. </label>
  23. <select class="form-select" name="company_id" id="new-sale-company-id" required>
  24. <option value=""><?=htmlspecialchars(__("Select Company"))?></option>
  25. <?php
  26. HtmlHelper::renderOptions(Company::getOptions(), $default_company_id);
  27. ?>
  28. </select>
  29. </div>
  30. <div class="mb-3">
  31. <label class="form-label" for="location-id"><?= htmlspecialchars(__("Location")) ?></label>
  32. <select class="form-select" name="location_id" id="location-id">
  33. <?php
  34. foreach($customers as $customer) {
  35. foreach($customer->getLocations() as $location) {
  36. ?>
  37. <option value="<?=$location->id?>">
  38. <?=htmlspecialchars($location->getDisplayName())?>
  39. </option>
  40. <?php
  41. }
  42. }
  43. ?>
  44. </select>
  45. </div>
  46. <div class="mb-3">
  47. <label class="form-label" for="date-predicted-sold"><?=htmlspecialchars(__("Predicted Sold Date"))?></label>
  48. <input class="form-control" type="date" name="date_predicted_sold" id="date-predicted-sold" placeholder="<?=htmlspecialchars(__("Predicted Sold Date"))?>" required />
  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>