Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <?php # DISPLAY SHOPPING CART PAGE.
  2.  
  3. # Access session.
  4. session_start() ;
  5.  
  6. # Redirect if not logged in.
  7. if ( !isset( $_SESSION[ 'user_id' ] ) ) { require ( 'login_tools.php' ) ; load() ; }
  8.  
  9. # Set page title and display header section.
  10. $page_title = 'Reservation' ;
  11. include ( 'header2.php' ) ;
  12.  
  13. # Open database connection.
  14. require ( 'connect_db.php' ) ;
  15.  
  16. echo '<div class="container">
  17. <h1><i class="fa fa-book" aria-hidden="true"></i> Your Reservation</h1>';
  18. echo "{$_SESSION['first_name']} {$_SESSION['last_name']}";
  19.  
  20. # Retrieve items from 'movie2' database table.
  21. $q = "SELECT * FROM ordersWHERE user_id={$_SESSION['user_id']}" ;
  22. $r = mysqli_query( $link, $q ) ;
  23. if ( mysqli_num_rows( $r ) > 0 )
  24. {
  25.  
  26.  
  27.  
  28. while ( $row = mysqli_fetch_array( $r, MYSQLI_ASSOC ))
  29. {
  30. echo '<div class="container"><table class="table table-hover"><thead><tr><th>' . $row['order_id'] . '</th><th>' . $row['total'] . '</th><th>' . $row['order_date'] . '</th>';
  31. }
  32.  
  33. echo '</tbody></table>';
  34.  
  35. # Close database connection.
  36. mysqli_close( $link ) ;
  37. }
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement