Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.13 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <?php session_start() ?>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <!-- Head Items in This Section -->
  9.  
  10. <title>Crazy Hills Putting</title>
  11.  
  12. <!-- Links-->
  13. <link href="bootstrap-3.3.6-dist/css/bootstrap.min.css" rel="stylesheet">
  14. <link href="../../dist/css/bootstrap-theme.min.css" rel="stylesheet">
  15. </head>
  16. <!-- /Head Items in This Section -->
  17.  
  18. <body>
  19. <!-- Body Items in This Section -->
  20.  
  21. <!-- Main Nav -->
  22. <br>
  23. <div class="navbar-wrapper">
  24. <div class="container">
  25. <nav class="navbar navbar-inverse">
  26. <div class="container-fluid">
  27. <!-- Brand and toggle get grouped for better mobile display -->
  28. <div class="navbar-header">
  29. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
  30. <span class="sr-only">Toggle navigation</span>
  31. <span class="icon-bar"></span>
  32. <span class="icon-bar"></span>
  33. <span class="icon-bar"></span>
  34. </button>
  35. <a class="navbar-brand" href="index.php">Crazy Hills Putting</a>
  36. </div>
  37. <!-- -->
  38. <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  39. <ul class="nav navbar-nav">
  40. <li><a href="index.php">Home</a></li>
  41. <li><a href="about.php">About <span class="sr-only">(current)</span></a></li>
  42. <li><a href="tips.php">Tips</a></li>
  43. <li class="dropdown">
  44. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Leaderboards <span class="caret"></span></a>
  45. <ul class="dropdown-menu">
  46. <li class="active"><a href="leaderboards.php">Leaderboards</a></li>
  47. <li><a href="halloffame.php">Hall of Fame</a></li>
  48. </ul>
  49. <li><a href="contact.php">Contact Us</a></li>
  50. </li>
  51. </ul>
  52. <!-- -->
  53. <ul class="nav navbar-nav navbar-right">
  54. <li class="dropdown">
  55. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Admin <span class="caret"></span></a>
  56. <ul class="dropdown-menu">
  57. <?php
  58. if (isset($_SESSION['loggedin'])) { ?>
  59. <li><a href="admin/logout.php">Logout</a></li>
  60. <?php } ?>
  61. <?php
  62. if (!isset($_SESSION['loggedin'])) { ?>
  63. <li><a href="admin/login.php">Login</a></li>
  64. <?php } ?>
  65. <?php
  66. if (isset($_SESSION['loggedin'])) { ?>
  67. <li><a href="admin/index.php">Admin</a></li>
  68. <?php } ?>
  69. </ul>
  70. </li>
  71. </ul>
  72. </div>
  73. </div>
  74. </nav>
  75. </div>
  76. </div>
  77. <!-- -->
  78.  
  79. <div class="main-textgrids">
  80. <div class="container">
  81. <hr class="featurette-divider">
  82. <h3>Weekly Leaderboard</h3>
  83. <br>
  84.  
  85. <div class="panel panel-success">
  86. <!-- Default panel contents -->
  87. <div class="panel-heading">Star of The Week</div>
  88. <div class="panel-body">
  89. <p>Congratulations to Tom Forte for braving strong winds to score an impressive 33. Next time you come to play please bring proof of ID and have a free game on us!</p>
  90. </div>
  91. <?php
  92. // Database Connection Information
  93. $db_server = "localhost";
  94. $db_username = "root";
  95. $db_password = "";
  96. $db_database = "crazyhills";
  97. $connect = mysqli_connect($db_server, $db_username, $db_password, $db_database);
  98. $queryweek = "SELECT * FROM t_leadboard WHERE date > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY SCORE ASC LIMIT 10"; // Running the query
  99. $result = mysqli_query($connect, $queryweek);
  100. ?>
  101. <table class="table table-striped table-hover ">
  102. <thead>
  103. <tr>
  104. <th>Rank</th>
  105. <th>Name</th>
  106. <th>Date Played</th>
  107. <th>Score</th>
  108. </tr>
  109. </thead>
  110. <?php
  111. $icount = "1";
  112. while($row = mysqli_fetch_assoc($result))
  113. { ?>
  114. <tbody>
  115. <tr class="success">
  116. <td><?php echo $icount++; ?></td>
  117. <td><?php echo $row['FNAME']; echo " "; echo $row['LNAME']; ?></td>
  118. <td><?php echo $row['DATE']; ?></td>
  119. <td><?php echo $row['SCORE']; ?></td>
  120. </tr>
  121. </tbody>
  122. <?php } ?>
  123. </table>
  124. </div>
  125. </div>
  126. <div class="container">
  127. <hr class="featurette-divider">
  128.  
  129.  
  130. <h3>Monthly Leaderboard</h3>
  131. <br>
  132.  
  133. <div class="panel panel-success">
  134. <!-- Default panel contents -->
  135. <div class="panel-heading">Star of The Month</div>
  136. <div class="panel-body">
  137. <p>Congratulations to Tom Forte for braving strong winds to score an impressive 33. Next time you come to play please bring proof of ID and have a five free games on us!</p>
  138. </div>
  139. <?php
  140. $querymonth = "SELECT * FROM t_leadboard WHERE date > DATE_SUB(NOW(), INTERVAL 1 MONTH) ORDER BY SCORE ASC LIMIT 10"; // Running the query
  141. $result = mysqli_query($connect, $querymonth);
  142. ?>
  143. <table class="table table-striped table-hover ">
  144. <thead>
  145. <tr>
  146. <th>Rank</th>
  147. <th>Name</th>
  148. <th>Date Played</th>
  149. <th>Score</th>
  150. </tr>
  151. </thead>
  152. <?php
  153. $icount = "1";
  154. while($row = mysqli_fetch_assoc($result))
  155. { ?>
  156. <tbody>
  157. <tr class="success">
  158. <td><?php echo $icount++; ?></td>
  159. <td><?php echo $row['FNAME']; echo " "; echo $row['LNAME']; ?></td>
  160. <td><?php echo $row['DATE']; ?></td>
  161. <td><?php echo $row['SCORE']; ?></td>
  162. </tr>
  163. </tbody>
  164. <?php } ?>
  165. </table>
  166. </div>
  167. </div>
  168.  
  169. <div class="container">
  170. <hr class="featurette-divider">
  171. <h3>Yearly Leaderboard</h3>
  172. <br>
  173.  
  174. <div class="panel panel-success">
  175. <!-- Default panel contents -->
  176. <div class="panel-heading">Star of The Year</div>
  177. <div class="panel-body">
  178. <p>Congratulations to Tom Forte for finishing the year with the best score! You have won a VIP pass which will grant you an unlimited amount of free games!</p>
  179. </div>
  180. <?php
  181. $queryyear = "SELECT * FROM t_leadboard WHERE date > DATE_SUB(NOW(), INTERVAL 1 YEAR) ORDER BY SCORE ASC LIMIT 10"; // Running the query
  182. $result = mysqli_query($connect, $queryyear);
  183. ?>
  184. <table class="table table-striped table-hover ">
  185. <thead>
  186. <tr>
  187. <th>Rank</th>
  188. <th>Name</th>
  189. <th>Date Played</th>
  190. <th>Score</th>
  191. </tr>
  192. </thead>
  193. <?php
  194. $icount = "1";
  195. while($row = mysqli_fetch_assoc($result))
  196. { ?>
  197. <tbody>
  198. <tr class="success">
  199. <td><?php echo $icount++; ?></td>
  200. <td><?php echo $row['FNAME']; echo " "; echo $row['LNAME']; ?></td>
  201. <td><?php echo $row['DATE']; ?></td>
  202. <td><?php echo $row['SCORE']; ?></td>
  203. </tr>
  204. </tbody>
  205. <?php } ?>
  206. </table>
  207. </div>
  208. </div>
  209. </div>
  210.  
  211. <br>
  212. <div class="container">
  213. <hr class="featurette-divider">
  214. <br>
  215. <footer>
  216. <p class="pull-right"><a href="#">Back to top</a></p>
  217. <p>&copy; 2016, Crazy Hills</p>
  218. </footer>
  219. <br>
  220.  
  221. </div>
  222.  
  223. <!-- /Body Items in This Section -->
  224.  
  225. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  226. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  227. <!-- Include all compiled plugins (below), or include individual files as needed -->
  228. <script src="bootstrap-3.3.6-dist/js/bootstrap.min.js"></script>
  229. </body>
  230. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement