本文整理汇总了PHP中DbUtil::getLineName方法的典型用法代码示例。如果您正苦于以下问题:PHP DbUtil::getLineName方法的具体用法?PHP DbUtil::getLineName怎么用?PHP DbUtil::getLineName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbUtil
的用法示例。
在下文中一共展示了DbUtil::getLineName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sin
{
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';
}
if ($timeData[$k]->time < get4Time()) {
$classText = 'class=danger';
示例2: DbUtil
<!DOCTYPE html>
<?php
require_once '../db.php';
$Database = new DbUtil();
$userName = $Database->getUserName();
if ($userName == null) {
header('Location: ../login.php', true, 303);
exit;
}
$ID = $_GET['sid'];
$LINE = $_GET['lid'];
$stopData = $Database->getStop($ID);
$lineName = $Database->getLineName($LINE, $userName);
if ($lineName == null) {
die('PERMISSION DENIED');
}
$timeData = $_GET['time'];
$typeData = $_GET['type'];
if ($Database->isExistTime($ID, $LINE, $timeData, $typeData)) {
$Database->deleteTime($ID, $LINE, $timeData, $typeData);
}
header("Location: timetable.php?stopid={$ID}&lineid={$LINE}", true, 303);
示例3:
<h2>バス停情報</h2>
<hr />
<h3><?php
echo "{$stopData->stopName}";
?>
</h3>
<table class="table">
<thead>
<tr>
<th>行き先</th>
<th><div align="right"><input type="button" class="btn btn-primary" value="新規" data-toggle="modal" data-target="#newModal"/></div></th>
</tr>
</thead>
<?php
for ($i = 0; $i < count($lineData); $i++) {
$lineName = $Database->getLineName($lineData[$i], $userName);
echo "<tr><td><a href=timetable.php?stopid={$ID}&lineid={$lineData[$i]}>{$lineName}</a></td>";
echo "<td align='right'><a href='delline.php?sid={$ID}&lid={$lineData[$i]}' class='btn btn-danger'>削除</a></td></tr>";
}
?>
</table>
</div>
</div>
<div class="modal fade" id="newModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">行き先の追加</h4>
</div>