Consolidated ASP Classic MVC framework from best components
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

154 lignes
7.4KB

  1. <div class="container mt-4">
  2. <nav aria-label="breadcrumb">
  3. <ol class="breadcrumb">
  4. <li class="breadcrumb-item"><a href="/households">Households</a></li>
  5. <li class="breadcrumb-item active" aria-current="page">New Household</li>
  6. </ol>
  7. </nav>
  8. <h1>New Household</h1>
  9. <% Flash().ShowErrorsIfPresent %>
  10. <div class="card">
  11. <div class="card-body">
  12. <form method="post" action="/households">
  13. <div class="row">
  14. <div class="col-md-6">
  15. <div class="mb-3">
  16. <label for="Address" class="form-label">Address <span class="text-danger">*</span></label>
  17. <input type="text" class="form-control" id="Address" name="Address" required maxlength="255">
  18. </div>
  19. <div class="row">
  20. <div class="col-md-4">
  21. <div class="mb-3">
  22. <label for="StreetNumber" class="form-label">Street Number</label>
  23. <input type="number" class="form-control" id="StreetNumber" name="StreetNumber" value="0">
  24. </div>
  25. </div>
  26. <div class="col-md-8">
  27. <div class="mb-3">
  28. <label for="StreetName" class="form-label">Street Name</label>
  29. <input type="text" class="form-control" id="StreetName" name="StreetName" maxlength="255">
  30. </div>
  31. </div>
  32. </div>
  33. <div class="mb-3">
  34. <label for="TerritoryId" class="form-label">Territory <span class="text-danger">*</span></label>
  35. <select class="form-select" id="TerritoryId" name="TerritoryId" required>
  36. <option value="">Select a territory...</option>
  37. <%
  38. Dim tIter, tItem
  39. Set tIter = HouseholdController.territoriesList.Iterator()
  40. Do While tIter.HasNext()
  41. Set tItem = tIter.GetNext()
  42. %>
  43. <option value="<%= tItem.Id %>" <% If tItem.Id = HouseholdController.household.TerritoryId Then Response.Write "selected" End If %>><%= Server.HTMLEncode(tItem.Name) %></option>
  44. <%
  45. Loop
  46. %>
  47. </select>
  48. </div>
  49. <div class="mb-3">
  50. <div class="form-check">
  51. <input class="form-check-input" type="checkbox" id="IsBusiness" name="IsBusiness" value="1">
  52. <label class="form-check-label" for="IsBusiness">
  53. This household is a business
  54. </label>
  55. </div>
  56. </div>
  57. <div class="card border-danger-subtle mb-3">
  58. <div class="card-body">
  59. <div class="form-check mb-3">
  60. <input class="form-check-input" type="checkbox" id="DoNotCall" name="DoNotCall" value="1">
  61. <label class="form-check-label" for="DoNotCall">
  62. Mark this household as Do Not Call
  63. </label>
  64. </div>
  65. <div class="mb-3">
  66. <label for="DoNotCallDate" class="form-label">Do Not Call Date</label>
  67. <input type="date" class="form-control" id="DoNotCallDate" name="DoNotCallDate">
  68. </div>
  69. <div class="mb-3">
  70. <label for="DoNotCallNotes" class="form-label">Do Not Call Notes</label>
  71. <textarea class="form-control" id="DoNotCallNotes" name="DoNotCallNotes" rows="3"></textarea>
  72. </div>
  73. <div class="mb-0">
  74. <label for="DoNotCallPrivateNotes" class="form-label">Private Do Not Call Notes</label>
  75. <textarea class="form-control" id="DoNotCallPrivateNotes" name="DoNotCallPrivateNotes" rows="3"></textarea>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="row">
  80. <div class="col-md-6">
  81. <div class="mb-3">
  82. <label for="Latitude" class="form-label">Latitude</label>
  83. <input type="text" class="form-control" id="Latitude" name="Latitude" placeholder="-33.8688">
  84. </div>
  85. </div>
  86. <div class="col-md-6">
  87. <div class="mb-3">
  88. <label for="Longitude" class="form-label">Longitude</label>
  89. <input type="text" class="form-control" id="Longitude" name="Longitude" placeholder="151.2093">
  90. </div>
  91. </div>
  92. </div>
  93. <div class="d-flex gap-2">
  94. <button type="submit" class="btn btn-primary">Create Household</button>
  95. <a href="/households" class="btn btn-secondary">Cancel</a>
  96. </div>
  97. </div>
  98. <div class="col-md-6">
  99. <label class="form-label">Location (click to set coordinates)</label>
  100. <div id="map" style="height: 350px; width: 100%; border-radius: 8px;"></div>
  101. <small class="text-muted">Click on the map to set latitude and longitude.</small>
  102. </div>
  103. </div>
  104. </form>
  105. </div>
  106. </div>
  107. </div>
  108. <script src="https://maps.googleapis.com/maps/api/js?key=<%= Server.HTMLEncode(GetAppSetting("GoogleMapsApiKey")) %>&callback=initMap" async defer></script>
  109. <script>
  110. var map, marker;
  111. function initMap() {
  112. var defaultCenter = { lat: -33.8688, lng: 151.2093 };
  113. map = new google.maps.Map(document.getElementById('map'), {
  114. zoom: 12,
  115. center: defaultCenter,
  116. mapTypeId: 'roadmap'
  117. });
  118. // Click to place marker and set coordinates
  119. map.addListener('click', function(event) {
  120. placeMarker(event.latLng);
  121. });
  122. }
  123. function placeMarker(location) {
  124. if (marker) {
  125. marker.setPosition(location);
  126. } else {
  127. marker = new google.maps.Marker({
  128. position: location,
  129. map: map
  130. });
  131. }
  132. document.getElementById('Latitude').value = location.lat().toFixed(6);
  133. document.getElementById('Longitude').value = location.lng().toFixed(6);
  134. }
  135. </script>

Powered by TurnKey Linux.