@@ -146,8 +146,7 @@ |
||
146 | 146 | $obs_geodetic->lat = $qth->lat * Predict::de2ra; |
147 | 147 | $obs_geodetic->alt = $qth->alt / 1000.0; |
148 | 148 | $obs_geodetic->theta = 0; |
149 | - } |
|
150 | - else { |
|
149 | + } else { |
|
151 | 150 | $obs_geodetic->lon = 0.0; |
152 | 151 | $obs_geodetic->lat = 0.0; |
153 | 152 | $obs_geodetic->alt = 0.0; |
@@ -23,8 +23,11 @@ discard block |
||
23 | 23 | echo $e->getMessage(); |
24 | 24 | } |
25 | 25 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
26 | - if (isset($result[0])) return $result[0]; |
|
27 | - else return array(); |
|
26 | + if (isset($result[0])) { |
|
27 | + return $result[0]; |
|
28 | + } else { |
|
29 | + return array(); |
|
30 | + } |
|
28 | 31 | } |
29 | 32 | public function get_tle_types() { |
30 | 33 | $query = 'SELECT DISTINCT tle_type FROM tle ORDER BY tle_type'; |
@@ -35,8 +38,11 @@ discard block |
||
35 | 38 | echo $e->getMessage(); |
36 | 39 | } |
37 | 40 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
38 | - if (isset($result[0])) return $result; |
|
39 | - else return array(); |
|
41 | + if (isset($result[0])) { |
|
42 | + return $result; |
|
43 | + } else { |
|
44 | + return array(); |
|
45 | + } |
|
40 | 46 | } |
41 | 47 | public function get_tle_names() { |
42 | 48 | $query = 'SELECT DISTINCT tle_name, tle_type FROM tle'; |
@@ -47,8 +53,11 @@ discard block |
||
47 | 53 | echo $e->getMessage(); |
48 | 54 | } |
49 | 55 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
50 | - if (isset($result[0])) return $result; |
|
51 | - else return array(); |
|
56 | + if (isset($result[0])) { |
|
57 | + return $result; |
|
58 | + } else { |
|
59 | + return array(); |
|
60 | + } |
|
52 | 61 | } |
53 | 62 | public function get_tle_names_type($type) { |
54 | 63 | $query = 'SELECT tle_name, tle_type FROM tle WHERE tle_type = :type ORDER BY tle_name'; |
@@ -59,8 +68,11 @@ discard block |
||
59 | 68 | echo $e->getMessage(); |
60 | 69 | } |
61 | 70 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
62 | - if (isset($result[0])) return $result; |
|
63 | - else return array(); |
|
71 | + if (isset($result[0])) { |
|
72 | + return $result; |
|
73 | + } else { |
|
74 | + return array(); |
|
75 | + } |
|
64 | 76 | } |
65 | 77 | |
66 | 78 | public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
@@ -95,7 +107,9 @@ discard block |
||
95 | 107 | $sat = new Predict_Sat($tle); |
96 | 108 | $predict = new Predict(); |
97 | 109 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
98 | - if ($timestamp_begin == '') $timestamp_begin = time(); |
|
110 | + if ($timestamp_begin == '') { |
|
111 | + $timestamp_begin = time(); |
|
112 | + } |
|
99 | 113 | if ($timestamp_end == '') { |
100 | 114 | $now = Predict_Time::unix2daynum($timestamp_begin); |
101 | 115 | //echo $now; |
@@ -54,7 +54,9 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | if (!isset($array_value)) { |
57 | - if (!isset($arrayd_value)) $arrayd_value = ''; |
|
57 | + if (!isset($arrayd_value)) { |
|
58 | + $arrayd_value = ''; |
|
59 | + } |
|
58 | 60 | //$array_value = "'".$key."' => array(".$arrayd_value.")"; |
59 | 61 | $array_value = "array(".$arrayd_value.")"; |
60 | 62 | } elseif (isset($arrayd_value)) { |
@@ -71,7 +73,9 @@ discard block |
||
71 | 73 | } |
72 | 74 | } |
73 | 75 | } |
74 | - if (!isset($array_value)) $array_value = ''; |
|
76 | + if (!isset($array_value)) { |
|
77 | + $array_value = ''; |
|
78 | + } |
|
75 | 79 | $replace = "\n".'\$'.$settingname." = array(".$array_value.")"; |
76 | 80 | unset($array_value); |
77 | 81 | } else { |
@@ -25,7 +25,9 @@ discard block |
||
25 | 25 | $airspace = $result[0]; |
26 | 26 | date_default_timezone_set('UTC'); |
27 | 27 | print '<div class="top">'; |
28 | -if (isset($airspace['name'])) $airspace['title'] = $airspace['name']; |
|
28 | +if (isset($airspace['name'])) { |
|
29 | + $airspace['title'] = $airspace['name']; |
|
30 | +} |
|
29 | 31 | print '<div class="right"><div class="callsign-details"><div class="callsign">'.$airspace['title'].'</a></div>'; |
30 | 32 | print '</div>'; |
31 | 33 | print '<div class="details">'; |
@@ -44,13 +46,17 @@ discard block |
||
44 | 46 | print '</div>'; |
45 | 47 | } |
46 | 48 | |
47 | -if (isset($airspace['ceiling'])) $airspace['tops'] = $airspace['ceiling']; |
|
49 | +if (isset($airspace['ceiling'])) { |
|
50 | + $airspace['tops'] = $airspace['ceiling']; |
|
51 | +} |
|
48 | 52 | print '<div>'; |
49 | 53 | print '<span>'._("Tops").'</span>'; |
50 | 54 | print $airspace['tops']; |
51 | 55 | print '</div>'; |
52 | 56 | |
53 | -if (isset($airspace['floor'])) $airspace['base'] = $airspace['floor']; |
|
57 | +if (isset($airspace['floor'])) { |
|
58 | + $airspace['base'] = $airspace['floor']; |
|
59 | +} |
|
54 | 60 | print '<div>'; |
55 | 61 | print '<span>'._("Base").'</span>'; |
56 | 62 | print $airspace['base']; |
@@ -67,12 +67,22 @@ |
||
67 | 67 | } else { |
68 | 68 | $geom = geoPHP::load(stream_get_contents($row['wkb'])); |
69 | 69 | } |
70 | - if (isset($properties['type'])) $properties['type'] = trim($properties['type']); |
|
71 | - elseif (isset($properties['class'])) $properties['type'] = trim($properties['class']); |
|
72 | - if (isset($properties['ogr_fid'])) $properties['id'] = $properties['ogr_fid']; |
|
73 | - elseif (isset($properties['ogc_fid'])) $properties['id'] = $properties['ogc_fid']; |
|
74 | - if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling']; |
|
75 | - if (isset($properties['floor'])) $properties['base'] = $properties['floor']; |
|
70 | + if (isset($properties['type'])) { |
|
71 | + $properties['type'] = trim($properties['type']); |
|
72 | + } elseif (isset($properties['class'])) { |
|
73 | + $properties['type'] = trim($properties['class']); |
|
74 | + } |
|
75 | + if (isset($properties['ogr_fid'])) { |
|
76 | + $properties['id'] = $properties['ogr_fid']; |
|
77 | + } elseif (isset($properties['ogc_fid'])) { |
|
78 | + $properties['id'] = $properties['ogc_fid']; |
|
79 | + } |
|
80 | + if (isset($properties['ceiling'])) { |
|
81 | + $properties['tops'] = $properties['ceiling']; |
|
82 | + } |
|
83 | + if (isset($properties['floor'])) { |
|
84 | + $properties['base'] = $properties['floor']; |
|
85 | + } |
|
76 | 86 | if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) { |
77 | 87 | $properties['upper_limit'] = round($matches['alt']*100*0.38048); |
78 | 88 | } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['tops']),$matches)) { |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | print '<option></option>'; |
22 | 22 | $Stats = new Stats(); |
23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
24 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
24 | + if (empty($airline_names)) { |
|
25 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
26 | + } |
|
25 | 27 | foreach($airline_names as $airline_name) |
26 | 28 | { |
27 | 29 | if($airline == $airline_name['airline_icao']) |
@@ -43,8 +45,7 @@ discard block |
||
43 | 45 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
44 | 46 | { |
45 | 47 | 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" />'; |
46 | - } |
|
47 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | 49 | { |
49 | 50 | 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" />'; |
50 | 51 | } |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | print '<option></option>'; |
22 | 22 | $Stats = new Stats(); |
23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
24 | - if (empty($ariline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
24 | + if (empty($ariline_names)) { |
|
25 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
26 | + } |
|
25 | 27 | foreach($airline_names as $airline_name) |
26 | 28 | { |
27 | 29 | if($_GET['airline'] == $airline_name['airline_icao']) |
@@ -43,8 +45,7 @@ discard block |
||
43 | 45 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
44 | 46 | { |
45 | 47 | 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" />'; |
46 | - } |
|
47 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | 49 | { |
49 | 50 | 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" />'; |
50 | 51 | } |
@@ -24,7 +24,9 @@ |
||
24 | 24 | print '<option></option>'; |
25 | 25 | $Stats = new Stats(); |
26 | 26 | $aircraft_types = $Stats->getAllAircraftTypes(); |
27 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
27 | + if (empty($aircraft_types)) { |
|
28 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
29 | + } |
|
28 | 30 | foreach($aircraft_types as $aircrafttype) |
29 | 31 | { |
30 | 32 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $limit_start = 0; |
15 | 15 | $limit_end = 25; |
16 | 16 | $absolute_difference = 25; |
17 | - } else { |
|
17 | + } else { |
|
18 | 18 | $limit_explode = explode(",", $_GET['limit']); |
19 | 19 | $limit_start = $limit_explode[0]; |
20 | 20 | $limit_end = $limit_explode[1]; |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | print '<option></option>'; |
46 | 46 | $Stats = new Stats(); |
47 | 47 | $aircraft_types = $Stats->getAllAircraftTypes(); |
48 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
48 | + if (empty($aircraft_types)) { |
|
49 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
50 | + } |
|
49 | 51 | foreach($aircraft_types as $aircrafttype) |
50 | 52 | { |
51 | 53 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -66,7 +68,9 @@ discard block |
||
66 | 68 | print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>'; |
67 | 69 | print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>'; |
68 | 70 | print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; |
69 | - if (isset($spotter_array[0]['aircraft_manufacturer'])) print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>'; |
|
71 | + if (isset($spotter_array[0]['aircraft_manufacturer'])) { |
|
72 | + print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>'; |
|
73 | + } |
|
70 | 74 | print '</div>'; |
71 | 75 | } else { |
72 | 76 | print '<div class="alert alert-warning">'._("This special aircraft profile shows all flights in where the aircraft type is unknown.").'</div>'; |