/[projects]/tog-php/xml_display.php
ViewVC logotype

Contents of /tog-php/xml_display.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 300 - (show annotations) (download)
Wed Sep 2 13:49:30 2009 UTC (14 years, 8 months ago) by torben
File size: 1273 byte(s)
Initial import


1 <?
2 header("Content-type: application/xml; charset=ISO-8859-1");
3
4 header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
5 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
6
7 require("function.php");
8
9
10 $stationcode = $_GET["stationcode"];
11 $stationname = $_GET["stationname"];
12 #$type = $_GET["type"];
13
14 #$result = tog($type, $stationcode,$stationname);
15 if ($stationname != "")
16 $result = tog2($stationname);
17 else
18 $result = tog3($stationcode);
19
20
21 echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
22 echo "<depatureinfo>\n";
23 //echo " <station>\n";
24 //echo " <code>$stationcode</code>\n";
25 //echo " <name>$stationname</name>\n";
26 //echo " </station>\n";
27
28
29 for ($i = 0; $i< sizeof($result); $i++)
30 {
31 echo " <train>\n";
32 echo " <time>" . trim($result[$i][0]) . "</time>\n";
33 echo " <updated>" . $result[$i][1] . "</updated>\n";
34 echo " <trainnumber>" . $result[$i][2] . "</trainnumber>\n";
35 echo " <destination>" . $result[$i][3] . "</destination>\n";
36 echo " <origin>" . $result[$i][4] . "</origin>\n";
37 echo " <location>" . $result[$i][5] . "</location>\n";
38 echo " <status>" . $result[$i][6] . "</status>\n";
39 echo " <note>" . $result[$i][7] . "</note>\n";
40 echo " </train>\n";
41
42
43 }
44
45 echo "</depatureinfo>\n";
46 ?>

  ViewVC Help
Powered by ViewVC 1.1.20