register.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. $newsletter_consent_checked = ($user->newsletter_consent) ? "checked" : "";
  3. ?>
  4. <div class="container mt-3 py-4">
  5. <h2>Register</h2>
  6. <p>Become a tester and earn £10 per test which should last no longer than 8 minutes!</p>
  7. <p>If you want more information on our security policy, please call us on 07841 353775 (mobile call rate).</p>
  8. <hr />
  9. <form method="post">
  10. <div class="row">
  11. <div class="col-lg-8 offset-lg-2">
  12. <div class="row mb-1">
  13. <label class="col-sm-4 col-form-label" for="title">Title</label>
  14. <div class="col-sm">
  15. <select class="form-control" name="title" id="title" required>
  16. <option value="">Select title</option>
  17. <?php
  18. foreach(User::TITLES as $title) {
  19. $selected = ($user->title == $title) ? "selected" : "";
  20. ?>
  21. <option value="<?=htmlspecialchars($title)?>" <?=$selected?>><?=htmlspecialchars($title)?></option>
  22. <?php
  23. }
  24. ?>
  25. </select>
  26. </div>
  27. </div>
  28. <div class="row mb-1">
  29. <label class="col-sm-4 col-form-label" for="first-name">First Name</label>
  30. <div class="col-sm">
  31. <input class="form-control" type="text" name="first_name" id="first-name" placeholder="Enter first name" value="<?=htmlspecialchars($user->first_name)?>" required />
  32. </div>
  33. </div>
  34. <div class="row mb-1">
  35. <label class="col-sm-4 col-form-label" for="last-name">Last Name</label>
  36. <div class="col-sm">
  37. <input class="form-control" type="text" name="last_name" id="last-name" placeholder="Enter last name" value="<?=htmlspecialchars($user->last_name)?>" required />
  38. </div>
  39. </div>
  40. <div class="row mb-1">
  41. <label class="col-sm-4 col-form-label" for="gender">Gender</label>
  42. <div class="col-sm">
  43. <select class="form-control" name="gender" id="gender" required>
  44. <option value="">Select gender</option>
  45. <?php
  46. foreach(User::GENDERS as $gender) {
  47. $display = $gender;
  48. $value = substr($gender, 0, 1);
  49. $selected = ($user->gender == $value) ? "selected" : "";
  50. ?>
  51. <option value="<?=htmlspecialchars($value)?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
  52. <?php
  53. }
  54. ?>
  55. </select>
  56. </div>
  57. </div>
  58. <div class="row mb-1">
  59. <label class="col-sm-4 col-form-label" for="email">Email Address</label>
  60. <div class="col-sm">
  61. <input class="form-control" type="email" name="email" id="email" placeholder="Enter email address" value="<?=htmlspecialchars($user->email)?>" required />
  62. </div>
  63. </div>
  64. <div class="row mb-1">
  65. <label class="col-sm-4 col-form-label" for="phone">Mobile Number</label>
  66. <div class="col-sm">
  67. <input class="form-control" type="phone" name="phone" id="phone" placeholder="Enter mobile number" value="<?=htmlspecialchars($user->phone)?>" required />
  68. </div>
  69. </div>
  70. <div class="row mb-1">
  71. <label class="col-sm-4 col-form-label" for="password">Password</label>
  72. <div class="col-sm">
  73. <input class="form-control" type="password" name="password" id="password" placeholder="Enter password" required />
  74. <small class="text-muted form-text">At least <span data-length-requirement>6 characters</span>. Must contain at least one <span data-lowercase-requirement>lowercase</span>, <span data-uppercase-requirement>uppercase</span>, <span data-number-requirement>number</span> and <span data-special-requirement>special</span> character.</small>
  75. </div>
  76. </div>
  77. <div class="row mb-1">
  78. <label class="col-sm-4 col-form-label" for="password-confirm">Confirm Password</label>
  79. <div class="col-sm">
  80. <input class="form-control" type="password" name="password_confirm" id="password-confirm" placeholder="Confirm password" required />
  81. </div>
  82. </div>
  83. <div class="row mb-1">
  84. <label class="col-sm-4 col-form-label" for="date-of-birth">Date of Birth</label>
  85. <div class="col-sm">
  86. <select class="form-control w-auto d-inline-block" name="date_of_birth_day" id="date-of-birth-day">
  87. <option value="">Day</option>
  88. <?php
  89. Form::renderDayOptions();
  90. ?>
  91. </select>
  92. <select class="form-control w-auto d-inline-block" name="date_of_birth_month" id="date-of-birth-month">
  93. <option value="">Month</option>
  94. <?php
  95. Form::renderMonthOptions();
  96. ?>
  97. </select>
  98. <select class="form-control w-auto d-inline-block" name="date_of_birth_year" id="date-of-birth-year">
  99. <option value="">Year</option>
  100. <?php
  101. Form::renderYearOptionsDescending();
  102. ?>
  103. </select>
  104. </div>
  105. </div>
  106. <div class="row mb-1">
  107. <label class="col-sm-4 col-form-label" for="postal-code">Postal Code</label>
  108. <div class="col-sm">
  109. <input class="form-control" type="text" name="postal_code" id="postal-code" placeholder="Enter postal code" value="<?=htmlspecialchars($user_address->postal_code)?>" required />
  110. </div>
  111. </div>
  112. <div class="row mb-3">
  113. <label class="col-sm-4 col-form-label" for="country">Country</label>
  114. <div class="col-sm">
  115. <select class="form-control" name="country" id="country" required>
  116. <?=Form::renderCountryOptions($user_address->country)?>
  117. </select>
  118. </div>
  119. </div>
  120. <div class="row mb-1">
  121. <div class="col-sm offset-sm-4">
  122. <label>
  123. <input type="checkbox" value="1" name="terms_accepted" /> I agree to and have read the <a href="/terms-and-conditions" target="_blank">Terms and Conditions</a> and <a href="/privacy-policy" target="_blank">Privacy Policy</a>
  124. </label>
  125. </div>
  126. </div>
  127. <div class="row mb-1">
  128. <div class="col-sm offset-sm-4 align-self-center">
  129. <label><input type="checkbox" name="newsletter_content" id="newsletter-consent" value="1" <?=$newsletter_consent_checked?> /> Opt-in to newsletters about <?=htmlspecialchars(APP_NAME)?></label>
  130. </div>
  131. </div>
  132. <div class="row">
  133. <div class="col-sm offset-sm-4">
  134. <?php
  135. if(GOOGLE_RECAPTCHA_SITE_KEY) {
  136. ?>
  137. <div class="g-recaptcha mb-1" data-sitekey="<?=GOOGLE_RECAPTCHA_SITE_KEY?>"></div>
  138. <?php
  139. }
  140. ?>
  141. <button class="btn btn-primary" type="submit" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">Register</button>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </form>
  147. </div>