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.

179 lines
7.1 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="#" class="w3-bar-item w3-button w3-teal"><i class="fa fa-home w3-margin-right"></i>Logo</a>
  74. <a href="../index.php" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Home</a>
  75. <a href="../about.php" class="w3-bar-item w3-button w3-hide-small w3-hover-white">About</a>
  76. <div class="w3-dropdown-hover w3-hide-small">
  77. <button class="w3-button" title="Notifications">Games<i class="fa fa-caret-down"></i></button>
  78. <div class="w3-dropdown-content w3-card-4 w3-bar-block">
  79. <a href="bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
  80. <a href="zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
  81. <a href="#" class="w3-bar-item w3-button">Link</a>
  82. </div>
  83. </div>
  84. </div>
  85. <!-- Navbar on small screens -->
  86. <div id="navDemo" class="w3-bar-block w3-theme-d2 w3-hide w3-hide-large w3-hide-medium">
  87. <a href="../index.php" class="w3-bar-item w3-button">Home</a>
  88. <a href="../games.php" class="w3-bar-item w3-button">Games</a>
  89. <a href="../about.php" class="w3-bar-item w3-button">About</a>
  90. </div>
  91. </div>
  92. <!-- Image Header -->
  93. <div class="w3-display-container w3-animate-opacity">
  94. <img src="../includes/banner.png" alt="boat" style="width:100%;min-height:350px;">
  95. </div>';
  96. }
  97. else
  98. {
  99. echo '<!DOCTYPE html>
  100. <html>
  101. <head>
  102. <title>Club Panda</title>
  103. <meta charset="UTF-8">
  104. <meta name="viewport" content="width=device-width, initial-scale=1">';
  105. echo '<link rel="stylesheet" href="includes/w3.css">';
  106. echo '<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-black.css">
  107. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  108. </head>
  109. <body id="myPage">
  110. <!-- Sidebar on click -->
  111. <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">
  112. <a href="javascript:void(0)" onclick="w3_close()" class="w3-bar-item w3-button w3-display-topright w3-text-teal">Close
  113. <i class="fa fa-remove"></i>
  114. </a>
  115. <a href="games/bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
  116. <a href="games/zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
  117. <a href="#" class="w3-bar-item w3-button">Link 3</a>
  118. <a href="#" class="w3-bar-item w3-button">Link 4</a>
  119. <a href="#" class="w3-bar-item w3-button">Link 5</a>
  120. </nav>
  121. <!-- Navbar -->
  122. <div class="w3-top">
  123. <div class="w3-bar w3-theme-d2 w3-left-align">
  124. <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>
  125. <a href="#" class="w3-bar-item w3-button w3-teal"><i class="fa fa-home w3-margin-right"></i>Logo</a>
  126. <a href="index.php" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Home</a>
  127. <a href="about.php" class="w3-bar-item w3-button w3-hide-small w3-hover-white">About</a>
  128. <div class="w3-dropdown-hover w3-hide-small">
  129. <button class="w3-button" title="Notifications">Games<i class="fa fa-caret-down"></i></button>
  130. <div class="w3-dropdown-content w3-card-4 w3-bar-block">
  131. <a href="games/bamboofield.php" class="w3-bar-item w3-button">Bamboo Field</a>
  132. <a href="games/zombiePanda.php" class="w3-bar-item w3-button">Zombie Pandas</a>
  133. <a href="#" class="w3-bar-item w3-button">Link</a>
  134. </div>
  135. </div>
  136. </div>
  137. <!-- Navbar on small screens -->
  138. <div id="navDemo" class="w3-bar-block w3-theme-d2 w3-hide w3-hide-large w3-hide-medium">
  139. <a href="index.php" class="w3-bar-item w3-button">Home</a>
  140. <a href="games.php" class="w3-bar-item w3-button">Games</a>
  141. <a href="about.php" class="w3-bar-item w3-button">About</a>
  142. </div>
  143. </div>
  144. <!-- Image Header -->
  145. <div class="w3-display-container w3-animate-opacity">
  146. <img src="includes/banner.png" alt="boat" style="width:100%;min-height:350px;">
  147. </div>';
  148. }
  149. ?>