fetchAll( "SELECT * FROM orders WHERE customer_id = :id ORDER BY created_at DESC LIMIT 5", ['id' => $customer['customer_id']] ); // Get order stats $orderStats = db()->fetch( "SELECT COUNT(*) as total_orders, COALESCE(SUM(total), 0) as total_spent FROM orders WHERE customer_id = :id AND payment_status = 'paid'", ['id' => $customer['customer_id']] ); // Get wishlist count $wishlistCount = db()->count('wishlist', 'customer_id = :id', ['id' => $customer['customer_id']]); // Get recent wallet transactions $walletTransactions = db()->fetchAll( "SELECT * FROM wallet_transactions WHERE customer_id = :id ORDER BY created_at DESC LIMIT 5", ['id' => $customer['customer_id']] ); require_once __DIR__ . '/../includes/header.php'; ?>