count('orders'); $todayOrders = db()->count('orders', 'DATE(created_at) = CURDATE()'); $totalRevenue = db()->fetch("SELECT COALESCE(SUM(total), 0) as total FROM orders WHERE payment_status = 'paid'")['total'] ?? 0; $todayRevenue = db()->fetch("SELECT COALESCE(SUM(total), 0) as total FROM orders WHERE payment_status = 'paid' AND DATE(created_at) = CURDATE()")['total'] ?? 0; $totalCustomers = db()->count('customers'); $totalProducts = db()->count('products', 'is_active = 1'); $lowStockProducts = db()->count('products', 'stock <= low_stock_threshold AND is_active = 1'); $pendingOrders = db()->count('orders', "order_status = 'pending'"); // Recent orders $recentOrders = db()->fetchAll( "SELECT * FROM orders ORDER BY created_at DESC LIMIT 10" ); // Low stock products $lowStockItems = db()->fetchAll( "SELECT * FROM products WHERE stock <= low_stock_threshold AND is_active = 1 ORDER BY stock ASC LIMIT 5" ); ?>
Today's Revenue
Today's Orders
Total Customers
Pending Orders

Recent Orders

View All
Order Customer Total Status Date
No orders yet
'warning', 'confirmed', 'processing' => 'primary', 'shipped', 'delivered' => 'success', 'cancelled', 'refunded' => 'error', default => 'primary' }; ?>

Overview

Total Revenue
Total Orders
Active Products
Low Stock Items

Low Stock