diff --git a/php/LDB-Tests/example_output.php b/php/LDB-Tests/example_output.php new file mode 100644 index 0000000..19806e3 --- /dev/null +++ b/php/LDB-Tests/example_output.php @@ -0,0 +1,56 @@ + + + + TESTING + + + GetDepartureBoard(10,"GTW"); + $template["header"] = " + + + + + + + + + + + "; + $template["row"] = " + + + + + + + "; + $template["footer"] = " + +
TimeDestinationPlatformExpected
{std}{destination}{platform}{etd}
+ "; + 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"]; + } + ?> + + \ No newline at end of file diff --git a/php/LDB-Tests/example_output_SV.php b/php/LDB-Tests/example_output_SV.php new file mode 100644 index 0000000..05bbe88 --- /dev/null +++ b/php/LDB-Tests/example_output_SV.php @@ -0,0 +1,61 @@ + + + + TESTING + + + GetDepartureBoardByCRS(10,"BRI",date("H:i:s",time()),120,"","","","","True"); + $template["header"] = " + + + + + + + + + + + + + "; + $template["row"] = " + + + + + + + + + "; + $template["footer"] = " + +
IDOrg.Dest.Plat.SchExp
{id}{org}{dest}{plat}{sch}{act}
+ "; + if (isset($response->GetBoardResult->trainServices->service)) + { + print $template["header"]; + foreach($response->GetBoardResult->trainServices->service as $service) + { + $row = $template["row"]; + $destinations = array(); + + $row = str_replace("{id}",$service->trainid,$row); + $row = str_replace("{org}",$service->origin->location->tiploc,$row); + $row = str_replace("{dest}",$service->destination->location->tiploc,$row); + $row = str_replace("{plat}",$service->platform,$row); + $row = str_replace("{sch}",$servoce->std,$row); + $row = str_replace("{act}",$service->etd,$row); + print $row; + } + print $template["footer"]; + } + ?> + + \ No newline at end of file