Advertisement
swimmerbhs

Untitled

Apr 20th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.62 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     if(!isset($_SESSION['userName']))
  4.     {
  5.         session_destroy();
  6.         header("location:index.php");
  7.     }
  8.     if(isset($_SESSION['userName'])){
  9.     $results=mysqli_query($con, "select * from Users where `userName` ='$userName'");
  10. $row = mysqli_fetch_array($result);
  11. $id = $row['id_cust'];
  12.     }
  13.     if(isset($_POST['logout']))
  14. {
  15.         header("location:logout.php");
  16. }
  17. include 'database_connector.php';
  18. $currenttime=date("Y-m-d");
  19. ?>
  20. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  21. <html xmlns="http://www.w3.org/1999/xhtml">
  22. <head>
  23. <link href="index.css" rel="stylesheet" type="text/css" />
  24. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  25. <title>Users Page</title>
  26. </head>
  27. <body>
  28. <div id="floatleft">
  29. <iframe src="//www.gamechanger.io/team-52c86f6d1645cf08a4c3ff43/scoreboard?g=5&p=5131254a45506d60704191af" width="728" height="90" scrolling="no" frameborder="0"></iframe>
  30. </div>
  31. <div id="signin">
  32. [ <a href="signup.php">Sign Up</a> ]
  33. [ <a href="signin.php">Sign In</a> ]
  34. [ <a href="logout.php">Log Out</a> ]
  35. </div>
  36. <div id="clear"></div>
  37. <div class="navbar">
  38. <ul>
  39. <li><a href="concerts.php" target="_self">Concert</a></li>
  40. <li><a href="restaurants.php" target="_self">Restaurant</a></li>
  41. <li><a href="sports.php" target="_self">Sports</a></li>
  42. <li><a href="users.php" target="_self">Users</a></li>
  43. <li><a href="addconcert.php" target="_self">Add Concerts</a></li>
  44. <li><a href="addrestaurants.php" target="_self">Add Restaurants</a></li>
  45. <li><a href="addsports.php" target="_self">Add Sports</a></li>
  46. </ul>
  47. </div>
  48. <div id="results">
  49. Current Sports Event you have added
  50. <?php echo $userName;
  51.     ?>
  52. <?php
  53. $result=mysqli_query($con, "select * from Sports where `id_cust` = '$id'");
  54. echo "<table>";
  55. echo "<tr>
  56.       <th>Date</th>
  57.       <th>Event Type</th>
  58.       <th>Team 1</th>
  59.       <th>Team 2</th>
  60.       <th>Place</th>
  61.       <th>Price</th>
  62.       <th>Delete</th>
  63.       <th>Update</th>
  64.       </tr>";  
  65. while($rows=mysqli_fetch_array($result)){
  66.  
  67.  ?>
  68. <td><? echo $rows['date']; ?></td>
  69. <td><? echo $rows['event']; ?></td>
  70. <td><? echo $rows['Team 1']; ?></td>
  71. <td><? echo $rows['Team 2']; ?></td>
  72. <td><? echo $rows['Place']; ?></td>
  73. <td><? echo $rows['Price']; ?></td>
  74. <td align="center"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id_cust']; ?>"></td>
  75. <td align="center"><input name="radio[]" type="radio" value="<? echo $rows['id_cust']; ?>"></td
  76. }
  77. <?php
  78. }
  79. echo "</table>"
  80. ?>
  81. <form name="update" action="" method="post">
  82. <input type="submit" value="submit" name="submit" />
  83. </form>
  84. </div>
  85. </body>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement