prepare($sql); $stmt->execute([$order_id, $_SESSION['user_id']]); $order = $stmt->fetch(); if (!$order) { header('Location: orders.php'); exit; } // Fetch order items $sql = " SELECT oi.*, p.name as product_name FROM order_items oi JOIN products p ON oi.product_id = p.id WHERE oi.order_id = ? "; $stmt = $pdo->prepare($sql); $stmt->execute([$order_id]); $order_items = $stmt->fetchAll(); ?>
Total Amount: $
Status:
Date:
| Product | Quantity | Price | Total |
|---|---|---|---|
| $ | $ |