Completed
Push — master ( d8c574...a11679 )
by Yannick
07:12
created

statistics-route-waypoint.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
require_once('require/class.Connection.php');
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
$title = _("Statistics").' - '._("Most common Route by Waypoint");
7
require_once('header.php');
8
include('statistics-sub-menu.php'); 
9
10
print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
11
		<div class="info">
12
	  	<h1>'._("Most common Route by Waypoint").'</h1>
13
	  </div>
14
      <p>'._("Below are the <strong>Top 10</strong> most common routes, based on the waypoint data. Theoretically, since the waypoint data is the full 'planned flight route' this statistic would show the actual most common route.").'</p>';
15
      
16
$route_array = $Spotter->countAllRoutesWithWaypoints();
17
if (!empty($route_array))
18
{
19
	print '<div class="table-responsive">';
20
	print '<table class="common-routes-waypoints table-striped">';
21
	print '<thead>';
22
	print '<th></th>';
23
	print '<th>'._("Departure Airport").'</th>';
24
	print '<th>'._("Arrival Airport").'</th>';
25
	print '<th>'._("# of times").'</th>';
26
	print '<th></th>';
27
	print '</thead>';
28
	print '<tbody>';
29
	$i = 1;
30
	foreach($route_array as $route_item)
31
	{
32
		print '<tr>';
33
		print '<td><strong>'.$i.'</strong></td>';
34
		print '<td>';
35
		print '<a href="'.$globalURL.'/airport/'.$route_item['airport_departure_icao'].'">'.$route_item['airport_departure_city'].', '.$route_item['airport_departure_country'].' ('.$route_item['airport_departure_icao'].')</a>';
36
		print '</td>';
37
		print '<td>';
38
		print '<a href="'.$globalURL.'/airport/'.$route_item['airport_arrival_icao'].'">'.$route_item['airport_arrival_city'].', '.$route_item['airport_arrival_country'].' ('.$route_item['airport_arrival_icao'].')</a>';
39
		print '</td>';
40
		print '<td>'.$route_item['route_count'].'</td>';
41
		print '<td>';
42
		print '<a href="'.$globalURL.'/flightid/'.$route_item['spotter_id'].'">'._("Recent Flight on this route").'</a>';
43
		print '</td>';
44
		print '</tr>';
45
		$i++;
46
	}
47
	print '<tbody>';
48
	print '</table>';
49
	print '</div>';
50
}
51
52
require_once('footer.php');
53
?>
1 ignored issue
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...