index.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. if(session_status() == PHP_SESSION_NONE) {
  3. session_start();
  4. }
  5. ?>
  6. <!DOCTYPE html>
  7. <html lang="en">
  8. <head>
  9. <meta charset="utf-8">
  10. <title>Kajetans Stuff</title>
  11. <link rel="icon" href="favicon.png">
  12. <meta name="viewport" content="width=device-width, maximum-scale=1.0"/>
  13. <link href="css/bootstrap.min.css" rel="stylesheet">
  14. <link href="css/style.css" rel="stylesheet">
  15. <link href="css/snuviscript.css" rel="stylesheet">
  16. <link href="css/brainfuck.css" rel="stylesheet">
  17. <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  18. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  19. <script src="js/bootstrap.min.js"></script>
  20. </head>
  21. <body id="body">
  22. <nav id="navbar" class="navbar navbar-expand-md">
  23. <div class="navbar-brand">Kajetans Stuff</div>
  24. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bar" aria-controls="bar" aria-expanded="false" aria-label="Toggle navigation">
  25. <span class="navbar-toggler-icon"></span>
  26. </button>
  27. <div class="collapse navbar-collapse" id="bar">
  28. <ul class="navbar-nav ml-auto">
  29. <li class="nav-item"><a class="nav-link" href="index.php?section=home">Home</a></li>
  30. <li class='nav-item dropdown'>
  31. <a class='nav-link dropdown-toggle' href='#' id='snuvi_dropdown' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
  32. SnuviScript
  33. </a>
  34. <div class='dropdown-menu nav_drop' aria-labelledby='snuvi_dropdown'>
  35. <a class='dropdown-item nav_drop_item' href='index.php?section=snuvi_core'>Core</a>
  36. <a class='dropdown-item nav_drop_item' href='index.php?section=snuvi_supersnuvi'>Super Snuvi</a>
  37. <a class='dropdown-item nav_drop_item' href='index.php?section=snuvi_minecraft'>Minecraft</a>
  38. </div>
  39. </li>
  40. <li class="nav-item"><a class="nav-link" href="index.php?section=brainfuck">Brainfuck</a></li>
  41. <li class="nav-item"><a class="nav-link" href="index.php?section=fruits">Fruits</a></li>
  42. <li class="nav-item"><a class="nav-link" href="index.php?section=endlerbrecer">Endlerbrecer</a></li>
  43. </ul>
  44. </div>
  45. </nav>
  46. <main class="container">
  47. <?php
  48. if(isset($_GET["section"])) {
  49. switch ($_GET["section"]) {
  50. case "snuvi_core":
  51. include "snuvi_core.php";
  52. break;
  53. case "snuvi_minecraft":
  54. include "snuvi_minecraft.php";
  55. break;
  56. case "snuvi_supersnuvi":
  57. include "snuvi_supersnuvi.php";
  58. break;
  59. case "brainfuck":
  60. include "brainfuck.php";
  61. break;
  62. case "login":
  63. include "login.php";
  64. break;
  65. case "logout":
  66. include "logout.php";
  67. break;
  68. case "fruits":
  69. include "fruits.php";
  70. break;
  71. case "endlerbrecer":
  72. include "endlerbrecer.php";
  73. break;
  74. case "home":
  75. default:
  76. include "home.php";
  77. break;
  78. }
  79. } else {
  80. include "home.php";
  81. }
  82. ?>
  83. </main>
  84. <footer>
  85. <span class="footerPipe">Made by Kajetan</span>
  86. <?php
  87. if(isset($_SESSION["user"])) {
  88. echo "<a class='login' href='index.php?section=logout'>Logout</a>";
  89. } else {
  90. echo "<a class='login' href='index.php?section=login'>Login</a>";
  91. }
  92. ?>
  93. </footer>
  94. </body>
  95. </html>