header.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. $body_class = "";
  3. $print = http::value("print");
  4. if($print) $body_class = "print";
  5. ?>
  6. <!DOCTYPE html>
  7. <html lang="<?=htmlspecialchars(Core::getLang())?>">
  8. <head>
  9. <meta charset="utf-8" />
  10. <meta http-equiv="x-ua-compatible" content="ie=edge" />
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  12. <title><?=htmlspecialchars($page_title)?> | <?=htmlspecialchars(APP_NAME)?></title>
  13. <meta property="og:site_name" content="<?=htmlspecialchars(APP_NAME)?>" />
  14. <meta property="og:title" content="<?=htmlspecialchars($page_title)?>" />
  15. <meta property="og:description" content="<?=htmlspecialchars(__("Age Verification Testing and Training across the UK"))?>" />
  16. <meta property="og:type" content="website" />
  17. <meta property="og:image" content="<?=PROTOCOL?>://<?=DOMAIN?>/img/logo.png" />
  18. <meta property="og:image:alt" content="<?=htmlspecialchars(APP_NAME)?> logo" />
  19. <meta property="og:url" content="<?=PROTOCOL?>://<?=DOMAIN?><?=htmlspecialchars($_SERVER["REQUEST_URI"])?>" />
  20. <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet" />
  21. <?php
  22. $stylesheets = Core::getStylesheets();
  23. foreach($stylesheets as $stylesheet) {
  24. HTML::stylesheet($stylesheet);
  25. }
  26. ?>
  27. <link rel="icon" href="/<?=Core::getIcon()?>?<?=filemtime("public/" . Core::getIcon())?>" />
  28. <script type="text/javascript" src="/js/all.min.js?<?=filemtime("public/js/all.min.js")?>"></script>
  29. <?php
  30. if(GOOGLE_ANALYTICS_ID) {
  31. ?>
  32. <!-- Global site tag (gtag.js) - Google Analytics -->
  33. <script async src="https://www.googletagmanager.com/gtag/js?id=<?=GOOGLE_ANALYTICS_ID?>"></script>
  34. <script>
  35. window.dataLayer = window.dataLayer || [];
  36. function gtag(){dataLayer.push(arguments);}
  37. gtag('js', new Date());
  38. gtag('config', '<?=GOOGLE_ANALYTICS_ID?>');
  39. </script>
  40. <?php
  41. }
  42. ?>
  43. </head>
  44. <body class="<?=htmlspecialchars($body_class)?>">
  45. <div class="fixed-top d-print-none" style="overflow-y: auto; max-height: 100%;">
  46. <nav class="navbar navbar-expand-lg navbar-light bg-light">
  47. <div class="navbar-brand p-0">
  48. <a href="/">
  49. <img src="/<?=htmlspecialchars(Core::getLogo())?>?<?=filemtime("public/" . Core::getLogo())?>" style="height: 40px;" alt="<?=htmlspecialchars(APP_NAME)?>" />
  50. </a>
  51. </div>
  52. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-content" aria-controls="navbar-content" aria-expanded="false" aria-label="Toggle navigation">
  53. <span class="navbar-toggler-icon"></span>
  54. </button>
  55. <div class="collapse navbar-collapse" id="navbar-content">
  56. <ul class="navbar-nav ml-auto">
  57. <?php
  58. if(!Core::isLoggedIn()) {
  59. ?>
  60. <li class="nav-item">
  61. <a class="nav-link" href="/services"><?=htmlspecialchars(__("Services"))?></a>
  62. </li>
  63. <li class="nav-item">
  64. <a class="nav-link" href="/become-a-tester"><?=htmlspecialchars(__("Become a Tester"))?></a>
  65. </li>
  66. <?php
  67. }
  68. ?>
  69. <li class="nav-item">
  70. <a class="nav-link" href="/contact"><?=htmlspecialchars(__("Contact"))?></a>
  71. </li>
  72. <?php
  73. if(Core::isLoggedIn()) {
  74. ?>
  75. <li class="nav-item">
  76. <a class="nav-link" href="/account"><?=htmlspecialchars(__("Account"))?></a>
  77. </li>
  78. <li class="nav-item">
  79. <a class="nav-link" href="/log-out"><?=htmlspecialchars(__("Log Out"))?></a>
  80. </li>
  81. <?php
  82. }
  83. else {
  84. ?>
  85. <li class="nav-item">
  86. <a class="nav-link" href="/jobs"><?=htmlspecialchars(__("Jobs"))?></a>
  87. </li>
  88. <li class="nav-item">
  89. <a class="nav-link" href="/register"><?=htmlspecialchars(__("Register"))?></a>
  90. </li>
  91. <li class="nav-item">
  92. <a class="nav-link" href="/log-in"><?=htmlspecialchars(__("Log In"))?></a>
  93. </li>
  94. <?php
  95. }
  96. ?>
  97. </ul>
  98. </div>
  99. </nav>
  100. </div>
  101. <?php
  102. if(count(Core::$breadcrumbs) > 1) {
  103. View::include("breadcrumbs");
  104. }
  105. if(!PRODUCTION) {
  106. $style = (count(Core::$breadcrumbs) > 1) ? "margin-top: -1rem;" : "";
  107. ?>
  108. <div class="p-2 bg-danger text-white text-center d-print-none" style="<?=$style?>">
  109. <strong><?=htmlspecialchars(__("PLEASE NOTE:"))?></strong>
  110. <?=htmlspecialchars(__("This is a development version of the site."))?>
  111. <?php
  112. if(Email::isEnabled()) {
  113. echo htmlspecialchars(__("Emails will be sent."));
  114. }
  115. else {
  116. echo htmlspecialchars(__("Emails will not be sent."));
  117. }
  118. ?>
  119. </div>
  120. <?php
  121. }
  122. if(Core::$show_alerts) {
  123. $alerts = Core::getAlerts();
  124. if($alerts) {
  125. ?>
  126. <div class="container">
  127. <?php
  128. foreach($alerts as $alert) {
  129. list($class, $message) = $alert;
  130. $icon = "info-circle";
  131. if($class == "success") $icon = "check";
  132. if($class == "warning") $icon = "exclamation-triangle";
  133. if($class == "error") $icon = "exclamation-circle";
  134. ?>
  135. <div class="alert alert-<?=$class?> alert-dismissable fade show">
  136. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  137. <span aria-hidden="true">&times;</span>
  138. </button>
  139. <i class="fal fa-fw fa-<?=$icon?>"></i> <?=htmlspecialchars($message)?>
  140. </div>
  141. <?php
  142. }
  143. ?>
  144. </div>
  145. <?php
  146. }
  147. }
  148. if(!Core::$cookie_alert_shown) {
  149. ?>
  150. <div class="container mt-3">
  151. <div class="alert alert-info alert-dismissable fade show">
  152. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  153. <span aria-hidden="true">&times;</span>
  154. </button>
  155. <div class="row">
  156. <div class="col-auto pr-0">
  157. <i class="fal fa-fw fa-info-circle"></i>
  158. </div>
  159. <div class="col">
  160. <strong><?=htmlspecialchars(__("This site uses cookies to improve functionality and personalisation."))?></strong><br />
  161. <?=htmlspecialchars(__("This site uses cookies solely for functionality purposes. We do not use cookies to track users or collect data for advertising purposes. By continuing to use the site, you agree to our Privacy Policy."))?>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <?php
  167. }
  168. ?>