Advertisement
swimmerbhs

users

Apr 19th, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.57 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.     else{
  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>Add Restaurant</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. </div>
  35. <div id="clear"></div>
  36. <div class="navbar">
  37. <ul>
  38. <li><a href="concerts.php" target="_self">Concert</a></li>
  39. <li><a href="restaurants.php" target="_self">Restaurant</a></li>
  40. <li><a href="sports.php" target="_self">Sports</a></li>
  41. <li><a href="addconcert.php" target="_self">Add Concerts</a></li>
  42. <li><a href="addrestaurants.php" target="_self">Add Restaurants</a></li>
  43. <li><a href="addsports.php" target="_self">Add Sports</a></li>
  44. </ul>
  45. </div>
  46. <div id="results">
  47. Current Sports Event you have added
  48. <?php
  49. $result=mysqli_query($con, "select * from Sports where `date` >= '$currenttime' AND `id_cust = '$id'");
  50. echo "<table>";
  51. echo "<tr>
  52.       <th>Date</th>
  53.       <th>Event Type</th>
  54.       <th>Team 1</th>
  55.       <th>Team 2</th>
  56.       <th>Place</th>
  57.       <th>Price</th>
  58.       <th>Delete</th>
  59.       <th>Update</th>
  60.       </tr>";  
  61. while($row=mysqli_fetch_array($result)){
  62.   $date     = $row['Date'];
  63.   $event    = $row['event'];
  64.   $team1    = $row['Team 1'];
  65.   $team2    = $row['Team 2'];
  66.   $place    = $row['Place'];
  67.   $price    = $row['Price'];
  68.   echo "<tr>
  69.         <td>".$date. "</td>
  70.         <td>".$event."</td>
  71.        <td>".$team1."</td>
  72.        <td>".$team2."</td>
  73.         <td>".$place."</td>
  74.         <td>" . "$" .$price."</td>
  75.         <td>"<input type='checkbox' name='delete[]' value='{$row['cust_id']}' />"</td>
  76.         <td>"<input type='radio' name='update[]' value='{$row['ID']}' />"</td>
  77.         </tr>";
  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