PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/sites/all/themes/md_oldal/template/page--node--7.tpl.php

https://bitbucket.org/jaayyy/country-lane-farms
PHP | 254 lines | 208 code | 41 blank | 5 comment | 7 complexity | d627bcb03d0815baaaa91c72a2851969 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
  1. <div class="main-wrap">
  2. <?php include 'header.php';
  3. drupal_add_js($base_url."/".drupal_get_path('theme', 'md_oldal')."/js/jquery.valid-email.js");
  4. drupal_add_js($base_url."/".drupal_get_path('theme', 'md_oldal')."/js/bootstrap.min.js");
  5. drupal_add_js($base_url."/".drupal_get_path('theme', 'md_oldal')."/js/jquery.register.js");
  6. drupal_add_js("https://maps.googleapis.com/maps/api/js?key=" . OM_MAPS_API_KEY, "external");
  7. //drupal_add_js($base_url."/".drupal_get_path('theme', 'md_oldal')."/js/register-map.js");
  8. $Locations = om_location();
  9. if ($Locations["StatusCode"] == 1) {
  10. $Locations = $Locations["Data"];
  11. } else {
  12. $Locations = false;
  13. }
  14. ?>
  15. <style type="text/css">
  16. #map-container {
  17. width: 650px;
  18. height: 400px;
  19. }
  20. #map-container img{ max-width: none; }
  21. </style>
  22. <div class="content col-md-10 col-md-offset-1">
  23. <div class="register-form form">
  24. <h1>Create a new account</h1>
  25. <p>
  26. Register with us to start your first order and receive newsletter updates on upcoming specials.
  27. </p>
  28. <p>Required<sup class="red-text">*</sup></p>
  29. <form action="<?php echo base_url()."/?q=".drupal_lookup_path("alias", "node/12"); ?>" method="post" id="register-form">
  30. <div class="left-col col-md-4">
  31. <div class="form-group">
  32. <label for="first-name">First Name<sup class="red-text">*</sup></label>
  33. <input type="text" id="first-name" name="f[firstname]" >
  34. </div>
  35. <div class="form-group">
  36. <label for="last-name">Last Name<sup class="red-text">*</sup></label>
  37. <input type="text" id="last-name" name="f[lastname]" >
  38. </div>
  39. <div class="form-group">
  40. <label for="email">Email Address<sup class="red-text">*</sup></label>
  41. <input type="text" id="email" name="f[email]" ok="false" >
  42. </div>
  43. <div class="form-group">
  44. <label for="conf-email">Confirm Email Address<sup class="red-text">*</sup></label>
  45. <input type="text" id="conf-email" name="f[emailconfirm]" >
  46. </div>
  47. <div class="form-group">
  48. <label for="password">Password<sup class="red-text">*</sup> (must be 8 characters or more)</label>
  49. <input type="password" id="password" name="f[password]">
  50. </div>
  51. <div class="form-group">
  52. <label for="conf-password">Confirm Password<sup class="red-text">*</sup> (must be 8 characters or more)</label>
  53. <input type="password" id="conf-password" name="f[passwordconfirm]" data-container="body" data-trigger="focus" data-toggle="popover" data-placement="bottom">
  54. </div>
  55. <div class="form-group">
  56. <label for="phone">Phone<sup class="red-text">*</sup></label>
  57. <input type="text" id="phone" name="f[phone]">
  58. </div>
  59. <div class="form-group">
  60. <label for="hear-about">How did you hear about us?</label>
  61. <select id="hear-about" class="form-control" style="padding: 6px 12px; border-width: 2px;">
  62. <option value="">Select an Option</option>
  63. <option value="Friend">Friend</option>
  64. <option value="Internet">Internet</option>
  65. <option value="Other">Other</option>
  66. </select>
  67. <input type="text" id="hear-option">
  68. <input type="hidden" name="f[hear]" value="" id="hear-value" />
  69. </div>
  70. </div>
  71. <div class="right-col col-md-8">
  72. <?php
  73. if (!isset($FormData["locationid"])) {
  74. $FormData["locationid"] = 0;
  75. }
  76. $Selected[$FormData["locationid"]] = "checked";
  77. ?>
  78. <div class="inner row">
  79. <div class="col-sm-4 hidden-xs">
  80. <label id="preferred-location">Preferred Pick up location<sup class="red-text">*</sup></label>
  81. <div class="radio" id="preferred-location-div">
  82. <label>
  83. <input type="radio" class="location0" name="f[locationid]" value="0" <?php echo $Selected[0]; ?> />None
  84. </label>
  85. </div>
  86. <?php
  87. foreach($Locations as $idx => $l) {
  88. ?>
  89. <div class="radio">
  90. <label>
  91. <input type="radio" class="location<?php echo $l->id; ?>" name="f[locationid]" value="<?php echo $l->id; ?>" <?php echo $Selected[$l->id]; ?> onclick="javascript:PickupSelected(<?php echo $idx; ?>);" /><?php echo $l->name; ?>
  92. </label>
  93. </div>
  94. <?php } ?>
  95. </div>
  96. <style>
  97. #map-canvas {width: 100%; height: 489px}
  98. #map-canvas img{ max-width: none; }
  99. </style>
  100. <script type="text/javascript">
  101. var markers = <?php echo json_encode($Locations);?>;
  102. var map;
  103. function initialize() {
  104. var mapOptions = {
  105. center: new google.maps.LatLng(51.533873, -114.029312),
  106. zoom: 8
  107. };
  108. map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  109. var googleMapMarkers = [];
  110. var contentStrings = [];
  111. var infoWindows = [];
  112. for(var i in markers){
  113. addMarker(map, markers[i]);
  114. }
  115. }
  116. google.maps.event.addDomListener(window, 'load', initialize);
  117. function addMarker(map, place){
  118. var latLng = new google.maps.LatLng(place.latitude,place.longitude);
  119. var marker = new google.maps.Marker({
  120. position: latLng,
  121. map: map
  122. });
  123. var infoWindow = new google.maps.InfoWindow({
  124. content: place.name + "<br />" + place.address
  125. });
  126. google.maps.event.addListener(marker, 'click', function() {
  127. infoWindow.open(map,marker);
  128. });
  129. }
  130. function PickupSelected(idx){
  131. var place = markers[idx];
  132. var latLng = new google.maps.LatLng(place.latitude,place.longitude);
  133. map.setCenter(latLng);
  134. map.setZoom(15);
  135. }
  136. </script>
  137. <div class="map col-sm-8">
  138. <div id="map-canvas">
  139. </div>
  140. <!--
  141. <img src="http://maps.google.com/maps/api/staticmap?center=51.079685,-114.054366&zoom=9&scale=2&size=650x300&markers=51.052068,-113.823654|51.127442,-114.069121|51.130128,-114.198562|51.069330,-114.013168|50.654566,-112.832137|51.051205,-114.144317|50.950956,-114.068786|51.107285,-114.162170|50.914821,-114.059345" alt="">
  142. -->
  143. </div>
  144. </div>
  145. <div class="fields row">
  146. <div class="col-md-6 nopadding">
  147. <div class="form-group">
  148. <label for="address">Address</label>
  149. <input type="text" id="address" name="f[address]">
  150. </div>
  151. <div class="form-group">
  152. <label for="city">City</label>
  153. <input type="text" id="city" name="f[city]">
  154. </div>
  155. <div class="form-group">
  156. <label for="postal-code">Postal Code</label>
  157. <input type="text" id="postal-code" name="f[postalcode]">
  158. </div>
  159. </div>
  160. </div>
  161. <div class="pickup-mobile row visible-xs">
  162. <label>Preferred Pick up location<sup class="red-text">*</sup></label>
  163. <select class="form-control" name="f[location]" id="preferred-location-mobile">
  164. <?php
  165. if (!isset($FormData["locationid"])) {
  166. $FormData["locationid"] = 0;
  167. }
  168. $Selected[$FormData["locationid"]] = "checked";
  169. ?>
  170. <option value="0" <?php echo $Selected[0]; ?>>None</option>
  171. <?php
  172. foreach($Locations as $l) { ?>
  173. <option value="<?php echo $l->id; ?>" <?php if($Selected[$l->id] === 'checked') echo 'selected'; ?>><?php echo $l->name; ?></option>
  174. <?php } ?>
  175. </select>
  176. </div>
  177. <div class="row">
  178. <div class="checkbox">
  179. <label>
  180. <input type="checkbox" name="f[newsletter]" value="1" checked>Newsletter Signup (no more than three times per month)<br/>
  181. <span class="note">PLEASE NOTE: Order confirmation &amp; Reminders will always be sent.</span>
  182. </label>
  183. </div>
  184. <div class="checkbox">
  185. <label>
  186. <input type="checkbox" name="f[privacy]" value="1" id="privacy" data-container="body" data-trigger="focus" data-toggle="popover" data-placement="left">I agree to the <a href="/privacy-policy" target="_blank">Privacy Policy</a>
  187. </label>
  188. </div>
  189. <div class="checkbox" >
  190. <label>
  191. <input type="checkbox" name="f[terms]" value="1" id="terms" data-container="body" data-trigger="focus" data-toggle="popover" data-placement="left">I agree to the <a href="/terms-of-use" target="_blank">Terms of Use</a>
  192. </label>
  193. </div>
  194. <div class="submit-buttons">
  195. <input type="submit" value="Create" class="button" style="border: none;" />
  196. <span class="login-link">or&nbsp;&nbsp;<a href="/login">Log In</span></a>
  197. </div>
  198. </div>
  199. </div>
  200. </form>
  201. </div>
  202. </div>
  203. </div>
  204. <script>
  205. jQuery(document).ready(function($) {
  206. $('#preferred-location-mobile').change(function() {
  207. var value = $('#preferred-location-mobile').val();
  208. var activeclass = "location"+value;
  209. $('.'+activeclass+'').prop('checked', true);;
  210. });
  211. });
  212. </script>
  213. <?php include 'footer.php'; ?>