@@ -5,16 +5,16 @@ discard block |
||
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | $Spotter = new Spotter(); |
7 | 7 | |
8 | -if (!isset($_GET['aircraft_type'])){ |
|
8 | +if (!isset($_GET['aircraft_type'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/aircraft'); |
10 | 10 | } else { |
11 | 11 | //calculuation for the pagination |
12 | - if(!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2) |
|
12 | + if (!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2) |
|
13 | 13 | { |
14 | 14 | $limit_start = 0; |
15 | 15 | $limit_end = 25; |
16 | 16 | $absolute_difference = 25; |
17 | - } else { |
|
17 | + } else { |
|
18 | 18 | $limit_explode = explode(",", $_GET['limit']); |
19 | 19 | $limit_start = $limit_explode[0]; |
20 | 20 | $limit_end = $limit_explode[1]; |
@@ -28,19 +28,19 @@ discard block |
||
28 | 28 | $limit_previous_1 = $limit_start - $absolute_difference; |
29 | 29 | $limit_previous_2 = $limit_end - $absolute_difference; |
30 | 30 | |
31 | - $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
31 | + $aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/aircraft/'.$aircraft_type; |
33 | 33 | |
34 | - $sort = htmlspecialchars(filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING)); |
|
35 | - $spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,$limit_start.",".$absolute_difference, $sort); |
|
34 | + $sort = htmlspecialchars(filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING)); |
|
35 | + $spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, $limit_start.",".$absolute_difference, $sort); |
|
36 | 36 | |
37 | 37 | $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_type); |
38 | 38 | if (!empty($spotter_array) || !empty($aircraft_info)) |
39 | 39 | { |
40 | 40 | if (!empty($aircraft_info)) { |
41 | - $title = sprintf(_("Detailed View for %s (%s)"),$aircraft_info[0]['type'],$aircraft_info[0]['icao']); |
|
41 | + $title = sprintf(_("Detailed View for %s (%s)"), $aircraft_info[0]['type'], $aircraft_info[0]['icao']); |
|
42 | 42 | } else { |
43 | - $title = sprintf(_("Detailed View for %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
43 | + $title = sprintf(_("Detailed View for %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
44 | 44 | } |
45 | 45 | require_once('header.php'); |
46 | 46 | |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | $Stats = new Stats(); |
52 | 52 | $aircraft_types = $Stats->getAllAircraftTypes(); |
53 | 53 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
54 | - foreach($aircraft_types as $aircrafttype) |
|
54 | + foreach ($aircraft_types as $aircrafttype) |
|
55 | 55 | { |
56 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
56 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
57 | 57 | { |
58 | 58 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_manufacturer'].' '.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
59 | 59 | } else { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if (!empty($spotter_array)) { |
91 | 91 | include('aircraft-sub-menu.php'); |
92 | 92 | print '<div class="table column">'; |
93 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
93 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
94 | 94 | include('table-output.php'); |
95 | 95 | print '<div class="pagination">'; |
96 | 96 | if ($limit_previous_1 >= 0) |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $limit_start = 0; |
15 | 15 | $limit_end = 25; |
16 | 16 | $absolute_difference = 25; |
17 | - } else { |
|
17 | + } else { |
|
18 | 18 | $limit_explode = explode(",", $_GET['limit']); |
19 | 19 | $limit_start = $limit_explode[0]; |
20 | 20 | $limit_end = $limit_explode[1]; |
@@ -50,7 +50,9 @@ discard block |
||
50 | 50 | print '<option></option>'; |
51 | 51 | $Stats = new Stats(); |
52 | 52 | $aircraft_types = $Stats->getAllAircraftTypes(); |
53 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
53 | + if (empty($aircraft_types)) { |
|
54 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
55 | + } |
|
54 | 56 | foreach($aircraft_types as $aircrafttype) |
55 | 57 | { |
56 | 58 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -73,14 +75,22 @@ discard block |
||
73 | 75 | print '<div><span class="label">'._("Name").'</span>'.$aircraft_info[0]['type'].'</div>'; |
74 | 76 | print '<div><span class="label">'._("ICAO").'</span>'.$aircraft_info[0]['icao'].'</div>'; |
75 | 77 | print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $aircraft_info[0]['manufacturer'])).'">'.$aircraft_info[0]['manufacturer'].'</a></div>'; |
76 | - if ($aircraft_info[0]['aircraft_description'] != '') print '<div><span class="label">'._("Description").'</span>'.$aircraft_info[0]['aircraft_description'].'</div>'; |
|
77 | - if ($aircraft_info[0]['engine_type'] != '') print '<div><span class="label">'._("Engine").'</span>'.$aircraft_info[0]['engine_type'].'</div>'; |
|
78 | - if ($aircraft_info[0]['engine_count'] != '') print '<div><span class="label">'._("Engine count").'</span>'.$aircraft_info[0]['engine_count'].'</div>'; |
|
78 | + if ($aircraft_info[0]['aircraft_description'] != '') { |
|
79 | + print '<div><span class="label">'._("Description").'</span>'.$aircraft_info[0]['aircraft_description'].'</div>'; |
|
80 | + } |
|
81 | + if ($aircraft_info[0]['engine_type'] != '') { |
|
82 | + print '<div><span class="label">'._("Engine").'</span>'.$aircraft_info[0]['engine_type'].'</div>'; |
|
83 | + } |
|
84 | + if ($aircraft_info[0]['engine_count'] != '') { |
|
85 | + print '<div><span class="label">'._("Engine count").'</span>'.$aircraft_info[0]['engine_count'].'</div>'; |
|
86 | + } |
|
79 | 87 | } else { |
80 | 88 | print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>'; |
81 | 89 | print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>'; |
82 | 90 | print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; |
83 | - if (isset($spotter_array[0]['aircraft_manufacturer'])) print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>'; |
|
91 | + if (isset($spotter_array[0]['aircraft_manufacturer'])) { |
|
92 | + print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>'; |
|
93 | + } |
|
84 | 94 | } |
85 | 95 | print '</div>'; |
86 | 96 | } else { |