@@ -4,16 +4,16 @@ discard block |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | |
7 | -if (!isset($_GET['aircraft_type'])){ |
|
7 | +if (!isset($_GET['aircraft_type'])) { |
|
8 | 8 | header('Location: '.$globalURL.'/aircraft'); |
9 | 9 | } else { |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2) |
|
11 | + if (!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference; |
28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference; |
29 | 29 | |
30 | - $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
30 | + $aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
31 | 31 | $page_url = $globalURL.'/aircraft/'.$aircraft_type; |
32 | 32 | |
33 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
34 | - $spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,$limit_start.",".$absolute_difference, $sort); |
|
33 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
34 | + $spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, $limit_start.",".$absolute_difference, $sort); |
|
35 | 35 | |
36 | 36 | if (!empty($spotter_array)) |
37 | 37 | { |
38 | - $title = sprintf(_("Detailed View for %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
38 | + $title = sprintf(_("Detailed View for %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
39 | 39 | require_once('header.php'); |
40 | 40 | |
41 | 41 | print '<div class="select-item">'; |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
44 | 44 | print '<option></option>'; |
45 | 45 | $aircraft_types = $Spotter->getAllAircraftTypes(); |
46 | - foreach($aircraft_types as $aircrafttype) |
|
46 | + foreach ($aircraft_types as $aircrafttype) |
|
47 | 47 | { |
48 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
48 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
49 | 49 | { |
50 | 50 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_manufacturer'].' '.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
51 | 51 | } else { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | include('aircraft-sub-menu.php'); |
73 | 73 | |
74 | 74 | print '<div class="table column">'; |
75 | - 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>'; |
|
75 | + 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>'; |
|
76 | 76 | |
77 | 77 | include('table-output.php'); |
78 | 78 |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | print '<div class="select-item">'; |
43 | 43 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
44 | 44 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
45 | - print '<option></option>'; |
|
46 | - $Stats = new Stats(); |
|
45 | + print '<option></option>'; |
|
46 | + $Stats = new Stats(); |
|
47 | 47 | $aircraft_types = $Stats->getAllAircraftTypes(); |
48 | 48 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
49 | 49 | foreach($aircraft_types as $aircrafttype) |
@@ -54,20 +54,20 @@ discard block |
||
54 | 54 | } else { |
55 | 55 | print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_manufacturer'].' '.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
56 | 56 | } |
57 | - } |
|
58 | - print '</select>'; |
|
59 | - print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
|
57 | + } |
|
58 | + print '</select>'; |
|
59 | + print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
|
60 | 60 | print '</form>'; |
61 | 61 | print '</div>'; |
62 | 62 | |
63 | 63 | if ($aircraft_type != "NA") |
64 | 64 | { |
65 | - print '<div class="info column">'; |
|
66 | - print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>'; |
|
67 | - print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>'; |
|
68 | - print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; |
|
69 | - 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>'; |
|
70 | - print '</div>'; |
|
65 | + print '<div class="info column">'; |
|
66 | + print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>'; |
|
67 | + print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>'; |
|
68 | + print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; |
|
69 | + 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>'; |
|
70 | + print '</div>'; |
|
71 | 71 | } else { |
72 | 72 | print '<div class="alert alert-warning">'._("This special aircraft profile shows all flights in where the aircraft type is unknown.").'</div>'; |
73 | 73 | } |
@@ -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]; |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | print '<option></option>'; |
46 | 46 | $Stats = new Stats(); |
47 | 47 | $aircraft_types = $Stats->getAllAircraftTypes(); |
48 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
48 | + if (empty($aircraft_types)) { |
|
49 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
50 | + } |
|
49 | 51 | foreach($aircraft_types as $aircrafttype) |
50 | 52 | { |
51 | 53 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -66,7 +68,9 @@ discard block |
||
66 | 68 | print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>'; |
67 | 69 | print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>'; |
68 | 70 | print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; |
69 | - 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>'; |
|
71 | + if (isset($spotter_array[0]['aircraft_manufacturer'])) { |
|
72 | + 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>'; |
|
73 | + } |
|
70 | 74 | print '</div>'; |
71 | 75 | } else { |
72 | 76 | print '<div class="alert alert-warning">'._("This special aircraft profile shows all flights in where the aircraft type is unknown.").'</div>'; |
@@ -7,11 +7,11 @@ |
||
7 | 7 | { |
8 | 8 | $spotter_id = $Spotter->getSpotterIDBasedOnFlightAwareID($_GET['flightaware_id']); |
9 | 9 | |
10 | - if ($spotter_id != "") |
|
11 | - { |
|
12 | - header('Location: '.$globalURL.'/flightid/'.$spotter_id); |
|
13 | - } else { |
|
10 | + if ($spotter_id != "") |
|
11 | + { |
|
12 | + header('Location: '.$globalURL.'/flightid/'.$spotter_id); |
|
13 | + } else { |
|
14 | 14 | header('Location: '.$globalURL); |
15 | - } |
|
15 | + } |
|
16 | 16 | } |
17 | 17 | ?> |
18 | 18 | \ No newline at end of file |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | if (empty($aircraft_types) || $aircraft_types[0]['aircraft_name'] == '') $aircraft_types = $Spotter->getAllAircraftTypes(); |
20 | 20 | $previous = null; |
21 | 21 | print '<div class="alphabet-legend">'; |
22 | - foreach($aircraft_types as $value) { |
|
22 | + foreach ($aircraft_types as $value) { |
|
23 | 23 | $firstLetter = substr($value['aircraft_name'], 0, 1); |
24 | - if($previous !== $firstLetter) |
|
24 | + if ($previous !== $firstLetter) |
|
25 | 25 | { |
26 | 26 | if ($previous !== null) print ' | '; |
27 | 27 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | } |
31 | 31 | print '</div>'; |
32 | 32 | $previous = null; |
33 | - foreach($aircraft_types as $value) { |
|
33 | + foreach ($aircraft_types as $value) { |
|
34 | 34 | $firstLetter = substr($value['aircraft_name'], 0, 1); |
35 | 35 | if ($firstLetter != "") |
36 | 36 | { |
37 | - if($previous !== $firstLetter) |
|
37 | + if ($previous !== $firstLetter) |
|
38 | 38 | { |
39 | 39 | if ($previous !== null) print '</div>'; |
40 | 40 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
@@ -16,7 +16,9 @@ discard block |
||
16 | 16 | print '<h1>'._("Aircrafts Types").'</h1>'; |
17 | 17 | |
18 | 18 | $aircraft_types = $Stats->getAllAircraftTypes(); |
19 | - if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
19 | + if (empty($aircraft_types) || $aircraft_types[0]['aircraft_manufacturer'] == '') { |
|
20 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
21 | + } |
|
20 | 22 | $previous = null; |
21 | 23 | print '<div class="alphabet-legend">'; |
22 | 24 | foreach($aircraft_types as $value) { |
@@ -24,7 +26,9 @@ discard block |
||
24 | 26 | $firstLetter = substr($value['aircraft_manufacturer'], 0, 1); |
25 | 27 | if($previous !== $firstLetter) |
26 | 28 | { |
27 | - if ($previous !== null) print ' | '; |
|
29 | + if ($previous !== null) { |
|
30 | + print ' | '; |
|
31 | + } |
|
28 | 32 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
29 | 33 | } |
30 | 34 | $previous = $firstLetter; |
@@ -38,7 +42,9 @@ discard block |
||
38 | 42 | { |
39 | 43 | if($previous !== $firstLetter) |
40 | 44 | { |
41 | - if ($previous !== null) print '</div>'; |
|
45 | + if ($previous !== null) { |
|
46 | + print '</div>'; |
|
47 | + } |
|
42 | 48 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
43 | 49 | } |
44 | 50 | $previous = $firstLetter; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | print '<div class="column">'; |
15 | 15 | print '<h1>'._("Airlines").'</h1>'; |
16 | 16 | if (isset($_POST['airline_type'])) { |
17 | - $airline_type = filter_input(INPUT_POST,'airline_type',FILTER_SANITIZE_STRING); |
|
17 | + $airline_type = filter_input(INPUT_POST, 'airline_type', FILTER_SANITIZE_STRING); |
|
18 | 18 | //$airline_names = $Spotter->getAllAirlineNames($airline_type); |
19 | 19 | } else { |
20 | 20 | //$airline_names = $Spotter->getAllAirlineNames(); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | if (isset($_POST['airline_type'])) |
37 | 37 | { |
38 | - $airline_type = filter_input(INPUT_POST,'airline_type',FILTER_SANITIZE_STRING); |
|
38 | + $airline_type = filter_input(INPUT_POST, 'airline_type', FILTER_SANITIZE_STRING); |
|
39 | 39 | $airline_names = $Spotter->getAllAirlineNames($airline_type); |
40 | 40 | } else { |
41 | 41 | $Stats = new Stats(); |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | } |
46 | 46 | $previous = null; |
47 | 47 | print '<div class="alphabet-legend">'; |
48 | - foreach($airline_names as $value) |
|
48 | + foreach ($airline_names as $value) |
|
49 | 49 | { |
50 | 50 | //echo $value['airline_name']."\n"; |
51 | 51 | //echo mb_substr($value['airline_name'],0,1).' - '.$value['airline_name']."\n"; |
52 | - $firstLetter = mb_strtoupper(mb_substr($value['airline_name'], 0, 1),'UTF-8'); |
|
53 | - if($previous !== $firstLetter) |
|
52 | + $firstLetter = mb_strtoupper(mb_substr($value['airline_name'], 0, 1), 'UTF-8'); |
|
53 | + if ($previous !== $firstLetter) |
|
54 | 54 | { |
55 | 55 | if ($previous !== null) print ' | '; |
56 | 56 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | } |
60 | 60 | print '</div>'; |
61 | 61 | $previous = null; |
62 | - foreach($airline_names as $value) { |
|
62 | + foreach ($airline_names as $value) { |
|
63 | 63 | $firstLetter = strtoupper(substr($value['airline_name'], 0, 1)); |
64 | 64 | if ($firstLetter != "") |
65 | 65 | { |
66 | - if($previous !== $firstLetter) |
|
66 | + if ($previous !== $firstLetter) |
|
67 | 67 | { |
68 | 68 | if ($previous !== null) print '</div>'; |
69 | 69 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
@@ -24,13 +24,21 @@ discard block |
||
24 | 24 | |
25 | 25 | print '<div class="select-item"><form action="'.$globalURL.'/airline" method="post"><select name="airline_type" class="selectpicker" data-live-search="true">'; |
26 | 26 | print '<option value="all"'; |
27 | - if ($airline_type == 'all') print 'selected="selected" '; |
|
27 | + if ($airline_type == 'all') { |
|
28 | + print 'selected="selected" '; |
|
29 | + } |
|
28 | 30 | print '>'._("All").'</option><option value="passenger"'; |
29 | - if ($airline_type == 'passenger') print 'selected="selected" '; |
|
31 | + if ($airline_type == 'passenger') { |
|
32 | + print 'selected="selected" '; |
|
33 | + } |
|
30 | 34 | print '>'._("Passenger").'</option><option value="cargo"'; |
31 | - if ($airline_type == 'cargo') print 'selected="selected" '; |
|
35 | + if ($airline_type == 'cargo') { |
|
36 | + print 'selected="selected" '; |
|
37 | + } |
|
32 | 38 | print '>'._("Cargo").'</option><option value="military"'; |
33 | - if ($airline_type == 'military') print 'selected="selected" '; |
|
39 | + if ($airline_type == 'military') { |
|
40 | + print 'selected="selected" '; |
|
41 | + } |
|
34 | 42 | print '>'._("Military").'</option></select>'; |
35 | 43 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button></form></div>'; |
36 | 44 | |
@@ -57,7 +65,9 @@ discard block |
||
57 | 65 | $firstLetter = mb_strtoupper(mb_substr($value['airline_name'], 0, 1),'UTF-8'); |
58 | 66 | if($previous !== $firstLetter) |
59 | 67 | { |
60 | - if ($previous !== null) print ' | '; |
|
68 | + if ($previous !== null) { |
|
69 | + print ' | '; |
|
70 | + } |
|
61 | 71 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
62 | 72 | } |
63 | 73 | $previous = $firstLetter; |
@@ -70,7 +80,9 @@ discard block |
||
70 | 80 | { |
71 | 81 | if($previous !== $firstLetter) |
72 | 82 | { |
73 | - if ($previous !== null) print '</div>'; |
|
83 | + if ($previous !== null) { |
|
84 | + print '</div>'; |
|
85 | + } |
|
74 | 86 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
75 | 87 | } |
76 | 88 | $previous = $firstLetter; |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
10 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Aircraft from %s"),$manufacturer); |
|
16 | + $title = sprintf(_("Most Common Aircraft from %s"), $manufacturer); |
|
17 | 17 | |
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
22 | 22 | print '<option></option>'; |
23 | 23 | $all_manufacturers = $Spotter->getAllManufacturers(); |
24 | - foreach($all_manufacturers as $all_manufacturer) |
|
24 | + foreach ($all_manufacturers as $all_manufacturer) |
|
25 | 25 | { |
26 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
26 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
27 | 27 | { |
28 | 28 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
29 | 29 | } else { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | include('manufacturer-sub-menu.php'); |
43 | 43 | print '<div class="column">'; |
44 | 44 | print '<h2>'._("Most Common Aircraft").'</h2>'; |
45 | - print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
45 | + print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
46 | 46 | |
47 | 47 | $aircraft_array = $Spotter->countAllAircraftTypesByManufacturer($manufacturer); |
48 | 48 | if (!empty($aircraft_array)) |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | print '</thead>'; |
58 | 58 | print '<tbody>'; |
59 | 59 | $i = 1; |
60 | - foreach($aircraft_array as $aircraft_item) |
|
60 | + foreach ($aircraft_array as $aircraft_item) |
|
61 | 61 | { |
62 | 62 | print '<tr>'; |
63 | 63 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['aircraft_manufacturer'])) { |
6 | - header('Location: '.$globalURL.'/manufacturer'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/manufacturer'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -11,12 +11,12 @@ |
||
11 | 11 | //checks to see if FlightAware import is set |
12 | 12 | if ($globalFlightAware == TRUE) |
13 | 13 | { |
14 | - $SpotterLive = new SpotterLive(); |
|
15 | - $Spotter = new Spotter(); |
|
16 | - //deletes the spotter LIVE data |
|
17 | - $SpotterLive->deleteLiveSpotterData(); |
|
14 | + $SpotterLive = new SpotterLive(); |
|
15 | + $Spotter = new Spotter(); |
|
16 | + //deletes the spotter LIVE data |
|
17 | + $SpotterLive->deleteLiveSpotterData(); |
|
18 | 18 | |
19 | - //imports the new data from FlightAware |
|
20 | - $Spotter->importFromFlightAware(); |
|
19 | + //imports the new data from FlightAware |
|
20 | + $Spotter->importFromFlightAware(); |
|
21 | 21 | } |
22 | 22 | ?> |
23 | 23 | \ No newline at end of file |
@@ -5,8 +5,8 @@ |
||
5 | 5 | */ |
6 | 6 | require_once(dirname(__FILE__).'/../require/settings.php'); |
7 | 7 | if ($globalInstalled) { |
8 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
9 | - exit; |
|
8 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
9 | + exit; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | require_once('../require/class.Connection.php'); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
12 | 12 | $schema = new Connection(); |
13 | 13 | if ($schema->latest() === false) { |
14 | - echo "You MUST update to latest schema. Run install/index.php"; |
|
15 | - exit(); |
|
14 | + echo "You MUST update to latest schema. Run install/index.php"; |
|
15 | + exit(); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | $debug = true; |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | date_default_timezone_set('UTC'); |
22 | 22 | // signal handler - playing nice with sockets and dump1090 |
23 | 23 | pcntl_signal(SIGINT, function($signo) { |
24 | - global $sock; |
|
25 | - echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
|
26 | - socket_shutdown($sock, 0); |
|
27 | - socket_close($sock); |
|
28 | - die("Bye!\n"); |
|
24 | + global $sock; |
|
25 | + echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
|
26 | + socket_shutdown($sock, 0); |
|
27 | + socket_close($sock); |
|
28 | + die("Bye!\n"); |
|
29 | 29 | }); |
30 | 30 | pcntl_signal_dispatch(); |
31 | 31 | |
@@ -38,24 +38,24 @@ discard block |
||
38 | 38 | // Bind the source address |
39 | 39 | if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) ) |
40 | 40 | { |
41 | - $errorcode = socket_last_error(); |
|
42 | - $errormsg = socket_strerror($errorcode); |
|
41 | + $errorcode = socket_last_error(); |
|
42 | + $errormsg = socket_strerror($errorcode); |
|
43 | 43 | |
44 | - die("Could not bind socket : [$errorcode] $errormsg \n"); |
|
44 | + die("Could not bind socket : [$errorcode] $errormsg \n"); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | echo "LISTEN UDP MODE \n\n"; |
48 | 48 | while(1) { |
49 | - $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
|
50 | - |
|
51 | - // lets play nice and handle signals such as ctrl-c/kill properly |
|
52 | - pcntl_signal_dispatch(); |
|
53 | - $dataFound = false; |
|
54 | - // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
|
55 | - echo $buffer."\n"; |
|
56 | - $ACARS->add(trim($buffer)); |
|
57 | - socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
58 | - $ACARS->deleteLiveAcarsData(); |
|
49 | + $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
|
50 | + |
|
51 | + // lets play nice and handle signals such as ctrl-c/kill properly |
|
52 | + pcntl_signal_dispatch(); |
|
53 | + $dataFound = false; |
|
54 | + // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
|
55 | + echo $buffer."\n"; |
|
56 | + $ACARS->add(trim($buffer)); |
|
57 | + socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
58 | + $ACARS->deleteLiveAcarsData(); |
|
59 | 59 | } |
60 | 60 | pcntl_exec($_,$argv); |
61 | 61 | ?> |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | |
18 | 18 | $debug = true; |
19 | 19 | |
20 | -$ACARS=new ACARS(); |
|
20 | +$ACARS = new ACARS(); |
|
21 | 21 | date_default_timezone_set('UTC'); |
22 | 22 | // signal handler - playing nice with sockets and dump1090 |
23 | -pcntl_signal(SIGINT, function($signo) { |
|
23 | +pcntl_signal(SIGINT, function($signo) { |
|
24 | 24 | global $sock; |
25 | 25 | echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
26 | 26 | socket_shutdown($sock, 0); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $sock = socket_create(AF_INET, SOCK_DGRAM, 0) or die("Unable to create socket\n"); |
37 | 37 | |
38 | 38 | // Bind the source address |
39 | -if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) ) |
|
39 | +if (!socket_bind($sock, $globalACARSHost, $globalACARSPort)) |
|
40 | 40 | { |
41 | 41 | $errorcode = socket_last_error(); |
42 | 42 | $errormsg = socket_strerror($errorcode); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | echo "LISTEN UDP MODE \n\n"; |
48 | -while(1) { |
|
48 | +while (1) { |
|
49 | 49 | $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
50 | 50 | |
51 | 51 | // lets play nice and handle signals such as ctrl-c/kill properly |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
55 | 55 | echo $buffer."\n"; |
56 | 56 | $ACARS->add(trim($buffer)); |
57 | - socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
57 | + socket_sendto($sock, "OK ".$buffer, 100, 0, $remote_ip, $remote_port); |
|
58 | 58 | $ACARS->deleteLiveAcarsData(); |
59 | 59 | } |
60 | -pcntl_exec($_,$argv); |
|
60 | +pcntl_exec($_, $argv); |
|
61 | 61 | ?> |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Arrival Airports by Country of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Arrival Airports by Country of %s"), $spotter_array[0]['ident']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('ident-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByIdent($ident); |
29 | 29 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
30 | 30 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | var data = google.visualization.arrayToDataTable([ |
36 | 36 | ["'._("Country").'", "'._("# of times").'"], '; |
37 | 37 | $country_data = ''; |
38 | - foreach($airport_country_array as $airport_item) |
|
38 | + foreach ($airport_country_array as $airport_item) |
|
39 | 39 | { |
40 | 40 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
41 | 41 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | print '</thead>'; |
70 | 70 | print '<tbody>'; |
71 | 71 | $i = 1; |
72 | - foreach($airport_country_array as $airport_item) |
|
72 | + foreach ($airport_country_array as $airport_item) |
|
73 | 73 | { |
74 | 74 | print '<tr>'; |
75 | 75 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['ident'])) { |
6 | - header('Location: '.$globalURL.'/ident'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/ident'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |