"OdenseTrack" is a school assignment/project from AspIT https://aspit.dfine.net/odensetrack
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

design.class.php 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <?php
  2. class Design {
  3. private function __construct() {
  4. }
  5. /**
  6. *
  7. * $setup = array(title, headline, description, keywords);
  8. * $level indicated what userlevel is required to view the page. 0 means public/nologin
  9. *
  10. */
  11. public static function header($setup = array(), $level) { // Primary design function. This function is called on all pages, this is our header.
  12. if ($level > 0) {
  13. if (!User::checkLevel($level)) {
  14. header('Location: ' . Config::$sys_url . '?page=login&r=level');
  15. die("You are not authorized to view this page.");
  16. }
  17. }
  18. if (isset($_SESSION['username'])) { $username = $_SESSION['username']; }
  19. echo '<!DOCTYPE html>
  20. <!--
  21. Made by DFiNE (Kenneth Hedahl)
  22. Copyright DIS (www.dfine.net)
  23. Design is a copyright of CVK-WEB
  24. -->
  25. <html lang="da">
  26. <head>
  27. <title>' . $setup['title'] . ' | Odense Track</title>
  28. <meta charset="UTF-8">
  29. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  30. <meta name="headline" content="' . $setup['headline'] . '">
  31. <meta name="description" content="' . $setup['description'] . '">
  32. <meta name="keywords" content="' . $setup['keywords'] . '">
  33. <meta name="author" content="Odense Track">
  34. <link href="css/style.css" rel="stylesheet" />
  35. <link rel="stylesheet" type="text/css" href="css/slick.css" />
  36. <link rel="stylesheet" type="text/css" href="css/slick-theme.css" />
  37. <link rel="stylesheet" type="text/css" href="css/jquery.datetimepicker.min.css" />
  38. <link href="//stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
  39. <!-- WYSIWYG -->
  40. </head>
  41. <body>
  42. <div class="contentwrapper"> <!-- Contentwrapper start -->
  43. <header> <!-- Header start -->
  44. <div class="topnav">
  45. ' . (User::userLevel() > 0 ? "<div class=\"pull_left\"><span class=\"white\">&nbsp;Velkommen tilbage $username!</span></div>" : "") . '<p>Support: <a href="?page=contact"><i class="fa fa-envelope"></i></a></p> <a href="?page=order"><button>Bestil nu</button></a>
  46. </div>
  47. <div class="header">
  48. <a href="' . Config::$sys_url . '"><div class="header_logo"></div></a>
  49. <div class="header_right">
  50. <a href="' . Config::$sys_url . '?page=aboutus">Om Odense Track</a> | <a href="' . Config::$sys_url . '?page=contact">Kontakt Os</a>
  51. </div>
  52. </div>
  53. <div class="clear"></div>
  54. <nav class="mainnav"> <!-- Main navigation start -->
  55. <ul>
  56. <li><a href="' . Config::$sys_url . '?page=home">Formel 1</a></li>
  57. <li><a href="' . Config::$sys_url . '?page=events">Events</a></li>
  58. <li><a href="' . Config::$sys_url . '?page=news">Nyheder</a></li>
  59. ' . (User::userLevel() > 74 ? "<li><a href=\"?page=newsadmin\">Nyhedsadmin</a></li>" : "") . '
  60. ' . (User::userLevel() > 74 ? "<li><a href=\"?page=eventadmin\">Eventadmin</a></li>" : "") . '
  61. ' . (User::userLevel() > 0 ? "<li><a href=\"_login.php?logout\">Log ud</a></li>" : "<li><a href=\"?page=login\">Login</a></li>") . '
  62. </ul>
  63. </nav> <!-- Main navigation end -->
  64. </header> <!-- Header end -->
  65. <div class="content"> <!-- Content start -->';
  66. }
  67. public static function footer($scripts) { // Shown at the bottom of every page we display. - if $scripts true, use javascripts on page
  68. echo '</div> <!-- Content end -->
  69. </div> <!-- Contentwrapper End -->
  70. <footer> <!-- Footer start -->
  71. <div class="footer_wrap">
  72. <a href="' . Config::$sys_url . '"><div class="footer_logo"></div></a>
  73. <div class="footer_followus">
  74. <h1>Følg os her</h1>
  75. <p>Tilmeld dig vores sociale netværk</p>
  76. <div class="socialicons">
  77. <a href="#"><img src="' . Config::$sys_url . 'img/icons/facebook.png" alt="facebook" title="Følg os på facebook" /></a>
  78. <a href="#"><img src="' . Config::$sys_url . 'img/icons/twitter.png" alt="twitter" title="Følg os på twitter" /></a>
  79. <a href="#"><img src="' . Config::$sys_url . 'img/icons/youtube.png" alt="YouTube" title="Følg os på YouTube" /></a>
  80. <a href="#"><img src="' . Config::$sys_url . 'img/icons/instagram.png" alt="Instagram" title="Følg os på Instagram" /></a>
  81. </div>
  82. </div>
  83. <div class="footer_newsletter">
  84. <h1>Tilmeld dig vores nyhedsbrev</h1>
  85. <p>Tilmeld dig vores sociale netværk</p>
  86. </div>
  87. <div class="clear"></div>
  88. <div class="footer_links">
  89. <div class="pull_left">
  90. <ul>
  91. <li><a href="' . Config::$sys_url . '?page=contact">Kontakt os</a></li>
  92. <li><a href="' . Config::$sys_url . '?page=aboutus">Om Odense Track</a></li>
  93. <li><a href="' . Config::$sys_url . '?page=sitemap">Sitemap</a></li>
  94. </ul>
  95. </div>
  96. <div class="pull_right">
  97. &copy; <a href="' . Config::$sys_url . '">Odense Track</a>
  98. </div>
  99. </div>
  100. </div>
  101. </footer> <!-- Footer end -->';
  102. if ($scripts == true) {
  103. echo '
  104. <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
  105. <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
  106. <script src="js/jquery.datetimepicker.full.min.js"></script>
  107. <script src="' . Config::$sys_url . 'js/slick.min.js"></script>
  108. <script>
  109. $(document).ready(function(){
  110. $(\'.eventslider\').slick({
  111. "slidesToShow": 5, "slidesToScroll": 1, "autoplay": true, "autoplayspeed": 4000
  112. });
  113. });
  114. $(".activityprev").click(function(){
  115. $(".activityfeed").slick("slickPrev");
  116. })
  117. $(".activitynext").click(function(){
  118. $(".activityfeed").slick("slickNext");
  119. })
  120. $(\'.activityfeed\').slick({
  121. dots: false,
  122. infinite: false,
  123. speed: 300,
  124. slidesToShow: 3,
  125. vertical: true,
  126. adaptiveHeight: false,
  127. arrows: false,
  128. verticalSwiping:true
  129. });
  130. jQuery(\'.datetime\').datetimepicker();
  131. </script>
  132. <!-- WYSIWYG -->
  133. <script src="' . Config::$sys_url . 'js/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
  134. <script src="' . Config::$sys_url . 'js/tiny.php" referrerpolicy="origin"></script>
  135. ';
  136. }
  137. echo '
  138. </body>
  139. </html>';
  140. if (Config::$debug == true) {
  141. echo '<div style="position:fixed; top:5px; left:5px; background-color:#000; color:#20C20E; border:1px solid #20C20E; width:300px; height:auto;">';
  142. echo '<center>Debug Panel</center><hr>';
  143. echo '<br/>-GET' . var_dump($_GET) . '<hr>';
  144. echo '<br/>-POST' . var_dump($_POST) . '<hr>';
  145. echo '<br/>-SESS' . var_dump($_SESSION) . '<hr>';
  146. echo '<center>Disable this in CONFIG!</center></div>';
  147. }
  148. }
  149. }