Advertisement
Guest User

Untitled

a guest
May 27th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 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. <div class="row">
  13. <h3>DVD</h3>
  14. </div>
  15. <div class="row">
  16. <p>
  17. <a href="create.php" class="btn btn-success">Create</a>
  18. </p>
  19.  
  20. <table class="table table-striped table-bordered">
  21. <thead>
  22. <tr>
  23. <th>Title</th>
  24. <th>Description</th>
  25. <th>Origin Country</th>
  26. <th>Duration</th>
  27. <th>Releasedate</th>
  28. <th></th>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. <?php
  33. include 'database.php';
  34. $pdo = Database::connect();
  35. $sql = 'SELECT * FROM tl_dvd';
  36. foreach ($pdo->query($sql) as $row) {
  37. echo '<tr>';
  38. echo '<td>'. $row['title'] . '</td>';
  39. echo '<td>'. $row['description'] . '</td>';
  40. echo '<td>'. $row['origin_country'] . '</td>';
  41. echo '<td>'. $row['duration'] . '</td>';
  42. echo '<td>'. $row['release_date'].'</td>';
  43. echo '<td width=250>';
  44. echo '<a class="btn" href="read.php?id='.$row['id'].'">Read</a>';
  45. echo ' ';
  46. echo '<a class="btn btn-success" href="update.php?id='.$row['id'].'">Update</a>';
  47. echo ' ';
  48. echo '<a class="btn btn-danger" href="delete.php?id='.$row['id'].'">Delete</a>';
  49. echo '</td>';
  50. echo '</tr>';
  51. }
  52. Database::disconnect();
  53. ?>
  54. </tbody>
  55. </table>
  56. </div>
  57. </div> <!-- /container -->
  58. </body>
  59. </html>
  60.  
  61. <?php
  62. require 'database.php';
  63. $pdo = Database::connect();
  64. $sql = 'SELECT * FROM tl_ dvd WHERE id = ?';
  65. foreach ($pdo->query($sql) as $row) {
  66. echo '<tr>';
  67. echo '<td>'. $row['title'] . '</td>';
  68. echo '<td>'. $row['description'] . '</td>';
  69. echo '<td>'. $row['origin_country'] . '</td>';
  70. echo '<td>'. $row['duration'] . '</td>';
  71. echo '<td>'. $row['releasedate'] . '</td>';
  72. echo '</tr>';
  73. }
  74. Database::disconnect();
  75. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement