You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
109 lines
3.3 KiB
109 lines
3.3 KiB
6 months ago
|
<?php
|
||
|
// Collect the query parameters from the URL
|
||
|
$food_type = isset($_GET['food-type']) ? $_GET['food-type'] : 'N/A';
|
||
|
$quantity = isset($_GET['quantity']) ? $_GET['quantity'] : 'N/A';
|
||
|
$pickup_time = isset($_GET['pickup']) ? $_GET['pickup'] : 'N/A';
|
||
|
$pickup_address = isset($_GET['pickup-address']) ? $_GET['pickup-address'] : 'N/A';
|
||
|
$comments = isset($_GET['comments']) ? $_GET['comments'] : 'N/A';
|
||
|
?>
|
||
|
|
||
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8" />
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
|
<title>Thank You for Your Donation</title>
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
|
||
|
<style>
|
||
|
body {
|
||
|
margin: 0;
|
||
|
font-family: Arial, sans-serif;
|
||
|
}
|
||
|
header {
|
||
|
text-align: center;
|
||
|
padding: 20px;
|
||
|
color: #333;
|
||
|
}
|
||
|
h1 {
|
||
|
margin: 0;
|
||
|
}
|
||
|
p {
|
||
|
color: #555;
|
||
|
}
|
||
|
#donation-details {
|
||
|
max-width: 600px;
|
||
|
margin: 20px auto;
|
||
|
padding: 20px;
|
||
|
background-color: #ffffff;
|
||
|
border-radius: 8px;
|
||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
|
}
|
||
|
strong {
|
||
|
color: #3b9b3a;
|
||
|
}
|
||
|
button {
|
||
|
display: block;
|
||
|
width: 100%;
|
||
|
padding: 10px;
|
||
|
color: #080808;
|
||
|
border: none;
|
||
|
border-radius: 4px;
|
||
|
font-size: 18px;
|
||
|
font-weight: bold;
|
||
|
cursor: pointer;
|
||
|
margin-top: 20px;
|
||
|
transition: background-color 0.3s ease;
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<section id="thank-you-page">
|
||
|
<header>
|
||
|
<h1>Thank You for Your Donation!</h1>
|
||
|
<p>
|
||
|
Your donation form has been successfully submitted. Below are the
|
||
|
details:
|
||
|
</p>
|
||
|
</header>
|
||
|
|
||
|
<div id="donation-details">
|
||
|
<p>
|
||
|
<strong>Food Type:</strong> <span><?php echo htmlspecialchars($food_type); ?></span>
|
||
|
</p>
|
||
|
<p><strong>Quantity:</strong> <span><?php echo htmlspecialchars($quantity); ?></span></p>
|
||
|
<p>
|
||
|
<strong>Preferred Pickup Time:</strong> <span><?php echo htmlspecialchars($pickup_time); ?></span>
|
||
|
</p>
|
||
|
<p>
|
||
|
<strong>Pickup Address:</strong> <span><?php echo htmlspecialchars($pickup_address); ?></span>
|
||
|
</p>
|
||
|
<p>
|
||
|
<strong>Additional Comments:</strong> <span><?php echo htmlspecialchars($comments); ?></span>
|
||
|
</p>
|
||
|
</div>
|
||
|
|
||
|
<button id="download-pdf">Download Donation Details</button>
|
||
|
</section>
|
||
|
|
||
|
<script>
|
||
|
// Download PDF functionality
|
||
|
document
|
||
|
.getElementById("download-pdf")
|
||
|
.addEventListener("click", function () {
|
||
|
const { jsPDF } = window.jspdf;
|
||
|
const doc = new jsPDF();
|
||
|
|
||
|
doc.text("Donation Details", 20, 20);
|
||
|
doc.text("Food Type: <?php echo addslashes($food_type); ?>", 20, 30);
|
||
|
doc.text("Quantity: <?php echo addslashes($quantity); ?>", 20, 40);
|
||
|
doc.text("Pickup Time: <?php echo addslashes($pickup_time); ?>", 20, 50);
|
||
|
doc.text("Pickup Address: <?php echo addslashes($pickup_address); ?>", 20, 60);
|
||
|
doc.text("Additional Comments: <?php echo addslashes($comments); ?>", 20, 70);
|
||
|
|
||
|
// Save the PDF
|
||
|
doc.save("donation-details.pdf");
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|