include_once "class/BusDb.php"; 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
$DIR_IMAGES = HOST . "/images/"; // 長野 $map_lat = 36.110446929932; $map_lon = 138.08520507812; $map_zoom = 7; // prefs $is_first = true; $list = ""; $map_markers = "["; $prefs = $db->getPrefs(); foreach ($prefs as $pref) { $pref_id = $pref["id"]; $pref_name = $pref["name"]; $url = "<a href=\"prefecture.php?id=" . $pref_id . "\">" . $pref_name . "</a>"; $list .= "<li>" . $url . "</li>\n"; list($lat, $lon, $zoom) = $util->calcMapCenter($pref["max_lat"], $pref["min_lat"], $pref["max_lon"], $pref["min_lon"]); if (!$is_first) { $map_markers .= ",\n"; } $map_markers .= "[" . $lat . "," . $lon . "," . $pref_id . ",\"" . $pref_name . "\"]"; $is_first = false; } $map_markers .= "]"; $com_num = $db->getCompanyCount(); $route_num = $db->getRouteCount(); $node_num = $db->getNodeCount(); ?> <!doctype html> <html> <head> <meta charset="utf-8">