register.php 7.2 KB

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