@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
9 | 9 | if ($airline_icao == 'all') { |
10 | - unset($_COOKIE['stats_airline_icao']); |
|
11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | - $airline_icao = ''; |
|
10 | + unset($_COOKIE['stats_airline_icao']); |
|
11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + $airline_icao = ''; |
|
13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
17 | 17 | } |
18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
19 | 19 |
@@ -6,17 +6,17 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Busiest Month of Last Year"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | 20 | |
21 | 21 | require_once('header.php'); |
22 | 22 | include('statistics-sub-menu.php'); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | </div> |
27 | 27 | <p>'._("Below is a chart that plots the busiest month during the <strong>last year</strong>.").'</p>'; |
28 | 28 | |
29 | -$date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
29 | +$date_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
30 | 30 | print '<div id="chart" class="chart" width="100%"></div> |
31 | 31 | <script> |
32 | 32 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | ["'._("Month").'", "'._("# of Flights").'"], '; |
37 | 37 | |
38 | 38 | $date_data = ''; |
39 | -foreach($date_array as $date_item) |
|
39 | +foreach ($date_array as $date_item) |
|
40 | 40 | { |
41 | 41 | $date_data .= '[ "'.date("F, Y", strtotime($date_item['year_name'].'-'.$date_item['month_name'].'-01')).'",'.$date_item['date_count'].'],'; |
42 | 42 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | print '</thead>'; |
74 | 74 | print '<tbody>'; |
75 | 75 | $i = 1; |
76 | - foreach($date_array as $date_item) |
|
76 | + foreach ($date_array as $date_item) |
|
77 | 77 | { |
78 | 78 | print '<tr>'; |
79 | 79 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Callsign"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | require_once('header.php'); |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
9 | 9 | if ($airline_icao == 'all') { |
10 | - unset($_COOKIE['stats_airline_icao']); |
|
11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | - $airline_icao = ''; |
|
10 | + unset($_COOKIE['stats_airline_icao']); |
|
11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + $airline_icao = ''; |
|
13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
17 | 17 | } |
18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
19 | 19 |
@@ -6,17 +6,17 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Arrival Airport"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | 20 | |
21 | 21 | require_once('header.php'); |
22 | 22 | include('statistics-sub-menu.php'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | </div> |
28 | 28 | <p>'._("Below are the <strong>Top 10</strong> most common arrival airports.").'</p>'; |
29 | 29 | |
30 | -$airport_airport_array = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
30 | +$airport_airport_array = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name); |
|
31 | 31 | print '<script> |
32 | 32 | google.load("visualization", "1", {packages:["geochart"]}); |
33 | 33 | google.setOnLoadCallback(drawCharts); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | ["'._("Airport").'", "'._("# of times").'"],'; |
41 | 41 | |
42 | 42 | $airport_data = ''; |
43 | -foreach($airport_airport_array as $airport_item) |
|
43 | +foreach ($airport_airport_array as $airport_item) |
|
44 | 44 | { |
45 | 45 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
46 | 46 | $name = str_replace("'", "", $name); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | print '</thead>'; |
81 | 81 | print '<tbody>'; |
82 | 82 | $i = 1; |
83 | -foreach($airport_airport_array as $airport_item) |
|
83 | +foreach ($airport_airport_array as $airport_item) |
|
84 | 84 | { |
85 | 85 | print '<tr>'; |
86 | 86 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Callsign"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | require_once('header.php'); |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
9 | 9 | if ($airline_icao == 'all') { |
10 | - unset($_COOKIE['stats_airline_icao']); |
|
11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | - $airline_icao = ''; |
|
10 | + unset($_COOKIE['stats_airline_icao']); |
|
11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + $airline_icao = ''; |
|
13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
17 | 17 | } |
18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
19 | 19 |
@@ -6,17 +6,17 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Callsign"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | 20 | |
21 | 21 | require_once('header.php'); |
22 | 22 | include('statistics-sub-menu.php'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | </div> |
28 | 28 | <p>'._("Below are the <strong>Top 10</strong> most common ident/callsigns of all airlines.").'</p>'; |
29 | 29 | |
30 | -$callsign_array = $Stats->countAllCallsigns(true,$airline_icao,$filter_name); |
|
30 | +$callsign_array = $Stats->countAllCallsigns(true, $airline_icao, $filter_name); |
|
31 | 31 | print '<div id="chart" class="chart" width="100%"></div> |
32 | 32 | <script> |
33 | 33 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | var data = google.visualization.arrayToDataTable([ |
37 | 37 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
38 | 38 | $callsign_data = ''; |
39 | -foreach($callsign_array as $callsign_item) |
|
39 | +foreach ($callsign_array as $callsign_item) |
|
40 | 40 | { |
41 | 41 | $callsign_data .= '[ "'.$callsign_item['callsign_icao'].' ('.$callsign_item['airline_name'].')",'.$callsign_item['callsign_icao_count'].'],'; |
42 | 42 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | print '</thead>'; |
71 | 71 | print '<tbody>'; |
72 | 72 | $i = 1; |
73 | - foreach($callsign_array as $callsign_item) |
|
73 | + foreach ($callsign_array as $callsign_item) |
|
74 | 74 | { |
75 | 75 | print '<tr>'; |
76 | 76 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Callsign"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | require_once('header.php'); |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
9 | 9 | if ($airline_icao == 'all') { |
10 | - unset($_COOKIE['stats_airline_icao']); |
|
11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | - $airline_icao = ''; |
|
10 | + unset($_COOKIE['stats_airline_icao']); |
|
11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + $airline_icao = ''; |
|
13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
17 | 17 | } |
18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
19 | 19 |
@@ -6,17 +6,17 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Departure Airport by Country"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | 20 | |
21 | 21 | require_once('header.php'); |
22 | 22 | include('statistics-sub-menu.php'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | </div> |
28 | 28 | <p>'._("Below are the <strong>Top 10</strong> most common countries of all the departure airports.").'</p>'; |
29 | 29 | |
30 | -$airport_country_array = $Stats->countAllDepartureCountries(true,$airline_icao,$filter_name); |
|
30 | +$airport_country_array = $Stats->countAllDepartureCountries(true, $airline_icao, $filter_name); |
|
31 | 31 | print '<script> |
32 | 32 | google.load("visualization", "1", {packages:["geochart"]}); |
33 | 33 | google.setOnLoadCallback(drawCharts); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | ["'._("Country").'", "'._("# of times").'"],'; |
41 | 41 | |
42 | 42 | $country_data = ''; |
43 | -foreach($airport_country_array as $airport_item) |
|
43 | +foreach ($airport_country_array as $airport_item) |
|
44 | 44 | { |
45 | 45 | $country_data .= '[ "'.$airport_item['airport_departure_country'].'",'.$airport_item['airport_departure_country_count'].'],'; |
46 | 46 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | print '</thead>'; |
76 | 76 | print '<tbody>'; |
77 | 77 | $i = 1; |
78 | -foreach($airport_country_array as $airport_item) |
|
78 | +foreach ($airport_country_array as $airport_item) |
|
79 | 79 | { |
80 | 80 | print '<tr>'; |
81 | 81 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Callsign"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | require_once('header.php'); |
@@ -7,13 +7,13 @@ |
||
7 | 7 | |
8 | 8 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
9 | 9 | if ($airline_icao == 'all') { |
10 | - unset($_COOKIE['stats_airline_icao']); |
|
11 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | - $airline_icao = ''; |
|
10 | + unset($_COOKIE['stats_airline_icao']); |
|
11 | + setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + $airline_icao = ''; |
|
13 | 13 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
14 | - $airline_icao = $_COOKIE['stats_airline_icao']; |
|
14 | + $airline_icao = $_COOKIE['stats_airline_icao']; |
|
15 | 15 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
16 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
16 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
17 | 17 | } |
18 | 18 | setcookie('stats_airline_icao',$airline_icao); |
19 | 19 |
@@ -6,17 +6,17 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Arrival Airport by Country"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == 'all') { |
11 | 11 | unset($_COOKIE['stats_airline_icao']); |
12 | - setcookie('stats_airline_icao', '', time()-3600); |
|
12 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
13 | 13 | $airline_icao = ''; |
14 | 14 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 15 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 16 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | 17 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
18 | 18 | } |
19 | -setcookie('stats_airline_icao',$airline_icao); |
|
19 | +setcookie('stats_airline_icao', $airline_icao); |
|
20 | 20 | |
21 | 21 | require_once('header.php'); |
22 | 22 | include('statistics-sub-menu.php'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | </div> |
28 | 28 | <p>'._("Below are the <strong>Top 10</strong> most common countries of all the arrival airports.").'</p>'; |
29 | 29 | |
30 | -$airport_country_array = $Stats->countAllArrivalCountries(true,$airline_icao,$filter_name); |
|
30 | +$airport_country_array = $Stats->countAllArrivalCountries(true, $airline_icao, $filter_name); |
|
31 | 31 | |
32 | 32 | print '<script> |
33 | 33 | google.load("visualization", "1", {packages:["geochart"]}); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ["'._("Country").'", "'._("# of times").'"],'; |
42 | 42 | |
43 | 43 | $country_data = ''; |
44 | -foreach($airport_country_array as $airport_item) |
|
44 | +foreach ($airport_country_array as $airport_item) |
|
45 | 45 | { |
46 | 46 | $country_data .= '[ "'.$airport_item['airport_arrival_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
47 | 47 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | print '</thead>'; |
77 | 77 | print '<tbody>'; |
78 | 78 | $i = 1; |
79 | -foreach($airport_country_array as $airport_item) |
|
79 | +foreach ($airport_country_array as $airport_item) |
|
80 | 80 | { |
81 | 81 | print '<tr>'; |
82 | 82 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Callsign"); |
7 | 7 | |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
10 | 12 | if ($airline_icao == 'all') { |
11 | 13 | unset($_COOKIE['stats_airline_icao']); |
@@ -14,8 +16,10 @@ discard block |
||
14 | 16 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
15 | 17 | $airline_icao = $_COOKIE['stats_airline_icao']; |
16 | 18 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
17 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
18 | -} |
|
19 | + if (isset($globalFilter['airline'])) { |
|
20 | + $airline_icao = $globalFilter['airline'][0]; |
|
21 | + } |
|
22 | + } |
|
19 | 23 | setcookie('stats_airline_icao',$airline_icao); |
20 | 24 | |
21 | 25 | require_once('header.php'); |
@@ -124,45 +124,72 @@ discard block |
||
124 | 124 | </div> |
125 | 125 | <p> |
126 | 126 | <label for="dbhost">Database hostname</label> |
127 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
127 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
128 | + print $globalDBhost; |
|
129 | +} |
|
130 | +?>" /> |
|
128 | 131 | </p> |
129 | 132 | <p> |
130 | 133 | <label for="dbport">Database port</label> |
131 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
134 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
135 | + print $globalDBport; |
|
136 | +} |
|
137 | +?>" /> |
|
132 | 138 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
133 | 139 | </p> |
134 | 140 | <p> |
135 | 141 | <label for="dbname">Database name</label> |
136 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
142 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
143 | + print $globalDBname; |
|
144 | +} |
|
145 | +?>" /> |
|
137 | 146 | </p> |
138 | 147 | <p> |
139 | 148 | <label for="dbuser">Database user</label> |
140 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
149 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
150 | + print $globalDBuser; |
|
151 | +} |
|
152 | +?>" /> |
|
141 | 153 | </p> |
142 | 154 | <p> |
143 | 155 | <label for="dbuserpass">Database user password</label> |
144 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
156 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
157 | + print $globalDBpass; |
|
158 | +} |
|
159 | +?>" /> |
|
145 | 160 | </p> |
146 | 161 | </fieldset> |
147 | 162 | <fieldset id="site"> |
148 | 163 | <legend>Site configuration</legend> |
149 | 164 | <p> |
150 | 165 | <label for="sitename">Site name</label> |
151 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
166 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
167 | + print $globalName; |
|
168 | +} |
|
169 | +?>" /> |
|
152 | 170 | </p> |
153 | 171 | <p> |
154 | 172 | <label for="siteurl">Site directory</label> |
155 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
173 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
174 | + print $globalURL; |
|
175 | +} |
|
176 | +?>" /> |
|
156 | 177 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
157 | 178 | </p> |
158 | 179 | <p> |
159 | 180 | <label for="timezone">Timezone</label> |
160 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
181 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
182 | + print $globalTimezone; |
|
183 | +} |
|
184 | +?>" /> |
|
161 | 185 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
162 | 186 | </p> |
163 | 187 | <p> |
164 | 188 | <label for="language">Language</label> |
165 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
189 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
190 | + print $globalLanguage; |
|
191 | +} |
|
192 | +?>" /> |
|
166 | 193 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
167 | 194 | </p> |
168 | 195 | </fieldset> |
@@ -183,11 +210,17 @@ discard block |
||
183 | 210 | <div id="mapbox_data"> |
184 | 211 | <p> |
185 | 212 | <label for="mapboxid">Mapbox id</label> |
186 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
213 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
214 | + print $globalMapboxId; |
|
215 | +} |
|
216 | +?>" /> |
|
187 | 217 | </p> |
188 | 218 | <p> |
189 | 219 | <label for="mapboxtoken">Mapbox token</label> |
190 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
220 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
221 | + print $globalMapboxToken; |
|
222 | +} |
|
223 | +?>" /> |
|
191 | 224 | </p> |
192 | 225 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
193 | 226 | </div> |
@@ -195,7 +228,10 @@ discard block |
||
195 | 228 | <div id="google_data"> |
196 | 229 | <p> |
197 | 230 | <label for="googlekey">Google API key</label> |
198 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
231 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
232 | + print $globalGoogleAPIKey; |
|
233 | +} |
|
234 | +?>" /> |
|
199 | 235 | <p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p> |
200 | 236 | </p> |
201 | 237 | </div> |
@@ -203,7 +239,10 @@ discard block |
||
203 | 239 | <div id="bing_data"> |
204 | 240 | <p> |
205 | 241 | <label for="bingkey">Bing Map key</label> |
206 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
242 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
243 | + print $globalBingMapKey; |
|
244 | +} |
|
245 | +?>" /> |
|
207 | 246 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
208 | 247 | </p> |
209 | 248 | </div> |
@@ -211,7 +250,10 @@ discard block |
||
211 | 250 | <div id="mapquest_data"> |
212 | 251 | <p> |
213 | 252 | <label for="mapquestkey">MapQuest key</label> |
214 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
253 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
254 | + print $globalMapQuestKey; |
|
255 | +} |
|
256 | +?>" /> |
|
215 | 257 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
216 | 258 | </p> |
217 | 259 | </div> |
@@ -219,11 +261,17 @@ discard block |
||
219 | 261 | <div id="here_data"> |
220 | 262 | <p> |
221 | 263 | <label for="hereappid">Here App_Id</label> |
222 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
264 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
265 | + print $globalHereappId; |
|
266 | +} |
|
267 | +?>" /> |
|
223 | 268 | </p> |
224 | 269 | <p> |
225 | 270 | <label for="hereappcode">Here App_Code</label> |
226 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
271 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
272 | + print $globalHereappCode; |
|
273 | +} |
|
274 | +?>" /> |
|
227 | 275 | </p> |
228 | 276 | <p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p> |
229 | 277 | </div> |
@@ -232,42 +280,86 @@ discard block |
||
232 | 280 | <legend>Coverage area</legend> |
233 | 281 | <p> |
234 | 282 | <label for="latitudemax">The maximum latitude (north)</label> |
235 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
283 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
284 | + print $globalLatitudeMax; |
|
285 | +} |
|
286 | +?>" /> |
|
236 | 287 | </p> |
237 | 288 | <p> |
238 | 289 | <label for="latitudemin">The minimum latitude (south)</label> |
239 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
290 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
291 | + print $globalLatitudeMin; |
|
292 | +} |
|
293 | +?>" /> |
|
240 | 294 | </p> |
241 | 295 | <p> |
242 | 296 | <label for="longitudemax">The maximum longitude (west)</label> |
243 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
297 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
298 | + print $globalLongitudeMax; |
|
299 | +} |
|
300 | +?>" /> |
|
244 | 301 | </p> |
245 | 302 | <p> |
246 | 303 | <label for="longitudemin">The minimum longitude (east)</label> |
247 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
304 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
305 | + print $globalLongitudeMin; |
|
306 | +} |
|
307 | +?>" /> |
|
248 | 308 | </p> |
249 | 309 | <p> |
250 | 310 | <label for="latitudecenter">The latitude center</label> |
251 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
311 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
312 | + print $globalCenterLatitude; |
|
313 | +} |
|
314 | +?>" /> |
|
252 | 315 | </p> |
253 | 316 | <p> |
254 | 317 | <label for="longitudecenter">The longitude center</label> |
255 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
318 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
319 | + print $globalCenterLongitude; |
|
320 | +} |
|
321 | +?>" /> |
|
256 | 322 | </p> |
257 | 323 | <p> |
258 | 324 | <label for="livezoom">Default Zoom on live map</label> |
259 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
325 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
326 | + print $globalLiveZoom; |
|
327 | +} else { |
|
328 | + print '9'; |
|
329 | +} |
|
330 | +?>" /> |
|
260 | 331 | </p> |
261 | 332 | <p> |
262 | 333 | <label for="squawk_country">Country for squawk usage</label> |
263 | 334 | <select name="squawk_country" id="squawk_country"> |
264 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
265 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
266 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
267 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
268 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
269 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
270 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
335 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
336 | + print ' selected '; |
|
337 | +} |
|
338 | +?>>UK</option> |
|
339 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
340 | + print ' selected '; |
|
341 | +} |
|
342 | +?>>NZ</option> |
|
343 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
344 | + print ' selected '; |
|
345 | +} |
|
346 | +?>>US</option> |
|
347 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
348 | + print ' selected '; |
|
349 | +} |
|
350 | +?>>AU</option> |
|
351 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
352 | + print ' selected '; |
|
353 | +} |
|
354 | +?>>NL</option> |
|
355 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
356 | + print ' selected '; |
|
357 | +} |
|
358 | +?>>FR</option> |
|
359 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
360 | + print ' selected '; |
|
361 | +} |
|
362 | +?>>TR</option> |
|
271 | 363 | </select> |
272 | 364 | </p> |
273 | 365 | </fieldset> |
@@ -276,15 +368,24 @@ discard block |
||
276 | 368 | <p><i>Only put in DB flights that are inside a circle</i></p> |
277 | 369 | <p> |
278 | 370 | <label for="latitude">Center latitude</label> |
279 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
371 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
372 | + echo $globalDistanceIgnore['latitude']; |
|
373 | +} |
|
374 | +?>" /> |
|
280 | 375 | </p> |
281 | 376 | <p> |
282 | 377 | <label for="longitude">Center longitude</label> |
283 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
378 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
379 | + echo $globalDistanceIgnore['longitude']; |
|
380 | +} |
|
381 | +?>" /> |
|
284 | 382 | </p> |
285 | 383 | <p> |
286 | 384 | <label for="Distance">Distance (in km)</label> |
287 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
385 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
386 | + echo $globalDistanceIgnore['distance']; |
|
387 | +} |
|
388 | +?>" /> |
|
288 | 389 | </p> |
289 | 390 | </fieldset> |
290 | 391 | <fieldset id="sourceloc"> |
@@ -379,11 +480,17 @@ discard block |
||
379 | 480 | <div id="flightaware_data"> |
380 | 481 | <p> |
381 | 482 | <label for="flightawareusername">FlightAware username</label> |
382 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
483 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
484 | + print $globalFlightAwareUsername; |
|
485 | +} |
|
486 | +?>" /> |
|
383 | 487 | </p> |
384 | 488 | <p> |
385 | 489 | <label for="flightawarepassword">FlightAware password/API key</label> |
386 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
490 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
491 | + print $globalFlightAwarePassword; |
|
492 | +} |
|
493 | +?>" /> |
|
387 | 494 | </p> |
388 | 495 | </div> |
389 | 496 | --> |
@@ -442,25 +549,76 @@ discard block |
||
442 | 549 | ?> |
443 | 550 | <td> |
444 | 551 | <select name="format[]" id="format"> |
445 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
446 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
447 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
448 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
449 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
450 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
451 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
452 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server</option> |
|
453 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
454 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
455 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
456 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
457 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
458 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
459 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS over SBS-3 TCP</option> |
|
552 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
553 | + print 'selected'; |
|
554 | +} |
|
555 | +?>>Auto</option> |
|
556 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
557 | + print 'selected'; |
|
558 | +} |
|
559 | +?>>SBS</option> |
|
560 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
561 | + print 'selected'; |
|
562 | +} |
|
563 | +?>>TSV</option> |
|
564 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
565 | + print 'selected'; |
|
566 | +} |
|
567 | +?>>Raw</option> |
|
568 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
569 | + print 'selected'; |
|
570 | +} |
|
571 | +?>>APRS</option> |
|
572 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
573 | + print 'selected'; |
|
574 | +} |
|
575 | +?>>Radarcape deltadb.txt</option> |
|
576 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
577 | + print 'selected'; |
|
578 | +} |
|
579 | +?>>Vatsim</option> |
|
580 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
581 | + print 'selected'; |
|
582 | +} |
|
583 | +?>>Virtual Radar Server</option> |
|
584 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
585 | + print 'selected'; |
|
586 | +} |
|
587 | +?>>phpVMS</option> |
|
588 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
589 | + print 'selected'; |
|
590 | +} |
|
591 | +?>>Virtual Airlines Manager</option> |
|
592 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
593 | + print 'selected'; |
|
594 | +} |
|
595 | +?>>IVAO</option> |
|
596 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
597 | + print 'selected'; |
|
598 | +} |
|
599 | +?>>FlightGear Multiplayer</option> |
|
600 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
601 | + print 'selected'; |
|
602 | +} |
|
603 | +?>>FlightGear Singleplayer</option> |
|
604 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
605 | + print 'selected'; |
|
606 | +} |
|
607 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
608 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
609 | + print 'selected'; |
|
610 | +} |
|
611 | +?>>ACARS over SBS-3 TCP</option> |
|
460 | 612 | </select> |
461 | 613 | </td> |
462 | - <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /></td> |
|
463 | - <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td> |
|
614 | + <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
615 | + print $source['name']; |
|
616 | +} |
|
617 | +?>" /></td> |
|
618 | + <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) { |
|
619 | + print 'checked'; |
|
620 | +} |
|
621 | +?> /></td> |
|
464 | 622 | <td><input type="button" id="delhost" value="Delete" onclick="deleteRow(this)" /> <input type="button" id="addhost" value="Add" onclick="insRow()" /></td> |
465 | 623 | </tr> |
466 | 624 | <?php |
@@ -506,11 +664,17 @@ discard block |
||
506 | 664 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
507 | 665 | <p> |
508 | 666 | <label for="acarshost">ACARS UDP host</label> |
509 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
667 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
668 | + print $globalACARSHost; |
|
669 | +} |
|
670 | +?>" /> |
|
510 | 671 | </p> |
511 | 672 | <p> |
512 | 673 | <label for="acarsport">ACARS UDP port</label> |
513 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
674 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
675 | + print $globalACARSPort; |
|
676 | +} |
|
677 | +?>" /> |
|
514 | 678 | </p> |
515 | 679 | </fieldset> |
516 | 680 | </div> |
@@ -585,13 +749,19 @@ discard block |
||
585 | 749 | <div id="schedules_options"> |
586 | 750 | <p> |
587 | 751 | <label for="britishairways">British Airways API Key</label> |
588 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
752 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
753 | + print $globalBritishAirwaysKey; |
|
754 | +} |
|
755 | +?>" /> |
|
589 | 756 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
590 | 757 | </p> |
591 | 758 | <!-- |
592 | 759 | <p> |
593 | 760 | <label for="transavia">Transavia Test API Consumer Key</label> |
594 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
761 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
762 | + print $globalTransaviaKey; |
|
763 | +} |
|
764 | +?>" /> |
|
595 | 765 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
596 | 766 | </p> |
597 | 767 | --> |
@@ -600,10 +770,16 @@ discard block |
||
600 | 770 | <b>Lufthansa API Key</b> |
601 | 771 | <p> |
602 | 772 | <label for="lufthansakey">Key</label> |
603 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
773 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
774 | + print $globalLufthansaKey['key']; |
|
775 | +} |
|
776 | +?>" /> |
|
604 | 777 | </p><p> |
605 | 778 | <label for="lufthansasecret">Secret</label> |
606 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
779 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
780 | + print $globalLufthansaKey['secret']; |
|
781 | +} |
|
782 | +?>" /> |
|
607 | 783 | </p> |
608 | 784 | </div> |
609 | 785 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -623,7 +799,10 @@ discard block |
||
623 | 799 | </p> |
624 | 800 | <p> |
625 | 801 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
626 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
802 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
803 | + print $globalNOTAMSource; |
|
804 | +} |
|
805 | +?>" /> |
|
627 | 806 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
628 | 807 | </p> |
629 | 808 | <br /> |
@@ -639,14 +818,20 @@ discard block |
||
639 | 818 | <div id="metarsrc"> |
640 | 819 | <p> |
641 | 820 | <label for="metarsource">URL of your METAR source</label> |
642 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
821 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
822 | + print $globalMETARurl; |
|
823 | +} |
|
824 | +?>" /> |
|
643 | 825 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
644 | 826 | </p> |
645 | 827 | </div> |
646 | 828 | <br /> |
647 | 829 | <p> |
648 | 830 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
649 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
831 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
832 | + print $globalBitlyAccessToken; |
|
833 | +} |
|
834 | +?>" /> |
|
650 | 835 | </p> |
651 | 836 | <br /> |
652 | 837 | <p> |
@@ -660,7 +845,12 @@ discard block |
||
660 | 845 | </p> |
661 | 846 | <p> |
662 | 847 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
663 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" /> |
|
848 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
849 | + print $globalArchiveMonths; |
|
850 | +} else { |
|
851 | + echo '0'; |
|
852 | +} |
|
853 | +?>" /> |
|
664 | 854 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
665 | 855 | </p> |
666 | 856 | <p> |
@@ -670,12 +860,22 @@ discard block |
||
670 | 860 | </p> |
671 | 861 | <p> |
672 | 862 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
673 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" /> |
|
863 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
864 | + print $globalArchiveKeepMonths; |
|
865 | +} else { |
|
866 | + echo '0'; |
|
867 | +} |
|
868 | +?>" /> |
|
674 | 869 | <p class="help-block">0 to disable</p> |
675 | 870 | </p> |
676 | 871 | <p> |
677 | 872 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
678 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" /> |
|
873 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
874 | + print $globalArchiveKeepTrackMonths; |
|
875 | +} else { |
|
876 | + echo '0'; |
|
877 | +} |
|
878 | +?>" /> |
|
679 | 879 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
680 | 880 | </p> |
681 | 881 | <br /> |
@@ -685,7 +885,12 @@ discard block |
||
685 | 885 | <p class="help-block">Uncheck if the script is running as cron job</p> |
686 | 886 | <div id="cronends"> |
687 | 887 | <label for="cronend">Run script for xx seconds</label> |
688 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
888 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
889 | + print $globalCronEnd; |
|
890 | +} else { |
|
891 | + print '0'; |
|
892 | +} |
|
893 | +?>" /> |
|
689 | 894 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
690 | 895 | </div> |
691 | 896 | </p> |
@@ -725,26 +930,49 @@ discard block |
||
725 | 930 | <br /> |
726 | 931 | <p> |
727 | 932 | <label for="refresh">Show flights detected since xxx seconds</label> |
728 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
933 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
934 | + echo $globalLiveInterval; |
|
935 | +} else { |
|
936 | + echo '200'; |
|
937 | +} |
|
938 | +?>" /> |
|
729 | 939 | </p> |
730 | 940 | <p> |
731 | 941 | <label for="maprefresh">Live map refresh (in seconds)</label> |
732 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
942 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
943 | + echo $globalMapRefresh; |
|
944 | +} else { |
|
945 | + echo '30'; |
|
946 | +} |
|
947 | +?>" /> |
|
733 | 948 | </p> |
734 | 949 | <p> |
735 | 950 | <label for="mapidle">Map idle timeout (in minutes)</label> |
736 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
951 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
952 | + echo $globalMapIdleTimeout; |
|
953 | +} else { |
|
954 | + echo '30'; |
|
955 | +} |
|
956 | +?>" /> |
|
737 | 957 | <p class="help-block">0 to disable</p> |
738 | 958 | </p> |
739 | 959 | <br /> |
740 | 960 | <p> |
741 | 961 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
742 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
962 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
963 | + echo $globalClosestMinDist; |
|
964 | +} else { |
|
965 | + echo '50'; |
|
966 | +} |
|
967 | +?>" /> |
|
743 | 968 | </p> |
744 | 969 | <br /> |
745 | 970 | <p> |
746 | 971 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
747 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
972 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
973 | + echo $globalAircraftSize; |
|
974 | +} |
|
975 | +?>" /> |
|
748 | 976 | </p> |
749 | 977 | <br /> |
750 | 978 | <p> |
@@ -752,7 +980,12 @@ discard block |
||
752 | 980 | if (extension_loaded('gd') && function_exists('gd_info')) { |
753 | 981 | ?> |
754 | 982 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
755 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
983 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
984 | + echo $globalAircraftIconColor; |
|
985 | +} else { |
|
986 | + echo '1a3151'; |
|
987 | +} |
|
988 | +?>" /> |
|
756 | 989 | <?php |
757 | 990 | if (!is_writable('../cache')) { |
758 | 991 | ?> |
@@ -770,8 +1003,18 @@ discard block |
||
770 | 1003 | <p> |
771 | 1004 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
772 | 1005 | <div class="range"> |
773 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
774 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
1006 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
1007 | + echo $globalAirportZoom; |
|
1008 | +} else { |
|
1009 | + echo '7'; |
|
1010 | +} |
|
1011 | +?>" /> |
|
1012 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
1013 | + echo $globalAirportZoom; |
|
1014 | +} else { |
|
1015 | + echo '7'; |
|
1016 | +} |
|
1017 | +?></output> |
|
775 | 1018 | </div> |
776 | 1019 | </p> |
777 | 1020 | </fieldset> |
@@ -799,8 +1042,12 @@ discard block |
||
799 | 1042 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
800 | 1043 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
801 | 1044 | |
802 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
803 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1045 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
1046 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
1047 | + } |
|
1048 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
1049 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1050 | + } |
|
804 | 1051 | |
805 | 1052 | $_SESSION['database_root'] = $dbroot; |
806 | 1053 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -867,15 +1114,23 @@ discard block |
||
867 | 1114 | $source_city = $_POST['source_city']; |
868 | 1115 | $source_country = $_POST['source_country']; |
869 | 1116 | $source_ref = $_POST['source_ref']; |
870 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
871 | - else $source_id = array(); |
|
1117 | + if (isset($source_id)) { |
|
1118 | + $source_id = $_POST['source_id']; |
|
1119 | + } else { |
|
1120 | + $source_id = array(); |
|
1121 | + } |
|
872 | 1122 | |
873 | 1123 | $sources = array(); |
874 | 1124 | foreach ($source_name as $keys => $name) { |
875 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
876 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1125 | + if (isset($source_id[$keys])) { |
|
1126 | + $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1127 | + } else { |
|
1128 | + $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1129 | + } |
|
1130 | + } |
|
1131 | + if (count($sources) > 0) { |
|
1132 | + $_SESSION['sources'] = $sources; |
|
877 | 1133 | } |
878 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
879 | 1134 | |
880 | 1135 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
881 | 1136 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -913,13 +1168,21 @@ discard block |
||
913 | 1168 | $port = $_POST['port']; |
914 | 1169 | $name = $_POST['name']; |
915 | 1170 | $format = $_POST['format']; |
916 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
917 | - else $sourcestats = array(); |
|
1171 | + if (isset($_POST['sourcestats'])) { |
|
1172 | + $sourcestats = $_POST['sourcestats']; |
|
1173 | + } else { |
|
1174 | + $sourcestats = array(); |
|
1175 | + } |
|
918 | 1176 | $gSources = array(); |
919 | 1177 | foreach ($host as $key => $h) { |
920 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
921 | - else $cov = 'FALSE'; |
|
922 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
1178 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
1179 | + $cov = 'TRUE'; |
|
1180 | + } else { |
|
1181 | + $cov = 'FALSE'; |
|
1182 | + } |
|
1183 | + if ($h != '') { |
|
1184 | + $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
1185 | + } |
|
923 | 1186 | } |
924 | 1187 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
925 | 1188 | |
@@ -943,7 +1206,9 @@ discard block |
||
943 | 1206 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
944 | 1207 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
945 | 1208 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
946 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1209 | + } else { |
|
1210 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1211 | + } |
|
947 | 1212 | |
948 | 1213 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
949 | 1214 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -982,7 +1247,9 @@ discard block |
||
982 | 1247 | |
983 | 1248 | // Create in settings.php keys not yet configurable if not already here |
984 | 1249 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
985 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1250 | + if (!isset($globalDebug)) { |
|
1251 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1252 | + } |
|
986 | 1253 | |
987 | 1254 | $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
988 | 1255 | if ($archive == 'archive') { |
@@ -1012,27 +1279,43 @@ discard block |
||
1012 | 1279 | } |
1013 | 1280 | */ |
1014 | 1281 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
1015 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1016 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1017 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1018 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1282 | + if ($globalsbs == 'sbs') { |
|
1283 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1284 | + } else { |
|
1285 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1286 | + } |
|
1287 | + if ($globalaprs == 'aprs') { |
|
1288 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1289 | + } else { |
|
1290 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1291 | + } |
|
1019 | 1292 | if ($globalivao == 'ivao') { |
1020 | 1293 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
1021 | 1294 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
1022 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1295 | + } else { |
|
1296 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1297 | + } |
|
1023 | 1298 | if ($globalvatsim == 'vatsim') { |
1024 | 1299 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
1025 | 1300 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
1026 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1301 | + } else { |
|
1302 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1303 | + } |
|
1027 | 1304 | if ($globalphpvms == 'phpvms') { |
1028 | 1305 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
1029 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1306 | + } else { |
|
1307 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1308 | + } |
|
1030 | 1309 | if ($globalvam == 'vam') { |
1031 | 1310 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
1032 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1311 | + } else { |
|
1312 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1313 | + } |
|
1033 | 1314 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
1034 | 1315 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
1035 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1316 | + } else { |
|
1317 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1318 | + } |
|
1036 | 1319 | |
1037 | 1320 | |
1038 | 1321 | |
@@ -1156,7 +1439,9 @@ discard block |
||
1156 | 1439 | $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
1157 | 1440 | } |
1158 | 1441 | |
1159 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1442 | + if (!isset($globalTransaction)) { |
|
1443 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1444 | + } |
|
1160 | 1445 | |
1161 | 1446 | // Set some defaults values... |
1162 | 1447 | if (!isset($globalAircraftImageSources)) { |
@@ -1171,15 +1456,23 @@ discard block |
||
1171 | 1456 | |
1172 | 1457 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1173 | 1458 | |
1174 | - if ($error == '') settings::modify_settings($settings); |
|
1175 | - if ($error == '') settings::comment_settings($settings_comment); |
|
1459 | + if ($error == '') { |
|
1460 | + settings::modify_settings($settings); |
|
1461 | + } |
|
1462 | + if ($error == '') { |
|
1463 | + settings::comment_settings($settings_comment); |
|
1464 | + } |
|
1176 | 1465 | if ($error != '') { |
1177 | 1466 | print '<div class="info column">'.$error.'</div>'; |
1178 | 1467 | require('../footer.php'); |
1179 | 1468 | exit; |
1180 | 1469 | } else { |
1181 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
1182 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
1470 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
1471 | + $_SESSION['waypoints'] = 1; |
|
1472 | + } |
|
1473 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
1474 | + $_SESSION['owner'] = 1; |
|
1475 | + } |
|
1183 | 1476 | if (isset($_POST['createdb'])) { |
1184 | 1477 | $_SESSION['install'] = 'database_create'; |
1185 | 1478 | } else { |
@@ -1220,10 +1513,18 @@ discard block |
||
1220 | 1513 | $popw = false; |
1221 | 1514 | foreach ($_SESSION['done'] as $done) { |
1222 | 1515 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
1223 | - if ($done == 'Create database') $pop = true; |
|
1224 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1225 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1226 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1516 | + if ($done == 'Create database') { |
|
1517 | + $pop = true; |
|
1518 | + } |
|
1519 | + if ($_SESSION['install'] == 'database_create') { |
|
1520 | + $pop = true; |
|
1521 | + } |
|
1522 | + if ($_SESSION['install'] == 'database_import') { |
|
1523 | + $popi = true; |
|
1524 | + } |
|
1525 | + if ($_SESSION['install'] == 'waypoints') { |
|
1526 | + $popw = true; |
|
1527 | + } |
|
1227 | 1528 | } |
1228 | 1529 | if ($pop) { |
1229 | 1530 | sleep(5); |
@@ -1234,7 +1535,9 @@ discard block |
||
1234 | 1535 | } else if ($popw) { |
1235 | 1536 | sleep(5); |
1236 | 1537 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
1237 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1538 | + } else { |
|
1539 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1540 | + } |
|
1238 | 1541 | print '</div></ul>'; |
1239 | 1542 | print '<div id="error"></div>'; |
1240 | 1543 | /* foreach ($_SESSION['done'] as $done) { |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | require_once(dirname(__FILE__).'/class.create_db.php'); |
10 | 10 | require_once(dirname(__FILE__).'/class.update_schema.php'); |
11 | 11 | require_once(dirname(__FILE__).'/class.settings.php'); |
12 | -$title="Install"; |
|
12 | +$title = "Install"; |
|
13 | 13 | require(dirname(__FILE__).'/../require/settings.php'); |
14 | 14 | require(dirname(__FILE__).'/header.php'); |
15 | 15 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | if (!extension_loaded('curl')) { |
64 | 64 | $error[] = "Curl is not loaded."; |
65 | 65 | } |
66 | -if(function_exists('apache_get_modules') ){ |
|
67 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
66 | +if (function_exists('apache_get_modules')) { |
|
67 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
68 | 68 | $error[] = "mod_rewrite is not available."; |
69 | 69 | } |
70 | 70 | /* |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | } |
80 | 80 | if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { |
81 | 81 | if (function_exists('get_headers')) { |
82 | - $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); |
|
83 | - if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { |
|
82 | + $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); |
|
83 | + if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { |
|
84 | 84 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>'; |
85 | 85 | } |
86 | 86 | } |
@@ -420,13 +420,13 @@ discard block |
||
420 | 420 | ?> |
421 | 421 | <tr> |
422 | 422 | <?php |
423 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
423 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
424 | 424 | ?> |
425 | 425 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
426 | 426 | <td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td> |
427 | 427 | <?php |
428 | 428 | } else { |
429 | - $hostport = explode(':',$source['host']); |
|
429 | + $hostport = explode(':', $source['host']); |
|
430 | 430 | if (isset($hostport[1])) { |
431 | 431 | $host = $hostport[0]; |
432 | 432 | $port = $hostport[1]; |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | <br /> |
750 | 750 | <p> |
751 | 751 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
752 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
752 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
753 | 753 | </p> |
754 | 754 | <br /> |
755 | 755 | <p> |
@@ -795,14 +795,14 @@ discard block |
||
795 | 795 | $error = ''; |
796 | 796 | |
797 | 797 | if (isset($_POST['dbtype'])) { |
798 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
799 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
800 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
801 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
802 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
803 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
804 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
805 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
798 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
799 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
800 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
801 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
802 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
803 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
804 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
805 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
806 | 806 | |
807 | 807 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
808 | 808 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -822,48 +822,48 @@ discard block |
||
822 | 822 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
823 | 823 | */ |
824 | 824 | |
825 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
825 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
826 | 826 | |
827 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
828 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
829 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
830 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
831 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
827 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
828 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
829 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
830 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
831 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
832 | 832 | |
833 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
834 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
835 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
836 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
837 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
838 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
839 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
840 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
841 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey)); |
|
833 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
834 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
835 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
836 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
837 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
838 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
839 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
840 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
841 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey)); |
|
842 | 842 | |
843 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
844 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
845 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
846 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
847 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
848 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
843 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
844 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
845 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
846 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
847 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
848 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
849 | 849 | |
850 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
851 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
850 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
851 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
852 | 852 | |
853 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
854 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
855 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
853 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
854 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
855 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
856 | 856 | |
857 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
857 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
858 | 858 | if ($acars == 'acars') { |
859 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
859 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
860 | 860 | } else { |
861 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
861 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
862 | 862 | } |
863 | 863 | |
864 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
865 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
866 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
864 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
865 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
866 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
867 | 867 | |
868 | 868 | $source_name = $_POST['source_name']; |
869 | 869 | $source_latitude = $_POST['source_latitude']; |
@@ -877,8 +877,8 @@ discard block |
||
877 | 877 | |
878 | 878 | $sources = array(); |
879 | 879 | foreach ($source_name as $keys => $name) { |
880 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
881 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
880 | + if (isset($source_id[$keys])) $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'id' => $source_id[$keys], 'source' => $source_ref[$keys]); |
|
881 | + else $sources[] = array('name' => $name, 'latitude' => $source_latitude[$keys], 'longitude' => $source_longitude[$keys], 'altitude' => $source_altitude[$keys], 'city' => $source_city[$keys], 'country' => $source_country[$keys], 'source' => $source_ref[$keys]); |
|
882 | 882 | } |
883 | 883 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
884 | 884 | |
@@ -891,13 +891,13 @@ discard block |
||
891 | 891 | $sbsurl = $_POST['sbsurl']; |
892 | 892 | */ |
893 | 893 | |
894 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
895 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
896 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
897 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING); |
|
898 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
899 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
900 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
894 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
895 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
896 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
897 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING); |
|
898 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
899 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
900 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
901 | 901 | |
902 | 902 | /* |
903 | 903 | $globalSBS1Hosts = array(); |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | } |
914 | 914 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
915 | 915 | */ |
916 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
916 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
917 | 917 | $host = $_POST['host']; |
918 | 918 | $port = $_POST['port']; |
919 | 919 | $name = $_POST['name']; |
@@ -924,89 +924,89 @@ discard block |
||
924 | 924 | foreach ($host as $key => $h) { |
925 | 925 | if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
926 | 926 | else $cov = 'FALSE'; |
927 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
927 | + if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov); |
|
928 | 928 | } |
929 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
929 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
930 | 930 | |
931 | 931 | /* |
932 | 932 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
933 | 933 | $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
934 | 934 | */ |
935 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
936 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
937 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
935 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
936 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
937 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
938 | 938 | |
939 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
940 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
939 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
940 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
941 | 941 | |
942 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
943 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
944 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
945 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
942 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
943 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
944 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
945 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
946 | 946 | |
947 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
948 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
949 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
947 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
948 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
949 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
950 | 950 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
951 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
952 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
951 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
952 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
953 | 953 | |
954 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
955 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
956 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
957 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
958 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
959 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
960 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
961 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
954 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
955 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
956 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
957 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
958 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
959 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
960 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
961 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
962 | 962 | |
963 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
964 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
963 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
964 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
965 | 965 | |
966 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
967 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
966 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
967 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
968 | 968 | |
969 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
969 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
970 | 970 | if ($archiveyear == "archiveyear") { |
971 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
971 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
972 | 972 | } else { |
973 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
973 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
974 | 974 | } |
975 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
976 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
977 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
978 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
975 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
976 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
977 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
978 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
979 | 979 | |
980 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
981 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
982 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
983 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
980 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
981 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
982 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
983 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
984 | 984 | |
985 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
986 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
987 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
985 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
986 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
987 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
988 | 988 | |
989 | 989 | // Create in settings.php keys not yet configurable if not already here |
990 | 990 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
991 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
991 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
992 | 992 | |
993 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
993 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
994 | 994 | if ($archive == 'archive') { |
995 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
995 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
996 | 996 | } else { |
997 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
997 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
998 | 998 | } |
999 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
999 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
1000 | 1000 | if ($daemon == 'daemon') { |
1001 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
1001 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
1002 | 1002 | } else { |
1003 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
1003 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
1004 | 1004 | } |
1005 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
1005 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
1006 | 1006 | if ($schedules == 'schedules') { |
1007 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
1007 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
1008 | 1008 | } else { |
1009 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
1009 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | /* |
@@ -1017,171 +1017,171 @@ discard block |
||
1017 | 1017 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
1018 | 1018 | } |
1019 | 1019 | */ |
1020 | - $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
|
1021 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1022 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1023 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1024 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1020 | + $settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); |
|
1021 | + if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); |
|
1022 | + else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); |
|
1023 | + if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); |
|
1024 | + else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); |
|
1025 | 1025 | if ($globalivao == 'ivao') { |
1026 | 1026 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
1027 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
1028 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1027 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
1028 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
1029 | 1029 | if ($globalvatsim == 'vatsim') { |
1030 | 1030 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
1031 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
1032 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1031 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
1032 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
1033 | 1033 | if ($globalphpvms == 'phpvms') { |
1034 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
1035 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1034 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
1035 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
1036 | 1036 | if ($globalvam == 'vam') { |
1037 | - $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
|
1038 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1037 | + $settings = array_merge($settings, array('globalVAM' => 'TRUE')); |
|
1038 | + } else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); |
|
1039 | 1039 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
1040 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
1041 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1040 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
1041 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
1042 | 1042 | |
1043 | 1043 | |
1044 | 1044 | |
1045 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
1045 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
1046 | 1046 | if ($notam == 'notam') { |
1047 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
1047 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
1048 | 1048 | } else { |
1049 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
1049 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
1050 | 1050 | } |
1051 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
1051 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
1052 | 1052 | if ($owner == 'owner') { |
1053 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
1053 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
1054 | 1054 | } else { |
1055 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
1055 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
1056 | 1056 | } |
1057 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING); |
|
1057 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING); |
|
1058 | 1058 | if ($map3d == 'map3d') { |
1059 | - $settings = array_merge($settings,array('globalMap3D' => 'TRUE')); |
|
1059 | + $settings = array_merge($settings, array('globalMap3D' => 'TRUE')); |
|
1060 | 1060 | } else { |
1061 | - $settings = array_merge($settings,array('globalMap3D' => 'FALSE')); |
|
1061 | + $settings = array_merge($settings, array('globalMap3D' => 'FALSE')); |
|
1062 | 1062 | } |
1063 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING); |
|
1063 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING); |
|
1064 | 1064 | if ($mapsatellites == 'mapsatellites') { |
1065 | - $settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); |
|
1065 | + $settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); |
|
1066 | 1066 | } else { |
1067 | - $settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); |
|
1067 | + $settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); |
|
1068 | 1068 | } |
1069 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING); |
|
1069 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING); |
|
1070 | 1070 | if ($map3ddefault == 'map3ddefault') { |
1071 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); |
|
1071 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); |
|
1072 | 1072 | } else { |
1073 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); |
|
1073 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); |
|
1074 | 1074 | } |
1075 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
1075 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
1076 | 1076 | if ($translate == 'translate') { |
1077 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
1077 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
1078 | 1078 | } else { |
1079 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
1079 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
1080 | 1080 | } |
1081 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING); |
|
1081 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING); |
|
1082 | 1082 | if ($realairlines == 'realairlines') { |
1083 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); |
|
1083 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); |
|
1084 | 1084 | } else { |
1085 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); |
|
1085 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); |
|
1086 | 1086 | } |
1087 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
1087 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
1088 | 1088 | if ($estimation == 'estimation') { |
1089 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
1089 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
1090 | 1090 | } else { |
1091 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
1091 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
1092 | 1092 | } |
1093 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
1093 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
1094 | 1094 | if ($metar == 'metar') { |
1095 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
1095 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
1096 | 1096 | } else { |
1097 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
1097 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
1098 | 1098 | } |
1099 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
1099 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
1100 | 1100 | if ($metarcycle == 'metarcycle') { |
1101 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
1101 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
1102 | 1102 | } else { |
1103 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
1103 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
1104 | 1104 | } |
1105 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
1105 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
1106 | 1106 | if ($fork == 'fork') { |
1107 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
1107 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
1108 | 1108 | } else { |
1109 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
1109 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
1110 | 1110 | } |
1111 | 1111 | |
1112 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
1112 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
1113 | 1113 | if ($colormap == 'colormap') { |
1114 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
1114 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
1115 | 1115 | } else { |
1116 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
1116 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
1117 | 1117 | } |
1118 | 1118 | |
1119 | 1119 | if (isset($_POST['aircrafticoncolor'])) { |
1120 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
1121 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
1120 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
1121 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
1122 | 1122 | } |
1123 | 1123 | |
1124 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
1125 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
1124 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
1125 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
1126 | 1126 | |
1127 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
1128 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
1129 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
1130 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
1131 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
1132 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
1127 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
1128 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
1129 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
1130 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
1131 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
1132 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
1133 | 1133 | |
1134 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
1134 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
1135 | 1135 | if ($mappopup == 'mappopup') { |
1136 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
1136 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
1137 | 1137 | } else { |
1138 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
1138 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
1139 | 1139 | } |
1140 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
1140 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
1141 | 1141 | if ($airportpopup == 'airportpopup') { |
1142 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
1142 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
1143 | 1143 | } else { |
1144 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
1144 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
1145 | 1145 | } |
1146 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
1146 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
1147 | 1147 | if ($maphistory == 'maphistory') { |
1148 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
1148 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
1149 | 1149 | } else { |
1150 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
1150 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
1151 | 1151 | } |
1152 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
1152 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
1153 | 1153 | if ($flightroute == 'flightroute') { |
1154 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
1154 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
1155 | 1155 | } else { |
1156 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
1156 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
1157 | 1157 | } |
1158 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING); |
|
1158 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING); |
|
1159 | 1159 | if ($allflights == 'allflights') { |
1160 | - $settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); |
|
1160 | + $settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); |
|
1161 | 1161 | } else { |
1162 | - $settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); |
|
1162 | + $settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); |
|
1163 | 1163 | } |
1164 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING); |
|
1164 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING); |
|
1165 | 1165 | if ($waypoints == 'waypoints') { |
1166 | - $settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); |
|
1166 | + $settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); |
|
1167 | 1167 | } else { |
1168 | - $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
|
1168 | + $settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); |
|
1169 | 1169 | } |
1170 | 1170 | |
1171 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1171 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
1172 | 1172 | |
1173 | 1173 | // Set some defaults values... |
1174 | 1174 | if (!isset($globalAircraftImageSources)) { |
1175 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1176 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1175 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
1176 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1177 | 1177 | } |
1178 | 1178 | |
1179 | 1179 | if (!isset($globalSchedulesSources)) { |
1180 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1181 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1180 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
1181 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
1184 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
1185 | 1185 | |
1186 | 1186 | if ($error == '') settings::modify_settings($settings); |
1187 | 1187 | if ($error == '') settings::comment_settings($settings_comment); |
@@ -305,17 +305,17 @@ discard block |
||
305 | 305 | </tr> |
306 | 306 | <!-- |
307 | 307 | <?php |
308 | - require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
309 | - $Connection = new Connection(); |
|
308 | + require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
309 | + $Connection = new Connection(); |
|
310 | 310 | ?> |
311 | 311 | --> |
312 | 312 | <?php |
313 | - if ($Connection->db != NULL) { |
|
313 | + if ($Connection->db != NULL) { |
|
314 | 314 | if ($Connection->tableExists('source_location')) { |
315 | - require_once(dirname(__FILE__).'/../require/class.Source.php'); |
|
316 | - $Source = new Source(); |
|
317 | - $alllocations = $Source->getAllLocationInfo(); |
|
318 | - foreach ($alllocations as $location) { |
|
315 | + require_once(dirname(__FILE__).'/../require/class.Source.php'); |
|
316 | + $Source = new Source(); |
|
317 | + $alllocations = $Source->getAllLocationInfo(); |
|
318 | + foreach ($alllocations as $location) { |
|
319 | 319 | ?> |
320 | 320 | <tr> |
321 | 321 | <input type="hidden" name="source_id[]" value="<?php print $location['id']; ?>" /> |
@@ -329,9 +329,9 @@ discard block |
||
329 | 329 | </tr> |
330 | 330 | |
331 | 331 | <?php |
332 | - } |
|
332 | + } |
|
333 | + } |
|
333 | 334 | } |
334 | - } |
|
335 | 335 | ?> |
336 | 336 | |
337 | 337 | <tr> |
@@ -424,12 +424,12 @@ discard block |
||
424 | 424 | ?> |
425 | 425 | <tr> |
426 | 426 | <?php |
427 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
427 | + if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
428 | 428 | ?> |
429 | 429 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
430 | 430 | <td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td> |
431 | 431 | <?php |
432 | - } else { |
|
432 | + } else { |
|
433 | 433 | $hostport = explode(':',$source['host']); |
434 | 434 | if (isset($hostport[1])) { |
435 | 435 | $host = $hostport[0]; |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | <td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td> |
443 | 443 | <td><input type="number" name="port[]" id="port" value="<?php print $port; ?>" /></td> |
444 | 444 | <?php |
445 | - } |
|
445 | + } |
|
446 | 446 | ?> |
447 | 447 | <td> |
448 | 448 | <select name="format[]" id="format"> |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | <br /> |
759 | 759 | <p> |
760 | 760 | <?php |
761 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
761 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
762 | 762 | ?> |
763 | 763 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
764 | 764 | <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
@@ -768,11 +768,11 @@ discard block |
||
768 | 768 | <b>The directory cache is not writable, aircraft icon will not be cached</b> |
769 | 769 | <?php |
770 | 770 | } |
771 | - } else { |
|
771 | + } else { |
|
772 | 772 | ?> |
773 | 773 | <b>PHP GD is not installed, you can t change color of aircraft icon on map</b> |
774 | 774 | <?php |
775 | - } |
|
775 | + } |
|
776 | 776 | ?> |
777 | 777 | </p> |
778 | 778 | <br /> |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | </p> |
792 | 792 | <?php |
793 | 793 | require('../footer.php'); |
794 | - exit; |
|
794 | + exit; |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | $settings = array(); |
@@ -881,8 +881,8 @@ discard block |
||
881 | 881 | |
882 | 882 | $sources = array(); |
883 | 883 | foreach ($source_name as $keys => $name) { |
884 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
885 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
884 | + if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
885 | + else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
886 | 886 | } |
887 | 887 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
888 | 888 | |
@@ -1176,14 +1176,14 @@ discard block |
||
1176 | 1176 | |
1177 | 1177 | // Set some defaults values... |
1178 | 1178 | if (!isset($globalAircraftImageSources)) { |
1179 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1180 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1179 | + $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1180 | + $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | if (!isset($globalSchedulesSources)) { |
1184 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1185 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1186 | - } |
|
1184 | + $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1185 | + $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1186 | + } |
|
1187 | 1187 | |
1188 | 1188 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1189 | 1189 | |
@@ -1235,21 +1235,21 @@ discard block |
||
1235 | 1235 | $popi = false; |
1236 | 1236 | $popw = false; |
1237 | 1237 | foreach ($_SESSION['done'] as $done) { |
1238 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1239 | - if ($done == 'Create database') $pop = true; |
|
1240 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1241 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1242 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1238 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1239 | + if ($done == 'Create database') $pop = true; |
|
1240 | + if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1241 | + if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1242 | + if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1243 | 1243 | } |
1244 | 1244 | if ($pop) { |
1245 | - sleep(5); |
|
1246 | - print '<li>Create database....<img src="../images/loading.gif" /></li>'; |
|
1245 | + sleep(5); |
|
1246 | + print '<li>Create database....<img src="../images/loading.gif" /></li>'; |
|
1247 | 1247 | } else if ($popi) { |
1248 | - sleep(5); |
|
1249 | - print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
1248 | + sleep(5); |
|
1249 | + print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
1250 | 1250 | } else if ($popw) { |
1251 | - sleep(5); |
|
1252 | - print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
|
1251 | + sleep(5); |
|
1252 | + print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
|
1253 | 1253 | } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
1254 | 1254 | print '</div></ul>'; |
1255 | 1255 | print '<div id="error"></div>'; |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | unset($_COOKIE['install']); |
1313 | 1313 | print '<div class="info column"><ul>'; |
1314 | 1314 | foreach ($_SESSION['done'] as $done) { |
1315 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1315 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1316 | 1316 | } |
1317 | 1317 | print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>'; |
1318 | 1318 | print '</ul></div>'; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | </div> |
15 | 15 | <p>'._("Below are the <strong>Top 10</strong> most common airlines.").'</p>'; |
16 | 16 | |
17 | -$airline_array = $Stats->countAllAirlines(true,$filter_name); |
|
17 | +$airline_array = $Stats->countAllAirlines(true, $filter_name); |
|
18 | 18 | print '<div id="chart" class="chart" width="100%"></div> |
19 | 19 | <script> |
20 | 20 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | var data = google.visualization.arrayToDataTable([ |
24 | 24 | ["'._("Airline").'", "'._("# of times").'"], '; |
25 | 25 | $airline_data = ''; |
26 | -foreach($airline_array as $airline_item) |
|
26 | +foreach ($airline_array as $airline_item) |
|
27 | 27 | { |
28 | 28 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
29 | 29 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | print '</thead>'; |
59 | 59 | print '<tbody>'; |
60 | 60 | $i = 1; |
61 | - foreach($airline_array as $airline_item) |
|
61 | + foreach ($airline_array as $airline_item) |
|
62 | 62 | { |
63 | 63 | print '<tr>'; |
64 | 64 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Route by Airport"); |
7 | 7 | require_once('header.php'); |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | include('statistics-sub-menu.php'); |
10 | 12 | |
11 | 13 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
@@ -6,7 +6,9 @@ discard block |
||
6 | 6 | $Stats = new Stats(); |
7 | 7 | $title = _("Statistics"); |
8 | 8 | |
9 | -if (!isset($filter_name)) $filter_name = ''; |
|
9 | +if (!isset($filter_name)) { |
|
10 | + $filter_name = ''; |
|
11 | +} |
|
10 | 12 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
11 | 13 | if ($airline_icao == 'all') { |
12 | 14 | unset($_COOKIE['stats_airline_icao']); |
@@ -15,8 +17,10 @@ discard block |
||
15 | 17 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
16 | 18 | $airline_icao = $_COOKIE['stats_airline_icao']; |
17 | 19 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
18 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
19 | -} |
|
20 | + if (isset($globalFilter['airline'])) { |
|
21 | + $airline_icao = $globalFilter['airline'][0]; |
|
22 | + } |
|
23 | + } |
|
20 | 24 | setcookie('stats_airline_icao',$airline_icao); |
21 | 25 | require_once('header.php'); |
22 | 26 | |
@@ -36,7 +40,9 @@ discard block |
||
36 | 40 | if (isset($last_update[0]['value'])) { |
37 | 41 | date_default_timezone_set('UTC'); |
38 | 42 | $lastupdate = strtotime($last_update[0]['value']); |
39 | - if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
|
43 | + if (isset($globalTimezone) && $globalTimezone != '') { |
|
44 | + date_default_timezone_set($globalTimezone); |
|
45 | + } |
|
40 | 46 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
41 | 47 | } |
42 | 48 | ?> |
@@ -89,8 +95,9 @@ discard block |
||
89 | 95 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
90 | 96 | <?php |
91 | 97 | $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
92 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
93 | - else { |
|
98 | + if (count($aircraft_array) == 0) { |
|
99 | + print _("No data available"); |
|
100 | + } else { |
|
94 | 101 | |
95 | 102 | print '<div id="chart1" class="chart" width="100%"></div> |
96 | 103 | <script> |
@@ -136,8 +143,9 @@ discard block |
||
136 | 143 | <h2><?php echo _("Top 10 Most Common Airline"); ?></h2> |
137 | 144 | <?php |
138 | 145 | $airline_array = $Stats->countAllAirlines(true,$filter_name); |
139 | - if (count($airline_array) == 0) print _("No data available"); |
|
140 | - else { |
|
146 | + if (count($airline_array) == 0) { |
|
147 | + print _("No data available"); |
|
148 | + } else { |
|
141 | 149 | |
142 | 150 | print '<div id="chart2" class="chart" width="100%"></div> |
143 | 151 | <script> |
@@ -197,8 +205,9 @@ discard block |
||
197 | 205 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
198 | 206 | <?php |
199 | 207 | $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
200 | - if (count($pilot_array) == 0) print _("No data available"); |
|
201 | - else { |
|
208 | + if (count($pilot_array) == 0) { |
|
209 | + print _("No data available"); |
|
210 | + } else { |
|
202 | 211 | |
203 | 212 | print '<div id="chart7" class="chart" width="100%"></div> |
204 | 213 | <script> |
@@ -244,8 +253,9 @@ discard block |
||
244 | 253 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
245 | 254 | <?php |
246 | 255 | $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
247 | - if (count($owner_array) == 0) print _("No data available"); |
|
248 | - else { |
|
256 | + if (count($owner_array) == 0) { |
|
257 | + print _("No data available"); |
|
258 | + } else { |
|
249 | 259 | |
250 | 260 | print '<div id="chart7" class="chart" width="100%"></div> |
251 | 261 | <script> |
@@ -293,8 +303,9 @@ discard block |
||
293 | 303 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
294 | 304 | <?php |
295 | 305 | //$flightover_array = $Stats->countAllFlightOverCountries(); |
296 | - if (count($flightover_array) == 0) print _("No data available"); |
|
297 | - else { |
|
306 | + if (count($flightover_array) == 0) { |
|
307 | + print _("No data available"); |
|
308 | + } else { |
|
298 | 309 | |
299 | 310 | print '<div id="chart10" class="chart" width="100%"></div> |
300 | 311 | <script> |
@@ -346,8 +357,9 @@ discard block |
||
346 | 357 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
347 | 358 | <?php |
348 | 359 | $airport_airport_array = $Stats->countAllDepartureAirports($airline_icao,$filter_name); |
349 | - if (count($airport_airport_array) == 0) print _("No data available"); |
|
350 | - else { |
|
360 | + if (count($airport_airport_array) == 0) { |
|
361 | + print _("No data available"); |
|
362 | + } else { |
|
351 | 363 | |
352 | 364 | print '<div id="chart3" class="chart" width="100%"></div> |
353 | 365 | <script> |
@@ -396,8 +408,9 @@ discard block |
||
396 | 408 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
397 | 409 | <?php |
398 | 410 | $airport_airport_array2 = $Stats->countAllArrivalAirports($airline_icao,$filter_name); |
399 | - if (count($airport_airport_array2) == 0) print _("No data available"); |
|
400 | - else { |
|
411 | + if (count($airport_airport_array2) == 0) { |
|
412 | + print _("No data available"); |
|
413 | + } else { |
|
401 | 414 | |
402 | 415 | print '<div id="chart4" class="chart" width="100%"></div> |
403 | 416 | <script> |
@@ -448,8 +461,9 @@ discard block |
||
448 | 461 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
449 | 462 | <?php |
450 | 463 | $year_array = $Stats->countAllMonthsLastYear($airline_icao,$filter_name); |
451 | - if (count($year_array) == 0) print _("No data available"); |
|
452 | - else { |
|
464 | + if (count($year_array) == 0) { |
|
465 | + print _("No data available"); |
|
466 | + } else { |
|
453 | 467 | print '<div id="chart8" class="chart" width="100%"></div> |
454 | 468 | <script> |
455 | 469 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -494,8 +508,9 @@ discard block |
||
494 | 508 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
495 | 509 | <?php |
496 | 510 | $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
497 | - if (count($month_array) == 0) print _("No data available"); |
|
498 | - else { |
|
511 | + if (count($month_array) == 0) { |
|
512 | + print _("No data available"); |
|
513 | + } else { |
|
499 | 514 | print '<div id="chart9" class="chart" width="100%"></div> |
500 | 515 | <script> |
501 | 516 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -540,8 +555,9 @@ discard block |
||
540 | 555 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
541 | 556 | <?php |
542 | 557 | $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
543 | - if (empty($date_array)) print _("No data available"); |
|
544 | - else { |
|
558 | + if (empty($date_array)) { |
|
559 | + print _("No data available"); |
|
560 | + } else { |
|
545 | 561 | print '<div id="chart5" class="chart" width="100%"></div> |
546 | 562 | <script> |
547 | 563 | google.load("visualization", "1", {packages:["corechart"]}); |
@@ -587,8 +603,9 @@ discard block |
||
587 | 603 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
588 | 604 | <?php |
589 | 605 | $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
590 | - if (empty($hour_array)) print _("No data available"); |
|
591 | - else { |
|
606 | + if (empty($hour_array)) { |
|
607 | + print _("No data available"); |
|
608 | + } else { |
|
592 | 609 | |
593 | 610 | print '<div id="chart6" class="chart" width="100%"></div> |
594 | 611 | <script> |
@@ -656,8 +673,11 @@ discard block |
||
656 | 673 | $distance = $distance; |
657 | 674 | $unit = 'km'; |
658 | 675 | } |
659 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
660 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
676 | + if (!isset($polar_data)) { |
|
677 | + $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
678 | + } else { |
|
679 | + $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
680 | + } |
|
661 | 681 | } |
662 | 682 | ?> |
663 | 683 | <div class="col-md-6"> |
@@ -704,8 +724,11 @@ discard block |
||
704 | 724 | foreach ($msg as $eachmsg) { |
705 | 725 | //$eachmsg = $msg[0]; |
706 | 726 | $data = $eachmsg['source_data']; |
707 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
708 | - else $max = 500; |
|
727 | + if ($data > 500) { |
|
728 | + $max = (round(($data+100)/100))*100; |
|
729 | + } else { |
|
730 | + $max = 500; |
|
731 | + } |
|
709 | 732 | ?> |
710 | 733 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
711 | 734 | <script> |
@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | $title = _("Statistics"); |
8 | 8 | |
9 | 9 | if (!isset($filter_name)) $filter_name = ''; |
10 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
10 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
11 | 11 | if ($airline_icao == 'all') { |
12 | 12 | unset($_COOKIE['stats_airline_icao']); |
13 | - setcookie('stats_airline_icao', '', time()-3600); |
|
13 | + setcookie('stats_airline_icao', '', time() - 3600); |
|
14 | 14 | $airline_icao = ''; |
15 | 15 | } elseif ($airline_icao == '' && isset($_COOKIE['stats_airline_icao'])) { |
16 | 16 | $airline_icao = $_COOKIE['stats_airline_icao']; |
17 | 17 | } elseif ($airline_icao == '' && isset($globalFilter)) { |
18 | 18 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
19 | 19 | } |
20 | -setcookie('stats_airline_icao',$airline_icao); |
|
20 | +setcookie('stats_airline_icao', $airline_icao); |
|
21 | 21 | require_once('header.php'); |
22 | 22 | |
23 | 23 | ?> |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | date_default_timezone_set('UTC'); |
38 | 38 | $lastupdate = strtotime($last_update[0]['value']); |
39 | 39 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
40 | - print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
|
40 | + print '<i>Last update: '.date('Y-m-d G:i:s', $lastupdate).'</i>'; |
|
41 | 41 | } |
42 | 42 | ?> |
43 | 43 | </div> |
@@ -46,30 +46,30 @@ discard block |
||
46 | 46 | ?> |
47 | 47 | <?php include('statistics-sub-menu.php'); ?> |
48 | 48 | <div class="row global-stats"> |
49 | - <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name)); ?></span></div> |
|
50 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
51 | - <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name)); ?></span></div> |
|
52 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
49 | + <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao, $filter_name)); ?></span></div> |
|
50 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
51 | + <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao, $filter_name)); ?></span></div> |
|
52 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
53 | 53 | <?php |
54 | 54 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
55 | 55 | ?> |
56 | - <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name)); ?></span></div> |
|
57 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
56 | + <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao, $filter_name)); ?></span></div> |
|
57 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
58 | 58 | <?php |
59 | 59 | } else { |
60 | 60 | ?> |
61 | - <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name)); ?></span></div> |
|
62 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
61 | + <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao, $filter_name)); ?></span></div> |
|
62 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
63 | 63 | <?php |
64 | 64 | } |
65 | 65 | ?> |
66 | - <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name)); ?></span></div> |
|
67 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
66 | + <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao, $filter_name)); ?></span></div> |
|
67 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
68 | 68 | <?php |
69 | 69 | if ($airline_icao == '') { |
70 | 70 | ?> |
71 | 71 | <div class="col-md-2"><span class="type"><?php echo _("Airlines"); ?></span><span><?php print number_format($Stats->countOverallAirlines($filter_name)); ?></span></div> |
72 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
72 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
73 | 73 | <?php |
74 | 74 | } |
75 | 75 | ?> |
@@ -77,18 +77,18 @@ discard block |
||
77 | 77 | if (!(isset($globalIVAO) && $globalIVAO) && !(isset($globalVATSIM) && $globalVATSIM) && !(isset($globalphpVMS) && $globalphpVMS)) { |
78 | 78 | ?> |
79 | 79 | <div class="col-md-2"><span class="type"><?php echo _("Military"); ?></span><span><?php print number_format($Stats->countOverallMilitaryFlights($filter_name)); ?></span></div> |
80 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
80 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
81 | 81 | <?php |
82 | 82 | } |
83 | 83 | ?> |
84 | 84 | </div> |
85 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
85 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
86 | 86 | <div class="specific-stats"> |
87 | 87 | <div class="row column"> |
88 | 88 | <div class="col-md-6"> |
89 | 89 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
90 | 90 | <?php |
91 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
|
91 | + $aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name); |
|
92 | 92 | if (count($aircraft_array) == 0) print _("No data available"); |
93 | 93 | else { |
94 | 94 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | var data = google.visualization.arrayToDataTable([ |
101 | 101 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
102 | 102 | $aircraft_data = ''; |
103 | - foreach($aircraft_array as $aircraft_item) |
|
103 | + foreach ($aircraft_array as $aircraft_item) |
|
104 | 104 | { |
105 | 105 | $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
106 | 106 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
128 | 128 | </div> |
129 | 129 | </div> |
130 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
130 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
131 | 131 | <?php |
132 | 132 | // echo $airline_icao; |
133 | 133 | if ($airline_icao == '' || $airline_icao == 'all') { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | <div class="col-md-6"> |
136 | 136 | <h2><?php echo _("Top 10 Most Common Airline"); ?></h2> |
137 | 137 | <?php |
138 | - $airline_array = $Stats->countAllAirlines(true,$filter_name); |
|
138 | + $airline_array = $Stats->countAllAirlines(true, $filter_name); |
|
139 | 139 | if (count($airline_array) == 0) print _("No data available"); |
140 | 140 | else { |
141 | 141 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | var data = google.visualization.arrayToDataTable([ |
148 | 148 | ["'._("Airline").'", "'._("# of times").'"], '; |
149 | 149 | $airline_data = ''; |
150 | - foreach($airline_array as $airline_item) |
|
150 | + foreach ($airline_array as $airline_item) |
|
151 | 151 | { |
152 | 152 | $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
153 | 153 | } |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | </div> |
176 | 176 | </div> |
177 | 177 | </div> |
178 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
178 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
179 | 179 | <?php |
180 | 180 | } |
181 | 181 | ?> |
182 | 182 | <div class="row column"> |
183 | 183 | |
184 | 184 | <?php |
185 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
185 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao, $filter_name); |
|
186 | 186 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
187 | 187 | if (empty($flightover_array)) { |
188 | 188 | ?> |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | ?> |
197 | 197 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
198 | 198 | <?php |
199 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
|
199 | + $pilot_array = $Stats->countAllPilots(true, $airline_icao, $filter_name); |
|
200 | 200 | if (count($pilot_array) == 0) print _("No data available"); |
201 | 201 | else { |
202 | 202 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | var data = google.visualization.arrayToDataTable([ |
209 | 209 | ["'._("Pilots").'", "'._("# of times").'"], '; |
210 | 210 | $pilot_data = ''; |
211 | - foreach($pilot_array as $pilot_item) |
|
211 | + foreach ($pilot_array as $pilot_item) |
|
212 | 212 | { |
213 | 213 | $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
214 | 214 | } |
@@ -236,14 +236,14 @@ discard block |
||
236 | 236 | </div> |
237 | 237 | </div> |
238 | 238 | |
239 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
239 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
240 | 240 | <?php |
241 | 241 | } else { |
242 | 242 | ?> |
243 | 243 | <div class="col-md-6"> |
244 | 244 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
245 | 245 | <?php |
246 | - $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
|
246 | + $owner_array = $Stats->countAllOwners(true, $airline_icao, $filter_name); |
|
247 | 247 | if (count($owner_array) == 0) print _("No data available"); |
248 | 248 | else { |
249 | 249 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | var data = google.visualization.arrayToDataTable([ |
256 | 256 | ["'._("Owner").'", "'._("# of times").'"], '; |
257 | 257 | $owner_data = ''; |
258 | - foreach($owner_array as $owner_item) |
|
258 | + foreach ($owner_array as $owner_item) |
|
259 | 259 | { |
260 | 260 | $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
261 | 261 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | </div> |
284 | 284 | </div> |
285 | 285 | |
286 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
286 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
287 | 287 | <?php |
288 | 288 | } |
289 | 289 | if (!empty($flightover_array)) { |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | var data = google.visualization.arrayToDataTable([ |
305 | 305 | ["'._("Country").'", "'._("# of times").'"], '; |
306 | 306 | $flightover_data = ''; |
307 | - foreach($flightover_array as $flightover_item) |
|
307 | + foreach ($flightover_array as $flightover_item) |
|
308 | 308 | { |
309 | 309 | $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
310 | 310 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | ?> |
339 | 339 | </div> |
340 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
340 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
341 | 341 | |
342 | 342 | |
343 | 343 | </div> |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | <div class="col-md-6"> |
346 | 346 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
347 | 347 | <?php |
348 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
348 | + $airport_airport_array = $Stats->countAllDepartureAirports(true, $airline_icao, $filter_name); |
|
349 | 349 | if (count($airport_airport_array) == 0) print _("No data available"); |
350 | 350 | else { |
351 | 351 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | var data = google.visualization.arrayToDataTable([ |
362 | 362 | ["'._("Airport").'", "'._("# of times").'"],'; |
363 | 363 | $airport_data = ''; |
364 | - foreach($airport_airport_array as $airport_item) |
|
364 | + foreach ($airport_airport_array as $airport_item) |
|
365 | 365 | { |
366 | 366 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
367 | 367 | $name = str_replace("'", "", $name); |
@@ -390,12 +390,12 @@ discard block |
||
390 | 390 | <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
391 | 391 | </div> |
392 | 392 | </div> |
393 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
393 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
394 | 394 | |
395 | 395 | <div class="col-md-6"> |
396 | 396 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
397 | 397 | <?php |
398 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
398 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true, $airline_icao, $filter_name); |
|
399 | 399 | if (count($airport_airport_array2) == 0) print _("No data available"); |
400 | 400 | else { |
401 | 401 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | var data = google.visualization.arrayToDataTable([ |
412 | 412 | ["'._("Airport").'", "'._("# of times").'"],'; |
413 | 413 | $airport_data2 = ''; |
414 | - foreach($airport_airport_array2 as $airport_item2) |
|
414 | + foreach ($airport_airport_array2 as $airport_item2) |
|
415 | 415 | { |
416 | 416 | $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
417 | 417 | $name2 = str_replace("'", "", $name2); |
@@ -441,13 +441,13 @@ discard block |
||
441 | 441 | </div> |
442 | 442 | </div> |
443 | 443 | </div> |
444 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
444 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
445 | 445 | |
446 | 446 | <div class="row column"> |
447 | 447 | <div class="col-md-6"> |
448 | 448 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
449 | 449 | <?php |
450 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
450 | + $year_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
451 | 451 | if (count($year_array) == 0) print _("No data available"); |
452 | 452 | else { |
453 | 453 | print '<div id="chart8" class="chart" width="100%"></div> |
@@ -458,9 +458,9 @@ discard block |
||
458 | 458 | var data = google.visualization.arrayToDataTable([ |
459 | 459 | ["'._("Month").'", "'._("# of Flights").'"], '; |
460 | 460 | $year_data = ''; |
461 | - foreach($year_array as $year_item) |
|
461 | + foreach ($year_array as $year_item) |
|
462 | 462 | { |
463 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
463 | + $year_data .= '[ "'.date('F, Y', strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
464 | 464 | } |
465 | 465 | $year_data = substr($year_data, 0, -1); |
466 | 466 | print $year_data; |
@@ -488,12 +488,12 @@ discard block |
||
488 | 488 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
489 | 489 | </div> |
490 | 490 | </div> |
491 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
491 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
492 | 492 | |
493 | 493 | <div class="col-md-6"> |
494 | 494 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
495 | 495 | <?php |
496 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
496 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name); |
|
497 | 497 | if (count($month_array) == 0) print _("No data available"); |
498 | 498 | else { |
499 | 499 | print '<div id="chart9" class="chart" width="100%"></div> |
@@ -504,9 +504,9 @@ discard block |
||
504 | 504 | var data = google.visualization.arrayToDataTable([ |
505 | 505 | ["'._("Day").'", "'._("# of Flights").'"], '; |
506 | 506 | $month_data = ''; |
507 | - foreach($month_array as $month_item) |
|
507 | + foreach ($month_array as $month_item) |
|
508 | 508 | { |
509 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
509 | + $month_data .= '[ "'.date('F j, Y', strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
510 | 510 | } |
511 | 511 | $month_data = substr($month_data, 0, -1); |
512 | 512 | print $month_data; |
@@ -534,12 +534,12 @@ discard block |
||
534 | 534 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
535 | 535 | </div> |
536 | 536 | </div> |
537 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
537 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
538 | 538 | |
539 | 539 | <div class="col-md-6"> |
540 | 540 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
541 | 541 | <?php |
542 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
542 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name); |
|
543 | 543 | if (empty($date_array)) print _("No data available"); |
544 | 544 | else { |
545 | 545 | print '<div id="chart5" class="chart" width="100%"></div> |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | ["'._("Date").'", "'._("# of Flights").'"], '; |
552 | 552 | $date_data = ''; |
553 | 553 | |
554 | - foreach($date_array as $date_item) |
|
554 | + foreach ($date_array as $date_item) |
|
555 | 555 | { |
556 | 556 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
557 | 557 | } |
@@ -581,12 +581,12 @@ discard block |
||
581 | 581 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
582 | 582 | </div> |
583 | 583 | </div> |
584 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
584 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
585 | 585 | |
586 | 586 | <div class="col-md-6"> |
587 | 587 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
588 | 588 | <?php |
589 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
589 | + $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name); |
|
590 | 590 | if (empty($hour_array)) print _("No data available"); |
591 | 591 | else { |
592 | 592 | |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | var data = google.visualization.arrayToDataTable([ |
599 | 599 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
600 | 600 | $hour_data = ''; |
601 | - foreach($hour_array as $hour_item) |
|
601 | + foreach ($hour_array as $hour_item) |
|
602 | 602 | { |
603 | 603 | $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
604 | 604 | } |
@@ -628,21 +628,21 @@ discard block |
||
628 | 628 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
629 | 629 | </div> |
630 | 630 | </div> |
631 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
631 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
632 | 632 | </div> |
633 | 633 | <?php |
634 | 634 | if ($airline_icao == '' && $filter_name == '') { |
635 | 635 | ?> |
636 | 636 | <div class="row column"> |
637 | 637 | <?php |
638 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
638 | + $polar = $Stats->getStatsSource(date('Y-m-d'), 'polar'); |
|
639 | 639 | if (!empty($polar)) { |
640 | 640 | print '<h2>'._("Coverage pattern").'</h2>'; |
641 | 641 | foreach ($polar as $eachpolar) { |
642 | 642 | unset($polar_data); |
643 | 643 | $Spotter = new Spotter(); |
644 | 644 | $data = json_decode($eachpolar['source_data']); |
645 | - foreach($data as $value => $key) { |
|
645 | + foreach ($data as $value => $key) { |
|
646 | 646 | $direction = $Spotter->parseDirection(($value*22.5)); |
647 | 647 | $distance = $key; |
648 | 648 | $unit = 'km'; |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | ?> |
663 | 663 | <div class="col-md-6"> |
664 | 664 | <h4><?php print $eachpolar['source_name']; ?></h4> |
665 | - <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
665 | + <div id="polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
|
666 | 666 | <script> |
667 | 667 | (function() { |
668 | 668 | var margin = {top: 100, right: 100, bottom: 100, left: 100}, |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | color: color, |
687 | 687 | unit: '<?php echo $unit; ?>' |
688 | 688 | }; |
689 | - RadarChart("#polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
689 | + RadarChart("#polar-<?php print str_replace(' ', '_', strtolower($eachpolar['source_name'])); ?>", data, radarChartOptions); |
|
690 | 690 | })(); |
691 | 691 | </script> |
692 | 692 | </div> |
@@ -698,19 +698,19 @@ discard block |
||
698 | 698 | <div class="row column"> |
699 | 699 | <div class="col-md-6"> |
700 | 700 | <?php |
701 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
701 | + $msg = $Stats->getStatsSource(date('Y-m-d'), 'msg'); |
|
702 | 702 | if (!empty($msg)) { |
703 | 703 | print '<h2>'._("Messages received").'</h2>'; |
704 | 704 | foreach ($msg as $eachmsg) { |
705 | 705 | //$eachmsg = $msg[0]; |
706 | 706 | $data = $eachmsg['source_data']; |
707 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
707 | + if ($data > 500) $max = (round(($data + 100)/100))*100; |
|
708 | 708 | else $max = 500; |
709 | 709 | ?> |
710 | - <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
710 | + <div id="msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
|
711 | 711 | <script> |
712 | 712 | var g = new JustGage({ |
713 | - id: "msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>", |
|
713 | + id: "msg-<?php print str_replace(' ', '_', strtolower($eachmsg['source_name'])); ?>", |
|
714 | 714 | value: <?php echo $data; ?>, |
715 | 715 | min: 0, |
716 | 716 | max: <?php print $max; ?>, |
@@ -730,12 +730,12 @@ discard block |
||
730 | 730 | <div class="row column"> |
731 | 731 | |
732 | 732 | <?php |
733 | - $hist = $Stats->getStatsSource(date('Y-m-d'),'hist'); |
|
733 | + $hist = $Stats->getStatsSource(date('Y-m-d'), 'hist'); |
|
734 | 734 | foreach ($hist as $hists) { |
735 | 735 | $hist_data = ''; |
736 | 736 | $source = $hists['source_name']; |
737 | 737 | $hist_array = json_decode($hists['source_data']); |
738 | - foreach($hist_array as $distance => $nb) |
|
738 | + foreach ($hist_array as $distance => $nb) |
|
739 | 739 | { |
740 | 740 | $unit = 'km'; |
741 | 741 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -753,13 +753,13 @@ discard block |
||
753 | 753 | $hist_data = substr($hist_data, 0, -1); |
754 | 754 | ?> |
755 | 755 | <div class="col-md-6"> |
756 | - <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
|
756 | + <h2><?php echo sprintf(_("Flights Distance for %s"), $source); ?></h2> |
|
757 | 757 | <?php |
758 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
758 | + print '<div id="charthist-'.str_replace(' ', '_', strtolower($source)).'" class="chart" width="100%"></div> |
|
759 | 759 | <script> |
760 | 760 | google.load("visualization", "1", {packages:["corechart"]}); |
761 | - google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
|
762 | - function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
|
761 | + google.setOnLoadCallback(drawCharthist_'.str_replace(' ', '_', strtolower($source)).'); |
|
762 | + function drawCharthist_'.str_replace(' ', '_', strtolower($source)).'() { |
|
763 | 763 | var data = google.visualization.arrayToDataTable([ |
764 | 764 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
765 | 765 | print $hist_data; |
@@ -774,16 +774,16 @@ discard block |
||
774 | 774 | colors: ["#1a3151"] |
775 | 775 | }; |
776 | 776 | |
777 | - var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ','_',strtolower($source)).'")); |
|
777 | + var chart = new google.visualization.AreaChart(document.getElementById("charthist-'.str_replace(' ', '_', strtolower($source)).'")); |
|
778 | 778 | chart.draw(data, options); |
779 | 779 | } |
780 | 780 | $(window).resize(function(){ |
781 | - drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
|
781 | + drawCharthist_'.str_replace(' ', '_', strtolower($source)).'(); |
|
782 | 782 | }); |
783 | 783 | </script>'; |
784 | 784 | ?> |
785 | 785 | </div> |
786 | - <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
|
786 | + <!-- <?php print 'Time elapsed : '.(microtime(true) - $beginpage).'s' ?> --> |
|
787 | 787 | <?php |
788 | 788 | } |
789 | 789 | ?> |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | if (isset($globalTimezone) && $globalTimezone != '') date_default_timezone_set($globalTimezone); |
40 | 40 | print '<i>Last update: '.date('Y-m-d G:i:s',$lastupdate).'</i>'; |
41 | 41 | } |
42 | - ?> |
|
42 | + ?> |
|
43 | 43 | </div> |
44 | 44 | <?php |
45 | 45 | // print_r($Stats->getAllAirlineNames()); |
46 | - ?> |
|
46 | + ?> |
|
47 | 47 | <?php include('statistics-sub-menu.php'); ?> |
48 | 48 | <div class="row global-stats"> |
49 | 49 | <div class="col-md-2"><span class="type"><?php echo _("Flights"); ?></span><span><?php print number_format($Stats->countOverallFlights($airline_icao,$filter_name)); ?></span></div> |
@@ -51,23 +51,23 @@ discard block |
||
51 | 51 | <div class="col-md-2"><span class="type"><?php echo _("Arrivals seen"); ?></span><span><?php print number_format($Stats->countOverallArrival($airline_icao,$filter_name)); ?></span></div> |
52 | 52 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
53 | 53 | <?php |
54 | - if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
54 | + if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
|
55 | 55 | ?> |
56 | 56 | <div class="col-md-2"><span class="type"><?php echo _("Pilots"); ?></span><span><?php print number_format($Stats->countOverallPilots($airline_icao,$filter_name)); ?></span></div> |
57 | 57 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
58 | 58 | <?php |
59 | - } else { |
|
60 | - ?> |
|
59 | + } else { |
|
60 | + ?> |
|
61 | 61 | <div class="col-md-2"><span class="type"><?php echo _("Owners"); ?></span><span><?php print number_format($Stats->countOverallOwners($airline_icao,$filter_name)); ?></span></div> |
62 | 62 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
63 | 63 | <?php |
64 | - } |
|
65 | - ?> |
|
64 | + } |
|
65 | + ?> |
|
66 | 66 | <div class="col-md-2"><span class="type"><?php echo _("Aircrafts"); ?></span><span><?php print number_format($Stats->countOverallAircrafts($airline_icao,$filter_name)); ?></span></div> |
67 | 67 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
68 | 68 | <?php |
69 | - if ($airline_icao == '') { |
|
70 | - ?> |
|
69 | + if ($airline_icao == '') { |
|
70 | + ?> |
|
71 | 71 | <div class="col-md-2"><span class="type"><?php echo _("Airlines"); ?></span><span><?php print number_format($Stats->countOverallAirlines($filter_name)); ?></span></div> |
72 | 72 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
73 | 73 | <?php |
@@ -88,25 +88,25 @@ discard block |
||
88 | 88 | <div class="col-md-6"> |
89 | 89 | <h2><?php echo _("Top 10 Most Common Aircraft Type"); ?></h2> |
90 | 90 | <?php |
91 | - $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
|
92 | - if (count($aircraft_array) == 0) print _("No data available"); |
|
93 | - else { |
|
91 | + $aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name); |
|
92 | + if (count($aircraft_array) == 0) print _("No data available"); |
|
93 | + else { |
|
94 | 94 | |
95 | - print '<div id="chart1" class="chart" width="100%"></div> |
|
95 | + print '<div id="chart1" class="chart" width="100%"></div> |
|
96 | 96 | <script> |
97 | 97 | google.load("visualization", "1", {packages:["corechart"]}); |
98 | 98 | google.setOnLoadCallback(drawChart1); |
99 | 99 | function drawChart1() { |
100 | 100 | var data = google.visualization.arrayToDataTable([ |
101 | 101 | ["'._("Aircraft").'", "'._("# of times").'"], '; |
102 | - $aircraft_data = ''; |
|
103 | - foreach($aircraft_array as $aircraft_item) |
|
104 | - { |
|
105 | - $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
106 | - } |
|
107 | - $aircraft_data = substr($aircraft_data, 0, -1); |
|
108 | - print $aircraft_data; |
|
109 | - print ']); |
|
102 | + $aircraft_data = ''; |
|
103 | + foreach($aircraft_array as $aircraft_item) |
|
104 | + { |
|
105 | + $aircraft_data .= '[ "'.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
106 | + } |
|
107 | + $aircraft_data = substr($aircraft_data, 0, -1); |
|
108 | + print $aircraft_data; |
|
109 | + print ']); |
|
110 | 110 | |
111 | 111 | var options = { |
112 | 112 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | drawChart1(); |
122 | 122 | }); |
123 | 123 | </script>'; |
124 | - } |
|
125 | - ?> |
|
124 | + } |
|
125 | + ?> |
|
126 | 126 | <div class="more"> |
127 | 127 | <a href="<?php print $globalURL; ?>/statistics/aircraft" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
128 | 128 | </div> |
@@ -130,30 +130,30 @@ discard block |
||
130 | 130 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
131 | 131 | <?php |
132 | 132 | // echo $airline_icao; |
133 | - if ($airline_icao == '' || $airline_icao == 'all') { |
|
133 | + if ($airline_icao == '' || $airline_icao == 'all') { |
|
134 | 134 | ?> |
135 | 135 | <div class="col-md-6"> |
136 | 136 | <h2><?php echo _("Top 10 Most Common Airline"); ?></h2> |
137 | 137 | <?php |
138 | - $airline_array = $Stats->countAllAirlines(true,$filter_name); |
|
139 | - if (count($airline_array) == 0) print _("No data available"); |
|
140 | - else { |
|
138 | + $airline_array = $Stats->countAllAirlines(true,$filter_name); |
|
139 | + if (count($airline_array) == 0) print _("No data available"); |
|
140 | + else { |
|
141 | 141 | |
142 | - print '<div id="chart2" class="chart" width="100%"></div> |
|
142 | + print '<div id="chart2" class="chart" width="100%"></div> |
|
143 | 143 | <script> |
144 | 144 | google.load("visualization", "1", {packages:["corechart"]}); |
145 | 145 | google.setOnLoadCallback(drawChart2); |
146 | 146 | function drawChart2() { |
147 | 147 | var data = google.visualization.arrayToDataTable([ |
148 | 148 | ["'._("Airline").'", "'._("# of times").'"], '; |
149 | - $airline_data = ''; |
|
150 | - foreach($airline_array as $airline_item) |
|
151 | - { |
|
152 | - $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
|
153 | - } |
|
154 | - $airline_data = substr($airline_data, 0, -1); |
|
155 | - print $airline_data; |
|
156 | - print ']); |
|
149 | + $airline_data = ''; |
|
150 | + foreach($airline_array as $airline_item) |
|
151 | + { |
|
152 | + $airline_data .= '[ "'.$airline_item['airline_name'].' ('.$airline_item['airline_icao'].')",'.$airline_item['airline_count'].'],'; |
|
153 | + } |
|
154 | + $airline_data = substr($airline_data, 0, -1); |
|
155 | + print $airline_data; |
|
156 | + print ']); |
|
157 | 157 | |
158 | 158 | var options = { |
159 | 159 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -168,8 +168,8 @@ discard block |
||
168 | 168 | drawChart2(); |
169 | 169 | }); |
170 | 170 | </script>'; |
171 | - } |
|
172 | - ?> |
|
171 | + } |
|
172 | + ?> |
|
173 | 173 | <div class="more"> |
174 | 174 | <a href="<?php print $globalURL; ?>/statistics/airline" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
175 | 175 | </div> |
@@ -177,44 +177,44 @@ discard block |
||
177 | 177 | </div> |
178 | 178 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
179 | 179 | <?php |
180 | - } |
|
180 | + } |
|
181 | 181 | ?> |
182 | 182 | <div class="row column"> |
183 | 183 | |
184 | 184 | <?php |
185 | - $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
185 | + $flightover_array = $Stats->countAllFlightOverCountries($airline_icao,$filter_name); |
|
186 | 186 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
187 | - if (empty($flightover_array)) { |
|
188 | - ?> |
|
187 | + if (empty($flightover_array)) { |
|
188 | + ?> |
|
189 | 189 | <div class="col-md-12"> |
190 | 190 | <?php |
191 | - } else { |
|
192 | - ?> |
|
191 | + } else { |
|
192 | + ?> |
|
193 | 193 | <div class="col-md-6"> |
194 | 194 | <?php |
195 | - } |
|
196 | - ?> |
|
195 | + } |
|
196 | + ?> |
|
197 | 197 | <h2><?php echo _("Top 10 Most Common Pilots"); ?></h2> |
198 | 198 | <?php |
199 | - $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
|
200 | - if (count($pilot_array) == 0) print _("No data available"); |
|
201 | - else { |
|
199 | + $pilot_array = $Stats->countAllPilots(true,$airline_icao,$filter_name); |
|
200 | + if (count($pilot_array) == 0) print _("No data available"); |
|
201 | + else { |
|
202 | 202 | |
203 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
203 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
204 | 204 | <script> |
205 | 205 | google.load("visualization", "1", {packages:["corechart"]}); |
206 | 206 | google.setOnLoadCallback(drawChart7); |
207 | 207 | function drawChart7() { |
208 | 208 | var data = google.visualization.arrayToDataTable([ |
209 | 209 | ["'._("Pilots").'", "'._("# of times").'"], '; |
210 | - $pilot_data = ''; |
|
211 | - foreach($pilot_array as $pilot_item) |
|
212 | - { |
|
213 | - $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
|
214 | - } |
|
215 | - $pilot_data = substr($pilot_data, 0, -1); |
|
216 | - print $pilot_data; |
|
217 | - print ']); |
|
210 | + $pilot_data = ''; |
|
211 | + foreach($pilot_array as $pilot_item) |
|
212 | + { |
|
213 | + $pilot_data .= '[ "'.$pilot_item['pilot_name'].' ('.$pilot_item['pilot_id'].')",'.$pilot_item['pilot_count'].'],'; |
|
214 | + } |
|
215 | + $pilot_data = substr($pilot_data, 0, -1); |
|
216 | + print $pilot_data; |
|
217 | + print ']); |
|
218 | 218 | |
219 | 219 | var options = { |
220 | 220 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -229,8 +229,8 @@ discard block |
||
229 | 229 | drawChart7(); |
230 | 230 | }); |
231 | 231 | </script>'; |
232 | - } |
|
233 | - ?> |
|
232 | + } |
|
233 | + ?> |
|
234 | 234 | <div class="more"> |
235 | 235 | <a href="<?php print $globalURL; ?>/statistics/pilot" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
236 | 236 | </div> |
@@ -238,30 +238,30 @@ discard block |
||
238 | 238 | |
239 | 239 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
240 | 240 | <?php |
241 | - } else { |
|
242 | - ?> |
|
241 | + } else { |
|
242 | + ?> |
|
243 | 243 | <div class="col-md-6"> |
244 | 244 | <h2><?php echo _("Top 10 Most Common Owners"); ?></h2> |
245 | 245 | <?php |
246 | - $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
|
247 | - if (count($owner_array) == 0) print _("No data available"); |
|
248 | - else { |
|
246 | + $owner_array = $Stats->countAllOwners(true,$airline_icao,$filter_name); |
|
247 | + if (count($owner_array) == 0) print _("No data available"); |
|
248 | + else { |
|
249 | 249 | |
250 | - print '<div id="chart7" class="chart" width="100%"></div> |
|
250 | + print '<div id="chart7" class="chart" width="100%"></div> |
|
251 | 251 | <script> |
252 | 252 | google.load("visualization", "1", {packages:["corechart"]}); |
253 | 253 | google.setOnLoadCallback(drawChart7); |
254 | 254 | function drawChart7() { |
255 | 255 | var data = google.visualization.arrayToDataTable([ |
256 | 256 | ["'._("Owner").'", "'._("# of times").'"], '; |
257 | - $owner_data = ''; |
|
258 | - foreach($owner_array as $owner_item) |
|
259 | - { |
|
260 | - $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
|
261 | - } |
|
262 | - $owner_data = substr($owner_data, 0, -1); |
|
263 | - print $owner_data; |
|
264 | - print ']); |
|
257 | + $owner_data = ''; |
|
258 | + foreach($owner_array as $owner_item) |
|
259 | + { |
|
260 | + $owner_data .= '[ "'.$owner_item['owner_name'].'",'.$owner_item['owner_count'].'],'; |
|
261 | + } |
|
262 | + $owner_data = substr($owner_data, 0, -1); |
|
263 | + print $owner_data; |
|
264 | + print ']); |
|
265 | 265 | |
266 | 266 | var options = { |
267 | 267 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | drawChart7(); |
277 | 277 | }); |
278 | 278 | </script>'; |
279 | - } |
|
280 | - ?> |
|
279 | + } |
|
280 | + ?> |
|
281 | 281 | <div class="more"> |
282 | 282 | <a href="<?php print $globalURL; ?>/statistics/owner" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
283 | 283 | </div> |
@@ -285,32 +285,32 @@ discard block |
||
285 | 285 | |
286 | 286 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
287 | 287 | <?php |
288 | - } |
|
289 | - if (!empty($flightover_array)) { |
|
290 | - ?> |
|
288 | + } |
|
289 | + if (!empty($flightover_array)) { |
|
290 | + ?> |
|
291 | 291 | |
292 | 292 | <div class="col-md-6"> |
293 | 293 | <h2><?php echo _("Top 20 Most Common Country a Flight was Over"); ?></h2> |
294 | 294 | <?php |
295 | - //$flightover_array = $Stats->countAllFlightOverCountries(); |
|
296 | - if (count($flightover_array) == 0) print _("No data available"); |
|
297 | - else { |
|
295 | + //$flightover_array = $Stats->countAllFlightOverCountries(); |
|
296 | + if (count($flightover_array) == 0) print _("No data available"); |
|
297 | + else { |
|
298 | 298 | |
299 | - print '<div id="chart10" class="chart" width="100%"></div> |
|
299 | + print '<div id="chart10" class="chart" width="100%"></div> |
|
300 | 300 | <script> |
301 | 301 | google.load("visualization", "1", {packages:["corechart"]}); |
302 | 302 | google.setOnLoadCallback(drawChart10); |
303 | 303 | function drawChart10() { |
304 | 304 | var data = google.visualization.arrayToDataTable([ |
305 | 305 | ["'._("Country").'", "'._("# of times").'"], '; |
306 | - $flightover_data = ''; |
|
307 | - foreach($flightover_array as $flightover_item) |
|
308 | - { |
|
309 | - $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
|
310 | - } |
|
311 | - $flightover_data = substr($flightover_data, 0, -1); |
|
312 | - print $flightover_data; |
|
313 | - print ']); |
|
306 | + $flightover_data = ''; |
|
307 | + foreach($flightover_array as $flightover_item) |
|
308 | + { |
|
309 | + $flightover_data .= '[ "'.$flightover_item['flight_country'].' ('.$flightover_item['flight_country_iso2'].')",'.$flightover_item['flight_count'].'],'; |
|
310 | + } |
|
311 | + $flightover_data = substr($flightover_data, 0, -1); |
|
312 | + print $flightover_data; |
|
313 | + print ']); |
|
314 | 314 | |
315 | 315 | var options = { |
316 | 316 | chartArea: {"width": "80%", "height": "60%"}, |
@@ -327,15 +327,15 @@ discard block |
||
327 | 327 | drawChart10(); |
328 | 328 | }); |
329 | 329 | </script>'; |
330 | - } |
|
331 | - ?> |
|
330 | + } |
|
331 | + ?> |
|
332 | 332 | <div class="more"> |
333 | 333 | <a href="<?php print $globalURL; ?>/statistics/country" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
334 | 334 | </div> |
335 | 335 | </div> |
336 | 336 | <?php |
337 | - } |
|
338 | - ?> |
|
337 | + } |
|
338 | + ?> |
|
339 | 339 | </div> |
340 | 340 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
341 | 341 | |
@@ -345,11 +345,11 @@ discard block |
||
345 | 345 | <div class="col-md-6"> |
346 | 346 | <h2><?php echo _("Top 10 Most Common Departure Airports"); ?></h2> |
347 | 347 | <?php |
348 | - $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
349 | - if (count($airport_airport_array) == 0) print _("No data available"); |
|
350 | - else { |
|
348 | + $airport_airport_array = $Stats->countAllDepartureAirports(true,$airline_icao,$filter_name); |
|
349 | + if (count($airport_airport_array) == 0) print _("No data available"); |
|
350 | + else { |
|
351 | 351 | |
352 | - print '<div id="chart3" class="chart" width="100%"></div> |
|
352 | + print '<div id="chart3" class="chart" width="100%"></div> |
|
353 | 353 | <script> |
354 | 354 | google.load("visualization", "1", {packages:["geochart"]}); |
355 | 355 | google.setOnLoadCallback(drawCharts3); |
@@ -360,17 +360,17 @@ discard block |
||
360 | 360 | |
361 | 361 | var data = google.visualization.arrayToDataTable([ |
362 | 362 | ["'._("Airport").'", "'._("# of times").'"],'; |
363 | - $airport_data = ''; |
|
364 | - foreach($airport_airport_array as $airport_item) |
|
365 | - { |
|
366 | - $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
367 | - $name = str_replace("'", "", $name); |
|
368 | - $name = str_replace('"', "", $name); |
|
369 | - $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
370 | - } |
|
371 | - $airport_data = substr($airport_data, 0, -1); |
|
372 | - print $airport_data; |
|
373 | - print ']); |
|
363 | + $airport_data = ''; |
|
364 | + foreach($airport_airport_array as $airport_item) |
|
365 | + { |
|
366 | + $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
|
367 | + $name = str_replace("'", "", $name); |
|
368 | + $name = str_replace('"', "", $name); |
|
369 | + $airport_data .= '[ "'.$name.'",'.$airport_item['airport_departure_icao_count'].'],'; |
|
370 | + } |
|
371 | + $airport_data = substr($airport_data, 0, -1); |
|
372 | + print $airport_data; |
|
373 | + print ']); |
|
374 | 374 | |
375 | 375 | var options = { |
376 | 376 | legend: {position: "none"}, |
@@ -384,8 +384,8 @@ discard block |
||
384 | 384 | chart.draw(data, options); |
385 | 385 | } |
386 | 386 | </script>'; |
387 | - } |
|
388 | - ?> |
|
387 | + } |
|
388 | + ?> |
|
389 | 389 | <div class="more"> |
390 | 390 | <a href="<?php print $globalURL; ?>/statistics/airport-departure" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
391 | 391 | </div> |
@@ -395,11 +395,11 @@ discard block |
||
395 | 395 | <div class="col-md-6"> |
396 | 396 | <h2><?php echo _("Top 10 Most Common Arrival Airports"); ?></h2> |
397 | 397 | <?php |
398 | - $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
399 | - if (count($airport_airport_array2) == 0) print _("No data available"); |
|
400 | - else { |
|
398 | + $airport_airport_array2 = $Stats->countAllArrivalAirports(true,$airline_icao,$filter_name); |
|
399 | + if (count($airport_airport_array2) == 0) print _("No data available"); |
|
400 | + else { |
|
401 | 401 | |
402 | - print '<div id="chart4" class="chart" width="100%"></div> |
|
402 | + print '<div id="chart4" class="chart" width="100%"></div> |
|
403 | 403 | <script> |
404 | 404 | google.load("visualization", "1", {packages:["geochart"]}); |
405 | 405 | google.setOnLoadCallback(drawCharts4); |
@@ -410,17 +410,17 @@ discard block |
||
410 | 410 | |
411 | 411 | var data = google.visualization.arrayToDataTable([ |
412 | 412 | ["'._("Airport").'", "'._("# of times").'"],'; |
413 | - $airport_data2 = ''; |
|
414 | - foreach($airport_airport_array2 as $airport_item2) |
|
415 | - { |
|
416 | - $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
417 | - $name2 = str_replace("'", "", $name2); |
|
418 | - $name2 = str_replace('"', "", $name2); |
|
419 | - $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
420 | - } |
|
421 | - $airport_data2 = substr($airport_data2, 0, -1); |
|
422 | - print $airport_data2; |
|
423 | - print ']); |
|
413 | + $airport_data2 = ''; |
|
414 | + foreach($airport_airport_array2 as $airport_item2) |
|
415 | + { |
|
416 | + $name2 = $airport_item2['airport_arrival_city'].', '.$airport_item2['airport_arrival_country'].' ('.$airport_item2['airport_arrival_icao'].')'; |
|
417 | + $name2 = str_replace("'", "", $name2); |
|
418 | + $name2 = str_replace('"', "", $name2); |
|
419 | + $airport_data2 .= '[ "'.$name2.'",'.$airport_item2['airport_arrival_icao_count'].'],'; |
|
420 | + } |
|
421 | + $airport_data2 = substr($airport_data2, 0, -1); |
|
422 | + print $airport_data2; |
|
423 | + print ']); |
|
424 | 424 | |
425 | 425 | var options = { |
426 | 426 | legend: {position: "none"}, |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | chart.draw(data, options); |
435 | 435 | } |
436 | 436 | </script>'; |
437 | - } |
|
438 | - ?> |
|
437 | + } |
|
438 | + ?> |
|
439 | 439 | <div class="more"> |
440 | 440 | <a href="<?php print $globalURL; ?>/statistics/airport-arrival" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
441 | 441 | </div> |
@@ -447,24 +447,24 @@ discard block |
||
447 | 447 | <div class="col-md-6"> |
448 | 448 | <h2><?php echo _("Busiest Months of the last 12 Months"); ?></h2> |
449 | 449 | <?php |
450 | - $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
451 | - if (count($year_array) == 0) print _("No data available"); |
|
452 | - else { |
|
453 | - print '<div id="chart8" class="chart" width="100%"></div> |
|
450 | + $year_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
451 | + if (count($year_array) == 0) print _("No data available"); |
|
452 | + else { |
|
453 | + print '<div id="chart8" class="chart" width="100%"></div> |
|
454 | 454 | <script> |
455 | 455 | google.load("visualization", "1", {packages:["corechart"]}); |
456 | 456 | google.setOnLoadCallback(drawChart8); |
457 | 457 | function drawChart8() { |
458 | 458 | var data = google.visualization.arrayToDataTable([ |
459 | 459 | ["'._("Month").'", "'._("# of Flights").'"], '; |
460 | - $year_data = ''; |
|
461 | - foreach($year_array as $year_item) |
|
462 | - { |
|
463 | - $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
464 | - } |
|
465 | - $year_data = substr($year_data, 0, -1); |
|
466 | - print $year_data; |
|
467 | - print ']); |
|
460 | + $year_data = ''; |
|
461 | + foreach($year_array as $year_item) |
|
462 | + { |
|
463 | + $year_data .= '[ "'.date('F, Y',strtotime($year_item['year_name'].'-'.$year_item['month_name'].'-01')).'",'.$year_item['date_count'].'],'; |
|
464 | + } |
|
465 | + $year_data = substr($year_data, 0, -1); |
|
466 | + print $year_data; |
|
467 | + print ']); |
|
468 | 468 | |
469 | 469 | var options = { |
470 | 470 | legend: {position: "none"}, |
@@ -482,8 +482,8 @@ discard block |
||
482 | 482 | drawChart8(); |
483 | 483 | }); |
484 | 484 | </script>'; |
485 | - } |
|
486 | - ?> |
|
485 | + } |
|
486 | + ?> |
|
487 | 487 | <div class="more"> |
488 | 488 | <a href="<?php print $globalURL; ?>/statistics/year" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
489 | 489 | </div> |
@@ -493,24 +493,24 @@ discard block |
||
493 | 493 | <div class="col-md-6"> |
494 | 494 | <h2><?php echo _("Busiest Day in the last Month"); ?></h2> |
495 | 495 | <?php |
496 | - $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
497 | - if (count($month_array) == 0) print _("No data available"); |
|
498 | - else { |
|
499 | - print '<div id="chart9" class="chart" width="100%"></div> |
|
496 | + $month_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
497 | + if (count($month_array) == 0) print _("No data available"); |
|
498 | + else { |
|
499 | + print '<div id="chart9" class="chart" width="100%"></div> |
|
500 | 500 | <script> |
501 | 501 | google.load("visualization", "1", {packages:["corechart"]}); |
502 | 502 | google.setOnLoadCallback(drawChart9); |
503 | 503 | function drawChart9() { |
504 | 504 | var data = google.visualization.arrayToDataTable([ |
505 | 505 | ["'._("Day").'", "'._("# of Flights").'"], '; |
506 | - $month_data = ''; |
|
507 | - foreach($month_array as $month_item) |
|
508 | - { |
|
509 | - $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
510 | - } |
|
511 | - $month_data = substr($month_data, 0, -1); |
|
512 | - print $month_data; |
|
513 | - print ']); |
|
506 | + $month_data = ''; |
|
507 | + foreach($month_array as $month_item) |
|
508 | + { |
|
509 | + $month_data .= '[ "'.date('F j, Y',strtotime($month_item['date_name'])).'",'.$month_item['date_count'].'],'; |
|
510 | + } |
|
511 | + $month_data = substr($month_data, 0, -1); |
|
512 | + print $month_data; |
|
513 | + print ']); |
|
514 | 514 | |
515 | 515 | var options = { |
516 | 516 | legend: {position: "none"}, |
@@ -528,8 +528,8 @@ discard block |
||
528 | 528 | drawChart9(); |
529 | 529 | }); |
530 | 530 | </script>'; |
531 | - } |
|
532 | - ?> |
|
531 | + } |
|
532 | + ?> |
|
533 | 533 | <div class="more"> |
534 | 534 | <a href="<?php print $globalURL; ?>/statistics/month" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
535 | 535 | </div> |
@@ -539,25 +539,25 @@ discard block |
||
539 | 539 | <div class="col-md-6"> |
540 | 540 | <h2><?php echo _("Busiest Day in the last 7 Days"); ?></h2> |
541 | 541 | <?php |
542 | - $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
543 | - if (empty($date_array)) print _("No data available"); |
|
544 | - else { |
|
545 | - print '<div id="chart5" class="chart" width="100%"></div> |
|
542 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
543 | + if (empty($date_array)) print _("No data available"); |
|
544 | + else { |
|
545 | + print '<div id="chart5" class="chart" width="100%"></div> |
|
546 | 546 | <script> |
547 | 547 | google.load("visualization", "1", {packages:["corechart"]}); |
548 | 548 | google.setOnLoadCallback(drawChart5); |
549 | 549 | function drawChart5() { |
550 | 550 | var data = google.visualization.arrayToDataTable([ |
551 | 551 | ["'._("Date").'", "'._("# of Flights").'"], '; |
552 | - $date_data = ''; |
|
552 | + $date_data = ''; |
|
553 | 553 | |
554 | - foreach($date_array as $date_item) |
|
555 | - { |
|
556 | - $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
557 | - } |
|
558 | - $date_data = substr($date_data, 0, -1); |
|
559 | - print $date_data; |
|
560 | - print ']); |
|
554 | + foreach($date_array as $date_item) |
|
555 | + { |
|
556 | + $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
|
557 | + } |
|
558 | + $date_data = substr($date_data, 0, -1); |
|
559 | + print $date_data; |
|
560 | + print ']); |
|
561 | 561 | |
562 | 562 | var options = { |
563 | 563 | legend: {position: "none"}, |
@@ -575,8 +575,8 @@ discard block |
||
575 | 575 | drawChart5(); |
576 | 576 | }); |
577 | 577 | </script>'; |
578 | - } |
|
579 | - ?> |
|
578 | + } |
|
579 | + ?> |
|
580 | 580 | <div class="more"> |
581 | 581 | <a href="<?php print $globalURL; ?>/statistics/date" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
582 | 582 | </div> |
@@ -586,25 +586,25 @@ discard block |
||
586 | 586 | <div class="col-md-6"> |
587 | 587 | <h2><?php echo _("Busiest Time of the Day"); ?></h2> |
588 | 588 | <?php |
589 | - $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
590 | - if (empty($hour_array)) print _("No data available"); |
|
591 | - else { |
|
589 | + $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
590 | + if (empty($hour_array)) print _("No data available"); |
|
591 | + else { |
|
592 | 592 | |
593 | - print '<div id="chart6" class="chart" width="100%"></div> |
|
593 | + print '<div id="chart6" class="chart" width="100%"></div> |
|
594 | 594 | <script> |
595 | 595 | google.load("visualization", "1", {packages:["corechart"]}); |
596 | 596 | google.setOnLoadCallback(drawChart6); |
597 | 597 | function drawChart6() { |
598 | 598 | var data = google.visualization.arrayToDataTable([ |
599 | 599 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
600 | - $hour_data = ''; |
|
601 | - foreach($hour_array as $hour_item) |
|
602 | - { |
|
603 | - $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
604 | - } |
|
605 | - $hour_data = substr($hour_data, 0, -1); |
|
606 | - print $hour_data; |
|
607 | - print ']); |
|
600 | + $hour_data = ''; |
|
601 | + foreach($hour_array as $hour_item) |
|
602 | + { |
|
603 | + $hour_data .= '[ "'.$hour_item['hour_name'].':00",'.$hour_item['hour_count'].'],'; |
|
604 | + } |
|
605 | + $hour_data = substr($hour_data, 0, -1); |
|
606 | + print $hour_data; |
|
607 | + print ']); |
|
608 | 608 | |
609 | 609 | var options = { |
610 | 610 | legend: {position: "none"}, |
@@ -622,8 +622,8 @@ discard block |
||
622 | 622 | drawChart6(); |
623 | 623 | }); |
624 | 624 | </script>'; |
625 | - } |
|
626 | - ?> |
|
625 | + } |
|
626 | + ?> |
|
627 | 627 | <div class="more"> |
628 | 628 | <a href="<?php print $globalURL; ?>/statistics/time" class="btn btn-default btn" role="button"><?php echo _("See full statistic"); ?>»</a> |
629 | 629 | </div> |
@@ -631,21 +631,21 @@ discard block |
||
631 | 631 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
632 | 632 | </div> |
633 | 633 | <?php |
634 | - if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') { |
|
634 | + if (($airline_icao == '' || $airline_icao == 'all') && $filter_name == '') { |
|
635 | 635 | ?> |
636 | 636 | <div class="row column"> |
637 | 637 | <?php |
638 | - $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
639 | - if (!empty($polar)) { |
|
640 | - print '<h2>'._("Coverage pattern").'</h2>'; |
|
641 | - foreach ($polar as $eachpolar) { |
|
642 | - unset($polar_data); |
|
643 | - $Spotter = new Spotter(); |
|
644 | - $data = json_decode($eachpolar['source_data']); |
|
645 | - foreach($data as $value => $key) { |
|
646 | - $direction = $Spotter->parseDirection(($value*22.5)); |
|
647 | - $distance = $key; |
|
648 | - $unit = 'km'; |
|
638 | + $polar = $Stats->getStatsSource(date('Y-m-d'),'polar'); |
|
639 | + if (!empty($polar)) { |
|
640 | + print '<h2>'._("Coverage pattern").'</h2>'; |
|
641 | + foreach ($polar as $eachpolar) { |
|
642 | + unset($polar_data); |
|
643 | + $Spotter = new Spotter(); |
|
644 | + $data = json_decode($eachpolar['source_data']); |
|
645 | + foreach($data as $value => $key) { |
|
646 | + $direction = $Spotter->parseDirection(($value*22.5)); |
|
647 | + $distance = $key; |
|
648 | + $unit = 'km'; |
|
649 | 649 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
650 | 650 | $distance = round($distance*0.539957); |
651 | 651 | $unit = 'nm'; |
@@ -656,10 +656,10 @@ discard block |
||
656 | 656 | $distance = $distance; |
657 | 657 | $unit = 'km'; |
658 | 658 | } |
659 | - if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
660 | - else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
661 | - } |
|
662 | - ?> |
|
659 | + if (!isset($polar_data)) $polar_data = '{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
660 | + else $polar_data = $polar_data.',{axis:"'.$direction[0]['direction_shortname'].'",value:'.$key.'}'; |
|
661 | + } |
|
662 | + ?> |
|
663 | 663 | <div class="col-md-6"> |
664 | 664 | <h4><?php print $eachpolar['source_name']; ?></h4> |
665 | 665 | <div id="polar-<?php print str_replace(' ','_',strtolower($eachpolar['source_name'])); ?>" class="chart" width="100%"></div> |
@@ -691,22 +691,22 @@ discard block |
||
691 | 691 | </script> |
692 | 692 | </div> |
693 | 693 | <?php |
694 | - } |
|
695 | - } |
|
696 | - ?> |
|
694 | + } |
|
695 | + } |
|
696 | + ?> |
|
697 | 697 | </div> |
698 | 698 | <div class="row column"> |
699 | 699 | <div class="col-md-6"> |
700 | 700 | <?php |
701 | - $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
702 | - if (!empty($msg)) { |
|
703 | - print '<h2>'._("Messages received").'</h2>'; |
|
704 | - foreach ($msg as $eachmsg) { |
|
705 | - //$eachmsg = $msg[0]; |
|
706 | - $data = $eachmsg['source_data']; |
|
707 | - if ($data > 500) $max = (round(($data+100)/100))*100; |
|
708 | - else $max = 500; |
|
709 | - ?> |
|
701 | + $msg = $Stats->getStatsSource(date('Y-m-d'),'msg'); |
|
702 | + if (!empty($msg)) { |
|
703 | + print '<h2>'._("Messages received").'</h2>'; |
|
704 | + foreach ($msg as $eachmsg) { |
|
705 | + //$eachmsg = $msg[0]; |
|
706 | + $data = $eachmsg['source_data']; |
|
707 | + if ($data > 500) $max = (round(($data+100)/100))*100; |
|
708 | + else $max = 500; |
|
709 | + ?> |
|
710 | 710 | <div id="msg-<?php print str_replace(' ','_',strtolower($eachmsg['source_name'])); ?>" class="col-md-4"></div> |
711 | 711 | <script> |
712 | 712 | var g = new JustGage({ |
@@ -722,9 +722,9 @@ discard block |
||
722 | 722 | }); |
723 | 723 | </script> |
724 | 724 | <?php |
725 | - } |
|
726 | - } |
|
727 | - ?> |
|
725 | + } |
|
726 | + } |
|
727 | + ?> |
|
728 | 728 | </div> |
729 | 729 | </div> |
730 | 730 | <div class="row column"> |
@@ -751,19 +751,19 @@ discard block |
||
751 | 751 | $hist_data .= '[ "'.$distance.'",'.$nb.'],'; |
752 | 752 | } |
753 | 753 | $hist_data = substr($hist_data, 0, -1); |
754 | - ?> |
|
754 | + ?> |
|
755 | 755 | <div class="col-md-6"> |
756 | 756 | <h2><?php echo sprintf(_("Flights Distance for %s"),$source); ?></h2> |
757 | 757 | <?php |
758 | - print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
758 | + print '<div id="charthist-'.str_replace(' ','_',strtolower($source)).'" class="chart" width="100%"></div> |
|
759 | 759 | <script> |
760 | 760 | google.load("visualization", "1", {packages:["corechart"]}); |
761 | 761 | google.setOnLoadCallback(drawCharthist_'.str_replace(' ','_',strtolower($source)).'); |
762 | 762 | function drawCharthist_'.str_replace(' ','_',strtolower($source)).'() { |
763 | 763 | var data = google.visualization.arrayToDataTable([ |
764 | 764 | ["'._("Distance").'", "'._("# of Flights").'"], '; |
765 | - print $hist_data; |
|
766 | - print ']); |
|
765 | + print $hist_data; |
|
766 | + print ']); |
|
767 | 767 | |
768 | 768 | var options = { |
769 | 769 | legend: {position: "none"}, |
@@ -781,15 +781,15 @@ discard block |
||
781 | 781 | drawCharthist_'.str_replace(' ','_',strtolower($source)).'(); |
782 | 782 | }); |
783 | 783 | </script>'; |
784 | - ?> |
|
784 | + ?> |
|
785 | 785 | </div> |
786 | 786 | <!-- <?php print 'Time elapsed : '.(microtime(true)-$beginpage).'s' ?> --> |
787 | 787 | <?php |
788 | - } |
|
789 | - ?> |
|
788 | + } |
|
789 | + ?> |
|
790 | 790 | </div> |
791 | 791 | <?php |
792 | - } |
|
792 | + } |
|
793 | 793 | ?> |
794 | 794 | </div> |
795 | 795 | </div> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | </div> |
15 | 15 | <p>'._("Below are the <strong>Top 10</strong> countries that an airline belongs to.").'</p>'; |
16 | 16 | |
17 | -$airline_array = $Stats->countAllAirlineCountries(true,$filter_name); |
|
17 | +$airline_array = $Stats->countAllAirlineCountries(true, $filter_name); |
|
18 | 18 | if (count($airline_array) > 0) { |
19 | 19 | print '<div id="chartCountry" class="chart" width="100%"></div> |
20 | 20 | <script> |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | var data = google.visualization.arrayToDataTable([ |
25 | 25 | ["'._("Country").'", "'._("# of times").'"], '; |
26 | 26 | $country_data = ''; |
27 | -foreach($airline_array as $airline_item) |
|
27 | +foreach ($airline_array as $airline_item) |
|
28 | 28 | { |
29 | 29 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
30 | 30 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | print '</thead>'; |
59 | 59 | print '<tbody>'; |
60 | 60 | $i = 1; |
61 | - foreach($airline_array as $airline_item) |
|
61 | + foreach ($airline_array as $airline_item) |
|
62 | 62 | { |
63 | 63 | print '<tr>'; |
64 | 64 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,7 +5,9 @@ |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Route by Airport"); |
7 | 7 | require_once('header.php'); |
8 | -if (!isset($filter_name)) $filter_name = ''; |
|
8 | +if (!isset($filter_name)) { |
|
9 | + $filter_name = ''; |
|
10 | +} |
|
9 | 11 | include('statistics-sub-menu.php'); |
10 | 12 | |
11 | 13 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |