account.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <div class="container mt-3 py-4">
  2. <div class="row">
  3. <div class="col">
  4. <h2><?=htmlspecialchars($page_title)?></h2>
  5. </div>
  6. <div class="col-auto">
  7. <?php
  8. if($logo_path) {
  9. $path = str_replace("public/", "", $logo_path);
  10. ?>
  11. <img src="<?=htmlspecialchars($path)?>" alt="<?=htmlspecialchars($customer->name)?>" style="height: 38px;">
  12. <?php
  13. }
  14. ?>
  15. </div>
  16. </div>
  17. <?php
  18. switch(Core::$user->level) {
  19. case User::LEVEL_BANNED:
  20. ?>
  21. <div class="alert alert-danger">
  22. <i class="fal fa-fw fa-exclamation-circle"></i>
  23. <?=htmlspecialchars(__("Your account has been banned. You will not be able to participate in any tests."))?>
  24. </div>
  25. <?php
  26. break;
  27. case User::LEVEL_REGISTERED:
  28. ?>
  29. <div class="alert alert-warning">
  30. <i class="fal fa-fw fa-clock"></i>
  31. <?=htmlspecialchars(__("Your account is not verified. You need to submit proof of ID and get your account verified before you can participate in tests."))?>
  32. </div>
  33. <?php
  34. break;
  35. case User::LEVEL_UNVERIFIED:
  36. ?>
  37. <div class="alert alert-warning">
  38. <i class="fal fa-fw fa-clock"></i>
  39. <?=htmlspecialchars(__("Your account is pending verification. You will be able to participate in tests once verified."))?>
  40. </div>
  41. <?php
  42. break;
  43. case User::LEVEL_DEACTIVATED:
  44. ?>
  45. <div class="alert alert-info">
  46. <i class="fal fa-fw fa-info-circle"></i>
  47. <?=htmlspecialchars(__("Your account is deactivated. You will not be able to participate in any tests until you reactivate your account."))?>
  48. </div>
  49. <?php
  50. break;
  51. }
  52. if(!empty($customer)) {
  53. ?>
  54. <h3>
  55. <?=htmlspecialchars("Quick Stats")?>
  56. </h3>
  57. <section class="row">
  58. <div class="col-xl-3 col-md-6">
  59. <div class="card card-body mb-3">
  60. <?=htmlspecialchars(__("Tests Completed"))?>
  61. <div class="stat">
  62. <?=$test_count?>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="col-xl-3 col-md-6">
  67. <div class="card card-body mb-3">
  68. <?=htmlspecialchars(__("Pass Rate"))?>
  69. <div class="stat">
  70. <?=round($pass_rate * 100, 2)?>%
  71. </div>
  72. </div>
  73. </div>
  74. <div class="col-xl-3 col-md-6">
  75. <div class="card card-body mb-3">
  76. <?=htmlspecialchars(__("Pass Count"))?>
  77. <div class="stat">
  78. <?=htmlspecialchars(number_format($pass_count))?> /
  79. <?=htmlspecialchars(number_format($pass_fail_test_count))?>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="col-xl-3 col-md-6">
  84. <div class="card card-body mb-3">
  85. <?=htmlspecialchars(__("Year Cycle"))?>
  86. <div class="stat">
  87. <?=htmlspecialchars($year_cycle_start_text)?>
  88. </div>
  89. </div>
  90. </div>
  91. </section>
  92. <?php
  93. }
  94. ?>
  95. <div class="row">
  96. <div class="col-xl mb-3 mb-lg-0">
  97. <h3>
  98. <?=htmlspecialchars(__("Main Menu"))?>
  99. </h3>
  100. <div class="row">
  101. <?php
  102. foreach($icons as $icon) {
  103. ?>
  104. <div class="col-6 col-sm-4 text-center">
  105. <a class="btn btn-light btn-block mb-3 p-2" href="<?=htmlspecialchars($icon->url)?>">
  106. <?php
  107. if($icon->counter) {
  108. ?>
  109. <span class="fa-layers fa-fw fa-3x mb-2">
  110. <i class="fal fa-<?=htmlspecialchars($icon->icon)?>"></i>
  111. <span class="fa-layers-counter fa-layers-bottom-right"><?=number_format($icon->counter)?></span>
  112. </span>
  113. <?php
  114. }
  115. else {
  116. ?>
  117. <i class="fal fa-3x fa-<?=htmlspecialchars($icon->icon)?> mb-2"></i>
  118. <?php
  119. }
  120. ?>
  121. <br />
  122. <?=htmlspecialchars($icon->name)?>
  123. </a>
  124. </div>
  125. <?php
  126. }
  127. ?>
  128. </div>
  129. </div>
  130. <div class="col-xl mb-3 mb-lg-0">
  131. <?php
  132. if($to_do) {
  133. ?>
  134. <h3><?=htmlspecialchars(__("To-Do"))?></h3>
  135. <div class="row">
  136. <?php
  137. foreach($to_do as $icon) {
  138. ?>
  139. <div class="col-6 col-sm-4 text-center">
  140. <a class="btn btn-primary btn-block mb-3 p-2" href="<?=htmlspecialchars($icon->url)?>">
  141. <?php
  142. if($icon->counter) {
  143. ?>
  144. <span class="fa-layers fa-fw fa-3x mb-2">
  145. <i class="fal fa-<?=htmlspecialchars($icon->icon)?>"></i>
  146. <span class="fa-layers-counter fa-layers-bottom-right"><?=number_format($icon->counter)?></span>
  147. </span>
  148. <?php
  149. }
  150. else {
  151. ?>
  152. <i class="fal fa-3x fa-<?=htmlspecialchars($icon->icon)?> mb-2"></i>
  153. <?php
  154. }
  155. ?>
  156. <br />
  157. <?=htmlspecialchars($icon->name)?>
  158. </a>
  159. </div>
  160. <?php
  161. }
  162. ?>
  163. </div>
  164. <?php
  165. }
  166. if(Core::$user->level != User::LEVEL_DEACTIVATED && !Core::$user->terms_accepted) {
  167. ?>
  168. <div class="alert alert-danger">
  169. <p><i class="fas fa-info-circle"></i> <strong><?=htmlspecialchars(__("Important"))?></strong></p>
  170. <?php
  171. if(is_null(Core::$user->terms_accepted)) {
  172. ?>
  173. <p>
  174. <a href="/terms-and-conditions">Terms and Conditions</a> have been published.
  175. <?=sprintf(htmlspecialchars(__("%sTerms and Conditions%s have been published.")), "<a href=\"/terms-and-conditions\">", "</a>")?>
  176. </p>
  177. <p>
  178. <?=sprintf(htmlspecialchars(__("Our records show that you have not accepted the %sTerms and Conditions%s on registration. Please take time to read our Terms and Conditions and then click Accept or Decline to continue.")), '<a href="/terms-and-conditions">', '</a>')?>
  179. </p>
  180. <?php
  181. }
  182. else {
  183. ?>
  184. <p>
  185. <?=sprintf(htmlspecialchars(__("Our records show that you have declined the %sTerms and Conditions. If you have changed your mind, please click Accept to continue or Decline for other actions.")), '<a href="/terms-and-conditions">', '</a>')?>
  186. </p>
  187. <?php
  188. }
  189. ?>
  190. <a class="btn btn-success" href="/account/accept-terms"><?=htmlspecialchars(__("Accept"))?></a>
  191. <a class="btn btn-danger" href="/account/decline-terms"><?=htmlspecialchars(__("Decline"))?></a>
  192. </div>
  193. <?php
  194. }
  195. ?>
  196. <?php
  197. if(Core::$user->isCustomer() == false) {
  198. ?>
  199. <h3><?=htmlspecialchars(__("Useful Documents"))?></h3>
  200. <div class="list-group mb-3">
  201. <a class="list-group-item list-group-item-action" href="/files/id_response.pdf">
  202. <i class="fal fa-fw fa-file-pdf"></i>
  203. <?=htmlspecialchars(__("ID Response for Testers"))?>
  204. </a>
  205. <a class="list-group-item list-group-item-action" href="/files/testing_methodology.pdf">
  206. <i class="fal fa-fw fa-file-pdf"></i>
  207. <?=htmlspecialchars(__("Age Verification Testing Methodology"))?>
  208. </a>
  209. <a class="list-group-item list-group-item-action" href="/files/machine_categories.pdf">
  210. <i class="fal fa-fw fa-file-pdf"></i>
  211. <?=htmlspecialchars(__("Machine Categories"))?>
  212. </a>
  213. <a class="list-group-item list-group-item-action" href="/files/testing_procedure_arcades.pdf">
  214. <i class="fal fa-fw fa-file-pdf"></i>
  215. <?=htmlspecialchars(__("Testing Procedure for Arcades"))?>
  216. </a>
  217. <a class="list-group-item list-group-item-action" href="/files/testing_procedure_pubs.pdf">
  218. <i class="fal fa-fw fa-file-pdf"></i>
  219. <?=htmlspecialchars(__("Testing Procedure for Pubs"))?>
  220. </a>
  221. </div>
  222. <?php
  223. }
  224. if(Core::$user->isTester()) {
  225. ?>
  226. <h3><?=htmlspecialchars(__("Referrals"))?></h3>
  227. <div class="list-group mb-3">
  228. <div class="list-group-item d-flex justify-content-between">
  229. <span>
  230. <i class="fal fa-fw fa-users"></i>
  231. <?=htmlspecialchars(__("Users Referred"))?>:
  232. </span>
  233. <span><?=number_format(count($referrals))?></span>
  234. </div>
  235. <div class="list-group-item d-flex justify-content-between">
  236. <span>
  237. <i class="fal fa-fw fa-external-link"></i>
  238. <?=htmlspecialchars(__("Referral Link"))?>:
  239. </span>
  240. <span>
  241. <a href="#" data-clipboard-text="<?=PROTOCOL?>://<?=DOMAIN?>/register?r=<?=Core::$user->id?>" data-toggle="tooltip" data-title="<?=htmlspecialchars(__("Copy to clipboard"))?>">
  242. <i class="fal fa-fw fa-clipboard"></i>
  243. <?=htmlspecialchars(__("Copy to clipboard"))?>
  244. </a>
  245. </span>
  246. </div>
  247. </div>
  248. <?php
  249. }
  250. ?>
  251. </div>
  252. </div>
  253. </div>