query('SELECT COUNT(*) FROM products')->fetchColumn(); // Today's Sales $today = date('Y-m-d'); $stmt_today = db()->prepare("SELECT COUNT(*) as num_transactions, SUM(total_amount) as total_sales FROM sales WHERE DATE(sale_date) = ?"); $stmt_today->execute([$today]); $today_sales = $stmt_today->fetch(PDO::FETCH_ASSOC); // All-Time Sales $stmt_all_time = db()->query("SELECT COUNT(*) as num_transactions, SUM(total_amount) as total_sales FROM sales"); $all_time_sales = $stmt_all_time->fetch(PDO::FETCH_ASSOC); // Low Stock $low_stock_threshold = 5; $stmt_low_stock = db()->prepare('SELECT COUNT(*) FROM products WHERE stock <= ?'); $stmt_low_stock->execute([$low_stock_threshold]); $low_stock_count = $stmt_low_stock->fetchColumn(); ?>

Dashboard

Total Products

items in inventory.

View details →
Today's Sales
Rp

from transactions.

View details →
All-Time Sales
Rp

from transactions.

View details →
Low Stock Alerts

items need restocking.

View details →
Sales Trend (Last 7 Days)
Best-Selling Products