halohalo
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
u295559686
/
domains
/
stanjo.in
/
public_html
/
Upload FileeE
HOME
<?php include 'header.php'; if (!isset($_SESSION['customer_id']) || !isset($_GET['id'])) { echo "<script>window.location.href='login.php';</script>"; exit; } $order_id = (int)$_GET['id']; $customer_id = $_SESSION['customer_id']; // Fetch order details and ensure it belongs to the logged-in customer $stmt = $conn->prepare("SELECT * FROM orders WHERE id = ? AND user_id = ?"); $stmt->bind_param("ii", $order_id, $customer_id); $stmt->execute(); $res = $stmt->get_result(); $order = $res->fetch_assoc(); if (!$order) { echo "<div class='min-h-screen bg-black text-white flex items-center justify-center'>Order not found.</div>"; include 'footer.php'; exit; } // Fetch order items $itemStmt = $conn->prepare("SELECT oi.*, p.title, p.image_path FROM order_items oi JOIN products p ON oi.product_id = p.id WHERE oi.order_id = ?"); $itemStmt->bind_param("i", $order_id); $itemStmt->execute(); $items = $itemStmt->get_result(); ?> <main class="mt-[80px] min-h-screen bg-black text-white py-20"> <div class="container-custom px-6 max-w-4xl mx-auto"> <!-- Header --> <div class="flex justify-between items-end border-b border-white/10 pb-10 mb-10"> <div> <img src="assets/logo.png" class="h-12 mb-6" alt="Stanjo"> <h1 class="text-3xl font-extralight tracking-[4px] uppercase">Invoice</h1> </div> <div class="text-right space-y-1"> <p class="text-stanjo-zinc text-xs uppercase tracking-widest">Order Number</p> <p class="text-lg font-bold">#<?= htmlspecialchars($order['order_number']) ?></p> <p class="text-stanjo-zinc text-xs uppercase tracking-widest mt-4">Date</p> <p class="text-sm"><?= date('d M Y', strtotime($order['created_at'])) ?></p> </div> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-12 mb-12"> <div> <h2 class="text-xs font-bold uppercase tracking-[2px] text-stanjo-zinc mb-4">Billing Details</h2> <div class="space-y-1 text-sm font-light leading-relaxed"> <p class="font-bold text-base mb-2"><?= htmlspecialchars($order['name']) ?></p> <p><?= htmlspecialchars($order['email']) ?></p> <p><?= htmlspecialchars($order['phone']) ?></p> <p class="mt-4"><?= nl2br(htmlspecialchars($order['address'])) ?></p> <p><?= htmlspecialchars($order['city']) ?>, <?= htmlspecialchars($order['state']) ?> - <?= htmlspecialchars($order['pincode']) ?></p> </div> </div> <div class="text-right"> <h2 class="text-xs font-bold uppercase tracking-[2px] text-stanjo-zinc mb-4">Payment Information</h2> <div class="space-y-1 text-sm font-light"> <p>Method: <span class="uppercase"><?= htmlspecialchars($order['payment_method']) ?></span></p> <p>Status: <span class="<?= $order['payment_status'] == 'Completed' ? 'text-green-500' : 'text-stanjo-yellow' ?>"><?= $order['payment_status'] ?></span></p> </div> </div> </div> <!-- Items Table --> <div class="border border-white/10 overflow-hidden mb-12"> <table class="w-full text-left text-sm"> <thead class="bg-white/5 border-b border-white/10 uppercase tracking-widest text-[10px]"> <tr> <th class="px-6 py-4 font-bold">Item</th> <th class="px-6 py-4 font-bold text-center">Price</th> <th class="px-6 py-4 font-bold text-center">Qty</th> <th class="px-6 py-4 font-bold text-right">Total</th> </tr> </thead> <tbody class="divide-y divide-white/5 font-light"> <?php while ($item = $items->fetch_assoc()): ?> <tr> <td class="px-6 py-4"> <div class="flex items-center gap-4"> <span><?= htmlspecialchars($item['title']) ?></span> <?php if (!empty($item['variant_value'])): ?> <span class="text-[10px] text-stanjo-zinc uppercase tracking-widest">(<?= htmlspecialchars($item['variant_value']) ?>)</span> <?php endif; ?> </div> </td> <td class="px-6 py-4 text-center">₹<?= number_format($item['price'], 2) ?></td> <td class="px-6 py-4 text-center"><?= $item['qty'] ?></td> <td class="px-6 py-4 text-right font-bold">₹<?= number_format($item['price'] * $item['qty'], 2) ?></td> </tr> <?php endwhile; ?> </tbody> </table> </div> <!-- Totals --> <div class="flex justify-end"> <div class="w-full md:w-64 space-y-4"> <div class="flex justify-between text-sm"> <span class="text-stanjo-zinc">Subtotal</span> <span>₹<?= number_format($order['total_amount'], 2) ?></span> </div> <div class="flex justify-between text-sm"> <span class="text-stanjo-zinc">Shipping</span> <span>₹0.00</span> </div> <div class="flex justify-between border-t border-white/10 pt-4"> <span class="text-lg font-extralight uppercase tracking-widest">Total</span> <span class="text-lg font-bold">₹<?= number_format($order['total_amount'], 2) ?></span> </div> </div> </div> <!-- Footer --> <div class="mt-20 pt-10 border-t border-white/10 text-center"> <p class="text-stanjo-zinc text-[10px] uppercase tracking-[4px] mb-4">Thank you for choosing Stanjo</p> <button onclick="window.print()" class="px-8 py-3 border border-white text-[10px] uppercase tracking-[4px] hover:bg-white hover:text-black transition-all no-print">Print This Invoice</button> </div> </div> </main> <style> @media print { .no-print, header, footer { display: none !important; } body { background: white !important; color: black !important; } .container-custom { max-width: 100% !important; margin: 0 !important; padding: 0 !important; } main { margin-top: 0 !important; padding: 20px !important; } .border-white\/10 { border-color: #eee !important; } .bg-white\/5 { background-color: #f9f9f9 !important; } .text-stanjo-zinc { color: #666 !important; } } </style> <?php include 'footer.php'; ?>