@@ -63,7 +63,10 @@ |
||
63 | 63 | imagedestroy($image); |
64 | 64 | } else { |
65 | 65 | header('Content-type: image/png'); |
66 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
67 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
68 | -} |
|
66 | + if ($color == 'FF0000') { |
|
67 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
68 | + } else { |
|
69 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
70 | + } |
|
71 | + } |
|
69 | 72 | ?> |
70 | 73 | \ No newline at end of file |
@@ -4,66 +4,66 @@ |
||
4 | 4 | $hex = str_replace("#", "", $hex); |
5 | 5 | $color = array(); |
6 | 6 | if (strlen($hex) == 3) { |
7 | - $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
8 | - $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
9 | - $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
7 | + $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
8 | + $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
9 | + $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
10 | 10 | } else if (strlen($hex) == 6) { |
11 | - $color['r'] = hexdec(substr($hex, 0, 2)); |
|
12 | - $color['g'] = hexdec(substr($hex, 2, 2)); |
|
13 | - $color['b'] = hexdec(substr($hex, 4, 2)); |
|
11 | + $color['r'] = hexdec(substr($hex, 0, 2)); |
|
12 | + $color['g'] = hexdec(substr($hex, 2, 2)); |
|
13 | + $color['b'] = hexdec(substr($hex, 4, 2)); |
|
14 | 14 | } |
15 | 15 | return $color; |
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | 19 | if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { |
20 | - exit(0); |
|
20 | + exit(0); |
|
21 | 21 | } |
22 | 22 | $color = $_GET['color']; |
23 | 23 | if (!isset($_GET['filename']) || !preg_match('/^[a-z0-9-_]+\.png$/', strtolower($_GET['filename']))) { |
24 | - echo "Incorrect filename"; |
|
25 | - exit(0); |
|
24 | + echo "Incorrect filename"; |
|
25 | + exit(0); |
|
26 | 26 | } |
27 | 27 | $filename = $_GET['filename']; |
28 | 28 | if (file_exists(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename)) { |
29 | - header('Content-type: image/png'); |
|
30 | - readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename); |
|
31 | - exit(0); |
|
29 | + header('Content-type: image/png'); |
|
30 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename); |
|
31 | + exit(0); |
|
32 | 32 | } |
33 | 33 | $original = dirname(__FILE__).DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'aircrafts'.DIRECTORY_SEPARATOR.'new'.DIRECTORY_SEPARATOR.$filename; |
34 | 34 | if (!file_exists($original)) { |
35 | - echo "File not found"; |
|
35 | + echo "File not found"; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | if (extension_loaded('gd') && function_exists('gd_info')) { |
39 | - $image = imagecreatefrompng($original); |
|
40 | - $index = imagecolorexact($image,26,49,81); |
|
41 | - if ($index < 0) { |
|
39 | + $image = imagecreatefrompng($original); |
|
40 | + $index = imagecolorexact($image,26,49,81); |
|
41 | + if ($index < 0) { |
|
42 | 42 | $index = imagecolorexact($image,25,49,79); |
43 | - } |
|
44 | - if ($index < 0) { |
|
43 | + } |
|
44 | + if ($index < 0) { |
|
45 | 45 | $index = imagecolorexact($image,0,0,0); |
46 | - } |
|
47 | - $c = hexToRGB($color); |
|
48 | - imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
46 | + } |
|
47 | + $c = hexToRGB($color); |
|
48 | + imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
49 | 49 | /* |
50 | 50 | $ig = imagecolorat($image, 0, 0); |
51 | 51 | imagecolortransparent($image, $ig); |
52 | 52 | */ |
53 | 53 | |
54 | 54 | |
55 | - header('Content-type: image/png'); |
|
56 | - imagealphablending($image, false); |
|
57 | - imagesavealpha($image, true); |
|
58 | - imagepng($image); |
|
59 | - if (is_writable('cache')) { |
|
60 | - imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
61 | - } |
|
55 | + header('Content-type: image/png'); |
|
56 | + imagealphablending($image, false); |
|
57 | + imagesavealpha($image, true); |
|
58 | + imagepng($image); |
|
59 | + if (is_writable('cache')) { |
|
60 | + imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
61 | + } |
|
62 | 62 | |
63 | - imagedestroy($image); |
|
63 | + imagedestroy($image); |
|
64 | 64 | } else { |
65 | - header('Content-type: image/png'); |
|
66 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
67 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
65 | + header('Content-type: image/png'); |
|
66 | + if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
67 | + else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
68 | 68 | } |
69 | 69 | ?> |
70 | 70 | \ No newline at end of file |
@@ -4,9 +4,9 @@ discard block |
||
4 | 4 | $hex = str_replace("#", "", $hex); |
5 | 5 | $color = array(); |
6 | 6 | if (strlen($hex) == 3) { |
7 | - $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
8 | - $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
9 | - $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
7 | + $color['r'] = hexdec(substr($hex, 0, 1).substr($hex, 0, 1)); |
|
8 | + $color['g'] = hexdec(substr($hex, 1, 1).substr($hex, 1, 1)); |
|
9 | + $color['b'] = hexdec(substr($hex, 2, 1).substr($hex, 2, 1)); |
|
10 | 10 | } else if (strlen($hex) == 6) { |
11 | 11 | $color['r'] = hexdec(substr($hex, 0, 2)); |
12 | 12 | $color['g'] = hexdec(substr($hex, 2, 2)); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | -if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { |
|
19 | +if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/', $_GET['color'])) { |
|
20 | 20 | exit(0); |
21 | 21 | } |
22 | 22 | $color = $_GET['color']; |
@@ -37,15 +37,15 @@ discard block |
||
37 | 37 | |
38 | 38 | if (extension_loaded('gd') && function_exists('gd_info')) { |
39 | 39 | $image = imagecreatefrompng($original); |
40 | - $index = imagecolorexact($image,26,49,81); |
|
40 | + $index = imagecolorexact($image, 26, 49, 81); |
|
41 | 41 | if ($index < 0) { |
42 | - $index = imagecolorexact($image,25,49,79); |
|
42 | + $index = imagecolorexact($image, 25, 49, 79); |
|
43 | 43 | } |
44 | 44 | if ($index < 0) { |
45 | - $index = imagecolorexact($image,0,0,0); |
|
45 | + $index = imagecolorexact($image, 0, 0, 0); |
|
46 | 46 | } |
47 | 47 | $c = hexToRGB($color); |
48 | - imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
48 | + imagecolorset($image, $index, $c['r'], $c['g'], $c['b']); |
|
49 | 49 | /* |
50 | 50 | $ig = imagecolorat($image, 0, 0); |
51 | 51 | imagecolortransparent($image, $ig); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | imagesavealpha($image, true); |
58 | 58 | imagepng($image); |
59 | 59 | if (is_writable('cache')) { |
60 | - imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
60 | + imagepng($image, dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | imagedestroy($image); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | $output = '{'; |
11 | 11 | $output .= '"flights": ['; |
12 | 12 | if (!empty($spotter_array)) { |
13 | - foreach($spotter_array as $spotter_item) |
|
13 | + foreach ($spotter_array as $spotter_item) |
|
14 | 14 | { |
15 | 15 | $output .= '{'; |
16 | 16 | $output .= '"flight_id": "'.$spotter_item['spotter_id'].'",'; |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['departure_airport']) || !isset($_GET['arrival_airport'])){ |
|
6 | +if (!isset($_GET['departure_airport']) || !isset($_GET['arrival_airport'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit'])) |
|
11 | + if (!isset($_GET['limit'])) |
|
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,8 +27,8 @@ discard block |
||
27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference; |
28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference; |
29 | 29 | |
30 | - $departure_airport = filter_input(INPUT_POST,'departure_airport',FILTER_SANITIZE_STRING); |
|
31 | - $arrival_airport = filter_input(INPUT_POST,'arrival_airport',FILTER_SANITIZE_STRING); |
|
30 | + $departure_airport = filter_input(INPUT_POST, 'departure_airport', FILTER_SANITIZE_STRING); |
|
31 | + $arrival_airport = filter_input(INPUT_POST, 'arrival_airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/route/'.$departure_airport.'/'.$arrival_airport; |
33 | 33 | |
34 | 34 | if (isset($_GET['sort'])) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | if (!empty($spotter_array)) |
41 | 41 | { |
42 | - $title = sprintf(_("Detailed View for flights between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
42 | + $title = sprintf(_("Detailed View for flights between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
43 | 43 | require_once('header.php'); |
44 | 44 | print '<div class="info column">'; |
45 | 45 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | include('route-sub-menu.php'); |
51 | 51 | print '<div class="table column">'; |
52 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights that used the route <strong>%s - %s</strong>."),$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['arrival_airport_icao']).'</p>'; |
|
52 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights that used the route <strong>%s - %s</strong>."), $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['arrival_airport_icao']).'</p>'; |
|
53 | 53 | |
54 | 54 | include('table-output.php'); |
55 | 55 | print '<div class="pagination">'; |
@@ -13,7 +13,7 @@ |
||
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]; |
@@ -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 Routes of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Routes 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 Routes").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | |
29 | 29 | $route_array = $Spotter->countAllRoutesByIdent($ident); |
30 | 30 | if (!empty($route_array)) |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | print '</thead>'; |
42 | 42 | print '<tbody>'; |
43 | 43 | $i = 1; |
44 | - foreach($route_array as $route_item) |
|
44 | + foreach ($route_array as $route_item) |
|
45 | 45 | { |
46 | 46 | print '<tr>'; |
47 | 47 | 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); |
@@ -6,14 +6,14 @@ discard block |
||
6 | 6 | header('Location: '.$globalURL.'/airport'); |
7 | 7 | die(); |
8 | 8 | } |
9 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
9 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
10 | 10 | $Spotter = new Spotter(); |
11 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
11 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
12 | 12 | $airport_array = $Spotter->getAllAirportInfo($airport); |
13 | 13 | |
14 | 14 | if (!empty($airport_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Arrival Airports by Country from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
16 | + $title = sprintf(_("Most Common Arrival Airports by Country from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="select-item">'; |
19 | 19 | print '<form action="'.$globalURL.'/airport" method="post">'; |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | print '<option></option>'; |
22 | 22 | $airport_names = $Spotter->getAllAirportNames(); |
23 | 23 | ksort($airport_names); |
24 | - foreach($airport_names as $airport_name) |
|
24 | + foreach ($airport_names as $airport_name) |
|
25 | 25 | { |
26 | - if($airport == $airport_name['airport_icao']) |
|
26 | + if ($airport == $airport_name['airport_icao']) |
|
27 | 27 | { |
28 | 28 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
29 | 29 | } else { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | include('airport-sub-menu.php'); |
55 | 55 | print '<div class="column">'; |
56 | 56 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
57 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
57 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
58 | 58 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByAirport($airport); |
59 | 59 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
60 | 60 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | var data = google.visualization.arrayToDataTable([ |
66 | 66 | ["'._("Country").'", "'._("# of times").'"], '; |
67 | 67 | $country_data = ''; |
68 | - foreach($airport_country_array as $airport_item) |
|
68 | + foreach ($airport_country_array as $airport_item) |
|
69 | 69 | { |
70 | 70 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
71 | 71 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | print '</thead>'; |
100 | 100 | print '<tbody>'; |
101 | 101 | $i = 1; |
102 | - foreach($airport_country_array as $airport_item) |
|
102 | + foreach ($airport_country_array as $airport_item) |
|
103 | 103 | { |
104 | 104 | print '<tr>'; |
105 | 105 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['airport'])) { |
6 | - header('Location: '.$globalURL.'/airport'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/airport'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
10 | 10 | $Spotter = new Spotter(); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | function drawChart() { |
66 | 66 | var data = google.visualization.arrayToDataTable([ |
67 | 67 | ["'._("Country").'", "'._("# of times").'"], '; |
68 | - $country_data = ''; |
|
68 | + $country_data = ''; |
|
69 | 69 | foreach($airport_country_array as $airport_item) |
70 | 70 | { |
71 | 71 | $country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],'; |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'], "0,1", $sort); |
|
8 | 8 | else $spotter_array = array(); |
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Aircraft on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Aircraft on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | require_once('header.php'); |
14 | 14 | print '<div class="select-item">'; |
15 | 15 | print '<form action="'.$globalURL.'/date" method="post">'; |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | print '</div>'; |
21 | 21 | |
22 | 22 | print '<div class="info column">'; |
23 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
23 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
24 | 24 | print '</div>'; |
25 | 25 | |
26 | 26 | include('date-sub-menu.php'); |
27 | 27 | print '<div class="column">'; |
28 | 28 | print '<h2>'._("Most Common Aircraft").'</h2>'; |
29 | - print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
29 | + print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
30 | 30 | |
31 | 31 | $aircraft_array = $Spotter->countAllAircraftTypesByDate($_GET['date']); |
32 | 32 | if (!empty($aircraft_array)) |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | print '</thead>'; |
42 | 42 | print '<tbody>'; |
43 | 43 | $i = 1; |
44 | - foreach($aircraft_array as $aircraft_item) |
|
44 | + foreach ($aircraft_array as $aircraft_item) |
|
45 | 45 | { |
46 | 46 | print '<tr>'; |
47 | 47 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,11 @@ |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
7 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
8 | -else $spotter_array = array(); |
|
7 | +if (isset($_GET['date'])) { |
|
8 | + $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
9 | +} else { |
|
10 | + $spotter_array = array(); |
|
11 | +} |
|
9 | 12 | |
10 | 13 | if (!empty($spotter_array)) |
11 | 14 | { |
@@ -75,46 +75,46 @@ discard block |
||
75 | 75 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
76 | 76 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
77 | 77 | <?php |
78 | - if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
|
78 | + if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
|
79 | 79 | ?> |
80 | 80 | <script src="http://maps.google.com/maps/api/js?v=3&key=<?php print $globalGoogleAPIKey; ?>"></script> |
81 | 81 | <script src="<?php print $globalURL; ?>/js/leaflet-Google.js"></script> |
82 | 82 | <?php |
83 | - } |
|
83 | + } |
|
84 | 84 | ?> |
85 | 85 | <?php |
86 | - if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
86 | + if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
87 | 87 | ?> |
88 | 88 | <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise"></script> |
89 | 89 | <script src="<?php print $globalURL; ?>/js/leaflet-Bing.js"></script> |
90 | 90 | <?php |
91 | - } |
|
91 | + } |
|
92 | 92 | ?> |
93 | 93 | <?php |
94 | - if (isset($globalMapQuestKey) && $globalMapQuestKey != '' && ($MapType == 'MapQuest-OSM' || $MapType == 'MapQuest-Roadmap' || $MapType == 'MapQuest-Aerial')) { |
|
94 | + if (isset($globalMapQuestKey) && $globalMapQuestKey != '' && ($MapType == 'MapQuest-OSM' || $MapType == 'MapQuest-Roadmap' || $MapType == 'MapQuest-Aerial')) { |
|
95 | 95 | ?> |
96 | 96 | <!--<script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=<?php print $globalMapQuestKey; ?>"></script>--> |
97 | 97 | <script src="https://open.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=<?php print $globalMapQuestKey; ?>"></script> |
98 | 98 | <?php |
99 | - } |
|
99 | + } |
|
100 | 100 | ?> |
101 | 101 | <?php |
102 | - if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
102 | + if (isset($globalHereappId) && $globalHereappId != '' && isset($globalHereappCode) && $globalHereappCode != '') { |
|
103 | 103 | ?> |
104 | 104 | <script src="<?php print $globalURL; ?>/js/leaflet-Here.js"></script> |
105 | 105 | <?php |
106 | - } |
|
106 | + } |
|
107 | 107 | ?> |
108 | 108 | <?php |
109 | - if ($MapType == 'Yandex') { |
|
109 | + if ($MapType == 'Yandex') { |
|
110 | 110 | ?> |
111 | 111 | <script src="http://api-maps.yandex.ru/2.0/?load=package.map&lang=en_US" type="text/javascript"></script> |
112 | 112 | <script src="<?php print $globalURL; ?>/js/leaflet-Yandex.js"></script> |
113 | 113 | <?php |
114 | - } |
|
114 | + } |
|
115 | 115 | ?> |
116 | 116 | <?php |
117 | - if (isset($_POST['archive'])) { |
|
117 | + if (isset($_POST['archive'])) { |
|
118 | 118 | ?> |
119 | 119 | <?php |
120 | 120 | if (isset($globalBeta) && $globalBeta) { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | ?> |
132 | 132 | <?php |
133 | - } else { |
|
133 | + } else { |
|
134 | 134 | ?> |
135 | 135 | <?php |
136 | 136 | if (isset($globalBeta) && $globalBeta) { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | ?> |
147 | 147 | <?php |
148 | - } |
|
148 | + } |
|
149 | 149 | } |
150 | 150 | ?> |
151 | 151 | <?php |
@@ -229,23 +229,23 @@ discard block |
||
229 | 229 | <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li> |
230 | 230 | <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li> |
231 | 231 | <?php |
232 | - if ($globalACARS) { |
|
233 | - if (isset($globalDemo) && $globalDemo) { |
|
234 | - ?> |
|
232 | + if ($globalACARS) { |
|
233 | + if (isset($globalDemo) && $globalDemo) { |
|
234 | + ?> |
|
235 | 235 | <li><hr /></li> |
236 | 236 | <li><i>_('ACARS data not available publicly'); ?></i></li> |
237 | 237 | <li><a href="">_('Latest ACARS messages'); ?></a></li> |
238 | 238 | <li><a href="">_('Archive ACARS messages'); ?></a></li> |
239 | 239 | <?php |
240 | - } else { |
|
241 | - ?> |
|
240 | + } else { |
|
241 | + ?> |
|
242 | 242 | <li><hr /></li> |
243 | 243 | <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li> |
244 | 244 | <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li> |
245 | 245 | <?php |
246 | - } |
|
247 | - } |
|
248 | - ?> |
|
246 | + } |
|
247 | + } |
|
248 | + ?> |
|
249 | 249 | <li><hr /></li> |
250 | 250 | <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li> |
251 | 251 | <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li> |
@@ -287,14 +287,14 @@ discard block |
||
287 | 287 | <form> |
288 | 288 | <select class="selectpicker" data-width="120px" onchange="language(this);"> |
289 | 289 | <?php |
290 | - $Language = new Language(); |
|
291 | - $alllang = $Language->getLanguages(); |
|
292 | - foreach ($alllang as $key => $lang) { |
|
293 | - print '<option value="'.$key.'"'; |
|
294 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
295 | - print '>'.$lang[0].'</option>'; |
|
296 | - } |
|
297 | - ?> |
|
290 | + $Language = new Language(); |
|
291 | + $alllang = $Language->getLanguages(); |
|
292 | + foreach ($alllang as $key => $lang) { |
|
293 | + print '<option value="'.$key.'"'; |
|
294 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
295 | + print '>'.$lang[0].'</option>'; |
|
296 | + } |
|
297 | + ?> |
|
298 | 298 | </select> |
299 | 299 | </form> |
300 | 300 | </div> |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | } |
331 | 331 | if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
332 | 332 | { |
333 | - ?> |
|
333 | + ?> |
|
334 | 334 | <div class="top-header clear" role="main"> |
335 | 335 | <div id="map"></div> |
336 | 336 | <link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" /> |
@@ -341,15 +341,15 @@ discard block |
||
341 | 341 | var zoom = 13; |
342 | 342 | //create the map |
343 | 343 | <?php |
344 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
344 | + if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
345 | 345 | ?> |
346 | 346 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
347 | 347 | <?php |
348 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
348 | + } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
349 | 349 | ?> |
350 | 350 | map = L.map('map', { zoomControl:true }); |
351 | 351 | <?php |
352 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
352 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
353 | 353 | ?> |
354 | 354 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
355 | 355 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -357,22 +357,22 @@ discard block |
||
357 | 357 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
358 | 358 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
359 | 359 | <?php |
360 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
360 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
361 | 361 | ?> |
362 | 362 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
363 | 363 | <?php |
364 | - } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
364 | + } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
365 | 365 | ?> |
366 | 366 | map = L.map('map', { zoomControl:true }); |
367 | 367 | <?php |
368 | - } |
|
368 | + } |
|
369 | 369 | ?> |
370 | 370 | //initialize the layer group for the aircrft markers |
371 | 371 | var layer_data = L.layerGroup(); |
372 | 372 | |
373 | 373 | //a few title layers |
374 | 374 | <?php |
375 | - if ($globalMapProvider == 'Mapbox') { |
|
375 | + if ($globalMapProvider == 'Mapbox') { |
|
376 | 376 | ?> |
377 | 377 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
378 | 378 | maxZoom: 18, |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | token : '<?php print $globalMapboxToken; ?>' |
384 | 384 | }).addTo(map); |
385 | 385 | <?php |
386 | - } elseif ($globalMapProvider == 'OpenStreetMap') { |
|
386 | + } elseif ($globalMapProvider == 'OpenStreetMap') { |
|
387 | 387 | ?> |
388 | 388 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
389 | 389 | maxZoom: 18, |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | '<a href="http://www.openstreetmap.org/copyright">Open Database Licence</a>' |
392 | 392 | }).addTo(map); |
393 | 393 | <?php |
394 | - } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
394 | + } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
395 | 395 | ?> |
396 | 396 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', { |
397 | 397 | maxZoom: 18, |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>' |
401 | 401 | }).addTo(map); |
402 | 402 | <?php |
403 | - } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
403 | + } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
404 | 404 | ?> |
405 | 405 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', { |
406 | 406 | maxZoom: 18, |
@@ -409,27 +409,27 @@ discard block |
||
409 | 409 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"' |
410 | 410 | }).addTo(map); |
411 | 411 | <?php |
412 | - } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
412 | + } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
413 | 413 | ?> |
414 | 414 | var googleLayer = new L.Google('ROADMAP'); |
415 | 415 | map.addLayer(googleLayer); |
416 | 416 | <?php |
417 | - } elseif ($globalMapProvider == 'Google-Satellite') { |
|
417 | + } elseif ($globalMapProvider == 'Google-Satellite') { |
|
418 | 418 | ?> |
419 | 419 | var googleLayer = new L.Google('SATELLITE'); |
420 | 420 | map.addLayer(googleLayer); |
421 | 421 | <?php |
422 | - } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
422 | + } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
423 | 423 | ?> |
424 | 424 | var googleLayer = new L.Google('HYBRID'); |
425 | 425 | map.addLayer(googleLayer); |
426 | 426 | <?php |
427 | - } elseif ($globalMapProvider == 'Google-Terrain') { |
|
427 | + } elseif ($globalMapProvider == 'Google-Terrain') { |
|
428 | 428 | ?> |
429 | 429 | var googleLayer = new L.Google('Terrain'); |
430 | 430 | map.addLayer(googleLayer); |
431 | 431 | <?php |
432 | - } |
|
432 | + } |
|
433 | 433 | ?> |
434 | 434 | </script> |
435 | 435 | </div> |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
164 | 164 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
165 | 165 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
166 | -<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
166 | +<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
167 | 167 | <?php |
168 | 168 | } |
169 | 169 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
180 | 180 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
181 | 181 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
182 | -<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
182 | +<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
183 | 183 | <?php |
184 | 184 | } |
185 | 185 | ?> |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | ?> |
304 | 304 | <div class="search"> |
305 | 305 | <form action="<?php print $globalURL; ?>/search" method="get"> |
306 | - <input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != ""){ print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button> |
|
306 | + <input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != "") { print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button> |
|
307 | 307 | </form> |
308 | 308 | </div> |
309 | 309 | <div class="social"> |
@@ -321,14 +321,14 @@ discard block |
||
321 | 321 | print '</div>'; |
322 | 322 | } |
323 | 323 | |
324 | -if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
324 | +if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
325 | 325 | ?> |
326 | 326 | <div class="top-header clear" role="main"> |
327 | 327 | <div id="archive-map"></div> |
328 | 328 | </div> |
329 | 329 | <?php |
330 | 330 | } |
331 | -if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
|
331 | +if ((strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) || (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false)) |
|
332 | 332 | { |
333 | 333 | ?> |
334 | 334 | <div class="top-header clear" role="main"> |
@@ -341,15 +341,15 @@ discard block |
||
341 | 341 | var zoom = 13; |
342 | 342 | //create the map |
343 | 343 | <?php |
344 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
344 | + if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
345 | 345 | ?> |
346 | 346 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
347 | 347 | <?php |
348 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
348 | + } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) { |
|
349 | 349 | ?> |
350 | 350 | map = L.map('map', { zoomControl:true }); |
351 | 351 | <?php |
352 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
352 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
353 | 353 | ?> |
354 | 354 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
355 | 355 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
358 | 358 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
359 | 359 | <?php |
360 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
360 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
361 | 361 | ?> |
362 | 362 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
363 | 363 | <?php |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
6 | 6 | $current_page = $file_path['filename']; |
7 | 7 | date_default_timezone_set($globalTimezone); |
8 | -if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
9 | -else $MapType = $globalMapProvider; |
|
8 | +if (isset($_COOKIE['MapType'])) { |
|
9 | + $MapType = $_COOKIE['MapType']; |
|
10 | +} else { |
|
11 | + $MapType = $globalMapProvider; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | <!DOCTYPE html> |
12 | 15 | <html> |
@@ -163,7 +166,13 @@ discard block |
||
163 | 166 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
164 | 167 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
165 | 168 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
166 | -<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
169 | +<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
170 | + print '&latitude='.$latitude; |
|
171 | +} |
|
172 | +?><?php if(isset($longitude)) { |
|
173 | + print '&longitude='.$longitude; |
|
174 | +} |
|
175 | +?>&<?php print time(); ?>"></script> |
|
167 | 176 | <?php |
168 | 177 | } |
169 | 178 | |
@@ -179,7 +188,13 @@ discard block |
||
179 | 188 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
180 | 189 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
181 | 190 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
182 | -<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
191 | +<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
192 | + print '&latitude='.$latitude; |
|
193 | +} |
|
194 | +?><?php if(isset($longitude)) { |
|
195 | + print '&longitude='.$longitude; |
|
196 | +} |
|
197 | +?>&<?php print time(); ?>"></script> |
|
183 | 198 | <?php |
184 | 199 | } |
185 | 200 | ?> |
@@ -213,7 +228,12 @@ discard block |
||
213 | 228 | <span class="icon-bar"></span> |
214 | 229 | </button> |
215 | 230 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a> |
216 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
231 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
232 | + print '/'; |
|
233 | +} else { |
|
234 | + print $globalURL; |
|
235 | +} |
|
236 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
217 | 237 | </div> |
218 | 238 | <div class="collapse navbar-collapse"> |
219 | 239 | <ul class="nav navbar-nav"> |
@@ -291,7 +311,9 @@ discard block |
||
291 | 311 | $alllang = $Language->getLanguages(); |
292 | 312 | foreach ($alllang as $key => $lang) { |
293 | 313 | print '<option value="'.$key.'"'; |
294 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
314 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
315 | + print ' selected '; |
|
316 | + } |
|
295 | 317 | print '>'.$lang[0].'</option>'; |
296 | 318 | } |
297 | 319 | ?> |
@@ -438,4 +460,7 @@ discard block |
||
438 | 460 | |
439 | 461 | ?> |
440 | 462 | |
441 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
463 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
464 | + print 'index '; |
|
465 | +} |
|
466 | +?>clear"> |
@@ -4,55 +4,55 @@ |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | - //for the date manipulation into the query |
|
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
9 | - $start_date = $_GET['start_date'].":00"; |
|
10 | - $end_date = $_GET['end_date'].":00"; |
|
11 | - $sql_date = $start_date.",".$end_date; |
|
12 | - } else if($_GET['start_date'] != ""){ |
|
13 | - $start_date = $_GET['start_date'].":00"; |
|
14 | - $sql_date = $start_date; |
|
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
16 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
17 | - $sql_date = $end_date; |
|
18 | - } else $sql_date = ''; |
|
7 | + //for the date manipulation into the query |
|
8 | + if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
9 | + $start_date = $_GET['start_date'].":00"; |
|
10 | + $end_date = $_GET['end_date'].":00"; |
|
11 | + $sql_date = $start_date.",".$end_date; |
|
12 | + } else if($_GET['start_date'] != ""){ |
|
13 | + $start_date = $_GET['start_date'].":00"; |
|
14 | + $sql_date = $start_date; |
|
15 | + } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
16 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
17 | + $sql_date = $end_date; |
|
18 | + } else $sql_date = ''; |
|
19 | 19 | } else $sql_date = ''; |
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | - //for altitude manipulation |
|
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | - $end_altitude = $_GET['highest_altitude']; |
|
25 | - $start_altitude = $_GET['lowest_altitude']; |
|
26 | - $sql_altitude = $start_altitude.",".$end_altitude; |
|
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
28 | - $end_altitude = $_GET['highest_altitude']; |
|
29 | - $sql_altitude = $end_altitude; |
|
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | - $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
32 | - $sql_altitude = $start_altitude; |
|
33 | - } else $sql_altitude = ''; |
|
22 | + //for altitude manipulation |
|
23 | + if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | + $end_altitude = $_GET['highest_altitude']; |
|
25 | + $start_altitude = $_GET['lowest_altitude']; |
|
26 | + $sql_altitude = $start_altitude.",".$end_altitude; |
|
27 | + } else if($_GET['highest_altitude'] != ""){ |
|
28 | + $end_altitude = $_GET['highest_altitude']; |
|
29 | + $sql_altitude = $end_altitude; |
|
30 | + } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | + $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
32 | + $sql_altitude = $start_altitude; |
|
33 | + } else $sql_altitude = ''; |
|
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | 37 | if(!isset($_GET['limit'])) |
38 | 38 | { |
39 | - if (!isset($_GET['number_results'])) |
|
40 | - { |
|
41 | - $limit_start = 0; |
|
42 | - $limit_end = 25; |
|
43 | - $absolute_difference = 25; |
|
44 | - } else { |
|
45 | - if ($_GET['number_results'] > 1000){ |
|
46 | - $_GET['number_results'] = 1000; |
|
47 | - } |
|
48 | - $limit_start = 0; |
|
49 | - $limit_end = $_GET['number_results']; |
|
50 | - $absolute_difference = $_GET['number_results']; |
|
51 | - } |
|
39 | + if (!isset($_GET['number_results'])) |
|
40 | + { |
|
41 | + $limit_start = 0; |
|
42 | + $limit_end = 25; |
|
43 | + $absolute_difference = 25; |
|
44 | + } else { |
|
45 | + if ($_GET['number_results'] > 1000){ |
|
46 | + $_GET['number_results'] = 1000; |
|
47 | + } |
|
48 | + $limit_start = 0; |
|
49 | + $limit_end = $_GET['number_results']; |
|
50 | + $absolute_difference = $_GET['number_results']; |
|
51 | + } |
|
52 | 52 | } else { |
53 | - $limit_explode = explode(",", $_GET['limit']); |
|
54 | - $limit_start = $limit_explode[0]; |
|
55 | - $limit_end = $limit_explode[1]; |
|
53 | + $limit_explode = explode(",", $_GET['limit']); |
|
54 | + $limit_start = $limit_explode[0]; |
|
55 | + $limit_end = $limit_explode[1]; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | 7 | //for the date manipulation into the query |
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
9 | 9 | $start_date = $_GET['start_date'].":00"; |
10 | 10 | $end_date = $_GET['end_date'].":00"; |
11 | 11 | $sql_date = $start_date.",".$end_date; |
12 | - } else if($_GET['start_date'] != ""){ |
|
12 | + } else if ($_GET['start_date'] != "") { |
|
13 | 13 | $start_date = $_GET['start_date'].":00"; |
14 | 14 | $sql_date = $start_date; |
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | 18 | } else $sql_date = ''; |
@@ -20,21 +20,21 @@ discard block |
||
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | 22 | //for altitude manipulation |
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
24 | 24 | $end_altitude = $_GET['highest_altitude']; |
25 | 25 | $start_altitude = $_GET['lowest_altitude']; |
26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
27 | + } else if ($_GET['highest_altitude'] != "") { |
|
28 | 28 | $end_altitude = $_GET['highest_altitude']; |
29 | 29 | $sql_altitude = $end_altitude; |
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
31 | 31 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
32 | 32 | $sql_altitude = $start_altitude; |
33 | 33 | } else $sql_altitude = ''; |
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | -if(!isset($_GET['limit'])) |
|
37 | +if (!isset($_GET['limit'])) |
|
38 | 38 | { |
39 | 39 | if (!isset($_GET['number_results'])) |
40 | 40 | { |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | $limit_end = 25; |
43 | 43 | $absolute_difference = 25; |
44 | 44 | } else { |
45 | - if ($_GET['number_results'] > 1000){ |
|
45 | + if ($_GET['number_results'] > 1000) { |
|
46 | 46 | $_GET['number_results'] = 1000; |
47 | 47 | } |
48 | 48 | $limit_start = 0; |
49 | 49 | $limit_end = $_GET['number_results']; |
50 | 50 | $absolute_difference = $_GET['number_results']; |
51 | 51 | } |
52 | -} else { |
|
52 | +} else { |
|
53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
54 | 54 | $limit_start = $limit_explode[0]; |
55 | 55 | $limit_end = $limit_explode[1]; |
@@ -69,30 +69,30 @@ discard block |
||
69 | 69 | |
70 | 70 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
71 | 71 | else $sort = ''; |
72 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
73 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
74 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
75 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
76 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
77 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
78 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
79 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
80 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
81 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
82 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
83 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
84 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
85 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
86 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
87 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
88 | -$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,''); |
|
72 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
73 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
74 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
75 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
76 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
77 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
78 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
79 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
80 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
81 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
82 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
83 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
84 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
85 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
86 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
87 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
88 | +$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, ''); |
|
89 | 89 | |
90 | 90 | $i = 1; |
91 | 91 | //$output .= "oid;Line\n"; |
92 | 92 | $output = ''; |
93 | 93 | if (!empty($spotter_array)) |
94 | 94 | { |
95 | - foreach($spotter_array as $spotter_item) |
|
95 | + foreach ($spotter_array as $spotter_item) |
|
96 | 96 | { |
97 | 97 | if ($spotter_item['waypoints'] != '') { |
98 | 98 | $waypoint_pieces = explode(' ', $spotter_item['waypoints']); |
@@ -15,8 +15,12 @@ discard block |
||
15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | - } else $sql_date = ''; |
|
19 | -} else $sql_date = ''; |
|
18 | + } else { |
|
19 | + $sql_date = ''; |
|
20 | + } |
|
21 | + } else { |
|
22 | + $sql_date = ''; |
|
23 | +} |
|
20 | 24 | |
21 | 25 | if (isset($_GET['highest_altitude'])) { |
22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
31 | 35 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
32 | 36 | $sql_altitude = $start_altitude; |
33 | - } else $sql_altitude = ''; |
|
34 | -} else $sql_altitude = ''; |
|
37 | + } else { |
|
38 | + $sql_altitude = ''; |
|
39 | + } |
|
40 | + } else { |
|
41 | + $sql_altitude = ''; |
|
42 | +} |
|
35 | 43 | |
36 | 44 | //calculuation for the pagination |
37 | 45 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
49 | 57 | $limit_end = $_GET['number_results']; |
50 | 58 | $absolute_difference = $_GET['number_results']; |
51 | 59 | } |
52 | -} else { |
|
60 | +} else { |
|
53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
54 | 62 | $limit_start = $limit_explode[0]; |
55 | 63 | $limit_end = $limit_explode[1]; |
@@ -67,8 +75,11 @@ discard block |
||
67 | 75 | |
68 | 76 | header("Content-type: text/yaml"); |
69 | 77 | |
70 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
71 | -else $sort = ''; |
|
78 | +if (isset($_GET['sort'])) { |
|
79 | + $sort = $_GET['sort']; |
|
80 | +} else { |
|
81 | + $sort = ''; |
|
82 | +} |
|
72 | 83 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
73 | 84 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
74 | 85 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -6,14 +6,14 @@ discard block |
||
6 | 6 | header('Location: '.$globalURL.'/airport'); |
7 | 7 | die(); |
8 | 8 | } |
9 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
9 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
10 | 10 | $Spotter = new Spotter(); |
11 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
11 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
12 | 12 | $airport_array = $Spotter->getAllAirportInfo($airport); |
13 | 13 | |
14 | 14 | if (!empty($airport_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Routes to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
16 | + $title = sprintf(_("Most Common Routes to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
17 | 17 | |
18 | 18 | require_once('header.php'); |
19 | 19 | print '<div class="select-item">'; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | print '<option></option>'; |
23 | 23 | $airport_names = $Spotter->getAllAirportNames(); |
24 | 24 | ksort($airport_names); |
25 | - foreach($airport_names as $airport_name) |
|
25 | + foreach ($airport_names as $airport_name) |
|
26 | 26 | { |
27 | - if($airport == $airport_name['airport_icao']) |
|
27 | + if ($airport == $airport_name['airport_icao']) |
|
28 | 28 | { |
29 | 29 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
30 | 30 | } else { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | print '<div><span class="label">'._("ICAO").'</span>'.$airport_array[0]['icao'].'</div>'; |
47 | 47 | print '<div><span class="label">'._("IATA").'</span>'.$airport_array[0]['iata'].'</div>'; |
48 | 48 | print '<div><span class="label">'._("Altitude").'</span>'.$airport_array[0]['altitude'].'</div>'; |
49 | - print '<div><span class="label">'._("Coordinates");'</span><a href="http://maps.google.ca/maps?z=10&t=k&q='.$airport_array[0]['latitude'].','.$airport_array[0]['longitude'].'" target="_blank">Google Map<i class="fa fa-angle-double-right"></i></a></div>'; |
|
49 | + print '<div><span class="label">'._("Coordinates"); '</span><a href="http://maps.google.ca/maps?z=10&t=k&q='.$airport_array[0]['latitude'].','.$airport_array[0]['longitude'].'" target="_blank">Google Map<i class="fa fa-angle-double-right"></i></a></div>'; |
|
50 | 50 | print '</div>'; |
51 | 51 | } else { |
52 | 52 | print '<div class="alert alert-warning">'._("This special airport profile shows all flights that do <u>not</u> have a departure and/or arrival airport associated with them.").'</div>'; |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | include('airport-sub-menu.php'); |
56 | 56 | print '<div class="column">'; |
57 | - print '<h2>'._("Most Common Routes");'</h2>'; |
|
58 | - print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
57 | + print '<h2>'._("Most Common Routes"); '</h2>'; |
|
58 | + print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
59 | 59 | |
60 | 60 | $route_array = $Spotter->countAllRoutesByAirport($airport); |
61 | 61 | if (!empty($route_array)) |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | print '</thead>'; |
72 | 72 | print '<tbody>'; |
73 | 73 | $i = 1; |
74 | - foreach($route_array as $route_item) |
|
74 | + foreach ($route_array as $route_item) |
|
75 | 75 | { |
76 | 76 | print '<tr>'; |
77 | 77 | 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['airport'])) { |
6 | - header('Location: '.$globalURL.'/airport'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/airport'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
10 | 10 | $Spotter = new Spotter(); |