<!DOCTYPE html>
<html lang="en">
<head>
<style type='text/css'>
body {
font-family: monospace;
white-space: nowrap;
}
table {
border-collapse: collapse;
}
th,td {
border: 1px solid #eee;
padding: 10px;
vertical-align:top;
}
th:nth-child(1),th:nth-child(2) {
text-align: left;
}
th:nth-child(3),td:nth-child(3) {
text-align: center;
}
th:nth-child(4),td:nth-child(4) {
text-align: right;
}
</style>
</head>
<body>
<?php
require("OpenLDBWS.php");
$OpenLDBWS = new OpenLDBWS("YOUR_ACCESS_TOKEN");
$response = $OpenLDBWS->GetDepBoardWithDetails(10,"GTW");
$template["header"] = "
<table>
<thead>
<tr>
<th>Time</th>
<th>Destination</th>
<th>Platform</th>
<th>Expected</th>
</tr>
</thead>
<tbody>
";
$template["row"] = "
<tr>
<td>{std}</td>
<td><strong>{destination}</strong>{detail}</td>
<td>{platform}</td>
<td>{etd}</td>
</tr>
";
$template["footer"] = "
</tbody>
</table>
";
if (isset($response->GetStationBoardResult))
{
print "<p><strong>".$response->GetStationBoardResult->locationName."</strong> Departures</p>";
if (isset($response->GetStationBoardResult->nrccMessages))
{
print "<ul>";
foreach($response->GetStationBoardResult->nrccMessages->message as $message)
{
print "<li>".$message->{"_"}."</li>";
}
print "</ul>";
}
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);
$detail = "";
if (($service->etd != "Cancelled") && isset($service->subsequentCallingPoints))
{
foreach($service->subsequentCallingPoints->callingPointList as $k => $callingPointList)
{
$callingPoints = $callingPointList->callingPoint;
if ($k)
{
$callingPoint = array_shift($callingPoints);
$detail .= "<p>Train divides at <strong>".$callingPoint->locationName."</strong></p>";
}
$detail .= "<p>CALLING AT:</p>";
foreach($callingPoints as $callingPoint)
{
$detail .= $callingPoint->locationName." (".(($callingPoint->st == "On time")?$callingPoint->et:$callingPoint->st).")<br />";
}
}
$detail .= "<p>".$service->operator.(isset($service->length)?" (".$service->length." coaches)":"")."</p>";
}
$row = str_replace("{detail}",$detail,$row);
print $row;
}
print $template["footer"];
}
else
{
print "<p>No services within 2 hours.</p>";
}
}
?>
</body>
</html>
Gatwick Airport Departures
Time | Destination | Platform | Expected |
---|---|---|---|
09:11 | Three Bridges CALLING AT: Three Bridges (09:16)Thameslink (12 coaches) |
3 | 09:16 |
09:15 | Brighton CALLING AT: Three Bridges (09:19)Haywards Heath (09:29) Burgess Hill (09:35) Brighton (09:48) Thameslink (12 coaches) |
7 | 09:17 |
09:16 | Cambridge CALLING AT: East Croydon (09:31)London Bridge (09:45) London Blackfriars (09:51) City Thameslink (09:53) Farringdon (09:56) London St Pancras (Intl) (10:00) Finsbury Park (10:07) Stevenage (10:31) Hitchin (10:37) Letchworth Garden City (10:42) Baldock (10:46) Ashwell & Morden (10:51) Royston (10:55) Cambridge (11:11) Thameslink (12 coaches) |
4 | On time |
09:18 | Horsham CALLING AT: Three Bridges (09:23)Crawley (09:28) Ifield (09:31) Littlehaven (09:37) Horsham (09:40) Thameslink (8 coaches) |
3 | 09:20 |
09:19 | Peterborough CALLING AT: Horley (09:21)Redhill (09:29) Merstham (09:33) Coulsdon South (09:38) East Croydon (09:45) London Bridge (10:00) London Blackfriars (10:06) City Thameslink (10:08) Farringdon (10:11) London St Pancras (Intl) (10:15) Finsbury Park (10:22) Stevenage (10:43) Hitchin (10:50) Arlesey (10:56) Biggleswade (11:01) Sandy (11:05) St Neots (11:12) Huntingdon (11:20) Peterborough (11:40) Thameslink (12 coaches) |
2 | On time |
09:22 | Littlehampton CALLING AT: Haywards Heath (09:33)Burgess Hill (09:39) Hassocks (09:43) Preston Park (09:50) Hove (09:53) Portslade (09:57) Shoreham-by-Sea (10:01) Lancing (10:06) Worthing (10:10) West Worthing (10:12) Durrington-on-Sea (10:15) Goring-by-Sea (10:18) Angmering (10:22) Littlehampton (10:32) Southern (8 coaches) |
6 | On time |
09:22 | London Victoria CALLING AT: Horley (09:25)Salfords (09:29) Earlswood (Surrey) (09:32) Redhill (09:36) Merstham (09:44) Coulsdon South (09:49) Purley (09:53) East Croydon (09:59) Clapham Junction (10:11) London Victoria (10:19) Southern (8 coaches) |
1 | On time |
09:23 | Three Bridges CALLING AT: Three Bridges (09:28)Thameslink (12 coaches) |
3 | On time |
09:26 | London Victoria CALLING AT: East Croydon (09:41)Clapham Junction (09:51) London Victoria (09:58) Southern (8 coaches) |
4 | On time |
09:26 | Ore CALLING AT: Haywards Heath (09:37)Wivelsfield (09:42) Plumpton (09:49) Lewes (09:56) Polegate (10:09) Eastbourne (10:17) Hampden Park (10:27) Pevensey & Westham (10:32) Normans Bay (10:37) Cooden Beach (10:42) Collington (10:45) Bexhill (10:48) St Leonards Warrior Square (10:55) Hastings (10:58) Ore (11:02) Southern (8 coaches) |
7 | On time |