@@ -15,11 +15,15 @@ discard block |
||
15 | 15 | require_once('require/class.Tracker.php'); |
16 | 16 | $Tracker = new Tracker(); |
17 | 17 | } |
18 | -if (!isset($filter_name)) $filter_name = ''; |
|
18 | +if (!isset($filter_name)) { |
|
19 | + $filter_name = ''; |
|
20 | +} |
|
19 | 21 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
20 | 22 | if ($airline_icao == '' && isset($globalFilter)) { |
21 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
22 | -} |
|
23 | + if (isset($globalFilter['airline'])) { |
|
24 | + $airline_icao = $globalFilter['airline'][0]; |
|
25 | + } |
|
26 | + } |
|
23 | 27 | |
24 | 28 | require_once('header.php'); |
25 | 29 | include('statistics-sub-menu.php'); |
@@ -32,9 +36,13 @@ discard block |
||
32 | 36 | </div> |
33 | 37 | <p>'._("Below is a chart that plots the busiest day during the <strong>last month</strong>.").'</p>'; |
34 | 38 | |
35 | -if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
36 | -elseif ($type == 'marine') $date_array = $Marine->countAllDatesLastMonth(); |
|
37 | -elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLastMonth(); |
|
39 | +if ($type == 'aircraft') { |
|
40 | + $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
41 | +} elseif ($type == 'marine') { |
|
42 | + $date_array = $Marine->countAllDatesLastMonth(); |
|
43 | +} elseif ($type == 'tracker') { |
|
44 | + $date_array = $Tracker->countAllDatesLastMonth(); |
|
45 | +} |
|
38 | 46 | |
39 | 47 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
40 | 48 | $month_data = ''; |
@@ -75,8 +83,11 @@ discard block |
||
75 | 83 | print '<tr>'; |
76 | 84 | print '<td><strong>'.$i.'</strong></td>'; |
77 | 85 | print '<td>'; |
78 | - if ($type == 'aircraft') print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
79 | - else print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
86 | + if ($type == 'aircraft') { |
|
87 | + print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
88 | + } else { |
|
89 | + print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
90 | + } |
|
80 | 91 | print '</td>'; |
81 | 92 | print '<td>'; |
82 | 93 | print $date_item['date_count']; |
@@ -17,11 +17,15 @@ discard block |
||
17 | 17 | $title = _("Statistics").' - '._("Busiest Month of Last Year"); |
18 | 18 | |
19 | 19 | |
20 | -if (!isset($filter_name)) $filter_name = ''; |
|
20 | +if (!isset($filter_name)) { |
|
21 | + $filter_name = ''; |
|
22 | +} |
|
21 | 23 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
22 | 24 | if ($airline_icao == '' && isset($globalFilter)) { |
23 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
24 | -} |
|
25 | + if (isset($globalFilter['airline'])) { |
|
26 | + $airline_icao = $globalFilter['airline'][0]; |
|
27 | + } |
|
28 | + } |
|
25 | 29 | |
26 | 30 | require_once('header.php'); |
27 | 31 | include('statistics-sub-menu.php'); |
@@ -33,9 +37,13 @@ discard block |
||
33 | 37 | </div> |
34 | 38 | <p>'._("Below is a chart that plots the busiest month during the <strong>last year</strong>.").'</p>'; |
35 | 39 | |
36 | -if ($type == 'aircraft') $date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
37 | -elseif ($type == 'marine') $date_array = $Marine->countAllMonthsLastYear(true); |
|
38 | -elseif ($type == 'tracker') $date_array = $Tracker->countAllMonthsLastYear(true); |
|
40 | +if ($type == 'aircraft') { |
|
41 | + $date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
42 | +} elseif ($type == 'marine') { |
|
43 | + $date_array = $Marine->countAllMonthsLastYear(true); |
|
44 | +} elseif ($type == 'tracker') { |
|
45 | + $date_array = $Tracker->countAllMonthsLastYear(true); |
|
46 | +} |
|
39 | 47 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
40 | 48 | $year_data = ''; |
41 | 49 | $year_cnt = ''; |
@@ -53,9 +61,13 @@ discard block |
||
53 | 61 | axis: { x: { type: "timeseries", localtime: false,tick: { format: "%Y-%m"}}, y: { label: "#"}},legend: { show: false }});'; |
54 | 62 | print '</script>'; |
55 | 63 | |
56 | -if ($type == 'aircraft') $date_array = $Stats->countAllMonths($airline_icao); |
|
57 | -elseif ($type == 'marine') $date_array = $Marine->countAllMonths(); |
|
58 | -elseif ($type == 'tracker') $date_array = $Tracker->countAllMonths(); |
|
64 | +if ($type == 'aircraft') { |
|
65 | + $date_array = $Stats->countAllMonths($airline_icao); |
|
66 | +} elseif ($type == 'marine') { |
|
67 | + $date_array = $Marine->countAllMonths(); |
|
68 | +} elseif ($type == 'tracker') { |
|
69 | + $date_array = $Tracker->countAllMonths(); |
|
70 | +} |
|
59 | 71 | |
60 | 72 | if (!empty($date_array)) |
61 | 73 | { |
@@ -16,11 +16,15 @@ discard block |
||
16 | 16 | $Tracker = new Tracker(); |
17 | 17 | } |
18 | 18 | |
19 | -if (!isset($filter_name)) $filter_name = ''; |
|
19 | +if (!isset($filter_name)) { |
|
20 | + $filter_name = ''; |
|
21 | +} |
|
20 | 22 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
21 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
22 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
23 | -} |
|
24 | + if (isset($globalFilter['airline'])) { |
|
25 | + $airline_icao = $globalFilter['airline'][0]; |
|
26 | + } |
|
27 | + } |
|
24 | 28 | |
25 | 29 | require_once('header.php'); |
26 | 30 | include('statistics-sub-menu.php'); |
@@ -33,9 +37,13 @@ discard block |
||
33 | 37 | </div> |
34 | 38 | <p>'._("Below is a list of the most common <strong>time of day</strong>.").'</p>'; |
35 | 39 | |
36 | -if ($type == 'aircraft') $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
37 | -elseif ($type == 'marine') $hour_array = $Marine->countAllHours('hour',true); |
|
38 | -elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('hour',true); |
|
40 | +if ($type == 'aircraft') { |
|
41 | + $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
42 | +} elseif ($type == 'marine') { |
|
43 | + $hour_array = $Marine->countAllHours('hour',true); |
|
44 | +} elseif ($type == 'tracker') { |
|
45 | + $hour_array = $Tracker->countAllHours('hour',true); |
|
46 | +} |
|
39 | 47 | print '<div id="chartHour" class="chart" width="100%"></div><script>'; |
40 | 48 | $hour_data = ''; |
41 | 49 | $hour_cnt = ''; |
@@ -53,9 +61,13 @@ discard block |
||
53 | 61 | axis: { x: { type: "category", categories: '.$hour_data.'},y: { label: "# of Flights"}},legend: { show: false }});'; |
54 | 62 | print '</script>'; |
55 | 63 | |
56 | -if ($type == 'aircraft') $hour_array = $Stats->countAllHours('count',true,$airline_icao,$filter_name); |
|
57 | -elseif ($type == 'marine') $hour_array = $Marine->countAllHours('count',true); |
|
58 | -elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('count',true); |
|
64 | +if ($type == 'aircraft') { |
|
65 | + $hour_array = $Stats->countAllHours('count',true,$airline_icao,$filter_name); |
|
66 | +} elseif ($type == 'marine') { |
|
67 | + $hour_array = $Marine->countAllHours('count',true); |
|
68 | +} elseif ($type == 'tracker') { |
|
69 | + $hour_array = $Tracker->countAllHours('count',true); |
|
70 | +} |
|
59 | 71 | if (!empty($hour_array)) |
60 | 72 | { |
61 | 73 | print '<div class="table-responsive">'; |
@@ -5,11 +5,15 @@ discard block |
||
5 | 5 | $Stats = new Stats(); |
6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft"); |
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 == '' && isset($globalFilter)) { |
11 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
12 | -} |
|
13 | + if (isset($globalFilter['airline'])) { |
|
14 | + $airline_icao = $globalFilter['airline'][0]; |
|
15 | + } |
|
16 | + } |
|
13 | 17 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
14 | 18 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
15 | 19 | |
@@ -28,9 +32,12 @@ discard block |
||
28 | 32 | $aircraft_data = ''; |
29 | 33 | foreach($aircraft_array as $aircraft_item) |
30 | 34 | { |
31 | - if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
32 | - else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
33 | -} |
|
35 | + if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') { |
|
36 | + $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
37 | + } else { |
|
38 | + $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
39 | + } |
|
40 | + } |
|
34 | 41 | $aircraft_data = substr($aircraft_data, 0, -1); |
35 | 42 | print 'var series = ['.$aircraft_data.'];'; |
36 | 43 | print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
@@ -8,7 +8,9 @@ |
||
8 | 8 | $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
9 | 9 | $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | - if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
|
11 | + if (!isset($atc_data[0])) { |
|
12 | + $atc_data = $ATC->getByIdent($atcident); |
|
13 | + } |
|
12 | 14 | ?> |
13 | 15 | <div class="alldetails"> |
14 | 16 | <button type="button" class="close">×</button> |
@@ -28,7 +28,9 @@ discard block |
||
28 | 28 | private $openedFiles = []; |
29 | 29 | |
30 | 30 | public function __construct($htgFilesDestination = '', $resolution = 3) { |
31 | - if ($htgFilesDestination == '') $htgFilesDestination = dirname(__FILE__).'/../data/'; |
|
31 | + if ($htgFilesDestination == '') { |
|
32 | + $htgFilesDestination = dirname(__FILE__).'/../data/'; |
|
33 | + } |
|
32 | 34 | $this->htgFilesDestination = $htgFilesDestination; |
33 | 35 | $this->resolution = $resolution; |
34 | 36 | switch ($resolution) { |
@@ -171,16 +173,26 @@ discard block |
||
171 | 173 | $fileName = "N{$N}E{$E}.hgt"; |
172 | 174 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName)) { |
173 | 175 | $Common = new Common(); |
174 | - if ($debug) echo 'Downloading '.$fileName.'.gz ...'; |
|
176 | + if ($debug) { |
|
177 | + echo 'Downloading '.$fileName.'.gz ...'; |
|
178 | + } |
|
175 | 179 | $Common->download('https://s3.amazonaws.com/elevation-tiles-prod/skadi/N'.$N.'/'.$fileName.'.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
176 | 180 | if (!file_exists($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz')) { |
177 | - if ($debug) echo "File '{$fileName}.gz' not exists."; |
|
181 | + if ($debug) { |
|
182 | + echo "File '{$fileName}.gz' not exists."; |
|
183 | + } |
|
178 | 184 | return false; |
179 | 185 | } |
180 | - if ($debug) echo 'Done'."\n"; |
|
181 | - if ($debug) echo 'Decompress '.$fileName.' ....'; |
|
186 | + if ($debug) { |
|
187 | + echo 'Done'."\n"; |
|
188 | + } |
|
189 | + if ($debug) { |
|
190 | + echo 'Decompress '.$fileName.' ....'; |
|
191 | + } |
|
182 | 192 | $Common->gunzip($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz',$this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName); |
183 | - if ($debug) echo 'Done'."\n"; |
|
193 | + if ($debug) { |
|
194 | + echo 'Done'."\n"; |
|
195 | + } |
|
184 | 196 | unlink($this->htgFilesDestination . DIRECTORY_SEPARATOR . $fileName . '.gz'); |
185 | 197 | } |
186 | 198 | return true; |
@@ -38,8 +38,11 @@ discard block |
||
38 | 38 | global $globalGeoidSource; |
39 | 39 | //if ($name == '') $name = dirname(__FILE__).'/../install/tmp/egm2008-1.pgm'; |
40 | 40 | if ($name == '') { |
41 | - if (isset($globalGeoidSource) && $globalGeoidSource != '') $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm'; |
|
42 | - else $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
|
41 | + if (isset($globalGeoidSource) && $globalGeoidSource != '') { |
|
42 | + $name = dirname(__FILE__).'/../data/'.$globalGeoidSource.'.pgm'; |
|
43 | + } else { |
|
44 | + $name = dirname(__FILE__).'/../data/egm96-15.pgm'; |
|
45 | + } |
|
43 | 46 | } |
44 | 47 | |
45 | 48 | $f = @fopen($name,"r"); |
@@ -156,7 +159,9 @@ discard block |
||
156 | 159 | } |
157 | 160 | } |
158 | 161 | $this->t = $t; |
159 | - } else $t = $this->t; |
|
162 | + } else { |
|
163 | + $t = $this->t; |
|
164 | + } |
|
160 | 165 | if (!($cubic)) { |
161 | 166 | $a = (((1 - $fx) * $this->v00) + ($fx * $this->v01)); |
162 | 167 | $b = (((1 - $fx) * $this->v10) + ($fx * $this->v11)); |
@@ -27,15 +27,21 @@ discard block |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | -if ($authorize === false) die; |
|
30 | +if ($authorize === false) { |
|
31 | + die; |
|
32 | +} |
|
31 | 33 | |
32 | -if (isset($globalTracker) && $globalTracker) require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
34 | +if (isset($globalTracker) && $globalTracker) { |
|
35 | + require_once(dirname(__FILE__).'/../require/class.TrackerImport.php'); |
|
36 | +} |
|
33 | 37 | if (isset($globalMarine) && $globalMarine) { |
34 | 38 | require_once(dirname(__FILE__).'/../require/class.AIS.php'); |
35 | 39 | require_once(dirname(__FILE__).'/../require/class.MarineImport.php'); |
36 | 40 | } |
37 | 41 | |
38 | -if (!isset($globalDebug)) $globalDebug = FALSE; |
|
42 | +if (!isset($globalDebug)) { |
|
43 | + $globalDebug = FALSE; |
|
44 | +} |
|
39 | 45 | |
40 | 46 | // Check if schema is at latest version |
41 | 47 | $Connection = new Connection(); |
@@ -45,10 +51,16 @@ discard block |
||
45 | 51 | } |
46 | 52 | |
47 | 53 | if (isset($globalServer) && $globalServer) { |
48 | - if ($globalDebug) echo "Using Server Mode\n"; |
|
54 | + if ($globalDebug) { |
|
55 | + echo "Using Server Mode\n"; |
|
56 | + } |
|
49 | 57 | $SI=new SpotterServer(); |
50 | -} else $SI=new SpotterImport($Connection->db); |
|
51 | -if (isset($globalTracker) && $globalTracker) $TI = new TrackerImport($Connection->db); |
|
58 | +} else { |
|
59 | + $SI=new SpotterImport($Connection->db); |
|
60 | +} |
|
61 | +if (isset($globalTracker) && $globalTracker) { |
|
62 | + $TI = new TrackerImport($Connection->db); |
|
63 | +} |
|
52 | 64 | if (isset($globalMarine) && $globalMarine) { |
53 | 65 | $AIS = new AIS(); |
54 | 66 | $MI = new MarineImport($Connection->db); |
@@ -57,7 +69,9 @@ discard block |
||
57 | 69 | date_default_timezone_set('UTC'); |
58 | 70 | |
59 | 71 | $buffer = ''; |
60 | -if (isset($_POST)) $buffer = $_POST; |
|
72 | +if (isset($_POST)) { |
|
73 | + $buffer = $_POST; |
|
74 | +} |
|
61 | 75 | $data = array(); |
62 | 76 | if (isset($buffer['type_event']) && isset($buffer['lat']) && isset($buffer['lon'])) { |
63 | 77 | $data['ident'] = $buffer['device_id']; |
@@ -68,15 +82,27 @@ discard block |
||
68 | 82 | //$data['heading'] = $buffer['cap']; // Only N/S/E/W |
69 | 83 | $data['datetime'] = date('Y-m-d H:i:s',$buffer['timestamp']); |
70 | 84 | $data['comment'] = ''; |
71 | - if (isset($buffer['battery']) && $buffer['battery'] != '') $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
85 | + if (isset($buffer['battery']) && $buffer['battery'] != '') { |
|
86 | + $data['comment'] .= 'Battery: '.$buffer['battery'].'% '; |
|
87 | + } |
|
72 | 88 | //if (isset($buffer['snr']) && $buffer['snr'] != '') $data['comment'] .= 'SNR: '.$buffer['snr'].' '; |
73 | - if (isset($buffer['temp']) && $buffer['temp'] != '') $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
74 | - if (isset($buffer['press']) && $buffer['press'] != '') $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
89 | + if (isset($buffer['temp']) && $buffer['temp'] != '') { |
|
90 | + $data['comment'] .= 'Temperature: '.$buffer['temp'].'°C '; |
|
91 | + } |
|
92 | + if (isset($buffer['press']) && $buffer['press'] != '') { |
|
93 | + $data['comment'] .= 'Pressure: '.$buffer['press'].'hPa '; |
|
94 | + } |
|
75 | 95 | $TI->add($data); |
76 | 96 | unset($data); |
77 | 97 | } |
78 | -if (isset($SI)) $SI->checkAll(); |
|
79 | -if (isset($MI)) $MI->checkAll(); |
|
80 | -if (isset($TI)) $TI->checkAll(); |
|
98 | +if (isset($SI)) { |
|
99 | + $SI->checkAll(); |
|
100 | +} |
|
101 | +if (isset($MI)) { |
|
102 | + $MI->checkAll(); |
|
103 | +} |
|
104 | +if (isset($TI)) { |
|
105 | + $TI->checkAll(); |
|
106 | +} |
|
81 | 107 | |
82 | 108 | ?> |
@@ -61,8 +61,11 @@ |
||
61 | 61 | print '<div class="col-sm-6">'.round($altitude-$geoid,3).'</div>'; |
62 | 62 | } |
63 | 63 | print '<div class="col-sm-6"><b>Earth Gravity Model</b></div>'; |
64 | - if (isset($globalGeoidSource) && $globalGeoidSource != '') $geoidsource = $globalGeoidSource; |
|
65 | - else $geoidsource = 'EGM96-15'; |
|
64 | + if (isset($globalGeoidSource) && $globalGeoidSource != '') { |
|
65 | + $geoidsource = $globalGeoidSource; |
|
66 | + } else { |
|
67 | + $geoidsource = 'EGM96-15'; |
|
68 | + } |
|
66 | 69 | print '<div class="col-sm-6">'.$geoidsource.'</div>'; |
67 | 70 | print '</div>'; |
68 | 71 | } |