query('SELECT COUNT(*) as total FROM daily_summary'); $result = $stmt->fetch(); echo " Total rows: {$result['total']}\n"; $stmt = $db->query('SELECT summary_date, SUM(total_count) as total_count, SUM(total_amount) as total_amount FROM daily_summary GROUP BY summary_date ORDER BY summary_date DESC LIMIT 5'); $results = $stmt->fetchAll(); echo " Sample data:\n"; foreach ($results as $row) { echo " - {$row['summary_date']}: {$row['total_count']} events, Rp " . number_format($row['total_amount']) . "\n"; } echo "\n2. Hourly Summary:\n"; $stmt = $db->query('SELECT COUNT(*) as total FROM hourly_summary'); $result = $stmt->fetch(); echo " Total rows: {$result['total']}\n"; $stmt = $db->query('SELECT summary_date, summary_hour, SUM(total_count) as total_count, SUM(total_amount) as total_amount FROM hourly_summary GROUP BY summary_date, summary_hour ORDER BY summary_date DESC, summary_hour ASC LIMIT 10'); $results = $stmt->fetchAll(); echo " Sample data:\n"; foreach ($results as $row) { echo " - {$row['summary_date']} {$row['summary_hour']}:00: {$row['total_count']} events, Rp " . number_format($row['total_amount']) . "\n"; } echo "\n3. Checking API response format:\n"; echo " GET /retribusi/v1/summary/daily?date=2025-12-16\n"; echo " Expected: { success: true, data: { summary_date, total_count, total_amount, ... }, timestamp }\n"; echo "\n GET /retribusi/v1/summary/hourly?date=2025-12-16\n"; echo " Expected: { success: true, data: { labels: [...], series: { total_count: [...], total_amount: [...] } }, timestamp }\n";