🤩 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:track-order.php
<?php require_once __DIR__ . '/../includes/config.php'; require_once __DIR__ . '/../includes/db.php'; require_once __DIR__ . '/../includes/functions.php'; $page = 'track-order'; $page_title = 'Track Your Order'; require_once '../includes/header.php'; require_once '../includes/navbar.php'; $order = null; $order_items = []; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $order_number = trim($_POST['order_number']); $email = trim($_POST['email']); $stmt = $db->prepare("SELECT * FROM orders WHERE order_number = ? AND email = ?"); $stmt->execute([$order_number, $email]); $order = $stmt->fetch(); if ($order) { $order_items = get_order_items($order['id']); } else { $error = "No order found with these details"; } } ?> <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 active">Track Order</li> </ol> </nav> </div> </section> <section class="track-section" style="padding: 60px 0;"> <div class="container"> <div class="row justify-content-center"> <div class="col-lg-8"> <div class="text-center mb-5"> <h1 style="font-size: 2.5rem; margin-bottom: 15px;">Track Your Order</h1> <p class="text-muted">Enter your order details to check the status</p> </div> <?php if (isset($error)): ?> <div class="alert alert-danger"><?= htmlspecialchars($error) ?></div> <?php endif; ?> <div style="background: var(--white); border-radius: 16px; padding: 40px; box-shadow: var(--shadow-sm);"> <form method="POST"> <div class="row g-3"> <div class="col-md-6"> <label class="form-label">Order Number *</label> <input type="text" name="order_number" class="form-control" required placeholder="VEL-20260101-XXXX" style="border-radius: 25px; padding: 12px 20px;" value="<?= htmlspecialchars($_POST['order_number'] ?? '') ?>"> </div> <div class="col-md-6"> <label class="form-label">Email Address *</label> <input type="email" name="email" class="form-control" required placeholder="your@email.com" style="border-radius: 25px; padding: 12px 20px;" value="<?= htmlspecialchars($_POST['email'] ?? '') ?>"> </div> <div class="col-md-12"> <button type="submit" class="btn-luxury w-100" style="justify-content: center;"> <i class="fas fa-search"></i> Track Order </button> </div> </div> </form> </div> <?php if ($order): ?> <div style="background: var(--white); border-radius: 16px; padding: 40px; box-shadow: var(--shadow-sm); margin-top: 30px;"> <h3 style="margin-bottom: 25px;">Order Status</h3> <div class="order-timeline" style="position: relative; padding: 20px 0;"> <?php $stages = [ ['pending', 'Order Placed', 'fas fa-clipboard-check'], ['processing', 'Processing', 'fas fa-cog'], ['shipped', 'Shipped', 'fas fa-truck'], ['delivered', 'Delivered', 'fas fa-home'] ]; $current_index = array_search($order['order_status'], array_column($stages, 0)); if ($current_index === false) $current_index = 0; ?> <div class="d-flex justify-content-between" style="position: relative;"> <div style="position: absolute; top: 30px; left: 12.5%; right: 12.5%; height: 3px; background: var(--gray-200); z-index: 1;"></div> <div style="position: absolute; top: 30px; left: 12.5%; height: 3px; background: var(--gradient-rose); z-index: 2; width: <?= ($current_index / (count($stages) - 1)) * 75 ?>%; transition: width 0.5s;"></div> <?php foreach ($stages as $i => $stage): $is_active = $i <= $current_index; $is_current = $i == $current_index; ?> <div class="text-center" style="position: relative; z-index: 3; flex: 1;"> <div style="width: 60px; height: 60px; border-radius: 50%; background: <?= $is_active ? 'var(--gradient-rose)' : 'var(--white)' ?>; border: 3px solid <?= $is_active ? 'var(--primary-rose-gold)' : 'var(--gray-200)' ?>; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; <?= $is_current ? 'box-shadow: var(--shadow-rose); transform: scale(1.1);' : '' ?>"> <i class="<?= $stage[2] ?>" style="color: <?= $is_active ? 'white' : 'var(--gray-400)' ?>; font-size: 1.2rem;"></i> </div> <strong style="display: block; color: <?= $is_active ? 'var(--dark-text)' : 'var(--gray-500)' ?>;"><?= $stage[1] ?></strong> </div> <?php endforeach; ?> </div> </div> <hr> <div class="row g-3 mt-3"> <div class="col-md-6"> <h6>Order Number</h6> <p style="color: var(--primary-rose-gold); font-weight: 600;"><?= htmlspecialchars($order['order_number']) ?></p> </div> <div class="col-md-6"> <h6>Order Date</h6> <p><?= date('M d, Y h:i A', strtotime($order['created_at'])) ?></p> </div> <div class="col-md-6"> <h6>Total Amount</h6> <p><?= format_currency($order['total']) ?></p> </div> <div class="col-md-6"> <h6>Payment Method</h6> <p style="text-transform: uppercase;"><?= htmlspecialchars($order['payment_method']) ?></p> </div> </div> <h5 style="margin-top: 30px; margin-bottom: 15px;">Order Items</h5> <?php foreach ($order_items as $item): ?> <div style="display: flex; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--gray-200);"> <div style="flex: 1;"> <strong><?= htmlspecialchars($item['product_name']) ?></strong> <small class="d-block text-muted">Qty: <?= $item['quantity'] ?> × <?= format_currency($item['price']) ?></small> </div> <div style="font-weight: 600;"><?= format_currency($item['total']) ?></div> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> </div> </div> </section> </main> <?php require_once '../includes/footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder