<?php
// thank-you.php
include "../../config.php";
$order_id = $_GET['order_id'] ?? null;
if (!$order_id) {
    echo "Order ID is missing!";
    exit;
}

// Fetch the order details using the 'getorder' API
$orderDetails = file_get_contents(API_URL . "?gofor=getorder&order_id=" . $order_id);
$orderDetails = json_decode($orderDetails, true);

if (isset($orderDetails['Order List'])) {
    $order = $orderDetails['Order List'];
    $orderDetail = $orderDetails['Order Detail'];
    $productDetails = $orderDetails['Product Detail'];
    $customerDetails = $orderDetails['Customer Detail'];
    $addressDetails = $orderDetails['Address Detail'];
} else {
    echo "Failed to fetch order details.";
    exit;
}
?>
<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Shopping Cart | Dr Siddha diabetes combo</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.png">
    <!-- CSS here -->
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/animate.min.css">
    <link rel="stylesheet" href="assets/css/magnific-popup.css">
    <link rel="stylesheet" href="assets/css/fontawesome-all.min.css">
    <link rel="stylesheet" href="assets/css/mCustomScrollbar.min.css">
    <link rel="stylesheet" href="assets/css/jquery-ui.css">
    <link rel="stylesheet" href="assets/css/flaticon.css">
    <link rel="stylesheet" href="assets/css/slick.css">
    <link rel="stylesheet" href="assets/css/default.css">
    <link rel="stylesheet" href="assets/css/style.css">
    <link rel="stylesheet" href="assets/css/responsive.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css"
        crossorigin="anonymous" referrerpolicy="no-referrer" />
    
</head>

<body>
    <?php include "header.php";?>

    <!-- main-area -->
    <main>
        <!-- Cart Section -->
        <section class="cart-area pt-120 pb-120" style="background: #f9f9f9;">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col-md-6">
                        <img src="https://drsiddha.com/assets/images/Thank-You.jpg" alt="Dr's Siddha Herbal Medicine" width="100%">
                    </div>
					<div class="col-md-6 d-flex flex-column justify-content-center">
                        <h1>Thank You for Your Order!</h1>
						<p>
						  We value your trust and will deliver on it. If you have any doubts, we are a click away. Dr's.Siddha will keep delivering the most natural herbal products for health & longevity. We value our customer experience very much. Please feel free to share your feedback & drop down your suggestion.
						</p>						
						<div>
							<a href="invoice.php?order_id=<?php echo $order_id;?>" class="btn special-btn" style="display:inline-block;" target="_blank">
								 View Invoice
							</a>&nbsp;&nbsp;
							<a href="index.php" class="btn solid-btn" style="display:inline-block;">
								Goto Homepage
							</a>
						</div>
                        
                    </div>
                </div>
            </div>
        </section>
    </main>
    <!-- main-area-end -->

    <!-- footer-area (reuse from index.html) -->
    <?php include "footer.php";?>
    <!-- footer-area-end -->

    <!-- JS here -->
    <script src="assets/js/vendor/jquery-3.6.0.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/isotope.pkgd.min.js"></script>
    <script src="assets/js/imagesloaded.pkgd.min.js"></script>
    <script src="assets/js/jquery.magnific-popup.min.js"></script>
    <script src="assets/js/jquery.easypiechart.min.js"></script>
    <script src="assets/js/jquery.mCustomScrollbar.min.js"></script>
    <script src="assets/js/jquery.inview.min.js"></script>
    <script src="assets/js/jquery.parallaxScroll.js"></script>
    <script src="assets/js/jquery.easing.js"></script>
    <script src="assets/js/jquery-ui.min.js"></script>
    <script src="assets/js/validator.js"></script>
    <script src="assets/js/nav-tool.js"></script>
    <script src="assets/js/slick.min.js"></script>
    <script src="assets/js/ajax-form.js"></script>
    <script src="assets/js/wow.min.js"></script>
    <script src="assets/js/main.js"></script>
    
</body>
</html>