| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace App;
- use App\Helpers\HtmlHelper;
- /**
- * @var Customer $customer
- */
- $customers = isset($customer) ? [$customer] : Customer::getAll();
- $request = Request::fromRequest();
- $core = Core::getInstance();
- $settings = $core->getSettings();
- $default_company_id = $settings->defaultCompanyId ?? null;
- $default_location_id = $request->int("add_location_id");
- $location_options = [];
- foreach($customers as $customer) {
- foreach($customer->getLocations() as $location) {
- $location_options[$location->id] = $location->getDisplayName();
- }
- }
- ?>
- <div class="modal fade" role="dialog" tabindex="-1" data-backdrop="static" id="new-sale-modal">
- <div class="modal-dialog modal-lg">
- <form class="modal-content" method="post" action="/leads/submit">
- <?php
- View::include("modals/header", ["title" => __("New Lead")]);
- ?>
- <div class="modal-body">
- <div class="mb-3">
- <label for="new-sale-company-id" class="form-label">
- <?=htmlspecialchars(__("Company"))?>
- </label>
- <select class="form-select" name="company_id" id="new-sale-company-id" required>
- <option value=""><?=htmlspecialchars(__("Select Company"))?></option>
- <?php
- HtmlHelper::renderOptions(Company::getOptions(), $default_company_id);
- ?>
- </select>
- </div>
- <div class="mb-3">
- <label class="form-label" for="new-sale-location-id"><?= htmlspecialchars(__("Location")) ?></label>
- <select class="form-select" name="location_id" id="new-sale-location-id">
- <?php
- HtmlHelper::renderOptions($location_options, $default_location_id);
- ?>
- </select>
- </div>
- <div class="mb-3">
- <label class="form-label" for="date-predicted-sold"><?=htmlspecialchars(__("Predicted Sold Date"))?></label>
- <input class="form-control" type="date" name="date_predicted_sold" id="date-predicted-sold" placeholder="<?=htmlspecialchars(__("Predicted Sold Date"))?>" required />
- </div>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-success">
- <?= htmlspecialchars(__("Submit")) ?>
- </button>
- </div>
- </form>
- </div>
- </div>
|