From b549bda5c732764aee15c342fe426223cff315dc Mon Sep 17 00:00:00 2001 From: Bitha17 <16521076@mahasiswa.itb.ac.id> Date: Wed, 4 Oct 2023 17:58:58 +0700 Subject: [PATCH] temp ticket purchase fe --- app/Views/pembelian/pembelian.php | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 app/Views/pembelian/pembelian.php diff --git a/app/Views/pembelian/pembelian.php b/app/Views/pembelian/pembelian.php new file mode 100644 index 0000000..35ad2ab --- /dev/null +++ b/app/Views/pembelian/pembelian.php @@ -0,0 +1,46 @@ +<<!-- app/Views/purchase.php --> + +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Purchase Ticket</title> + <!-- Include any CSS styles or external libraries here --> +</head> +<body> + <h1>Purchase Ticket</h1> + + <!-- Display the ticket details --> + <h2>Ticket Details</h2> + <p>Ticket ID: <?php echo $ticket['ticket_id']; ?></p> + <p>Ticket Name: <?php echo $ticket['ticket_name']; ?></p> + <p>Price: <?php echo $ticket['ticket_price']; ?></p> + + <!-- Purchase Form --> + <form id="purchaseForm" method="post" action="home.php?action=purchaseTicket"> + <input type="hidden" name="ticketId" value="<?php echo $ticket['ticket_id']; ?>"> + <input type="hidden" name="userId" value="<?php echo $_SESSION['user_id']; ?>"> + + <!-- Additional form fields or options can be added here --> + + <button type="button" id="confirmPurchaseBtn">Confirm Purchase</button> + </form> + + <!-- JavaScript code for the confirmation dialog --> + <script> + // Function to show the confirmation dialog + function showConfirmationDialog() { + if (confirm("Are you sure you want to purchase this ticket?")) { + // If the user confirms, submit the form + document.getElementById("purchaseForm").submit(); + } + } + + // Attach the confirmation dialog to the button click event + document.getElementById("confirmPurchaseBtn").addEventListener("click", showConfirmationDialog); + </script> + + <!-- Include any additional content or messages here --> +</body> +</html> -- GitLab