'Dashboard'] ]; // Get dashboard statistics $stats = getDashboardStats(); $recentTransactions = getRecentTransactions(10); $segmentPerformance = getSegmentPerformance(); $monthlyTrends = getMonthlyTrends(); // Calculate trends (mock data for now - can be replaced with actual calculation) $trends = [ 'revenue_growth' => 12.5, 'expense_growth' => -5.2, 'profit_growth' => 18.3, 'transactions_growth' => 8.1 ]; // Get recent activity for the current user $currentUser = getCurrentUser(); $recentActivity = []; if ($currentUser['role'] === 'admin') { // Admin can see all activities $recentActivity = fetchAll( "SELECT al.*, u.full_name FROM activity_logs al LEFT JOIN users u ON al.user_id = u.id ORDER BY al.created_at DESC LIMIT 15" ); } else { // Others see only their own activities $recentActivity = fetchAll( "SELECT al.*, u.full_name FROM activity_logs al LEFT JOIN users u ON al.user_id = u.id WHERE al.user_id = ? ORDER BY al.created_at DESC LIMIT 15", [$currentUser['id']] ); } // Include header include 'includes/header.php'; ?>

Welcome back, !

Here's what's happening with your fish business today.

Total Revenue
% vs last month
Total Expenses
% vs last month
Net Profit
Margin: %
Active Investments
Loans & Investments
Revenue vs Expenses Trend
Business Segments
Recent Transactions
No Recent Transactions

Start by adding your first sale or expense.

Type Description Amount Date Party
Segment Performance

No segment data available

0 ? ($segment['profit'] / $segment['revenue']) * 100 : 0; $performanceClass = $segment['profit'] >= 0 ? 'positive' : 'negative'; ?>
Revenue: | Expenses: | Margin: %
Recent Activity
by