// --- Nearby Stations Logic Start (Adapted from venues/detail_data.php) --- $nearby_stations = []; // Subway stations $display_stations = []; // KTX/SRT stations $subway_summary = null; $train_summary = null; // Use performance's venue data if (!empty($performance['venue_lat']) && !empty($performance['venue_lng']) && !empty($performance['venue_area'])) { $venue_lat = $performance['venue_lat']; $venue_lon = $performance['venue_lng']; $venue_area = $performance['venue_area']; // --- Subway Stations --- $subway_radius = ($venue_area === '수도권') ? 1 : 2; if (function_exists('get_nearby_subway_stations')) { $nearby_stations = get_nearby_subway_stations($conn, $venue_lat, $venue_lon, $subway_radius, $is_jp_domain); } // --- KTX/SRT Stations --- $ktx_station_most_lines = null; $ktx_station_nearest = null; $nearby_srt_station = null; $search_radius = ($venue_area === '수도권') ? 30 : 40; // KTX Logic 1: Most relevant lines $ktx_stations_candidates = []; $ktx_query_lines = " SELECT title, station_type, srt, latitude, longitude, ktx_line, ST_Distance_Sphere(point(?, ?), point(longitude, latitude)) / 1000 AS distance FROM train_stations WHERE station_type = 'ktx' AND ktx_line IS NOT NULL AND ktx_line != '' HAVING distance <= ? "; $stmt_ktx_lines = mysqli_prepare($conn, $ktx_query_lines); if ($stmt_ktx_lines) { mysqli_stmt_bind_param($stmt_ktx_lines, 'ddi', $venue_lon, $venue_lat, $search_radius); mysqli_stmt_execute($stmt_ktx_lines); $ktx_result_lines = mysqli_stmt_get_result($stmt_ktx_lines); while ($row = mysqli_fetch_assoc($ktx_result_lines)) { $lines = explode(',', trim($row['ktx_line'], ',')); $relevant_lines = ['ktx1', 'ktx3', 'ktx5', 'ktx6']; $count = 0; $found_lines = []; foreach ($lines as $line) { $trimmed_line = trim($line); if (in_array($trimmed_line, $relevant_lines) && !in_array($trimmed_line, $found_lines)) { $count++; $found_lines[] = $trimmed_line; } } if ($count > 0) { $row['relevant_line_count'] = min($count, 4); $ktx_stations_candidates[] = $row; } } mysqli_stmt_close($stmt_ktx_lines); if (!empty($ktx_stations_candidates)) { usort($ktx_stations_candidates, function($a, $b) { if ($a['relevant_line_count'] != $b['relevant_line_count']) { return $b['relevant_line_count'] <=> $a['relevant_line_count']; } return $a['distance'] <=> $b['distance']; }); $ktx_station_most_lines = $ktx_stations_candidates[0]; } } // KTX Logic 2: Nearest $ktx_query_nearest = " SELECT title, station_type, srt, latitude, longitude, ktx_line, ST_Distance_Sphere(point(?, ?), point(longitude, latitude)) / 1000 AS distance FROM train_stations WHERE station_type = 'ktx' HAVING distance <= ? ORDER BY distance ASC LIMIT 1"; $stmt_ktx_nearest = mysqli_prepare($conn, $ktx_query_nearest); if ($stmt_ktx_nearest) { mysqli_stmt_bind_param($stmt_ktx_nearest, 'ddi', $venue_lon, $venue_lat, $search_radius); mysqli_stmt_execute($stmt_ktx_nearest); $ktx_result_nearest = mysqli_stmt_get_result($stmt_ktx_nearest); $ktx_station_nearest = mysqli_fetch_assoc($ktx_result_nearest); mysqli_stmt_close($stmt_ktx_nearest); } // SRT Logic: Nearest $srt_query = " SELECT title, station_type, srt, latitude, longitude, ST_Distance_Sphere(point(?, ?), point(longitude, latitude)) / 1000 AS distance FROM train_stations WHERE station_type = 'srt' HAVING distance <= ? ORDER BY distance ASC LIMIT 1"; $stmt_srt = mysqli_prepare($conn, $srt_query); if ($stmt_srt) { mysqli_stmt_bind_param($stmt_srt, 'ddi', $venue_lon, $venue_lat, $search_radius); mysqli_stmt_execute($stmt_srt); $srt_result = mysqli_stmt_get_result($stmt_srt); $nearby_srt_station = mysqli_fetch_assoc($srt_result); mysqli_stmt_close($stmt_srt); } // Combine and filter train stations for display $added_titles = []; $icon_color = 'text-green-600'; if ($ktx_station_most_lines) { $station_info = $ktx_station_most_lines; $station_info['display_type'] = ($station_info['srt'] == 1) ? 'KTX/SRT' : 'KTX'; $station_info['icon_color'] = $icon_color; $display_stations[] = $station_info; $added_titles[] = $station_info['title']; } if ($ktx_station_nearest && !in_array($ktx_station_nearest['title'], $added_titles)) { $station_info = $ktx_station_nearest; $station_info['display_type'] = ($station_info['srt'] == 1) ? 'KTX/SRT' : 'KTX'; $station_info['icon_color'] = $icon_color; $display_stations[] = $station_info; $added_titles[] = $station_info['title']; } if ($nearby_srt_station) { if (!in_array($nearby_srt_station['title'], $added_titles)) { $station_info = $nearby_srt_station; $station_info['display_type'] = 'SRT'; $station_info['icon_color'] = $icon_color; $display_stations[] = $station_info; } else { foreach ($display_stations as $key => $station) { if ($station['title'] === $nearby_srt_station['title'] && $station['display_type'] === 'KTX') { $display_stations[$key]['display_type'] = 'KTX/SRT'; break; } } } } usort($display_stations, function($a, $b) { return $a['distance'] <=> $b['distance']; }); // Fallback: Find the absolute closest station if both arrays are still empty if (empty($nearby_stations) && empty($display_stations)) { $fallback_query = " SELECT type, title, distance, line_info, srt_flag, lat, lng FROM ( SELECT 'subway' AS type, station_name AS title, (6371 * ACOS(COS(RADIANS(?)) * COS(RADIANS(lat)) * COS(RADIANS(lng) - RADIANS(?)) + SIN(RADIANS(?)) * SIN(RADIANS(lat)))) AS distance, line_names AS line_info, NULL AS srt_flag, lat, lng FROM release_subway UNION ALL SELECT station_type AS type, title, (6371 * ACOS(COS(RADIANS(?)) * COS(RADIANS(latitude)) * COS(RADIANS(longitude) - RADIANS(?)) + SIN(RADIANS(?)) * SIN(RADIANS(latitude)))) AS distance, ktx_line AS line_info, srt AS srt_flag, latitude AS lat, longitude AS lng FROM train_stations WHERE station_type IN ('ktx', 'srt') ) AS combined_stations ORDER BY distance ASC LIMIT 1"; $stmt_fallback = mysqli_prepare($conn, $fallback_query); if ($stmt_fallback) { mysqli_stmt_bind_param($stmt_fallback, 'dddddd', $venue_lat, $venue_lon, $venue_lat, $venue_lat, $venue_lon, $venue_lat); mysqli_stmt_execute($stmt_fallback); $fallback_result = mysqli_stmt_get_result($stmt_fallback); $closest_station = mysqli_fetch_assoc($fallback_result); mysqli_stmt_close($stmt_fallback); if ($closest_station) { if ($closest_station['type'] === 'subway') { $station_data = ['station_name' => $closest_station['title'], 'distance' => $closest_station['distance'], 'line_names' => $closest_station['line_info'], 'lat' => $closest_station['lat'], 'lng' => $closest_station['lng']]; if ($is_jp_domain) { if (!function_exists('trans_station')) { @include_once '/var/www/stagepick/includes/languages/ja_station.php'; } $station_data['station_name_jp'] = function_exists('trans_station') ? trans_station($station_data['station_name']) : ''; } $nearby_stations[] = $station_data; } else { $display_type = ($closest_station['type'] === 'ktx') ? (($closest_station['srt_flag'] == 1) ? 'KTX/SRT' : 'KTX') : 'SRT'; $display_stations[] = ['title' => $closest_station['title'], 'distance' => $closest_station['distance'], 'display_type' => $display_type, 'icon_color' => 'text-green-600', 'latitude' => $closest_station['lat'], 'longitude' => $closest_station['lng']]; } } } } } // --- Nearby Stations Logic End --- ?>
THE SCENE 2024 '제로지 x KOP' - 인천
公演期間
2024. 05. 25
公演時間:
ジャンル
コンサート
最終更新: 2025年03月07日
登録日: 2024年10月14日
2024.10.25
インチョンムヌァイェスルフェグァン
2024.10.24
インチョンムヌァイェスルフェグァン
2024.10.23
インチョンムヌァイェスルフェグァン
2024.10.22
インチョンムヌァイェスルフェグァン
2024.05.26
インチョンムヌァイェスルフェグァン
2024.05.19
インチョンムヌァイェスルフェグァン
2024.05.18
インチョンムヌァイェスルフェグァン