@@ -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> |
@@ -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 | ?> |
@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
49 | 49 | if (isset($globalTimezone)) { |
50 | 50 | date_default_timezone_set($globalTimezone); |
51 | - } else date_default_timezone_set('UTC'); |
|
51 | + } else { |
|
52 | + date_default_timezone_set('UTC'); |
|
53 | + } |
|
52 | 54 | |
53 | 55 | if (is_array($all_data) && count($all_data) > 1) { |
54 | 56 | print '<br/>'; |
@@ -327,9 +329,13 @@ discard block |
||
327 | 329 | print '<div>'; |
328 | 330 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
329 | 331 | { |
330 | - if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
331 | - elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
332 | - else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
332 | + if ($spotter_item['format_source'] == 'whazzup') { |
|
333 | + print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
334 | + } elseif ($spotter_item['format_source'] == 'vatsimtxt') { |
|
335 | + print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
|
336 | + } else { |
|
337 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
338 | + } |
|
333 | 339 | } else { |
334 | 340 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
335 | 341 | { |
@@ -36,79 +36,126 @@ |
||
36 | 36 | $data['hex'] = trim($line['hex']); |
37 | 37 | if (preg_match('/^(\d{4}(?:\-\d{2}){2} \d{2}(?:\:\d{2}){2})$/',$line['datetime'])) { |
38 | 38 | $data['datetime'] = $line['datetime']; |
39 | - } else $data['datetime'] = date('Y-m-d H:i:s'); |
|
39 | + } else { |
|
40 | + $data['datetime'] = date('Y-m-d H:i:s'); |
|
41 | + } |
|
40 | 42 | if (!isset($line['aircraft_icao'])) { |
41 | 43 | $Spotter = new Spotter(); |
42 | 44 | $aircraft_icao = $Spotter->getAllAircraftType($data['hex']); |
43 | 45 | $Spotter->db = null; |
44 | 46 | if ($aircraft_icao == '' && isset($line['aircraft_type'])) { |
45 | - if ($line['aircraft_type'] == 'PARA_GLIDER') $aircraft_icao = 'GLID'; |
|
46 | - elseif ($line['aircraft_type'] == 'HELICOPTER_ROTORCRAFT') $aircraft_icao = 'UHEL'; |
|
47 | - elseif ($line['aircraft_type'] == 'TOW_PLANE') $aircraft_icao = 'TOWPLANE'; |
|
48 | - elseif ($line['aircraft_type'] == 'POWERED_AIRCRAFT') $aircraft_icao = 'POWAIRC'; |
|
47 | + if ($line['aircraft_type'] == 'PARA_GLIDER') { |
|
48 | + $aircraft_icao = 'GLID'; |
|
49 | + } elseif ($line['aircraft_type'] == 'HELICOPTER_ROTORCRAFT') { |
|
50 | + $aircraft_icao = 'UHEL'; |
|
51 | + } elseif ($line['aircraft_type'] == 'TOW_PLANE') { |
|
52 | + $aircraft_icao = 'TOWPLANE'; |
|
53 | + } elseif ($line['aircraft_type'] == 'POWERED_AIRCRAFT') { |
|
54 | + $aircraft_icao = 'POWAIRC'; |
|
55 | + } |
|
49 | 56 | } |
50 | 57 | $data['aircraft_icao'] = $aircraft_icao; |
51 | - } else $data['aircraft_icao'] = $line['aircraft_icao']; |
|
58 | + } else { |
|
59 | + $data['aircraft_icao'] = $line['aircraft_icao']; |
|
60 | + } |
|
52 | 61 | //if ($globalDebug) echo "*********** New aircraft hex : ".$data['hex']." ***********\n"; |
53 | 62 | } |
54 | 63 | if (isset($line['registration']) && $line['registration'] != '') { |
55 | 64 | $data['registration'] = $line['registration']; |
56 | - } else $data['registration'] = null; |
|
65 | + } else { |
|
66 | + $data['registration'] = null; |
|
67 | + } |
|
57 | 68 | if (isset($line['waypoints']) && $line['waypoints'] != '') { |
58 | 69 | $data['waypoints'] = $line['waypoints']; |
59 | - } else $data['waypoints'] = null; |
|
70 | + } else { |
|
71 | + $data['waypoints'] = null; |
|
72 | + } |
|
60 | 73 | if (isset($line['ident']) && $line['ident'] != '' && $line['ident'] != '????????' && $line['ident'] != '00000000' && preg_match('/^[a-zA-Z0-9]+$/', $line['ident'])) { |
61 | 74 | $data['ident'] = trim($line['ident']); |
62 | - } else $data['ident'] = null; |
|
75 | + } else { |
|
76 | + $data['ident'] = null; |
|
77 | + } |
|
63 | 78 | if (isset($line['latitude']) && isset($line['longitude']) && $line['latitude'] != '' && $line['longitude'] != '') { |
64 | 79 | if (isset($line['latitude']) && $line['latitude'] != '' && $line['latitude'] != 0 && $line['latitude'] < 91 && $line['latitude'] > -90) { |
65 | 80 | $data['latitude'] = $line['latitude']; |
66 | - } else $data['latitude'] = null; |
|
81 | + } else { |
|
82 | + $data['latitude'] = null; |
|
83 | + } |
|
67 | 84 | if (isset($line['longitude']) && $line['longitude'] != '' && $line['longitude'] != 0 && $line['longitude'] < 360 && $line['longitude'] > -180) { |
68 | - if ($line['longitude'] > 180) $line['longitude'] = $line['longitude'] - 360; |
|
85 | + if ($line['longitude'] > 180) { |
|
86 | + $line['longitude'] = $line['longitude'] - 360; |
|
87 | + } |
|
69 | 88 | $data['longitude'] = $line['longitude']; |
70 | - } else $data['longitude'] = null; |
|
89 | + } else { |
|
90 | + $data['longitude'] = null; |
|
91 | + } |
|
71 | 92 | } else { |
72 | 93 | $data['latitude'] = null; |
73 | 94 | $data['longitude'] = null; |
74 | 95 | } |
75 | 96 | if (isset($line['verticalrate']) && $line['verticalrate'] != '') { |
76 | 97 | $data['verticalrate'] = $line['verticalrate']; |
77 | - } else $data['verticalrate'] = null; |
|
98 | + } else { |
|
99 | + $data['verticalrate'] = null; |
|
100 | + } |
|
78 | 101 | if (isset($line['emergency']) && $line['emergency'] != '') { |
79 | 102 | $data['emergency'] = $line['emergency']; |
80 | - } else $data['emergency'] = null; |
|
103 | + } else { |
|
104 | + $data['emergency'] = null; |
|
105 | + } |
|
81 | 106 | if (isset($line['ground']) && $line['ground'] != '') { |
82 | 107 | $data['ground'] = $line['ground']; |
83 | - } else $data['ground'] = null; |
|
108 | + } else { |
|
109 | + $data['ground'] = null; |
|
110 | + } |
|
84 | 111 | if (isset($line['speed']) && $line['speed'] != '') { |
85 | 112 | $data['speed'] = round($line['speed']); |
86 | - } else $data['speed'] = null; |
|
113 | + } else { |
|
114 | + $data['speed'] = null; |
|
115 | + } |
|
87 | 116 | if (isset($line['squawk']) && $line['squawk'] != '') { |
88 | 117 | $data['squawk'] = $line['squawk']; |
89 | - } else $data['squawk'] = null; |
|
118 | + } else { |
|
119 | + $data['squawk'] = null; |
|
120 | + } |
|
90 | 121 | if (isset($line['altitude']) && $line['altitude'] != '') { |
91 | 122 | $data['altitude'] = round($line['altitude']); |
92 | - } else $data['altitude'] = null; |
|
123 | + } else { |
|
124 | + $data['altitude'] = null; |
|
125 | + } |
|
93 | 126 | if (isset($line['heading']) && $line['heading'] != '') { |
94 | 127 | $data['heading'] = round($line['heading']); |
95 | - } else $data['heading'] = null; |
|
128 | + } else { |
|
129 | + $data['heading'] = null; |
|
130 | + } |
|
96 | 131 | if (isset($line['source_name']) && $line['source_name'] != '') { |
97 | 132 | $data['source_name'] = $line['source_name']; |
98 | - } else $data['source_name'] = null; |
|
133 | + } else { |
|
134 | + $data['source_name'] = null; |
|
135 | + } |
|
99 | 136 | if (isset($line['over_country']) && $line['over_country'] != '') { |
100 | 137 | $data['over_country'] = $line['over_country']; |
101 | - } else $data['over_country'] = null; |
|
138 | + } else { |
|
139 | + $data['over_country'] = null; |
|
140 | + } |
|
102 | 141 | if (isset($line['noarchive']) && $line['noarchive']) { |
103 | 142 | $data['noarchive'] = true; |
104 | - } else $data['noarchive'] = false; |
|
143 | + } else { |
|
144 | + $data['noarchive'] = false; |
|
145 | + } |
|
105 | 146 | $data['format_source'] = $line['format_source']; |
106 | - if (isset($line['id_source'])) $id_source = $line['id_source']; |
|
147 | + if (isset($line['id_source'])) { |
|
148 | + $id_source = $line['id_source']; |
|
149 | + } |
|
107 | 150 | if (isset($data['hex'])) { |
108 | 151 | echo '.'; |
109 | 152 | $id_user = $globalServerUserID; |
110 | - if ($id_user == NULL) $id_user = 1; |
|
111 | - if (!isset($id_source)) $id_source = 1; |
|
153 | + if ($id_user == NULL) { |
|
154 | + $id_user = 1; |
|
155 | + } |
|
156 | + if (!isset($id_source)) { |
|
157 | + $id_source = 1; |
|
158 | + } |
|
112 | 159 | $query = 'INSERT INTO spotter_temp (id_user,datetime,hex,ident,latitude,longitude,verticalrate,speed,squawk,altitude,heading,registration,aircraft_icao,waypoints,id_source,noarchive,format_source,source_name,over_country) VALUES (:id_user,:datetime,:hex,:ident,:latitude,:longitude,:verticalrate,:speed,:squawk,:altitude,:heading,:registration,:aircraft_icao,:waypoints,:id_source,:noarchive, :format_source, :source_name, :over_country)'; |
113 | 160 | $query_values = array(':id_user' => $id_user,':datetime' => $data['datetime'],':hex' => $data['hex'],':ident' => $data['ident'],':latitude' => $data['latitude'],':longitude' => $data['longitude'],':verticalrate' => $data['verticalrate'],':speed' => $data['speed'],':squawk' => $data['squawk'],':altitude' => $data['altitude'],':heading' => $data['heading'],':registration' => $data['registration'],':aircraft_icao' => $data['aircraft_icao'],':waypoints' => $data['waypoints'],':id_source' => $id_source,':noarchive' => $data['noarchive'], ':format_source' => $data['format_source'], ':source_name' => $data['source_name'],':over_country' => $data['over_country']); |
114 | 161 | try { |
@@ -41,7 +41,9 @@ discard block |
||
41 | 41 | } |
42 | 42 | $Stats = new Stats(); |
43 | 43 | $airline_names = $Stats->getAllAirlineNames(); |
44 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
44 | + if (empty($airline_names)) { |
|
45 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
46 | + } |
|
45 | 47 | foreach($airline_names as $airline_name) |
46 | 48 | { |
47 | 49 | if($_GET['airline'] == $airline_name['airline_icao']) |
@@ -64,8 +66,7 @@ discard block |
||
64 | 66 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
65 | 67 | { |
66 | 68 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
67 | - } |
|
68 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
69 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
69 | 70 | { |
70 | 71 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
71 | 72 | } |
@@ -41,7 +41,9 @@ discard block |
||
41 | 41 | } |
42 | 42 | $Stats = new Stats(); |
43 | 43 | $airline_names = $Stats->getAllAirlineNames(); |
44 | - if (empty($ariline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
44 | + if (empty($ariline_names)) { |
|
45 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
46 | + } |
|
45 | 47 | foreach($airline_names as $airline_name) |
46 | 48 | { |
47 | 49 | if($_GET['airline'] == $airline_name['airline_icao']) |
@@ -64,8 +66,7 @@ discard block |
||
64 | 66 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
65 | 67 | { |
66 | 68 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
67 | - } |
|
68 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
69 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
69 | 70 | { |
70 | 71 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
71 | 72 | } |