Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <?php session_start() ?>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- Head Items in This Section -->
- <title>Crazy Hills Putting</title>
- <!-- Links-->
- <link href="bootstrap-3.3.6-dist/css/bootstrap.min.css" rel="stylesheet">
- <link href="../../dist/css/bootstrap-theme.min.css" rel="stylesheet">
- </head>
- <!-- /Head Items in This Section -->
- <body>
- <!-- Body Items in This Section -->
- <!-- Main Nav -->
- <br>
- <div class="navbar-wrapper">
- <div class="container">
- <nav class="navbar navbar-inverse">
- <div class="container-fluid">
- <!-- Brand and toggle get grouped for better mobile display -->
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="index.php">Crazy Hills Putting</a>
- </div>
- <!-- -->
- <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
- <ul class="nav navbar-nav">
- <li><a href="index.php">Home</a></li>
- <li><a href="about.php">About <span class="sr-only">(current)</span></a></li>
- <li><a href="tips.php">Tips</a></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Leaderboards <span class="caret"></span></a>
- <ul class="dropdown-menu">
- <li class="active"><a href="leaderboards.php">Leaderboards</a></li>
- <li><a href="halloffame.php">Hall of Fame</a></li>
- </ul>
- <li><a href="contact.php">Contact Us</a></li>
- </li>
- </ul>
- <!-- -->
- <ul class="nav navbar-nav navbar-right">
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Admin <span class="caret"></span></a>
- <ul class="dropdown-menu">
- <?php
- if (isset($_SESSION['loggedin'])) { ?>
- <li><a href="admin/logout.php">Logout</a></li>
- <?php } ?>
- <?php
- if (!isset($_SESSION['loggedin'])) { ?>
- <li><a href="admin/login.php">Login</a></li>
- <?php } ?>
- <?php
- if (isset($_SESSION['loggedin'])) { ?>
- <li><a href="admin/index.php">Admin</a></li>
- <?php } ?>
- </ul>
- </li>
- </ul>
- </div>
- </div>
- </nav>
- </div>
- </div>
- <!-- -->
- <div class="main-textgrids">
- <div class="container">
- <hr class="featurette-divider">
- <h3>Weekly Leaderboard</h3>
- <br>
- <div class="panel panel-success">
- <!-- Default panel contents -->
- <div class="panel-heading">Star of The Week</div>
- <div class="panel-body">
- <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>
- </div>
- <?php
- // Database Connection Information
- $db_server = "localhost";
- $db_username = "root";
- $db_password = "";
- $db_database = "crazyhills";
- $connect = mysqli_connect($db_server, $db_username, $db_password, $db_database);
- $queryweek = "SELECT * FROM t_leadboard WHERE date > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY SCORE ASC LIMIT 10"; // Running the query
- $result = mysqli_query($connect, $queryweek);
- ?>
- <table class="table table-striped table-hover ">
- <thead>
- <tr>
- <th>Rank</th>
- <th>Name</th>
- <th>Date Played</th>
- <th>Score</th>
- </tr>
- </thead>
- <?php
- $icount = "1";
- while($row = mysqli_fetch_assoc($result))
- { ?>
- <tbody>
- <tr class="success">
- <td><?php echo $icount++; ?></td>
- <td><?php echo $row['FNAME']; echo " "; echo $row['LNAME']; ?></td>
- <td><?php echo $row['DATE']; ?></td>
- <td><?php echo $row['SCORE']; ?></td>
- </tr>
- </tbody>
- <?php } ?>
- </table>
- </div>
- </div>
- <div class="container">
- <hr class="featurette-divider">
- <h3>Monthly Leaderboard</h3>
- <br>
- <div class="panel panel-success">
- <!-- Default panel contents -->
- <div class="panel-heading">Star of The Month</div>
- <div class="panel-body">
- <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>
- </div>
- <?php
- $querymonth = "SELECT * FROM t_leadboard WHERE date > DATE_SUB(NOW(), INTERVAL 1 MONTH) ORDER BY SCORE ASC LIMIT 10"; // Running the query
- $result = mysqli_query($connect, $querymonth);
- ?>
- <table class="table table-striped table-hover ">
- <thead>
- <tr>
- <th>Rank</th>
- <th>Name</th>
- <th>Date Played</th>
- <th>Score</th>
- </tr>
- </thead>
- <?php
- $icount = "1";
- while($row = mysqli_fetch_assoc($result))
- { ?>
- <tbody>
- <tr class="success">
- <td><?php echo $icount++; ?></td>
- <td><?php echo $row['FNAME']; echo " "; echo $row['LNAME']; ?></td>
- <td><?php echo $row['DATE']; ?></td>
- <td><?php echo $row['SCORE']; ?></td>
- </tr>
- </tbody>
- <?php } ?>
- </table>
- </div>
- </div>
- <div class="container">
- <hr class="featurette-divider">
- <h3>Yearly Leaderboard</h3>
- <br>
- <div class="panel panel-success">
- <!-- Default panel contents -->
- <div class="panel-heading">Star of The Year</div>
- <div class="panel-body">
- <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>
- </div>
- <?php
- $queryyear = "SELECT * FROM t_leadboard WHERE date > DATE_SUB(NOW(), INTERVAL 1 YEAR) ORDER BY SCORE ASC LIMIT 10"; // Running the query
- $result = mysqli_query($connect, $queryyear);
- ?>
- <table class="table table-striped table-hover ">
- <thead>
- <tr>
- <th>Rank</th>
- <th>Name</th>
- <th>Date Played</th>
- <th>Score</th>
- </tr>
- </thead>
- <?php
- $icount = "1";
- while($row = mysqli_fetch_assoc($result))
- { ?>
- <tbody>
- <tr class="success">
- <td><?php echo $icount++; ?></td>
- <td><?php echo $row['FNAME']; echo " "; echo $row['LNAME']; ?></td>
- <td><?php echo $row['DATE']; ?></td>
- <td><?php echo $row['SCORE']; ?></td>
- </tr>
- </tbody>
- <?php } ?>
- </table>
- </div>
- </div>
- </div>
- <br>
- <div class="container">
- <hr class="featurette-divider">
- <br>
- <footer>
- <p class="pull-right"><a href="#">Back to top</a></p>
- <p>© 2016, Crazy Hills</p>
- </footer>
- <br>
- </div>
- <!-- /Body Items in This Section -->
- <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
- <!-- Include all compiled plugins (below), or include individual files as needed -->
- <script src="bootstrap-3.3.6-dist/js/bootstrap.min.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement