Beispiel #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"]);
Beispiel #2
0
<?php

/**
 * Bus map
 * 2015-12-01 K.OHWADA
 */
/**
 * maker
 * require IPA font
 * http://ipafont.ipa.go.jp/old/ipafont/download.html
 */
include_once "config.php";
include_once "class/BusDb.php";
$db = new BusDb();
$db->connect();
$FONT = 'ipag.ttf';
// normal param
$angle = 0;
$normal_size = 11;
$circle_diameter = 50;
$normal_width = $circle_diameter + 2;
$normal_height = $circle_diameter + 2;
$normal_center_x = $normal_width / 2;
$normal_center_y = $normal_height / 2;
$normal_y = $normal_center_y + $normal_size / 2;
// small param
$small_size = 8;
$small_width = 4.5 * $small_size;
$small_height = 2 * $small_size;
$small_center_x = $small_width / 2;
$small_center_y = $small_height / 2;
Beispiel #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);
Beispiel #4
0
<?php

/**
 * Bus map
 * 2015-12-01 K.OHWADA
 */
/**
 * index
 */
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();
$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";
Beispiel #5
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);
Beispiel #6
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