<!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 |
|---|---|---|---|
| 19:36 | Bedford CALLING AT: East Croydon (19:51)London Bridge (20:05) London Blackfriars (20:11) City Thameslink (20:13) Farringdon (20:16) London St Pancras (Intl) (20:20) West Hampstead Thameslink (20:29) St Albans (20:41) Harpenden (20:47) Luton Airport Parkway (20:52) Luton (20:56) Leagrave (21:01) Harlington (21:06) Flitwick (21:10) Bedford (21:22) Thameslink (12 coaches) |
4 | 19:55 |
| 19:40 | Three Bridges CALLING AT: Three Bridges (19:46)Thameslink (12 coaches) |
3 | 20:05 |
| 19:45 | Brighton CALLING AT: Three Bridges (19:49)Haywards Heath (19:59) Burgess Hill (20:05) Brighton (20:18) Thameslink (12 coaches) |
7 | 20:02 |
| 19:46 | Cambridge CALLING AT: East Croydon (20:01)London Bridge (20:15) London Blackfriars (20:21) City Thameslink (20:23) Farringdon (20:26) London St Pancras (Intl) (20:30) Finsbury Park (20:37) Stevenage (20:58) Hitchin (21:04) Letchworth Garden City (21:10) Baldock (21:14) Ashwell & Morden (21:19) Royston (21:23) Cambridge (21:39) Thameslink |
4 | 19:59 |
| 19:47 | Horsham CALLING AT: Three Bridges (19:52)Crawley (19:57) Ifield (20:00) Faygate (20:04) Littlehaven (20:08) Horsham (20:12) Thameslink (12 coaches) |
3 | 20:05 |
| 19:49 | Peterborough CALLING AT: Horley (19:51)Redhill (19:59) Merstham (20:03) Coulsdon South (20:08) East Croydon (20:15) London Bridge (20:30) London Blackfriars (20:36) City Thameslink (20:38) Farringdon (20:41) London St Pancras (Intl) (20:45) Finsbury Park (20:52) Stevenage (21:13) Hitchin (21:20) Arlesey (21:26) Biggleswade (21:31) Sandy (21:35) St Neots (21:42) Huntingdon (21:49) Peterborough (22:05) Thameslink (12 coaches) |
1 | 20:17 |
| 19:56 | Eastbourne CALLING AT: Haywards Heath (20:07)Wivelsfield (20:11) Cooksbridge (20:21) Lewes (20:26) Berwick (Sussex) (20:36) Polegate (20:41) Hampden Park (20:46) Eastbourne (20:51) Southern (8 coaches) |
7 | 19:59 |
| 19:56 | London Victoria CALLING AT: East Croydon (20:11)Clapham Junction (20:21) London Victoria (20:29) Southern (8 coaches) |
4 | 20:01 |
| 19:59 | Reading CALLING AT: Redhill (20:07)Reigate (20:14) Dorking Deepdene (20:22) Gomshall (20:30) Chilworth (20:37) Guildford (20:43) Ash (20:53) North Camp (20:57) Farnborough North (21:01) Blackwater (21:06) Sandhurst (21:10) Crowthorne (21:13) Wokingham (21:19) Reading (21:37) Great Western Railway |
2 | On time |
| 20:01 | Brighton CALLING AT: Haywards Heath (20:11)Brighton (20:27) Gatwick Express (8 coaches) |
6 | On time |