Example #1
0
<?php

/**
 * Bus map
 * 2015-12-01 K.OHWADA
 */
/**
 * route
 */
include_once "config.php";
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"]);
Example #2
0
<?php

/**
 * Bus map
 * 2015-12-01 K.OHWADA
 */
/**
 * node
 */
include_once "config.php";
include_once "class/BusDb.php";
include_once "class/BusUtil.php";
$util = new BusUtil();
$db = new BusDb();
$db->connect();
$SEARCH_FORM = $util->makeSearchForm();
$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);
Example #3
0
<?php

/**
 * Bus map
 * 2015-12-01 K.OHWADA
 */
/**
 * prefecture
 */
include_once "config.php";
include_once "class/BusDb.php";
include_once "class/BusUtil.php";
$util = new BusUtil();
$db = new BusDb();
$db->connect();
$SEARCH_FORM = $util->makeSearchForm();
// prefs default:東京
$id = isset($_GET["id"]) ? intval($_GET["id"]) : 13;
$pref = $db->getPrefById($id);
$pref_name = $pref["name"];
$node_num = $pref["node_num"];
$route_num = $pref["route_num"];
list($map_lat, $map_lon, $map_zoom) = $util->calcMapCenter($pref["max_lat"], $pref["min_lat"], $pref["max_lon"], $pref["min_lon"]);
// companies
$list = "";
$companies = $db->getCompaniesByPrefId($id);
foreach ($companies as $com) {
    $url = "<a href=\"company.php?id=" . $com["id"] . "\">" . $com["name"] . "</a>";
    $list .= "<li>" . $url . "</li>\n";
}
$com_num = count($companies);
Example #4
0
<?php

/**
 * Bus map
 * 2015-12-01 K.OHWADA
 */
/**
 * company
 */
include_once "config.php";
include_once "class/BusDb.php";
include_once "class/BusUtil.php";
$util = new BusUtil();
$db = new BusDb();
$db->connect();
$SEARCH_FORM = $util->makeSearchForm();
$MAP_MAX_ZOOM = 13;
// company
$id = isset($_GET["id"]) ? intval($_GET["id"]) : 1;
$com = $db->getCompanyById($id);
$com_name = $com["name"];
list($map_lat, $map_lon, $map_zoom) = $util->calcMapCenter($com["max_lat"], $com["min_lat"], $com["max_lon"], $com["min_lon"]);
$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>";
}
// routes