0 ? '+' : '-') . $str; return $str . ($delay > 0 ? ' te laat' : ' te vroeg'); } class StopInfoboard extends Infoboard { private $found = false; private $stop; private $numberOfLines; private $currentTime; private $lines; private $disturbed = false; private $allLinesDisturbed = false; private $disturbances = false; private $notServed = false; public function __construct ($stopRef, $numberOfLines=50) { global $timezone; $this->currentTime = new DateTime('now', $timezone); $this->stop = new PTStop(intval($stopRef)); $this->numberOfLines = $numberOfLines; $result = $this->stop->getImminentVehicles($numberOfLines); $this->detours = $result['halteOmleidingen']; $this->disturbed = $result['dienstRegelingVerstoord']; $this->allLinesDisturbed = $result['alleLijnenVerstoord']; $this->disturbances = $result['storingen']; $this->notServed = $result['nietBediend']; $this->lines = $result['lijnen']; } public function title() { $name = $this->stop->getFullName(); if ($name) return $name; return 'Halte'; } public function display() { global $timezone; parent::header(); if (!$this->stop->getExists()) { echo '
' . str_replace("\n", "
", HTMLTools::makeSafe($description['omleiding'])) . '
'; if (!empty($detour['verstoordeLijnenSet'])) { echo ''; foreach ($detour['verstoordeLijnenSet'] as $line) { echo PTLine::htmlElement( $line['kleurAchterGrond'], $line['kleurAchterGrondRand'], $line['kleurVoorGrond'], $line['lijnNummerPubliek']); echo ' '; } echo '
'; } echo '' . PTLine::htmlElement( $line['kleurAchterGrond'], $line['kleurAchterGrondRand'], $line['kleurVoorGrond'], $line['lijnNummerPubliek']) . ' | '; // Destination echo '';
if ($canceled) echo ' | ';
// Delay
echo ''; if ($canceled) { echo 'Rijdt niet'; } elseif (abs($delay) >= 60) { echo formatDelay($delay) . ':'; } echo ' | '; // Departure time echo ''; if (!$realtime) { echo static::$theoreticalBefore; } echo $timeDT->format("H"); echo ' | '; echo ': | '; echo ''; echo $timeDT->format("i"); if ($realtime && intval($timeDT->format('s')) !== 0) { echo ':' . $timeDT->format('s') . ''; } if (!$realtime) { echo static::$theoreticalAfter; } echo ' | '; echo '