prepare("UPDATE orders SET status = ? WHERE order_id = ?"); $stmt->execute([$new_status, $order_id]); flashMessage('success', 'Order status updated successfully.'); header("Location: manage.php"); exit(); } // Get all orders with customer information $stmt = $pdo->prepare(" SELECT o.*, u.username as customer_name FROM orders o JOIN users u ON o.customer_id = u.user_id ORDER BY o.order_date DESC "); $stmt->execute(); $orders = $stmt->fetchAll(); ?>
| Order ID | Customer | Date | Amount | Status | Actions |
|---|---|---|---|---|---|
| # | $ |
Completed
Cancelled
|
View Details |