@@ -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)) { |
@@ -14,7 +14,9 @@ discard block |
||
14 | 14 | //foreach ($lines as $line) |
15 | 15 | while (($line = fgets($handle,4096)) !== false) |
16 | 16 | { |
17 | - if (substr($line,0,2) == '--' || $line == '') continue; |
|
17 | + if (substr($line,0,2) == '--' || $line == '') { |
|
18 | + continue; |
|
19 | + } |
|
18 | 20 | $templine .= $line; |
19 | 21 | if (substr(trim($line), -1,1) == ';') |
20 | 22 | { |
@@ -40,7 +42,9 @@ discard block |
||
40 | 42 | //foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename) |
41 | 43 | while(false !== ($filename = readdir($dh))) |
42 | 44 | { |
43 | - if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename); |
|
45 | + if (preg_match('/\.sql$/',$filename)) { |
|
46 | + $error .= create_db::import_file($directory.$filename); |
|
47 | + } |
|
44 | 48 | } |
45 | 49 | return $error; |
46 | 50 | } |
@@ -56,13 +60,17 @@ discard block |
||
56 | 60 | // Dirty hack |
57 | 61 | if ($host != 'localhost' && $host != '127.0.0.1') { |
58 | 62 | $grantright = $_SERVER['SERVER_ADDR']; |
59 | - } else $grantright = 'localhost'; |
|
63 | + } else { |
|
64 | + $grantright = 'localhost'; |
|
65 | + } |
|
60 | 66 | try { |
61 | 67 | $dbh = new PDO($db_type.':host='.$host,$root,$root_pass); |
62 | 68 | $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
63 | 69 | if ($db_type == 'mysql') { |
64 | 70 | $dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
65 | - if ($grantright == 'localhost') $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
71 | + if ($grantright == 'localhost') { |
|
72 | + $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
73 | + } |
|
66 | 74 | } else if ($db_type == 'pgsql') { |
67 | 75 | $dbh->exec("CREATE DATABASE ".$db.";"); |
68 | 76 | $dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."'; |
@@ -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']) |