account.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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);
  58. if($has_to_do && Core::$user->level >= User::LEVEL_ADMIN) {
  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. }
  85. if(Core::$user->level != User::LEVEL_DEACTIVATED && !Core::$user->terms_accepted) {
  86. ?>
  87. <div class="alert alert-danger">
  88. <p><i class="fas fa-info-circle"></i> <strong>IMPORTANT</strong></p>
  89. <?php
  90. if(is_null(Core::$user->terms_accepted)) {
  91. ?>
  92. <p><a href="/terms-and-conditions">Terms and Conditions</a> have been published.</p>
  93. <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>
  94. <?php
  95. }
  96. else {
  97. ?>
  98. <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>
  99. <?php
  100. }
  101. ?>
  102. <a class="btn btn-success" href="/account/accept-terms">Accept</a>
  103. <a class="btn btn-danger" href="/account/decline-terms">Decline</a>
  104. </div>
  105. <?php
  106. }
  107. ?>
  108. <h3>Useful Documents</h3>
  109. <div class="list-group mb-3">
  110. <a class="list-group-item list-group-item-action" href="/files/id_response.pdf">
  111. <i class="fal fa-fw fa-file-pdf"></i>
  112. ID Response for Testers
  113. </a>
  114. <a class="list-group-item list-group-item-action" href="/files/testing_methodology.pdf">
  115. <i class="fal fa-fw fa-file-pdf"></i>
  116. Age Verification Testing Methodology
  117. </a>
  118. <a class="list-group-item list-group-item-action" href="/files/machine_categories.pdf">
  119. <i class="fal fa-fw fa-file-pdf"></i>
  120. Machine Categories
  121. </a>
  122. <a class="list-group-item list-group-item-action" href="/files/testing_procedure.pdf">
  123. <i class="fal fa-fw fa-file-pdf"></i>
  124. Testing Procedure
  125. </a>
  126. </div>
  127. <h3>Referrals</h3>
  128. <div class="list-group mb-3">
  129. <div class="list-group-item d-flex justify-content-between">
  130. <span>
  131. <i class="fal fa-fw fa-users"></i>
  132. Users Referred:
  133. </span>
  134. <span><?=number_format(count($referrals))?></span>
  135. </div>
  136. <div class="list-group-item d-flex align-items-center justify-content-between">
  137. <span>
  138. <i class="fal fa-fw fa-external-link"></i>
  139. Referral Link:
  140. </span>
  141. <div class="input-group input-group-sm w-50">
  142. <input class="form-control w-auto" type="text" id="referral-link" readonly value="<?=PROTOCOL?>://<?=DOMAIN?>/register?r=<?=Core::$user->id?>" />
  143. <div class="input-group-append">
  144. <button class="btn btn-secondary" data-clipboard-target="#referral-link" data-toggle="tooltip" title="Copy to clipboard">
  145. <i class="fal fa-fw fa-clipboard"></i>
  146. <span class="sr-only">Copy to clipboard</span>
  147. </button>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>