index.php 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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_minecraft_paper'>Minecraft Paper</a>
  37. </div>
  38. </li>
  39. <li class="nav-item"><a class="nav-link" href="index.php?section=brainfuck">Brainfuck</a></li>
  40. <li class="nav-item"><a class="nav-link" href="index.php?section=fruits">Fruits</a></li>
  41. <li class="nav-item"><a class="nav-link" href="index.php?section=endlerbrecer">Endlerbrecer</a></li>
  42. </ul>
  43. </div>
  44. </nav>
  45. <main class="container">
  46. <?php
  47. if(isset($_GET["section"])) {
  48. switch ($_GET["section"]) {
  49. case "snuvi_core":
  50. include "snuvi_core.php";
  51. break;
  52. case "snuvi_minecraft_paper":
  53. include "snuvi_minecraft_paper.php";
  54. break;
  55. case "snuvi_supersnuvi":
  56. include "snuvi_supersnuvi.php";
  57. break;
  58. case "brainfuck":
  59. include "brainfuck.php";
  60. break;
  61. case "login":
  62. include "login.php";
  63. break;
  64. case "logout":
  65. include "logout.php";
  66. break;
  67. case "fruits":
  68. include "fruits.php";
  69. break;
  70. case "endlerbrecer":
  71. include "endlerbrecer.php";
  72. break;
  73. case "home":
  74. default:
  75. include "home.php";
  76. break;
  77. }
  78. } else {
  79. include "home.php";
  80. }
  81. ?>
  82. </main>
  83. <footer>
  84. <span class="footerPipe">Made by Kajetan</span>
  85. <?php
  86. if(isset($_SESSION["user"])) {
  87. echo "<a class='login' href='index.php?section=logout'>Logout</a>";
  88. } else {
  89. echo "<a class='login' href='index.php?section=login'>Login</a>";
  90. }
  91. ?>
  92. </footer>
  93. </body>
  94. </html>