GetDepartureBoard(10,"GTW");
$template["header"] = "
Time |
Destination |
Platform |
Expected |
";
$template["row"] = "
{std} |
{destination} |
{platform} |
{etd} |
";
$template["footer"] = "
";
if (isset($response->GetStationBoardResult->trainServices->service))
{
print $template["header"];
foreach($response->GetStationBoardResult->trainServices->service as $service)
{
$row = $template["row"];
$destinations = array();
foreach($service->destination->location as $location)
{
$destinations[] = $location->locationName;
}
$row = str_replace("{std}",$service->std,$row);
$row = str_replace("{destination}",implode(" and ",$destinations),$row);
$row = str_replace("{platform}",(isset($service->platform)?$service->platform:" "),$row);
$row = str_replace("{etd}",$service->etd,$row);
print $row;
}
print $template["footer"];
}
?>