Simple website with some JavaScript games.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
6.9 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <?php
  2. $loggedIn = false;
  3. $admin = false;
  4. session_start();
  5. ob_start();
  6. if($dir == 2)
  7. {
  8. require_once("../../club_connect.php");
  9. }
  10. else
  11. {
  12. require_once("../club_connect.php");
  13. }
  14. if((md5($_SERVER['HTTP_USERAGENT'] . 'salt')) == ($_SESSION['agent']) && $_SESSION['use'] == true)
  15. {
  16. $loggedIn = true;
  17. //checks to see if user is an admin
  18. $q = "select admin from users where user_name='" . $_SESSION['username'] . "'";
  19. $r = mysqli_query($dbc, $q);
  20. if(@mysqli_num_rows($r) == 1)
  21. {
  22. while($row = mysqli_fetch_array($r))
  23. {
  24. $checka = $row['admin'];
  25. }
  26. if($checka)
  27. {
  28. $admin = true;
  29. }
  30. }
  31. }
  32. try
  33. {
  34. include('games/insertScore.php');
  35. }
  36. catch (Exception $ex)
  37. {
  38. }
  39. echo '<!DOCTYPE html>
  40. <html>
  41. <head>
  42. <title>Club Panda</title>
  43. <meta charset="UTF-8">
  44. <meta name="viewport" content="width=device-width, initial-scale=1">';
  45. if($dir == 2)
  46. {
  47. echo '<!DOCTYPE html>
  48. <html>
  49. <head>
  50. <title>Club Panda</title>
  51. <meta charset="UTF-8">
  52. <meta name="viewport" content="width=device-width, initial-scale=1">';
  53. echo '<link rel="stylesheet" href="../includes/w3.css">';
  54. echo '<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-black.css">
  55. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  56. </head>
  57. <body id="myPage">
  58. <!-- Sidebar on click -->
  59. <nav class="w3-sidebar w3-bar-block w3-white w3-card-2 w3-animate-left w3-xxlarge" style="display:none;z-index:2" id="mySidebar">
  60. <a href="javascript:void(0)" onclick="w3_close()" class="w3-bar-item w3-button w3-display-topright w3-text-teal">Close
  61. <i class="fa fa-remove"></i>
  62. </a>
  63. <a href="bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
  64. <a href="zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
  65. <a href="#" class="w3-bar-item w3-button">Link 3</a>
  66. <a href="#" class="w3-bar-item w3-button">Link 4</a>
  67. <a href="#" class="w3-bar-item w3-button">Link 5</a>
  68. </nav>
  69. <!-- Navbar -->
  70. <div class="w3-top">
  71. <div class="w3-bar w3-theme-d2 w3-left-align">
  72. <a class="w3-bar-item w3-button w3-hide-medium w3-hide-large w3-right w3-hover-white w3-theme-d2" href="javascript:void(0);" onclick="openNav()"><i class="fa fa-bars"></i></a>
  73. <a href="../index.php" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Home</a>
  74. <a href="../about.php" class="w3-bar-item w3-button w3-hide-small w3-hover-white">About</a>
  75. <div class="w3-dropdown-hover w3-hide-small">
  76. <button class="w3-button" title="Notifications">Games<i class="fa fa-caret-down"></i></button>
  77. <div class="w3-dropdown-content w3-card-4 w3-bar-block">
  78. <a href="bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
  79. <a href="zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
  80. <a href="#" class="w3-bar-item w3-button">Link</a>
  81. </div>
  82. </div>
  83. </div>
  84. <!-- Navbar on small screens -->
  85. <div id="navDemo" class="w3-bar-block w3-theme-d2 w3-hide w3-hide-large w3-hide-medium">
  86. <a href="../index.php" class="w3-bar-item w3-button">Home</a>
  87. <a href="../games.php" class="w3-bar-item w3-button">Games</a>
  88. <a href="../about.php" class="w3-bar-item w3-button">About</a>
  89. </div>
  90. </div>
  91. <!-- Image Header -->
  92. <div class="w3-display-container w3-animate-opacity">
  93. <img src="../includes/banner.png" alt="boat" style="width:100%;min-height:350px;">
  94. </div>';
  95. }
  96. else
  97. {
  98. echo '<!DOCTYPE html>
  99. <html>
  100. <head>
  101. <title>Club Panda</title>
  102. <meta charset="UTF-8">
  103. <meta name="viewport" content="width=device-width, initial-scale=1">';
  104. echo '<link rel="stylesheet" href="includes/w3.css">';
  105. echo '<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-black.css">
  106. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  107. </head>
  108. <body id="myPage">
  109. <!-- Sidebar on click -->
  110. <nav class="w3-sidebar w3-bar-block w3-white w3-card-2 w3-animate-left w3-xxlarge" style="display:none;z-index:2" id="mySidebar">
  111. <a href="javascript:void(0)" onclick="w3_close()" class="w3-bar-item w3-button w3-display-topright w3-text-teal">Close
  112. <i class="fa fa-remove"></i>
  113. </a>
  114. <a href="games/bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
  115. <a href="games/zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
  116. <a href="#" class="w3-bar-item w3-button">Link 3</a>
  117. <a href="#" class="w3-bar-item w3-button">Link 4</a>
  118. <a href="#" class="w3-bar-item w3-button">Link 5</a>
  119. </nav>
  120. <!-- Navbar -->
  121. <div class="w3-top">
  122. <div class="w3-bar w3-theme-d2 w3-left-align">
  123. <a class="w3-bar-item w3-button w3-hide-medium w3-hide-large w3-right w3-hover-white w3-theme-d2" href="javascript:void(0);" onclick="openNav()"><i class="fa fa-bars"></i></a>
  124. <a href="index.php" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Home</a>
  125. <a href="about.php" class="w3-bar-item w3-button w3-hide-small w3-hover-white">About</a>
  126. <div class="w3-dropdown-hover w3-hide-small">
  127. <button class="w3-button" title="Notifications">Games<i class="fa fa-caret-down"></i></button>
  128. <div class="w3-dropdown-content w3-card-4 w3-bar-block">
  129. <a href="games/bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
  130. <a href="games/zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
  131. <a href="#" class="w3-bar-item w3-button">Link</a>
  132. </div>
  133. </div>
  134. </div>
  135. <!-- Navbar on small screens -->
  136. <div id="navDemo" class="w3-bar-block w3-theme-d2 w3-hide w3-hide-large w3-hide-medium">
  137. <a href="index.php" class="w3-bar-item w3-button">Home</a>
  138. <a href="games.php" class="w3-bar-item w3-button">Games</a>
  139. <a href="about.php" class="w3-bar-item w3-button">About</a>
  140. </div>
  141. </div>
  142. <!-- Image Header -->
  143. <div class="w3-display-container w3-animate-opacity">
  144. <img src="includes/banner.png" alt="boat" style="width:100%;min-height:350px;">
  145. </div>';
  146. }
  147. ?>