account.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <div class="container mt-3 py-4">
  2. <?php
  3. if($logo_path) {
  4. $path = str_replace("public/", "", $logo_path);
  5. ?>
  6. <img class="float-right" src="<?=htmlspecialchars($path)?>" alt="<?=htmlspecialchars($customer->name)?>" style="height: 88px;">
  7. <?php
  8. }
  9. ?>
  10. <h2><?=htmlspecialchars($page_title)?></h2>
  11. <?php
  12. switch(Core::$user->level) {
  13. case User::LEVEL_BANNED:
  14. ?>
  15. <div class="alert alert-danger">
  16. <i class="fal fa-fw fa-exclamation-circle"></i>
  17. <?=htmlspecialchars(__("Your account has been banned. You will not be able to participate in any tests."))?>
  18. </div>
  19. <?php
  20. break;
  21. case User::LEVEL_REGISTERED:
  22. ?>
  23. <div class="alert alert-warning">
  24. <i class="fal fa-fw fa-clock"></i>
  25. <?=htmlspecialchars(__("Your account is not verified. You need to submit proof of ID and get your account verified before you can participate in tests."))?>
  26. </div>
  27. <?php
  28. break;
  29. case User::LEVEL_UNVERIFIED:
  30. ?>
  31. <div class="alert alert-warning">
  32. <i class="fal fa-fw fa-clock"></i>
  33. <?=htmlspecialchars(__("Your account is pending verification. You will be able to participate in tests once verified."))?>
  34. </div>
  35. <?php
  36. break;
  37. case User::LEVEL_DEACTIVATED:
  38. ?>
  39. <div class="alert alert-info">
  40. <i class="fal fa-fw fa-info-circle"></i>
  41. <?=htmlspecialchars(__("Your account is deactivated. You will not be able to participate in any tests until you reactivate your account."))?>
  42. </div>
  43. <?php
  44. break;
  45. }
  46. if(!empty($customer)) {
  47. ?>
  48. <h3>
  49. <?=htmlspecialchars("Quick Stats")?>
  50. </h3>
  51. <section class="row">
  52. <div class="col-xl-3 col-md-6">
  53. <div class="card card-body mb-3">
  54. <?=htmlspecialchars(__("Tests Completed"))?>
  55. <div class="stat">
  56. <?=$test_count?>
  57. </div>
  58. </div>
  59. </div>
  60. <?php
  61. if($pass_fail_test_count) {
  62. ?>
  63. <div class="col-xl-3 col-md-6">
  64. <div class="card card-body mb-3">
  65. <?=htmlspecialchars(__("Pass Rate"))?>
  66. <div class="stat">
  67. <?=round($pass_rate * 100, 2)?>%
  68. </div>
  69. </div>
  70. </div>
  71. <div class="col-xl-3 col-md-6">
  72. <div class="card card-body mb-3">
  73. <?=htmlspecialchars(__("Pass Count"))?>
  74. <div class="stat">
  75. <?=htmlspecialchars(number_format($pass_count))?> /
  76. <?=htmlspecialchars(number_format($pass_fail_test_count))?>
  77. </div>
  78. </div>
  79. </div>
  80. <?php
  81. }
  82. ?>
  83. <div class="col-xl-3 col-md-6">
  84. <div class="card card-body mb-3">
  85. <?=htmlspecialchars(__("Year Cycle Start"))?>
  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>