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.Stats.php'); |
||
4 | require_once('require/class.Language.php'); |
||
5 | $Stats = new Stats(); |
||
6 | $title = _("Statistics").' - '._("Most common Callsign"); |
||
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 Callsign").'</h1> |
||
13 | </div> |
||
14 | <p>'._("Below are the <strong>Top 10</strong> most common ident/callsigns of all airlines.").'</p>'; |
||
15 | |||
16 | $callsign_array = $Stats->countAllCallsigns(); |
||
17 | print '<div id="chart" class="chart" width="100%"></div> |
||
18 | <script> |
||
19 | google.load("visualization", "1", {packages:["corechart"]}); |
||
20 | google.setOnLoadCallback(drawChart); |
||
21 | function drawChart() { |
||
22 | var data = google.visualization.arrayToDataTable([ |
||
23 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
||
24 | $callsign_data = ''; |
||
25 | foreach($callsign_array as $callsign_item) |
||
26 | { |
||
27 | $callsign_data .= '[ "'.$callsign_item['callsign_icao'].' ('.$callsign_item['airline_name'].')",'.$callsign_item['callsign_icao_count'].'],'; |
||
28 | } |
||
29 | $callsign_data = substr($callsign_data, 0, -1); |
||
30 | print $callsign_data; |
||
31 | print ']); |
||
32 | |||
33 | var options = { |
||
34 | chartArea: {"width": "80%", "height": "60%"}, |
||
35 | height:500, |
||
36 | is3D: true |
||
37 | }; |
||
38 | |||
39 | var chart = new google.visualization.PieChart(document.getElementById("chart")); |
||
40 | chart.draw(data, options); |
||
41 | } |
||
42 | $(window).resize(function(){ |
||
43 | drawChart(); |
||
44 | }); |
||
45 | </script>'; |
||
46 | |||
47 | if (!empty($callsign_array)) |
||
48 | { |
||
49 | print '<div class="table-responsive">'; |
||
50 | print '<table class="common-callsigns table-striped">'; |
||
51 | print '<thead>'; |
||
52 | print '<th></th>'; |
||
53 | print '<th>'._("Callsign").'</th>'; |
||
54 | print '<th>'._("Airline").'</th>'; |
||
55 | print '<th>'._("# of times").'</th>'; |
||
56 | print '</thead>'; |
||
57 | print '<tbody>'; |
||
58 | $i = 1; |
||
59 | foreach($callsign_array as $callsign_item) |
||
60 | { |
||
61 | print '<tr>'; |
||
62 | print '<td><strong>'.$i.'</strong></td>'; |
||
63 | print '<td>'; |
||
64 | print '<a href="'.$globalURL.'/ident/'.$callsign_item['callsign_icao'].'">'.$callsign_item['callsign_icao'].'</a>'; |
||
65 | print '</td>'; |
||
66 | print '<td>'; |
||
67 | print '<a href="'.$globalURL.'/airline/'.$callsign_item['airline_icao'].'">'.$callsign_item['airline_name'].'</a>'; |
||
68 | print '</td>'; |
||
69 | print '<td>'.$callsign_item['callsign_icao_count'].'</td>'; |
||
70 | print '</tr>'; |
||
71 | $i++; |
||
72 | } |
||
73 | print '<tbody>'; |
||
74 | print '</table>'; |
||
75 | print '</div>'; |
||
76 | } |
||
77 | |||
78 | require_once('footer.php'); |
||
79 | ?> |
||
1 ignored issue
–
show
|
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.