header.php 4.9 KB

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