Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <link rel="stylesheet" href="../CSS/main.css"> <!-- Stylesheet -->
- <?php
- //include the file session.php
- include("session.php");
- //include the file db_conn.php
- include("db_conn.php");
- /* Handles a user login */
- if(isset($_POST['login'])) {
- $username = $_POST['username'];
- $pass = $_POST['pass'];
- if($session_user!=""){
- header('Location: ./tute5_main.php');
- }
- if(isset($_GET['error']))
- {
- $errormessage = $_GET['error'];
- echo "<script>alert('$errormessage');</script>";
- }
- }
- ?>
- <body>
- <title>HOME</title>
- <div class="headerBar">
- <a href="cafe.php"> <!-- Handles the header bar -->
- <img src="../images/yeom.jpg">
- </a>
- <!-- Form to allow a user to login -->
- <form method="post" action="./signinengine.php" id="loginForm" class="loginForm">
- <input type="text" name="username" placeholder="Username" id="User">
- <input type="password" name="pass" placeholder="password" id="Pass">
- <input type="submit" value="Login!" name="login" id="log" class="login">
- </form>
- </div>
- <a href="./signout.php">
- <button class="signout">Sign Out!</button> <!-- log out button -->
- </a>
- <center>
- <hr><h2>Y.E.O.M</h2><hr>
- </center>
- <div1>
- <?php
- /* Handles the logged in message */
- if ($session_user==""){
- //header("Location: ./signup.php");
- }else {
- $username = $_SESSION['session_user'];
- $retrieve = "SELECT * FROM `tb_users` WHERE `Username` = '$username'";
- $result = $mysqli->query($retrieve);
- $row = $result->fetch_assoc();
- echo "Welcome " . $_SESSION['session_user'] . "! Your balance: $" . $row["Balance"];
- }
- ?>
- </div1>
- <br/>
- <br>
- <a href="./The Ref.php">
- <button class="refBtn">The Refectory</button> <!-- Redirects to The Refectory -->
- </a>
- <a href="./Lazenby.php">
- <button class=lazBtn>Lazenby</button> <!-- Redirects to Lazenby -->
- </a>
- <a href="./Trade Table.php">
- <button class="tblBtn">Trade Table</button> <!--Redirects to Trade Table -->
- </a>
- <a href="./The Grove.php">
- <button class="groveBtn">The Grove</button> <!-- Redirects to The Grove -->
- </a>
- <a href="./The Walk.php">
- <button class="walkBtn">The Walk</button> <!-- Redirects to The Walk -->
- </a>
- <?php
- /* if the user is logged in, allow them to navigate to their account page */
- if(!$_SESSION['session_user']){
- } else {
- echo "<a href='./userAccountPage.php'>
- <button class='account'>User Account Page</button>
- </a>";
- }
- ?>
- <form action="./register.php">
- <input type="submit" value="Signup" class="signup"> <!-- Allow a person to sign up to Y.E.O.M -->
- </form>
- <?php
- /* If an admin is logged in, allow them access to the master page */
- if($_SESSION['session_user'] != NULL && $_SESSION['session_access'] > 4){
- echo "<a href='./master.php'>
- <button class='master'>Master Page</button>
- </a>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement