1
0

account.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <div class="container mt-3 py-4">
  2. <h2>Account</h2>
  3. <?php
  4. switch(Core::$user->level) {
  5. case User::LEVEL_BANNED:
  6. ?>
  7. <div class="alert alert-danger"><i class="fal fa-fw fa-exclamation-circle"></i> Your account has been banned. You will not be able to participate in any tests.</div>
  8. <?php
  9. break;
  10. case User::LEVEL_REGISTERED:
  11. ?>
  12. <div class="alert alert-warning"><i class="fal fa-fw fa-clock"></i> Your account is not verified. You need to submit proof of ID and get your account verified before you can participate in tests.</div>
  13. <?php
  14. break;
  15. case User::LEVEL_UNVERIFIED:
  16. ?>
  17. <div class="alert alert-warning"><i class="fal fa-fw fa-clock"></i> Your account is pending verification. You will be able to participate in tests once verified.</div>
  18. <?php
  19. break;
  20. case User::LEVEL_DEACTIVATED:
  21. ?>
  22. <div class="alert alert-info"><i class="fal fa-fw fa-info-circle"></i> Your account is deactivated. You will not be able to participate in any tests until you reactivate your account.</div>
  23. <?php
  24. break;
  25. }
  26. ?>
  27. <div class="row">
  28. <div class="col-lg-4 mb-3 mb-lg-0">
  29. <h3>Main Menu</h3>
  30. <div class="list-group mb-3">
  31. <?php
  32. foreach($links as $path => $text) {
  33. ?>
  34. <a class="list-group-item list-group-item-action" href="<?=htmlspecialchars($path)?>">
  35. <?=htmlspecialchars($text)?>
  36. </a>
  37. <?php
  38. }
  39. ?>
  40. </div>
  41. <h3>Actions</h3>
  42. <div class="list-group mb-3">
  43. <?php
  44. foreach($actions as $path => $text) {
  45. $text_class = preg_match("/delete/i", $text) ? "text-danger" : "";
  46. ?>
  47. <a class="list-group-item list-group-item-action <?=$text_class?>" href="<?=htmlspecialchars($path)?>">
  48. <?=htmlspecialchars($text)?>
  49. </a>
  50. <?php
  51. }
  52. ?>
  53. </div>
  54. </div>
  55. <div class="col-lg mb-3 mb-lg-0">
  56. <?php
  57. $has_to_do = !empty($users_pending_verification) || !empty($tests_pending_verification) || !empty($tests_remaining);
  58. if($has_to_do) {
  59. ?>
  60. <h3>To-Do</h3>
  61. <?php
  62. if($users_pending_verification) {
  63. $s = ($users_pending_verification == 1) ? "" : "s";
  64. ?>
  65. <div class="alert alert-info mb-3 d-flex flex-row justify-content-between">
  66. <div class="align-self-center">
  67. <i class="fal fa-fw fa-info-circle"></i> <?=number_format($users_pending_verification)?> user<?=$s?> to be verified.
  68. </div>
  69. <a class="btn btn-primary" href="/account/users?level=<?=User::LEVEL_UNVERIFIED?>">View</a>
  70. </div>
  71. <?php
  72. }
  73. if($tests_pending_verification) {
  74. $s = ($tests_pending_verification == 1) ? "" : "s";
  75. ?>
  76. <div class="alert alert-info mb-3 d-flex flex-row justify-content-between">
  77. <div class="align-self-center">
  78. <i class="fal fa-fw fa-info-circle"></i> <?=number_format($tests_pending_verification)?> test<?=$s?> to be verified.
  79. </div>
  80. <a class="btn btn-primary" href="/account/tests?status=<?=Test::STATUS_PENDING_VERIFICATION?>">View</a>
  81. </div>
  82. <?php
  83. }
  84. if($tests_remaining) {
  85. $s = ($tests_remaining == 1) ? "" : "s";
  86. ?>
  87. <div class="alert alert-info mb-3 d-flex flex-row justify-content-between">
  88. <div class="align-self-center">
  89. <i class="fal fa-fw fa-info-circle"></i> <?=number_format($tests_remaining)?> test<?=$s?> remaining.
  90. </div>
  91. <a class="btn btn-primary" href="/account/tests">View</a>
  92. </div>
  93. <?php
  94. }
  95. }
  96. if(Core::$user->level != User::LEVEL_DEACTIVATED && !Core::$user->terms_accepted) {
  97. ?>
  98. <div class="alert alert-danger">
  99. <p><i class="fas fa-info-circle"></i> <strong>IMPORTANT</strong></p>
  100. <?php
  101. if(is_null(Core::$user->terms_accepted)) {
  102. ?>
  103. <p><a href="/terms-and-conditions">Terms and Conditions</a> have been published.</p>
  104. <p>Our records show that you have not accepted the <a href="/terms-and-conditions">Terms and Conditions</a> on registration. Please take time to read our Terms and Conditions and then click Accept or Decline to continue.</p>
  105. <?php
  106. }
  107. else {
  108. ?>
  109. <p>Our records show that you have declined the <a href="/terms-and-conditions">Terms and Conditions</a>. If you have changed your mind, please click Accept to continue or Decline for other actions.</p>
  110. <?php
  111. }
  112. ?>
  113. <a class="btn btn-success" href="/account/accept-terms">Accept</a>
  114. <a class="btn btn-danger" href="/account/decline-terms">Decline</a>
  115. </div>
  116. <?php
  117. }
  118. ?>
  119. <h3>Useful Documents</h3>
  120. <div class="list-group mb-3">
  121. <a class="list-group-item list-group-item-action" href="/files/id_response.pdf">
  122. <i class="fal fa-fw fa-file-pdf"></i>
  123. ID Response for Testers
  124. </a>
  125. <a class="list-group-item list-group-item-action" href="/files/testing_methodology.pdf">
  126. <i class="fal fa-fw fa-file-pdf"></i>
  127. Age Verification Testing Methodology
  128. </a>
  129. <a class="list-group-item list-group-item-action" href="/files/machine_categories.pdf">
  130. <i class="fal fa-fw fa-file-pdf"></i>
  131. Machine Categories
  132. </a>
  133. <a class="list-group-item list-group-item-action" href="/files/testing_procedure.pdf">
  134. <i class="fal fa-fw fa-file-pdf"></i>
  135. Testing Procedure
  136. </a>
  137. </div>
  138. <h3>Referrals</h3>
  139. <div class="list-group mb-3">
  140. <div class="list-group-item d-flex justify-content-between">
  141. <span>
  142. <i class="fal fa-fw fa-users"></i>
  143. Users Referred:
  144. </span>
  145. <span><?=number_format(count($referrals))?></span>
  146. </div>
  147. <div class="list-group-item d-flex align-items-center justify-content-between">
  148. <span>
  149. <i class="fal fa-fw fa-external-link"></i>
  150. Referral Link:
  151. </span>
  152. <div class="input-group input-group-sm w-50">
  153. <input class="form-control w-auto" type="text" id="referral-link" readonly value="<?=PROTOCOL?>://<?=DOMAIN?>/register?r=<?=Core::$user->id?>" />
  154. <div class="input-group-append">
  155. <button class="btn btn-secondary" data-clipboard-target="#referral-link" data-toggle="tooltip" title="Copy to clipboard">
  156. <i class="fal fa-fw fa-clipboard"></i>
  157. <span class="sr-only">Copy to clipboard</span>
  158. </button>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>