"OdenseTrack" is a school assignment/project from AspIT https://aspit.dfine.net/odensetrack
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

design.class.php 7.5KB

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