account.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <?php
  2. /**
  3. * @var string $logo_path
  4. * @var AccountIcon[] $icons
  5. */
  6. ?>
  7. <div class="container mt-3 py-4">
  8. <?php
  9. if($logo_path) {
  10. $path = str_replace("public/", "", $logo_path);
  11. ?>
  12. <img class="float-right" src="<?=htmlspecialchars($path)?>" alt="<?=htmlspecialchars($customer->name)?>" style="height: 88px;">
  13. <?php
  14. }
  15. ?>
  16. <h2><?=htmlspecialchars($page_title)?></h2>
  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. <?php
  67. if($pass_fail_test_count) {
  68. ?>
  69. <div class="col-xl-3 col-md-6">
  70. <div class="card card-body mb-3">
  71. <?=htmlspecialchars(__("Pass Rate"))?>
  72. <div class="stat">
  73. <?=round($pass_rate * 100, 2)?>%
  74. </div>
  75. </div>
  76. </div>
  77. <div class="col-xl-3 col-md-6">
  78. <div class="card card-body mb-3">
  79. <?=htmlspecialchars(__("Pass Count"))?>
  80. <div class="stat">
  81. <?=htmlspecialchars(number_format($pass_count))?> /
  82. <?=htmlspecialchars(number_format($pass_fail_test_count))?>
  83. </div>
  84. </div>
  85. </div>
  86. <?php
  87. }
  88. ?>
  89. <div class="col-xl-3 col-md-6">
  90. <div class="card card-body mb-3">
  91. <?=htmlspecialchars(__("Year Cycle Start"))?>
  92. <div class="stat">
  93. <?=htmlspecialchars($year_cycle_start_text)?>
  94. </div>
  95. </div>
  96. </div>
  97. </section>
  98. <?php
  99. }
  100. ?>
  101. <div class="row">
  102. <div class="col-xl mb-3 mb-lg-0">
  103. <h3>
  104. <?=htmlspecialchars(__("Main Menu"))?>
  105. </h3>
  106. <div class="row">
  107. <?php
  108. foreach($icons as $icon) {
  109. ?>
  110. <div class="col-6 col-sm-4 text-center">
  111. <a class="btn <?=$icon->buttonClass?> btn-block mb-3 p-2" href="<?=htmlspecialchars($icon->url)?>">
  112. <?php
  113. if($icon->counter) {
  114. ?>
  115. <span class="fa-layers fa-fw fa-3x mb-2">
  116. <i class="fal fa-<?=htmlspecialchars($icon->icon)?>"></i>
  117. <span class="fa-layers-counter fa-layers-bottom-right"><?=number_format($icon->counter)?></span>
  118. </span>
  119. <?php
  120. }
  121. else {
  122. ?>
  123. <i class="fal fa-3x fa-<?=htmlspecialchars($icon->icon)?> mb-2"></i>
  124. <?php
  125. }
  126. ?>
  127. <br />
  128. <?=htmlspecialchars($icon->name)?>
  129. </a>
  130. </div>
  131. <?php
  132. }
  133. ?>
  134. </div>
  135. </div>
  136. <div class="col-xl mb-3 mb-lg-0">
  137. <?php
  138. if($to_do) {
  139. ?>
  140. <h3><?=htmlspecialchars(__("To-Do"))?></h3>
  141. <div class="row">
  142. <?php
  143. foreach($to_do as $icon) {
  144. ?>
  145. <div class="col-6 col-sm-4 text-center">
  146. <a class="btn btn-primary btn-block mb-3 p-2" href="<?=htmlspecialchars($icon->url)?>">
  147. <?php
  148. if($icon->counter) {
  149. ?>
  150. <span class="fa-layers fa-fw fa-3x mb-2">
  151. <i class="fal fa-<?=htmlspecialchars($icon->icon)?>"></i>
  152. <span class="fa-layers-counter fa-layers-bottom-right"><?=number_format($icon->counter)?></span>
  153. </span>
  154. <?php
  155. }
  156. else {
  157. ?>
  158. <i class="fal fa-3x fa-<?=htmlspecialchars($icon->icon)?> mb-2"></i>
  159. <?php
  160. }
  161. ?>
  162. <br />
  163. <?=htmlspecialchars($icon->name)?>
  164. </a>
  165. </div>
  166. <?php
  167. }
  168. ?>
  169. </div>
  170. <?php
  171. }
  172. if(Core::$user->level != User::LEVEL_DEACTIVATED && !Core::$user->terms_accepted) {
  173. ?>
  174. <div class="alert alert-danger">
  175. <p><i class="fas fa-info-circle"></i> <strong><?=htmlspecialchars(__("Important"))?></strong></p>
  176. <?php
  177. if(is_null(Core::$user->terms_accepted)) {
  178. ?>
  179. <p>
  180. <a href="/terms-and-conditions">Terms and Conditions</a> have been published.
  181. <?=sprintf(htmlspecialchars(__("%sTerms and Conditions%s have been published.")), "<a href=\"/terms-and-conditions\">", "</a>")?>
  182. </p>
  183. <p>
  184. <?=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>')?>
  185. </p>
  186. <?php
  187. }
  188. else {
  189. ?>
  190. <p>
  191. <?=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>')?>
  192. </p>
  193. <?php
  194. }
  195. ?>
  196. <a class="btn btn-success" href="/account/accept-terms"><?=htmlspecialchars(__("Accept"))?></a>
  197. <a class="btn btn-danger" href="/account/decline-terms"><?=htmlspecialchars(__("Decline"))?></a>
  198. </div>
  199. <?php
  200. }
  201. ?>
  202. <?php
  203. if(Core::$user->isCustomer() == false) {
  204. ?>
  205. <h3><?=htmlspecialchars(__("Useful Documents"))?></h3>
  206. <div class="list-group mb-3">
  207. <a class="list-group-item list-group-item-action" href="/files/id_response.pdf">
  208. <i class="fal fa-fw fa-file-pdf"></i>
  209. <?=htmlspecialchars(__("ID Response for Testers"))?>
  210. </a>
  211. <a class="list-group-item list-group-item-action" href="/files/testing_methodology.pdf">
  212. <i class="fal fa-fw fa-file-pdf"></i>
  213. <?=htmlspecialchars(__("Age Verification Testing Methodology"))?>
  214. </a>
  215. <a class="list-group-item list-group-item-action" href="/files/machine_categories.pdf">
  216. <i class="fal fa-fw fa-file-pdf"></i>
  217. <?=htmlspecialchars(__("Machine Categories"))?>
  218. </a>
  219. <a class="list-group-item list-group-item-action" href="/files/testing_procedure_arcades.pdf">
  220. <i class="fal fa-fw fa-file-pdf"></i>
  221. <?=htmlspecialchars(__("Testing Procedure for Arcades"))?>
  222. </a>
  223. <a class="list-group-item list-group-item-action" href="/files/testing_procedure_pubs.pdf">
  224. <i class="fal fa-fw fa-file-pdf"></i>
  225. <?=htmlspecialchars(__("Testing Procedure for Pubs"))?>
  226. </a>
  227. </div>
  228. <?php
  229. }
  230. if(Core::$user->isTester()) {
  231. ?>
  232. <h3><?=htmlspecialchars(__("Referrals"))?></h3>
  233. <div class="list-group mb-3">
  234. <div class="list-group-item d-flex justify-content-between">
  235. <span>
  236. <i class="fal fa-fw fa-users"></i>
  237. <?=htmlspecialchars(__("Users Referred"))?>:
  238. </span>
  239. <span><?=number_format(count($referrals))?></span>
  240. </div>
  241. <div class="list-group-item d-flex justify-content-between">
  242. <span>
  243. <i class="fal fa-fw fa-external-link"></i>
  244. <?=htmlspecialchars(__("Referral Link"))?>:
  245. </span>
  246. <span>
  247. <a href="#" data-clipboard-text="<?=PROTOCOL?>://<?=DOMAIN?>/register?r=<?=Core::$user->id?>" data-toggle="tooltip" data-title="<?=htmlspecialchars(__("Copy to clipboard"))?>">
  248. <i class="fal fa-fw fa-clipboard"></i>
  249. <?=htmlspecialchars(__("Copy to clipboard"))?>
  250. </a>
  251. </span>
  252. </div>
  253. </div>
  254. <?php
  255. }
  256. ?>
  257. </div>
  258. </div>
  259. </div>