<?php
session_start();
require_once 'db/config.php';

if (!isset($_SESSION['user_id'])) {
    header("Location: login.php");
    exit();
}

if (!isset($_GET['id'])) {
    header("Location: index.php");
    exit();
}

$orderId = $_GET['id'];

include 'header.php';
?>

<div class="container mt-5">
    <div class="row">
        <div class="col-md-8 offset-md-2 text-center">
            <h2 class="mb-4">Thank You for Your Order!</h2>
            <p>Your order has been placed successfully.</p>
            <p>Your Order ID is: <strong><?php echo $orderId; ?></strong></p>
            <p>We have received your order and will begin processing it shortly.</p>
            <a href="index.php" class="btn btn-primary">Continue Shopping</a>
        </div>
    </div>
</div>

<?php include 'footer.php'; ?>
