header.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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">Log Out</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">Log In</a>
  85. </li>
  86. <?php
  87. }
  88. ?>
  89. </ul>
  90. </div>
  91. </nav>
  92. </div>
  93. <?php
  94. if(count(Core::$breadcrumbs) > 1) {
  95. View::include("breadcrumbs");
  96. }
  97. if(!PRODUCTION) {
  98. $style = (count(Core::$breadcrumbs) > 1) ? "margin-top: -1rem;" : "";
  99. ?>
  100. <div class="p-2 mb-3 bg-danger text-white text-center" style="<?=$style?>">
  101. <strong>PLEASE NOTE:</strong> This is a development version of the site.
  102. </div>
  103. <?php
  104. }
  105. if(Core::$show_alerts) {
  106. $alerts = Core::getAlerts();
  107. if($alerts) {
  108. ?>
  109. <div class="container">
  110. <?php
  111. foreach($alerts as $alert) {
  112. list($class, $message) = $alert;
  113. $icon = "info-circle";
  114. if($class == "success") $icon = "check";
  115. if($class == "warning") $icon = "exclamation-triangle";
  116. if($class == "error") $icon = "exclamation-circle";
  117. ?>
  118. <div class="alert alert-<?=$class?> alert-dismissable fade show">
  119. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  120. <span aria-hidden="true">&times;</span>
  121. </button>
  122. <i class="fal fa-fw fa-<?=$icon?>"></i> <?=htmlspecialchars($message)?>
  123. </div>
  124. <?php
  125. }
  126. ?>
  127. </div>
  128. <?php
  129. }
  130. }
  131. if(!Core::$cookie_alert_shown) {
  132. ?>
  133. <div class="container mt-3">
  134. <div class="alert alert-info alert-dismissable fade show">
  135. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  136. <span aria-hidden="true">&times;</span>
  137. </button>
  138. <div class="row">
  139. <div class="col-auto pr-0">
  140. <i class="fal fa-fw fa-info-circle"></i>
  141. </div>
  142. <div class="col">
  143. <strong>This site uses cookies to improve functionality and personalisation.</strong><br />
  144. By continuing to use the site, you consent to our use of cookies and our privacy policy.
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <?php
  150. }
  151. ?>