本文整理汇总了PHP中Agenda::getTransports方法的典型用法代码示例。如果您正苦于以下问题:PHP Agenda::getTransports方法的具体用法?PHP Agenda::getTransports怎么用?PHP Agenda::getTransports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agenda
的用法示例。
在下文中一共展示了Agenda::getTransports方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calcTotalPrice
private function calcTotalPrice()
{
$data =& $this->terms;
$transportation = Agenda::getTransports();
foreach ($this->transportTerms as $term) {
if (empty($data[$term])) {
continue;
}
$transport = json_decode($data[$term]);
$data[$term] = [];
$price = 0;
foreach ($transport as $mean) {
if (isset($transportation[$mean])) {
$data[$term][$mean] = $transportation[$mean];
$price += $transportation[$mean]['price'];
}
}
$this->totalPrice += $price;
}
}
示例2: Agenda
<?php
require 'Global.lib.php';
require 'api/class.agenda.php';
$month = !empty($_GET['month']) ? $_GET['month'] : null;
$year = !empty($_GET['year']) ? $_GET['year'] : null;
$agenda = new Agenda($month, $year);
$days = $agenda->getDays();
$transports = $agenda->getTransports();
$prevMonth = $agenda->month - 1;
$nextMonth = $agenda->month + 1;
$prevYear = $nextYear = $agenda->year;
if ($prevMonth <= 0) {
$prevMonth = 12;
$prevYear--;
}
if ($agenda->month + 1 > 12) {
$nextMonth = 1;
$nextYear++;
}
$title = sprintf('יומן עבודה - %s %d', DTime::$hebMonths[$agenda->month - 1], $agenda->year);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?php
echo $title;
?>
</title>