?> <body> <table> <tr><td>ID</td> <td>Name</td> <td>Surname</td> <td>Contact Number</td> <td>Email</td> <td>SA ID Number</td> <td>Address</td> <td>Actions</td></tr> <?php $dbconn = new mysql_database(); $result = $dbconn->fetch("select * from customer"); if ($result->num_rows > 0) { // output data of each row while ($row = $result->fetch_assoc()) { echo "<tr>" . "<td>" . $row["ID"] . "</td>" . " <td>" . $row["name"] . "</td>" . " <td>" . $row["surname"] . "</td>" . "<td>" . $row["contact_number"] . "</td>" . "<td>" . $row["email"] . "</td>" . "<td>" . $row["sa_id_number"] . "<td>" . $row["address"] . "<td><form action='customer.php?q=" . $row["ID"] . "' method='post'><input type='submit' value='edit'></form></td>" . "<td><form action='delete_customer.php?ID=" . $row["ID"] . "' method='post'><input type='submit' value='delete'></form></td>"; } } ?> </td></tr> </table> <table> <tr><td>ID</td> <td>Name</td> <td>Description</td>
<html> <?php include 'header.php'; ?> <body> <?php if (!empty($_GET)) { $id = $_GET["order_id"]; $dbconn = new mysql_database(); $result = $dbconn->fetch("select * from orders where orders_ID=" . $id . ""); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo '<form method="post" action="edit_order.php?order_id=' . $row["orders_ID"] . '"> Rental Date: <input type="text" name="rent_date" value="' . $row["rent_date"] . '" required><br> Due Date: <input type="text" name="due_date" value="' . $row["due_date"] . '" required><br> Return Date: <input type="text" name="actual_return_date" value="' . $row["actual_return_date"] . '" required><br> Customer ID: <input type="text" name="customer_id" value="' . $row["customer_id"] . '" required><br> <input type="submit"> </form>'; } } } else { //echo "<p>not clicked"; } $dbconn = new mysql_database(); if (!empty($_POST) && !empty($_GET)) { $orders_ID = $_GET["order_id"]; $rent_date = $_POST["rent_date"]; $due_date = $_POST["due_date"]; $actual_return_date = $_POST["actual_return_date"]; $customer_id = $_POST["customer_id"];
<html> <?php include 'header.php'; ?> <body> <?php if (!empty($_GET)) { $ID = $_GET["ID"]; $dbconn = new mysql_database(); $id = octdec($ID); $result = $dbconn->fetch("SELECT * FROM dvd where ID={$id}"); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { echo '<form method="post" action="edit_dvd.php?ID=' . $row["ID"] . '"> Name: <input type="text" name="name" value="' . $row["name"] . '" required><br> Description: <textarea name="description" value required>"' . $row["description"] . '"</textarea><br> Release Date: <input type="text" name="release_date" value="' . $row["release_date"] . '" required><br> Category ID: <input type="text" name="category_id" value="' . $row["category_id"] . '" required><br> <input type="submit"> </form>'; } } } else { //echo "<p>not clicked"; } if (!empty($_POST) && !empty($_GET)) { $ID = $_GET["ID"]; $name = $_POST["name"]; $description = $_POST["description"]; $release_date = $_POST["release_date"]; $category_id = $_POST["category_id"];
include 'header.php'; ?> <body> <form action="add_order.php" method="post"><input type="submit" value="Add order"></form> <table> <tr><td>Order ID</td> <td>Customer ID</td> <td>Rental Date</td> <td>Return Date</td> <td>Actions</td></tr> <?php $dbconn = new mysql_database(); $result = $dbconn->fetch("SELECT * FROM orders INNER JOIN customer on customer.ID=orders.customer_id ORDER BY orders_ID DESC"); if ($result->num_rows > 0) { // output data of each row while ($row = $result->fetch_assoc()) { echo "<tr>" . "<td>" . $row["orders_ID"] . "</td>" . "<td>" . $row["ID"] . "</td>" . "<td>" . $row["rent_date"] . "</td>" . "<td>" . $row["actual_return_date"] . "</td>" . "<td><form action='edit_order.php?order_id=" . $row["orders_ID"] . "' method='post'><input type='submit' value='edit'></form></td>" . "<td><form action='delete_order.php?order_id=" . $row["orders_ID"] . "' method='post'><input type='submit' value='delete'></form></td>"; } } ?> </td></tr> </table> </body> </html>
<html> <?php include 'header.php'; ?> <body> <table> <tr><td>Category</td> <td>ID</td> <td>Actions</td> </tr> <?php $dbconn = new mysql_database(); $result = $dbconn->fetch("SELECT * FROM category"); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { ?> <tr><td><?php echo $row["category_name"]; ?> </td> <td><?php echo $row["Category_ID"]; ?> </td> <td><form action="delete_category.php?ID=<?php echo $row["Category_ID"]; ?> " method="post"><input type="submit" value="delete"></form></td></tr> <?php } }
<?php include 'header.php'; ?> <body> <table> <tr><td>ID</td> <td>Name</td> <td>Surname</td> <td>Contact Number</td> <td>Email</td> <td>SA ID Number</td> <td>Address</td> <td>Actions</td></tr> <?php $dbconn = new mysql_database(); $result = $dbconn->fetch("select * from customer"); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { ?> <tr><td><?php echo $row["ID"]; ?> </td> <td><?php echo $row["name"]; ?> </td> <td><?php echo $row["surname"]; ?> </td>