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 Aircraft Registrations"); |
||
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 Aircraft Registrations").'</h1> |
||
13 | </div> |
||
14 | <p>'._("Below are the <strong>Top 10</strong> most common aircraft registrations.").'</p>'; |
||
15 | |||
16 | $registration_array = $Stats->countAllAircraftRegistrations(); |
||
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 Manufacturer").'", "'._("# of times").'"], '; |
||
24 | $registration_data = ''; |
||
25 | foreach($registration_array as $registration_item) |
||
26 | { |
||
27 | $registration_data .= '[ "'.$registration_item['registration'].' - '.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')",'.$registration_item['aircraft_registration_count'].'],'; |
||
28 | } |
||
29 | $registration_data = substr($registration_data, 0, -1); |
||
30 | print $registration_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($registration_array)) |
||
48 | { |
||
49 | print '<div class="table-responsive">'; |
||
50 | print '<table class="common-registration table-striped">'; |
||
51 | print '<thead>'; |
||
52 | print '<th></th>'; |
||
53 | print '<th></th>'; |
||
54 | print '<th>'._("Registration").'</th>'; |
||
55 | print '<th>'._("Aircraft").'</th>'; |
||
56 | print '<th>'._("# of times").'</th>'; |
||
57 | print '</thead>'; |
||
58 | print '<tbody>'; |
||
59 | $i = 1; |
||
60 | foreach($registration_array as $registration_item) |
||
61 | { |
||
62 | print '<tr>'; |
||
63 | print '<td><strong>'.$i.'</strong></td>'; |
||
64 | if (isset($registration_item['image_thumbnail']) && $registration_item['image_thumbnail'] != "") |
||
65 | { |
||
66 | print '<td class="aircraft_thumbnail">'; |
||
67 | print '<a href="'.$globalURL.'/registration/'.$registration_item['registration'].'"><img src="'.$registration_item['image_thumbnail'].'" class="img-rounded" data-toggle="popover" title="'.$registration_item['registration'].' - '.$registration_item['aircraft_icao'].' - '.$registration_item['airline_name'].'" alt="'.$registration_item['registration'].' - '.$registration_item['airline_name'].'" data-content="'._("Registration:").' '.$registration_item['registration'].'<br />'._("Aircraft:").' '.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')<br />'._("Airline:").' '.$registration_item['airline_name'].'" data-html="true" width="100px" /></a>'; |
||
68 | print '</td>'; |
||
69 | } else { |
||
70 | print '<td class="aircraft_thumbnail">'; |
||
71 | print '<a href="'.$globalURL.'/registration/'.$registration_item['registration'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" class="img-rounded" data-toggle="popover" title="'.$registration_item['registration'].' - '.$registration_item['aircraft_icao'].'" alt="'.$registration_item['registration'].'" data-content="'._("Registration:").' '.$registration_item['registration'].'<br />'._("Aircraft:").' '.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')" data-html="true" width="100px" /></a>'; |
||
72 | print '</td>'; |
||
73 | } |
||
74 | print '<td>'; |
||
75 | print '<a href="'.$globalURL.'/registration/'.$registration_item['registration'].'">'.$registration_item['registration'].'</a>'; |
||
76 | print '</td>'; |
||
77 | print '<td>'; |
||
78 | print '<a href="'.$globalURL.'/aircraft/'.$registration_item['aircraft_icao'].'">'.$registration_item['aircraft_name'].' ('.$registration_item['aircraft_icao'].')</a>'; |
||
79 | print '</td>'; |
||
80 | print '<td>'.$registration_item['aircraft_registration_count'].'</td>'; |
||
81 | print '</tr>'; |
||
82 | $i++; |
||
83 | } |
||
84 | print '<tbody>'; |
||
85 | print '</table>'; |
||
86 | print '</div>'; |
||
87 | } |
||
88 | require_once('footer.php'); |
||
89 | ?> |
||
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.