Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

113 строки
7.0KB

  1. <% Flash().ShowErrorsIfPresent : Flash().ShowSuccessIfPresent %>
  2. <nav aria-label="breadcrumb">
  3. <ol class="breadcrumb small mb-2">
  4. <li class="breadcrumb-item"><a href="/businesses">Businesses</a></li>
  5. <li class="breadcrumb-item active" aria-current="page">Add business</li>
  6. </ol>
  7. </nav>
  8. <h1 class="h3 mb-3">Add business</h1>
  9. <div class="row">
  10. <div class="col-lg-7">
  11. <% If Not dup Is Nothing Then %>
  12. <div class="alert alert-warning small">
  13. <i class="bi bi-exclamation-triangle"></i>
  14. Nothing was saved yet. The <%= dup("matched") %> you entered is already used by
  15. <a href="/businesses/<%= dup("id") %>" target="_blank" rel="noopener"><%= H(dup("name")) %></a>.
  16. Fix it, or press <strong>Save anyway</strong> to add it as a second business.
  17. </div>
  18. <% End If %>
  19. <div class="card shadow-sm mb-3">
  20. <div class="card-body">
  21. <form method="post" action="/business/create">
  22. <input type="hidden" name="csrf" value="<%= H(csrf) %>" />
  23. <% If Not dup Is Nothing Then %><input type="hidden" name="allow_duplicate" value="1" /><% End If %>
  24. <div class="mb-2">
  25. <label class="form-label small mb-1" for="f_name">Business name</label>
  26. <input type="text" class="form-control form-control-sm" id="f_name" name="name" value="<%= H(fv("name")) %>" maxlength="255" required autofocus />
  27. </div>
  28. <div class="mb-2">
  29. <label class="form-label small mb-1" for="f_contact">Contact</label>
  30. <input type="text" class="form-control form-control-sm" id="f_contact" name="contact_name" value="<%= H(fv("contact_name")) %>" maxlength="150" />
  31. </div>
  32. <div class="row g-2 mb-2">
  33. <div class="col-6">
  34. <label class="form-label small mb-1" for="f_phone">Phone</label>
  35. <input type="text" class="form-control form-control-sm" id="f_phone" name="phone" value="<%= H(fv("phone")) %>" maxlength="40" />
  36. </div>
  37. <div class="col-6">
  38. <label class="form-label small mb-1" for="f_email">Email</label>
  39. <input type="text" class="form-control form-control-sm" id="f_email" name="email" value="<%= H(fv("email")) %>" maxlength="255" />
  40. </div>
  41. </div>
  42. <div class="mb-2">
  43. <label class="form-label small mb-1" for="f_web">Website</label>
  44. <input type="text" class="form-control form-control-sm" id="f_web" name="website" value="<%= H(fv("website")) %>" maxlength="255" />
  45. </div>
  46. <div class="mb-2">
  47. <label class="form-label small mb-1" for="f_addr">Address</label>
  48. <input type="text" class="form-control form-control-sm" id="f_addr" name="address1" value="<%= H(fv("address1")) %>" maxlength="255" />
  49. </div>
  50. <div class="row g-2 mb-2">
  51. <div class="col-5"><label class="form-label small mb-1" for="f_city">City</label><input type="text" class="form-control form-control-sm" id="f_city" name="city" value="<%= H(fv("city")) %>" maxlength="100" /></div>
  52. <div class="col-3"><label class="form-label small mb-1" for="f_state">State</label><input type="text" class="form-control form-control-sm" id="f_state" name="state" value="<%= H(fv("state")) %>" maxlength="50" /></div>
  53. <div class="col-4"><label class="form-label small mb-1" for="f_zip">Zip</label><input type="text" class="form-control form-control-sm" id="f_zip" name="zip" value="<%= H(fv("zip")) %>" maxlength="20" /></div>
  54. </div>
  55. <div class="row g-2 mb-2">
  56. <div class="col-6">
  57. <label class="form-label small mb-1" for="f_ind">Industry</label>
  58. <select class="form-select form-select-sm" id="f_ind" name="industry_id">
  59. <option value="">(none)</option>
  60. <% For Each indKey2 In industries.Keys %>
  61. <option value="<%= indKey2 %>"<% If CStr(fv("industry_id") & "") = indKey2 Then Response.Write " selected" %>><%= H(industries(indKey2)) %></option>
  62. <% Next %>
  63. </select>
  64. </div>
  65. <div class="col-6">
  66. <label class="form-label small mb-1" for="f_indnew">&hellip;or add new</label>
  67. <input type="text" class="form-control form-control-sm" id="f_indnew" name="industry_new" maxlength="100" value="<% If fv.Exists("_industry_new") Then Response.Write H(fv("_industry_new")) %>" />
  68. </div>
  69. </div>
  70. <fieldset class="mb-2">
  71. <legend class="form-label small mb-1">Areas served</legend>
  72. <% If allAreas.Count > 0 Then %>
  73. <div class="border rounded px-2 py-1 mb-1" style="max-height:9rem;overflow-y:auto">
  74. <% For ix = 0 To allAreas.Count - 1 %>
  75. <div class="form-check form-check-inline">
  76. <input class="form-check-input" type="checkbox" id="f_area_<%= allAreas(ix)("id") %>" name="area_ids" value="<%= allAreas(ix)("id") %>"<% If areaSel.Exists(CStr(allAreas(ix)("id"))) Then Response.Write " checked" %> />
  77. <label class="form-check-label small" for="f_area_<%= allAreas(ix)("id") %>"><%= H(allAreas(ix)("name")) %></label>
  78. </div>
  79. <% Next %>
  80. </div>
  81. <% End If %>
  82. <label class="visually-hidden" for="f_areanew">Add new areas</label>
  83. <input type="text" class="form-control form-control-sm" id="f_areanew" name="area_new" maxlength="500" placeholder="<% If allAreas.Count > 0 Then Response.Write "&hellip;or add new, comma-separated" Else Response.Write "e.g. Dallas, Fort Worth" %>" value="<% If fv.Exists("_area_new") Then Response.Write H(fv("_area_new")) %>" />
  84. </fieldset>
  85. <div class="row g-2 mb-2 align-items-end">
  86. <div class="col-6">
  87. <div class="form-check">
  88. <input class="form-check-input" type="checkbox" id="f_cust" name="is_customer" value="1"<% If fv("is_customer") & "" = "1" Then Response.Write " checked" %> />
  89. <label class="form-check-label small" for="f_cust">Previous customer</label>
  90. </div>
  91. </div>
  92. <div class="col-6">
  93. <label class="form-label small mb-1" for="f_first">First order</label>
  94. <input type="date" class="form-control form-control-sm" id="f_first" name="first_order_date" value="<%= Date_Iso(fv("first_order_date")) %>" />
  95. </div>
  96. </div>
  97. <div class="mb-3">
  98. <label class="form-label small mb-1" for="f_notes">Notes</label>
  99. <textarea class="form-control form-control-sm" id="f_notes" name="notes" rows="4" maxlength="10000"><%= H(fv("notes")) %></textarea>
  100. </div>
  101. <button type="submit" class="btn <% If dup Is Nothing Then Response.Write "btn-primary" Else Response.Write "btn-warning" %> btn-sm"><% If dup Is Nothing Then Response.Write "Add business" Else Response.Write "Save anyway" %></button>
  102. <a href="/businesses" class="btn btn-outline-secondary btn-sm">Cancel</a>
  103. </form>
  104. </div>
  105. </div>
  106. </div>
  107. </div>

Powered by TurnKey Linux.