include_once "class/BusUtil.php"; $util = new BusUtil(); $db = new BusDb(); $db->connect(); $SEARCH_FORM = $util->makeSearchForm(); // route $id = isset($_GET["id"]) ? intval($_GET["id"]) : 1; $route = $db->getRouteById($id); $com_id = $route["company_id"]; $route_name = $route["bus_line"]; $route_day = $route["day"]; $route_saturday = $route["saturday"]; $route_holiday = $route["holiday"]; $route_type = $util->getBusType($route["type"]); list($map_lat, $map_lon, $map_zoom) = $util->calcMapCenter($route["max_lat"], $route["min_lat"], $route["max_lon"], $route["min_lon"]); $map_corves = $db->getMapCorvesByRoutes(array($route)); $map_lines = $util->makeLines($map_corves); // company $com_id = $route["company_id"]; $com = $db->getCompanyById($route["company_id"]); $url_corp = "<a href=\"company.php?id=" . $com_id . "\">" . $com["name"] . "</a>"; $url_home = ""; if ($com["url_home"]) { $url_home = "<a href=\"" . $com["url_home"] . "\" target=\"_blank\">[ホームページ]</a>"; } $url_search = ""; if ($com["url_search"]) { $url_search = "<a href=\"" . $com["url_search"] . "\" target=\"_blank\">[時刻表]</a>"; } // nodes $nodes = $db->getNodesByRouteId($id);
$map_zoom = "14"; $map_use_cluster = "false"; $use_caution = false; // node $id = isset($_GET["id"]) ? intval($_GET["id"]) : 1; $node = $db->getNodeById($id); $node_name = $node["name"]; $map_lat = $node["lat"]; $map_lon = $node["lon"]; $pref_id = $node["pref_id"]; $pref = $db->getPrefById($pref_id); $pref_title = "<a href=\"prefecture.php?id=" . $pref_id . "\">" . $pref["name"] . "</a>"; // routes $routes = $db->getRoutesByNodeId($id); list($list_route, $list_route_navi, $list_height) = $util->makeRouteList($routes, true); $map_corves = $db->getMapCorvesByRoutes($routes); $map_lines = $util->makeLines($map_corves); $route_num = count($routes); // nodes $nodes = $db->searchNodesPoint($map_lat, $map_lon, 5); $map_markers = $util->makeNodeMarkers($nodes); $list_node = $util->makeNodeListExcept($nodes, $id); $node_count = count($nodes); $node_num = $node_count > 0 ? $node_count - 1 : 0; ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>バス停 地図</title> <style >