Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <link rel="stylesheet" href="../CSS/main.css"> <!-- Stylesheet -->
  5.  
  6.  
  7. <?php
  8.  
  9. //include the file session.php
  10. include("session.php");
  11. //include the file db_conn.php
  12. include("db_conn.php");
  13.  
  14. /* Handles a user login */
  15. if(isset($_POST['login'])) {
  16. $username = $_POST['username'];
  17. $pass = $_POST['pass'];
  18.  
  19. if($session_user!=""){
  20. header('Location: ./tute5_main.php');
  21. }
  22.  
  23. if(isset($_GET['error']))
  24. {
  25. $errormessage = $_GET['error'];
  26. echo "<script>alert('$errormessage');</script>";
  27. }
  28. }
  29.  
  30. ?>
  31.  
  32. <body>
  33. <title>HOME</title>
  34. <div class="headerBar">
  35. <a href="cafe.php"> <!-- Handles the header bar -->
  36. <img src="../images/yeom.jpg">
  37. </a>
  38.  
  39. <!-- Form to allow a user to login -->
  40. <form method="post" action="./signinengine.php" id="loginForm" class="loginForm">
  41. <input type="text" name="username" placeholder="Username" id="User">
  42. <input type="password" name="pass" placeholder="password" id="Pass">
  43. <input type="submit" value="Login!" name="login" id="log" class="login">
  44. </form>
  45.  
  46. </div>
  47.  
  48. <a href="./signout.php">
  49. <button class="signout">Sign Out!</button> <!-- log out button -->
  50. </a>
  51.  
  52. <center>
  53. <hr><h2>Y.E.O.M</h2><hr>
  54. </center>
  55.  
  56. <div1>
  57. <?php
  58.  
  59. /* Handles the logged in message */
  60. if ($session_user==""){
  61. //header("Location: ./signup.php");
  62. }else {
  63. $username = $_SESSION['session_user'];
  64.  
  65. $retrieve = "SELECT * FROM `tb_users` WHERE `Username` = '$username'";
  66. $result = $mysqli->query($retrieve);
  67. $row = $result->fetch_assoc();
  68.  
  69. echo "Welcome " . $_SESSION['session_user'] . "! Your balance: $" . $row["Balance"];
  70.  
  71. }
  72. ?>
  73. </div1>
  74. <br/>
  75. <br>
  76.  
  77. <a href="./The Ref.php">
  78. <button class="refBtn">The Refectory</button> <!-- Redirects to The Refectory -->
  79. </a>
  80. <a href="./Lazenby.php">
  81. <button class=lazBtn>Lazenby</button> <!-- Redirects to Lazenby -->
  82. </a>
  83.  
  84. <a href="./Trade Table.php">
  85. <button class="tblBtn">Trade Table</button> <!--Redirects to Trade Table -->
  86. </a>
  87.  
  88. <a href="./The Grove.php">
  89. <button class="groveBtn">The Grove</button> <!-- Redirects to The Grove -->
  90. </a>
  91.  
  92. <a href="./The Walk.php">
  93. <button class="walkBtn">The Walk</button> <!-- Redirects to The Walk -->
  94. </a>
  95.  
  96. <?php
  97. /* if the user is logged in, allow them to navigate to their account page */
  98. if(!$_SESSION['session_user']){
  99.  
  100. } else {
  101. echo "<a href='./userAccountPage.php'>
  102. <button class='account'>User Account Page</button>
  103. </a>";
  104. }
  105.  
  106. ?>
  107. <form action="./register.php">
  108. <input type="submit" value="Signup" class="signup"> <!-- Allow a person to sign up to Y.E.O.M -->
  109. </form>
  110.  
  111. <?php
  112. /* If an admin is logged in, allow them access to the master page */
  113. if($_SESSION['session_user'] != NULL && $_SESSION['session_access'] > 4){
  114. echo "<a href='./master.php'>
  115. <button class='master'>Master Page</button>
  116. </a>";
  117. }
  118. ?>
  119.  
  120. </body>
  121. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement