98 lines
2.9 KiB
PHP
98 lines
2.9 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
// Check if the user has just placed an order
|
|
if (!isset($_SESSION['last_order_id'])) {
|
|
header('Location: index.php');
|
|
exit;
|
|
}
|
|
|
|
$order_id = $_SESSION['last_order_id'];
|
|
|
|
// Clear the session variable to prevent users from re-visiting this page for the same order
|
|
unset($_SESSION['last_order_id']);
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Order Confirmed - MajuroEats</title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
<style>
|
|
body {
|
|
font-family: 'Poppins', sans-serif;
|
|
background-color: #F8F9FA;
|
|
color: #333;
|
|
text-align: center;
|
|
}
|
|
.container {
|
|
padding: 4rem 2rem;
|
|
max-width: 700px;
|
|
margin: auto;
|
|
}
|
|
.confirmation-box {
|
|
background-color: #fff;
|
|
padding: 3rem;
|
|
border-radius: 0.5rem;
|
|
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
|
}
|
|
.confirmation-box h1 {
|
|
font-size: 2.5rem;
|
|
font-weight: 700;
|
|
color: #2E8B57;
|
|
margin-bottom: 1rem;
|
|
}
|
|
.confirmation-box p {
|
|
font-size: 1.1rem;
|
|
line-height: 1.7;
|
|
margin-bottom: 2rem;
|
|
}
|
|
.order-id {
|
|
font-size: 1.5rem;
|
|
font-weight: 600;
|
|
color: #40E0D0;
|
|
background-color: #f0fdfa;
|
|
padding: 0.5rem 1rem;
|
|
border-radius: 0.25rem;
|
|
display: inline-block;
|
|
}
|
|
.home-btn {
|
|
background-color: #40E0D0;
|
|
color: #fff;
|
|
border: none;
|
|
padding: 0.8rem 2rem;
|
|
border-radius: 0.5rem;
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
font-size: 1rem;
|
|
text-decoration: none;
|
|
display: inline-block;
|
|
margin-top: 1rem;
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
.home-btn:hover {
|
|
background-color: #2E8B57;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="confirmation-box">
|
|
<h1>Thank You For Your Order!</h1>
|
|
<p>Your order has been successfully placed. You will receive an email confirmation shortly. The restaurant will begin preparing your food soon!</p>
|
|
<p>Your Order ID is:</p>
|
|
<div class="order-id">#<?php echo htmlspecialchars($order_id); ?></div>
|
|
<br>
|
|
<a href="index.php" class="home-btn">Back to Homepage</a>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
// Clear the cart from local storage after a successful order
|
|
localStorage.removeItem('majuroEatsCart');
|
|
</script>
|
|
</body>
|
|
</html>
|