-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmobile_traffic.php
More file actions
63 lines (56 loc) · 1.59 KB
/
mobile_traffic.php
File metadata and controls
63 lines (56 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
function ReadXml($file)
{
require('includes/paths.php');
$file = $dir.'travel_data/'.$file.'_tpeg_copy.xml';
if (file_exists($file))
{
$xml = simplexml_load_file($file);
echo $xml->asXML();
foreach($xml->t_alert as $t_alert)
{
echo '<strong>Summary:</strong> '.$t_alert['summary'];
echo '<br /><em>Start: '.$t_alert['start'].' -> End: '.$t_alert['stop'].'</em><br /><hr />';
}
}
else
{
exit('Failed to open '.$file);
}
}
function ShowHeader()
{
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head>';
echo '<title>BlueGhostUK Mobile Traffic</title></head><body>';
echo '<strong id="top"><a href="mobile_traffic.php">BlueGhostUK Mobile Traffic</a></strong><br /><hr /><em>supported by <a href="http://backstage.bbc.co.uk">http://backstage.bbc.co.uk</a></em><br /><hr />';
}
function ShowFooter()
{
echo '<hr /><a href="#top">Top</a>';
echo '<hr /><em>supported by <a href="http://backstage.bbc.co.uk">http://backstage.bbc.co.uk</a></em><br /><hr />';
echo '</body></html>';
}
function ShowListing()
{
require('includes/paths.php');
$files = scandir($dir.'travel_data/');
foreach($files as $file)
{
if ($file != "." && $file != "..")
{
$parseFile = ereg_replace("_tpeg_copy.xml", "", $file);
echo '<a href="mobile_traffic.php?region='.$parseFile.'">'.$parseFile.'</a><br />';
}
}
}
ShowHeader();
if (!isset($_REQUEST['region']))
{
ShowListing();
}
else
{
ReadXml($_REQUEST['region']);
}
ShowFooter();
?>