Advertisement
Guest User

dvd

a guest
May 28th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <link href="css/bootstrap.min.css" rel="stylesheet">
  6. <link href="css/main.css" rel="stylesheet">
  7. <script src="js/bootstrap.min.js"></script>
  8. </head>
  9.  
  10. <body>
  11. <div class="container">
  12. <nav class="clearfix">
  13. <ul>
  14. <li><a href="index.php">Home</a></li>
  15. <li><a href="orders.php">Orders</a></li>
  16. <li><a href="dvds.php">Dvds</a></li>
  17. <li><a href="clients.php">Clients</a></li>
  18. </ul>
  19. </nav>
  20. <div class="row">
  21. <h2>Dvds</h2>
  22. </div>
  23. <div class="row">
  24. <p>
  25. <a href="create_dvds.php" class="btn btn-success">Create a new dvd</a>
  26. </p>
  27. <table class="table table-striped table-bordered">
  28. <thead>
  29. <tr>
  30. <th>Title</th>
  31. <th>Description</th>
  32. <th>Release date</th>
  33. <th>Duration</th>
  34. <th>Genre</th>
  35. <th>Action</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. <?php
  40. include 'database.php';
  41. $pdo = Database::connect();
  42. $sql = 'SELECT DISTINCT tl_dvd.id, tl_dvd.title, tl_dvd.description, tl_dvd.release_date, tl_order.returned FROM tl_dvd, tl_order WHERE tl_dvd.id = tl_order.dvd_id AND returned = 1';
  43. foreach ($pdo->query($sql) as $row) {
  44. echo '<tr>';
  45. echo '<td>'. $row['title'] . '</td>';
  46. echo '<td>'. $row['duration'] . '</td>';
  47. echo '<td>'. $row['release_date'] . '</td>';
  48. echo '<td>'. $row['description'] . '</td>';
  49. echo '<td>'. $row['name'] . '</td>';
  50. echo '<td><a class="btn" href="delete_dvd.php?id='.$row['id'].'">Delete</a></td>';
  51. echo '</tr>';
  52. }
  53. Database::disconnect();
  54. ?>
  55. </tbody>
  56. </table>
  57. </div>
  58. </div> <!-- /container -->
  59. </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement