} function dsin($arg) { return sin(deg2rad($arg)); } for ($i = 0; $i < count($myStopList); $i++) { if ($myStopList[$i]->lat != 0) { $r = 6378.137; $distant = $r * acos(dsin($lat) * dsin($myStopList[$i]->lat) + dcos($lat) * dcos($myStopList[$i]->lat) * dcos($myStopList[$i]->long - $long)); $distant = round($distant, 2) . ' km'; } else { $distant = 'N/A'; } echo "<h3>" . $myStopList[$i]->stopName . " <small>{$distant}</small></h3>"; echo "<hr>"; $lineList = $Database->getStopLine($myStopList[$i]->stopId); for ($j = 0; $j < count($lineList); $j++) { $lineName = $Database->getLineName($lineList[$j], $userName); echo "<h4>行き先: {$lineName}</h4>"; echo "<table class=table>"; echo "<thead><th>時刻</th><th>残り時間</th></thead>"; $timeData = $Database->getTimeTableEx($myStopList[$i]->stopId, $lineList[$j], get4Time() - 5, 3); for ($k = 0; $k < count($timeData); $k++) { if ($timeData[$k]->type != getTodayType()) { continue; } $classText = ''; $stopTime = formatTime($timeData[$k]->time); if (getRemainUnixTime($stopTime) < 600) { $classText = 'class=warning'; }
<!DOCTYPE html> <?php require_once '../nav.php'; require_once '../db.php'; require_once 'sidemenu.php'; $Database = new DbUtil(); $userName = $Database->getUserName(); $sideMenu = getSideMenu('ttbl'); $NAV = nav($userName); if ($userName == null) { header('Location: ../login.php', true, 303); exit; } $ID = $_GET['id']; $stopData = $Database->getStop($ID, $userName); $lineData = $Database->getStopLine($ID); ?> <html lang="ja"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>バス停 <?php echo "{$stopData->stopName}"; ?> </title> <!-- Bootstrap --> <link href="/bst/css/bootstrap.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->