<!DOCTYPE html>

<!--[if IE 8 ]><html class="ie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<!--<![endif]-->


<!-- Mirrored from themesflat.co/html/vemus/thank-you.php by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 02 Oct 2025 09:24:16 GMT -->
<head>
    <meta charset="utf-8">
    <title>Thank you - </title>
    <meta name="author" content="themesflat.com">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description"
        content="Themesflat Vemus - A modern and elegant Jewelry Ecommerce HTML Template, perfect for online stores selling rings, necklaces, watches, and other accessories. SEO-optimized, fast-loading, and fully customizable.">

    <!-- font -->
    <link rel="stylesheet" href="fonts/fonts.css">
    <link rel="stylesheet" href="icon/icomoon/style.css">
    <!-- css -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/swiper-bundle.min.css">
    <link rel="stylesheet" href="css/animate.css">
    <link rel="stylesheet" href="../../../sibforms.com/forms/end-form/build/sib-styles.css">
    <link rel="stylesheet" type="text/css" href="css/styles.css">

    <!-- Favicon and Touch Icons  -->
    <link rel="shortcut icon" href="images/logo/logo.png">
    <link rel="apple-touch-icon-precomposed" href="images/logo/logo.png">

</head>

<body>

    
    <!-- preload -->
    
    <!-- /preload -->

    <div id="wrapper">
        <!-- Top Bar-->
        <?php 
        include "common/header.php";
        $_SESSION['last_order_id'];
        ?>
        
        <!-- /Header -->
        <!-- Thank Your Order -->
        <section class="flat-spacing">
            <div class="container">
                <div class="thank-wrap flat-spacing pt-0">
                    <div class="thank-wrap flat-spacing pt-0 text-center" 
                         style="background: linear-gradient(135deg, #fffaf0, #ffffff); border-radius: 15px; padding: 50px 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05);">
                        
                        <span class="icon d-inline-flex align-items-center justify-content-center mb-4" 
                              style="width: 90px; height: 90px; border-radius: 50%; background: linear-gradient(145deg, #b8860b, #ffd700); box-shadow: 0 0 15px rgba(184,134,11,0.3);">
                            <i class="icon-check-3" style="font-size: 40px; color: #fff;"></i>
                        </span>
                    
                        <h2 class="title fw-bold text-uppercase mb-3" 
                            style="color: #b8860b; letter-spacing: 1px; font-size: 28px;">
                            Thank You For Your Order!
                        </h2>
                    
                        <p class="sub-title mb-2" 
                           style="font-size: 18px; color: #555;">
                           You are awesome, <strong><?php echo htmlspecialchars($_SESSION['cust_name'] ?? 'Valued Customer'); ?></strong>! 
                           Thank you so much for your purchase.
                        </p>
                    
                        <p class="text-muted" style="font-size: 16px;">
                            Your order has been successfully placed with <strong>Varnika Artificial Jewellery</strong>.<br>
                            We’ll notify you when your order is ready.
                        </p>
                    
                        <a href="index.php" 
                           class="btn mt-4 px-4 py-2" 
                           style="background-color:#b8860b; color:#fff; border-radius:30px; text-transform:uppercase; font-weight:600;">
                            Continue Shopping
                        </a>
                    </div>

                </div>
                <div class="s-checkout place-order-wrap">
                    <div class="left-col">
                        <div class="table-order-finish">
                            <?php
                        // ✅ Include config and start session
                        
                        
                        // ✅ Get last order ID
                        $order_id = $_SESSION['last_order_id'] ?? '';
                        
                        // ✅ Fetch order details
                        $sql = "SELECT * FROM tbl_payment WHERE order_id = '$order_id' LIMIT 1";
                        $result = mysqli_query($conn, $sql);
                        $order = mysqli_fetch_assoc($result);
                        ?>
                        
                        <table class="table table-bordered text-center align-middle" style="width:100%; border-collapse:collapse; border:1px solid #e0e0e0;">
                            <thead style="background-color:#f9f9f9;">
                                <tr>
                                    <th class="order_product h6 fw-semibold text-uppercase py-3">Order Id</th>
                                    <th class="order_price h6 fw-semibold text-uppercase py-3">Order Date</th>
                                    <th class="order_quantity h6 fw-semibold text-uppercase py-3">Currency</th>
                                    <th class="order_quantity h6 fw-semibold text-uppercase py-3">Order Total</th>
                                    <th class="order_subtotal h6 fw-semibold text-uppercase py-3">Payment Method</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if (!empty($order)) { ?>
                                    <tr class="order_item" style="font-size:15px;">
                                        <td class="order_number fw-bold text-dark">#<?php echo htmlspecialchars($order['order_id']); ?></td>
                                        <td class="order_date">
                                            <?php 
                                                $date = date("d M Y", strtotime($order['oder_date']));
                                                echo htmlspecialchars($date);
                                            ?>
                                        </td>
                                        <td class="order_total text-success"><?php echo $order['currency_code']; ?></td>
                                        <td class="order_total text-success"><?php echo number_format((float)$order['paid_amount'], 2); ?></td>
                                        <td class="order_payment text-muted">COD</td>
                                    </tr>
                                <?php } else { ?>
                                    <tr>
                                        <td colspan="4" class="text-muted py-3">No order details found.</td>
                                    </tr>
                                <?php } ?>
                            </tbody>
                        </table>

                        </div>
                        
                        <!--<div class="map d-flex">-->
                        <!--    <iframe-->
                        <!--        src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3536.400574347873!2d77.69543589999999!3d27.581108!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x39736e346a3ab9bb%3A0xa923564549b61ec4!2sGangotri%20Jewellers%20%26%20Arts!5e0!3m2!1sen!2sin!4v1761644324153!5m2!1sen!2sin"-->
                        <!--        width="100%" height="499" style="border:0;" allowfullscreen="" loading="lazy"-->
                        <!--        referrerpolicy="no-referrer-when-downgrade"></iframe>-->
                        <!--</div>-->
                        <?php
                        $order_id = $_SESSION['last_order_id'] ?? '';
                        
                        if ($order_id) {
                            $sql = "SELECT customer_name, phone, address1, address2, city, state, country, zip_code, customer_email 
                                    FROM tbl_payment WHERE order_id = '$order_id' LIMIT 1";
                            $result = mysqli_query($conn, $sql);
                            $address = mysqli_fetch_assoc($result);
                        }
                        ?>
                        
                        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

                        <div class="flat-spacing-11">
                          <div class="box-ship-address s-wrap flex-sm-nowrap">
                            <div class="ship-address-item shadow-sm border rounded-4 p-4 bg-light position-relative" style="max-width: 450px;">
                        
                              <div class="d-flex align-items-center mb-3">
                                <i class="fas fa-map-marker-alt text-primary me-2" style="font-size: 20px;"></i>
                                <h6 class="address-title mb-0 text-uppercase fw-bold text-primary">Shipping Address</h6>
                              </div>
                        
                              <?php if (!empty($address)) { ?>
                              <ul class="list-unstyled list-address mb-0">
                                <li><strong>Full Name:</strong> <?php echo htmlspecialchars($address['customer_name']); ?></li>
                                <li><strong>Address Line 1:</strong> <?php echo htmlspecialchars($address['address1']); ?></li>
                        
                                <?php if (!empty($address['address2'])) { ?>
                                  <li><strong>Address Line 2:</strong> <?php echo htmlspecialchars($address['address2']); ?></li>
                                <?php } ?>
                        
                                <li><strong>City:</strong> <?php echo htmlspecialchars($address['city']); ?></li>
                                <li><strong>State:</strong> <?php echo htmlspecialchars($address['state']); ?></li>
                                <li><strong>Country:</strong> <?php echo htmlspecialchars($address['country']); ?></li>
                                <li><strong>Zip Code:</strong> <?php echo htmlspecialchars($address['zip_code']); ?></li>
                                <li><strong>Email:</strong> 
                                  <a href="mailto:<?php echo htmlspecialchars($address['customer_email']); ?>" class="text-decoration-none text-dark">
                                    <?php echo htmlspecialchars($address['customer_email']); ?>
                                  </a>
                                </li>
                                <li><strong>Phone:</strong> 
                                  <a href="tel:<?php echo htmlspecialchars($address['phone']); ?>" class="text-decoration-none text-dark">
                                    <?php echo htmlspecialchars($address['phone']); ?>
                                  </a>
                                </li>
                              </ul>
                              <?php } else { ?>
                                <p class="text-muted mb-0">No shipping address found.</p>
                              <?php } ?>
                        
                            </div>
                          </div>
                        </div>


                        
                    </div>
                    <div class="right-col">
                        <?php
                        // ✅ Fetch order items
                        $sql = "SELECT product_name, metal_id, weight, quantity, product_image 
                                FROM tbl_order 
                                WHERE order_id = '$order_id'";
                        $result = mysqli_query($conn, $sql);
                        ?>
                        
                        <div class="tf-page-cart-sidebar">
                            <h4 class="checkout-title">ORDER DETAIL</h4>
                            <ul class="list-order-product">
                                <?php 
                                if ($result && mysqli_num_rows($result) > 0) { 
                                    while ($row = mysqli_fetch_assoc($result)) {
                                        
                                        // 🔹 Fetch metal name from metal_rates table
                                        $metal_id = $row['metal_id'];
                                        $metal_query = "SELECT metal_name FROM metal WHERE id = '$metal_id' LIMIT 1";
                                        $metal_result = mysqli_query($conn, $metal_query);
                                        $metal_data = mysqli_fetch_assoc($metal_result);
                                        $metal_name = $metal_data['metal_name'] ?? 'N/A';
                                ?>
                                    <li class="order-item" style="border-bottom:1px solid #eee; padding-bottom:10px; margin-bottom:10px;">
                                        <div class="content d-flex align-items-center">
                                            <div class="img-product me-3" style="position:relative;">
                                                <img src="prod/<?php echo htmlspecialchars($row['product_image']); ?>" 
                                                     alt="Product" 
                                                     class="prd" 
                                                     >
                                                <span class="text-caption quantity" 
                                                      >
                                                    <?php echo htmlspecialchars($row['quantity']); ?>
                                                </span>
                                            </div>
                                            <div class="info">
                                                <p class="name fw-semibold mb-1" style="font-size:15px;">
                                                    <?php echo htmlspecialchars($row['product_name']); ?>
                                                </p>
                                                <span class="variant text-muted" style="font-size:13px;">
                                                    <?php echo htmlspecialchars($metal_name); ?> / 
                                                    <?php echo htmlspecialchars($row['weight']); ?>g
                                                </span>
                                            </div>
                                        </div>
                                    </li>
                                <?php 
                                    } 
                                } else { 
                                ?>
                                    <li class="text-muted text-center py-3">No order details found.</li>
                                <?php } ?>
                            </ul>
                        </div>

                        
                    </div>
                </div>
            </div>
        </section>
        <!-- /Thank Your Order -->
        <!-- Footer -->
        <?php
        include "common/footer.php";
        ?>
        <!-- /Footer -->
    </div>
    
    <!-- /Toolbar -->
    <!-- Javascript -->
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/swiper-bundle.min.js"></script>
    <script src="js/carousel.js"></script>
    <script src="js/bootstrap-select.min.js"></script>
    <script src="js/lazysize.min.js"></script>
    <script src="js/count-down.js"></script>
    <script src="js/wow.min.js"></script>
    <script src="js/infinityslide.js"></script>
    <script src="js/gsap.min.js"></script>
    <script src="js/ScrollTrigger.min.js"></script>
    <script src="js/SplitText.min.js"></script>


    <script src="js/main.js"></script>
    <script src="js/sibforms.js" defer></script>
    <script>
        window.REQUIRED_CODE_ERROR_MESSAGE = 'Please choose a country code';
        window.LOCALE = 'en';
        window.EMAIL_INVALID_MESSAGE = window.SMS_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";

        window.REQUIRED_ERROR_MESSAGE = "This field cannot be left blank. ";

        window.GENERIC_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";

        window.translation = {
            common: {
                selectedList: '{quantity} list selected',
                selectedLists: '{quantity} lists selected'
            }
        };

        var AUTOHIDE = Boolean(0);
    </script>
</body>


<!-- Mirrored from themesflat.co/html/vemus/thank-you.php by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 02 Oct 2025 09:24:16 GMT -->
</html>