= DATE_SUB(CURDATE(), INTERVAL 6 DAY) GROUP BY log_date, action_type ORDER BY log_date ASC"; $result_action_type = $connection->query($query_action_type); $actionTypeData = []; while ($row = $result_action_type->fetch_assoc()) { $actionTypeData[] = $row; } // 서비스 도메인별 페이지 URI별 인터랙션 횟수 데이터 가져오기 $query_uri = " SELECT service_domain, page_uri, COUNT(*) AS interaction_count FROM interaction_log GROUP BY service_domain, page_uri ORDER BY interaction_count DESC"; $result_uri = $connection->query($query_uri); $uriData = []; while ($row = $result_uri->fetch_assoc()) { $uriData[] = $row; } // IP 주소 기반 위치 정보 가져오기 $locations = []; $ipCounts = []; // IP 주소별 인터랙션 수량을 집계 $query_ip_location = " SELECT ip_address, COUNT(*) AS interaction_count, region, country, log_timestamp FROM interaction_log GROUP BY ip_address"; $result_ip_location = $connection->query($query_ip_location); while ($row = $result_ip_location->fetch_assoc()) { $locations[] = $row; } // JSON으로 인코딩하여 JavaScript에서 사용할 수 있도록 준비 $actionTypeDataJson = json_encode($actionTypeData); $uriDataJson = json_encode($uriData); $locationsJson = json_encode($locations); // 연결 종료 $connection->close(); // 출력 버퍼링 종료 ob_end_flush(); ?>