halohalo
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
u295559686
/
domains
/
stanjo.in
/
public_html
/
Upload FileeE
HOME
<?php include 'header.php'; // Redirect if not logged in if (!isset($_SESSION['customer_id'])) { echo "<script>window.location.href='login.php';</script>"; exit; } $customer_id = $_SESSION['customer_id']; // Fetch customer details $custStmt = $conn->prepare("SELECT name, email, phone, created_at FROM customers WHERE id = ?"); $custStmt->bind_param("i", $customer_id); $custStmt->execute(); $customer = $custStmt->get_result()->fetch_assoc(); // Fetch orders $orderStmt = $conn->prepare("SELECT * FROM orders WHERE user_id = ? ORDER BY created_at DESC"); $orderStmt->bind_param("i", $customer_id); $orderStmt->execute(); $orders = $orderStmt->get_result(); ?> <main class="mt-[80px] min-h-screen bg-black text-white"> <!-- Hero Section --> <section class="py-12 border-b border-white/5 bg-stanjo-gray"> <div class="container-custom px-6"> <h1 class="text-2xl md:text-4xl font-extralight tracking-[4px] uppercase mb-2">My Account</h1> <p class="text-stanjo-zinc text-sm font-light tracking-widest">Welcome back, <?= htmlspecialchars($customer['name']) ?></p> </div> </section> <div class="container-custom px-6 py-12"> <div class="grid grid-cols-1 lg:grid-cols-3 gap-12"> <!-- Profile Info --> <div class="lg:col-span-1 space-y-8"> <div class="bg-white/5 border border-white/10 p-8 space-y-6"> <h2 class="text-sm font-bold uppercase tracking-[2px] border-b border-white/10 pb-4">Profile Details</h2> <div class="space-y-4"> <div> <label class="text-[10px] uppercase tracking-[2px] text-stanjo-zinc block mb-1">Full Name</label> <p class="text-sm font-light"><?= htmlspecialchars($customer['name']) ?></p> </div> <div> <label class="text-[10px] uppercase tracking-[2px] text-stanjo-zinc block mb-1">Email Address</label> <p class="text-sm font-light"><?= htmlspecialchars($customer['email']) ?></p> </div> <div> <label class="text-[10px] uppercase tracking-[2px] text-stanjo-zinc block mb-1">Phone Number</label> <p class="text-sm font-light"><?= htmlspecialchars($customer['phone'] ?: 'Not provided') ?></p> </div> <div> <label class="text-[10px] uppercase tracking-[2px] text-stanjo-zinc block mb-1">Member Since</label> <p class="text-sm font-light"><?= date('F Y', strtotime($customer['created_at'])) ?></p> </div> </div> <div class="pt-6"> <a href="logout.php" class="text-xs uppercase tracking-[2px] text-red-500 hover:text-red-400 transition">Logout Account</a> </div> </div> </div> <!-- Order History --> <div class="lg:col-span-2 space-y-8"> <div class="bg-white/5 border border-white/10 p-8"> <h2 class="text-sm font-bold uppercase tracking-[2px] border-b border-white/10 pb-4 mb-8">Order History</h2> <?php if ($orders->num_rows > 0): ?> <div class="space-y-6"> <?php while ($order = $orders->fetch_assoc()): ?> <div class="border border-white/5 p-6 hover:border-white/20 transition-all group"> <div class="flex flex-wrap justify-between items-start gap-4"> <div class="space-y-1"> <p class="text-xs uppercase tracking-[2px] text-stanjo-zinc">Order #<?= htmlspecialchars($order['order_number']) ?></p> <p class="text-sm font-light"><?= date('d M Y', strtotime($order['created_at'])) ?></p> </div> <div class="text-right"> <p class="text-sm font-bold">₹<?= number_format($order['total_amount'], 2) ?></p> <span class="text-[10px] uppercase tracking-[1px] px-2 py-0.5 border <?= $order['order_status'] == 'Delivered' ? 'border-green-500/50 text-green-500' : 'border-stanjo-yellow/50 text-stanjo-yellow' ?>"> <?= $order['order_status'] ?> </span> </div> </div> <div class="mt-6 pt-6 border-t border-white/5 flex justify-between items-center"> <p class="text-[11px] text-stanjo-zinc tracking-widest uppercase">Method: <?= htmlspecialchars($order['payment_method']) ?></p> <a href="invoice.php?id=<?= $order['id'] ?>" class="text-[11px] uppercase tracking-[2px] hover:text-stanjo-yellow transition underline underline-offset-4">View Invoice</a> </div> </div> <?php endwhile; ?> </div> <?php else: ?> <div class="py-20 text-center space-y-6"> <div class="flex justify-center"> <svg xmlns="http://www.w3.org/2000/svg" class="w-12 h-12 text-white/10" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /> </svg> </div> <p class="text-stanjo-zinc text-sm font-light tracking-widest">You haven't placed any orders yet.</p> <a href="shop.php" class="inline-block px-8 py-3 border border-white text-xs uppercase tracking-[4px] hover:bg-white hover:text-black transition-all">Start Shopping</a> </div> <?php endif; ?> </div> </div> </div> </div> </main> <?php include 'footer.php'; ?>