header.php 5.7 KB

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