@@ -73,8 +73,11 @@ discard block |
||
| 73 | 73 | $globalDBSname = $globalDBname; |
| 74 | 74 | $globalDBSuser = $globalDBuser; |
| 75 | 75 | $globalDBSpass = $globalDBpass; |
| 76 | - if (!isset($globalDBport) || $globalDBport === NULL || $globalDBport == '') $globalDBSport = 3306; |
|
| 77 | - else $globalDBSport = $globalDBport; |
|
| 76 | + if (!isset($globalDBport) || $globalDBport === NULL || $globalDBport == '') { |
|
| 77 | + $globalDBSport = 3306; |
|
| 78 | + } else { |
|
| 79 | + $globalDBSport = $globalDBport; |
|
| 80 | + } |
|
| 78 | 81 | } else { |
| 79 | 82 | $DBname = 'default'; |
| 80 | 83 | $globalDBSdriver = $globalDBdriver; |
@@ -82,8 +85,11 @@ discard block |
||
| 82 | 85 | $globalDBSname = $globalDBname; |
| 83 | 86 | $globalDBSuser = $user; |
| 84 | 87 | $globalDBSpass = $pass; |
| 85 | - if (!isset($globalDBport) || $globalDBport === NULL || $globalDBport == '') $globalDBSport = 3306; |
|
| 86 | - else $globalDBSport = $globalDBport; |
|
| 88 | + if (!isset($globalDBport) || $globalDBport === NULL || $globalDBport == '') { |
|
| 89 | + $globalDBSport = 3306; |
|
| 90 | + } else { |
|
| 91 | + $globalDBSport = $globalDBport; |
|
| 92 | + } |
|
| 87 | 93 | } |
| 88 | 94 | } else { |
| 89 | 95 | $globalDBSdriver = $globalDB[$DBname]['driver']; |
@@ -91,11 +97,16 @@ discard block |
||
| 91 | 97 | $globalDBSname = $globalDB[$DBname]['name']; |
| 92 | 98 | $globalDBSuser = $globalDB[$DBname]['user']; |
| 93 | 99 | $globalDBSpass = $globalDB[$DBname]['pass']; |
| 94 | - if (isset($globalDB[$DBname]['port'])) $globalDBSport = $globalDB[$DBname]['port']; |
|
| 95 | - else $globalDBSport = 3306; |
|
| 100 | + if (isset($globalDB[$DBname]['port'])) { |
|
| 101 | + $globalDBSport = $globalDB[$DBname]['port']; |
|
| 102 | + } else { |
|
| 103 | + $globalDBSport = 3306; |
|
| 104 | + } |
|
| 96 | 105 | } |
| 97 | 106 | // Set number of try to connect to DB |
| 98 | - if (!isset($globalDBretry) || $globalDBretry == '' || $globalDBretry === NULL) $globalDBretry = 5; |
|
| 107 | + if (!isset($globalDBretry) || $globalDBretry == '' || $globalDBretry === NULL) { |
|
| 108 | + $globalDBretry = 5; |
|
| 109 | + } |
|
| 99 | 110 | $i = 0; |
| 100 | 111 | while (true) { |
| 101 | 112 | try { |
@@ -104,10 +115,16 @@ discard block |
||
| 104 | 115 | $this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); |
| 105 | 116 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 106 | 117 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER); |
| 107 | - if (!isset($globalDBTimeOut)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,500); |
|
| 108 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
| 109 | - if (!isset($globalDBPersistent)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
| 110 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
| 118 | + if (!isset($globalDBTimeOut)) { |
|
| 119 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,500); |
|
| 120 | + } else { |
|
| 121 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
| 122 | + } |
|
| 123 | + if (!isset($globalDBPersistent)) { |
|
| 124 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
| 125 | + } else { |
|
| 126 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
| 127 | + } |
|
| 111 | 128 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); |
| 112 | 129 | $this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); |
| 113 | 130 | // Workaround against "ONLY_FULL_GROUP_BY" mode |
@@ -121,24 +138,36 @@ discard block |
||
| 121 | 138 | //$this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); |
| 122 | 139 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 123 | 140 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER); |
| 124 | - if (!isset($globalDBTimeOut)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,200); |
|
| 125 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
| 126 | - if (!isset($globalDBPersistent)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
| 127 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
| 141 | + if (!isset($globalDBTimeOut)) { |
|
| 142 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,200); |
|
| 143 | + } else { |
|
| 144 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
| 145 | + } |
|
| 146 | + if (!isset($globalDBPersistent)) { |
|
| 147 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
| 148 | + } else { |
|
| 149 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
| 150 | + } |
|
| 128 | 151 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); |
| 129 | 152 | $this->dbs[$DBname]->exec('SET timezone="UTC"'); |
| 130 | 153 | } |
| 131 | 154 | break; |
| 132 | 155 | } catch(PDOException $e) { |
| 133 | 156 | $i++; |
| 134 | - if (isset($globalDebug) && $globalDebug) echo 'Error connecting to DB: '.$globalDBSname.' - Error: '.$e->getMessage()."\n"; |
|
| 157 | + if (isset($globalDebug) && $globalDebug) { |
|
| 158 | + echo 'Error connecting to DB: '.$globalDBSname.' - Error: '.$e->getMessage()."\n"; |
|
| 159 | + } |
|
| 135 | 160 | //exit; |
| 136 | 161 | sleep(5); |
| 137 | - if ($i > $globalDBretry) return false; |
|
| 162 | + if ($i > $globalDBretry) { |
|
| 163 | + return false; |
|
| 164 | + } |
|
| 138 | 165 | //return false; |
| 139 | 166 | } |
| 140 | 167 | } |
| 141 | - if ($DBname === 'default') $this->db = $this->dbs['default']; |
|
| 168 | + if ($DBname === 'default') { |
|
| 169 | + $this->db = $this->dbs['default']; |
|
| 170 | + } |
|
| 142 | 171 | return true; |
| 143 | 172 | } |
| 144 | 173 | |
@@ -150,7 +179,9 @@ discard block |
||
| 150 | 179 | } else { |
| 151 | 180 | $query = "SELECT * FROM pg_catalog.pg_tables WHERE tablename = '".$table."'"; |
| 152 | 181 | } |
| 153 | - if ($this->db == NULL) return false; |
|
| 182 | + if ($this->db == NULL) { |
|
| 183 | + return false; |
|
| 184 | + } |
|
| 154 | 185 | try { |
| 155 | 186 | //$Connection = new Connection(); |
| 156 | 187 | $results = $this->db->query($query); |
@@ -159,22 +190,31 @@ discard block |
||
| 159 | 190 | } |
| 160 | 191 | if($results->rowCount()>0) { |
| 161 | 192 | return true; |
| 193 | + } else { |
|
| 194 | + return false; |
|
| 162 | 195 | } |
| 163 | - else return false; |
|
| 164 | 196 | } |
| 165 | 197 | |
| 166 | 198 | public function connectionExists() |
| 167 | 199 | { |
| 168 | 200 | global $globalDBdriver, $globalDBCheckConnection, $globalNoDB; |
| 169 | - if (isset($globalDBCheckConnection) && $globalDBCheckConnection === FALSE) return true; |
|
| 170 | - if (isset($globalNoDB) && $globalNoDB === TRUE) return true; |
|
| 201 | + if (isset($globalDBCheckConnection) && $globalDBCheckConnection === FALSE) { |
|
| 202 | + return true; |
|
| 203 | + } |
|
| 204 | + if (isset($globalNoDB) && $globalNoDB === TRUE) { |
|
| 205 | + return true; |
|
| 206 | + } |
|
| 171 | 207 | $query = "SELECT 1 + 1"; |
| 172 | - if ($this->db === null) return false; |
|
| 208 | + if ($this->db === null) { |
|
| 209 | + return false; |
|
| 210 | + } |
|
| 173 | 211 | try { |
| 174 | 212 | $sum = @$this->db->query($query); |
| 175 | 213 | if ($sum instanceof \PDOStatement) { |
| 176 | 214 | $sum = $sum->fetchColumn(0); |
| 177 | - } else $sum = 0; |
|
| 215 | + } else { |
|
| 216 | + $sum = 0; |
|
| 217 | + } |
|
| 178 | 218 | if (intval($sum) !== 2) { |
| 179 | 219 | return false; |
| 180 | 220 | } |
@@ -209,8 +249,9 @@ discard block |
||
| 209 | 249 | $nb = $results->fetchAll(PDO::FETCH_ASSOC); |
| 210 | 250 | if($nb[0]['nb'] > 0) { |
| 211 | 251 | return true; |
| 252 | + } else { |
|
| 253 | + return false; |
|
| 212 | 254 | } |
| 213 | - else return false; |
|
| 214 | 255 | } |
| 215 | 256 | |
| 216 | 257 | /* |
@@ -260,9 +301,12 @@ discard block |
||
| 260 | 301 | } |
| 261 | 302 | $result = $sth->fetch(PDO::FETCH_ASSOC); |
| 262 | 303 | $sth->closeCursor(); |
| 263 | - if ($result['nb'] > 0) return true; |
|
| 264 | - else return false; |
|
| 265 | -/* } else { |
|
| 304 | + if ($result['nb'] > 0) { |
|
| 305 | + return true; |
|
| 306 | + } else { |
|
| 307 | + return false; |
|
| 308 | + } |
|
| 309 | + /* } else { |
|
| 266 | 310 | $query = "SELECT * FROM ".$table." LIMIT 0"; |
| 267 | 311 | try { |
| 268 | 312 | $results = $this->db->query($query); |
@@ -301,7 +345,9 @@ discard block |
||
| 301 | 345 | $sth->closeCursor(); |
| 302 | 346 | return $result['value']; |
| 303 | 347 | } |
| 304 | - } else return $version; |
|
| 348 | + } else { |
|
| 349 | + return $version; |
|
| 350 | + } |
|
| 305 | 351 | } |
| 306 | 352 | |
| 307 | 353 | /* |
@@ -310,9 +356,14 @@ discard block |
||
| 310 | 356 | */ |
| 311 | 357 | public function latest() { |
| 312 | 358 | global $globalNoDB; |
| 313 | - if (isset($globalNoDB) && $globalNoDB === TRUE) return true; |
|
| 314 | - if ($this->check_schema_version() == $this->latest_schema) return true; |
|
| 315 | - else return false; |
|
| 359 | + if (isset($globalNoDB) && $globalNoDB === TRUE) { |
|
| 360 | + return true; |
|
| 361 | + } |
|
| 362 | + if ($this->check_schema_version() == $this->latest_schema) { |
|
| 363 | + return true; |
|
| 364 | + } else { |
|
| 365 | + return false; |
|
| 366 | + } |
|
| 316 | 367 | } |
| 317 | 368 | |
| 318 | 369 | } |
@@ -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) { |
@@ -94,7 +106,9 @@ discard block |
||
| 94 | 106 | $sat = new Predict_Sat($tle); |
| 95 | 107 | $predict = new Predict(); |
| 96 | 108 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
| 97 | - if ($timestamp_begin == '') $timestamp_begin = time(); |
|
| 109 | + if ($timestamp_begin == '') { |
|
| 110 | + $timestamp_begin = time(); |
|
| 111 | + } |
|
| 98 | 112 | if ($timestamp_end == '') { |
| 99 | 113 | $now = Predict_Time::unix2daynum($timestamp_begin); |
| 100 | 114 | $predict->predict_calc($sat,$qth,$now); |
@@ -119,8 +133,11 @@ discard block |
||
| 119 | 133 | echo $e->getMessage(); |
| 120 | 134 | } |
| 121 | 135 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 122 | - if (isset($result[0])) return $result[0]; |
|
| 123 | - else return array(); |
|
| 136 | + if (isset($result[0])) { |
|
| 137 | + return $result[0]; |
|
| 138 | + } else { |
|
| 139 | + return array(); |
|
| 140 | + } |
|
| 124 | 141 | } |
| 125 | 142 | |
| 126 | 143 | /** |
@@ -138,7 +155,9 @@ discard block |
||
| 138 | 155 | FROM satellite".$filter_query." satellite.launch_site <> '' AND satellite.launch_site IS NOT NULL"; |
| 139 | 156 | $query_values = array(); |
| 140 | 157 | $query .= " GROUP BY satellite.launch_site ORDER BY launch_site_count DESC"; |
| 141 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 158 | + if ($limit) { |
|
| 159 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 160 | + } |
|
| 142 | 161 | $sth = $this->db->prepare($query); |
| 143 | 162 | $sth->execute($query_values); |
| 144 | 163 | $launch_site_array = array(); |
@@ -167,7 +186,9 @@ discard block |
||
| 167 | 186 | FROM satellite".$filter_query." satellite.owner <> '' AND satellite.owner IS NOT NULL"; |
| 168 | 187 | $query_values = array(); |
| 169 | 188 | $query .= " GROUP BY satellite.owner ORDER BY owner_count DESC"; |
| 170 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 189 | + if ($limit) { |
|
| 190 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 191 | + } |
|
| 171 | 192 | $sth = $this->db->prepare($query); |
| 172 | 193 | $sth->execute($query_values); |
| 173 | 194 | $owner_array = array(); |
@@ -196,7 +217,9 @@ discard block |
||
| 196 | 217 | FROM satellite".$filter_query." satellite.country_owner <> '' AND satellite.country_owner IS NOT NULL"; |
| 197 | 218 | $query_values = array(); |
| 198 | 219 | $query .= " GROUP BY satellite.country_owner ORDER BY country_count DESC"; |
| 199 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
| 220 | + if ($limit) { |
|
| 221 | + $query .= " LIMIT 10 OFFSET 0"; |
|
| 222 | + } |
|
| 200 | 223 | $sth = $this->db->prepare($query); |
| 201 | 224 | $sth->execute($query_values); |
| 202 | 225 | $owner_array = array(); |
@@ -223,20 +246,26 @@ discard block |
||
| 223 | 246 | date_default_timezone_set($globalTimezone); |
| 224 | 247 | $datetime = new DateTime(); |
| 225 | 248 | $offset = $datetime->format('P'); |
| 226 | - } else $offset = '+00:00'; |
|
| 249 | + } else { |
|
| 250 | + $offset = '+00:00'; |
|
| 251 | + } |
|
| 227 | 252 | //$filter_query = $this->getFilter($filters,true,true); |
| 228 | 253 | $filter_query = ' WHERE'; |
| 229 | 254 | if ($globalDBdriver == 'mysql') { |
| 230 | 255 | $query = "SELECT MONTH(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
| 231 | 256 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR)"; |
| 232 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
| 257 | + if ($sincedate != '') { |
|
| 258 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
| 259 | + } |
|
| 233 | 260 | $query .= " GROUP BY year_name, month_name |
| 234 | 261 | ORDER BY year_name, month_name ASC"; |
| 235 | 262 | $query_data = array(':offset' => $offset); |
| 236 | 263 | } else { |
| 237 | 264 | $query = "SELECT EXTRACT(MONTH FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS month_name, EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
| 238 | 265 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 YEARS'"; |
| 239 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
| 266 | + if ($sincedate != '') { |
|
| 267 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
| 268 | + } |
|
| 240 | 269 | $query .= " GROUP BY year_name, month_name |
| 241 | 270 | ORDER BY year_name, month_name ASC"; |
| 242 | 271 | $query_data = array(':offset' => $offset); |
@@ -268,20 +297,26 @@ discard block |
||
| 268 | 297 | date_default_timezone_set($globalTimezone); |
| 269 | 298 | $datetime = new DateTime(); |
| 270 | 299 | $offset = $datetime->format('P'); |
| 271 | - } else $offset = '+00:00'; |
|
| 300 | + } else { |
|
| 301 | + $offset = '+00:00'; |
|
| 302 | + } |
|
| 272 | 303 | //$filter_query = $this->getFilter($filters,true,true); |
| 273 | 304 | $filter_query = ' WHERE'; |
| 274 | 305 | if ($globalDBdriver == 'mysql') { |
| 275 | 306 | $query = "SELECT YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
| 276 | 307 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 YEAR)"; |
| 277 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
| 308 | + if ($sincedate != '') { |
|
| 309 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
| 310 | + } |
|
| 278 | 311 | $query .= " GROUP BY year_name |
| 279 | 312 | ORDER BY year_name ASC"; |
| 280 | 313 | $query_data = array(':offset' => $offset); |
| 281 | 314 | } else { |
| 282 | 315 | $query = "SELECT EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
| 283 | 316 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '10 YEARS'"; |
| 284 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
| 317 | + if ($sincedate != '') { |
|
| 318 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
| 319 | + } |
|
| 285 | 320 | $query .= " GROUP BY year_name |
| 286 | 321 | ORDER BY year_name ASC"; |
| 287 | 322 | $query_data = array(':offset' => $offset); |
@@ -81,10 +81,15 @@ |
||
| 81 | 81 | // $launch_date = '15 November 1974'; |
| 82 | 82 | } else { |
| 83 | 83 | $ident = $sat; |
| 84 | - if (strpos($sat,'(')) $satname = $sat; |
|
| 85 | - else $satname = str_replace(array(' '),'-',$sat); |
|
| 84 | + if (strpos($sat,'(')) { |
|
| 85 | + $satname = $sat; |
|
| 86 | + } else { |
|
| 87 | + $satname = str_replace(array(' '),'-',$sat); |
|
| 88 | + } |
|
| 89 | + } |
|
| 90 | +if (!isset($satname)) { |
|
| 91 | + $satname = $sat; |
|
| 86 | 92 | } |
| 87 | -if (!isset($satname)) $satname = $sat; |
|
| 88 | 93 | $info = $Satellite->get_info(strtolower(trim($satname))); |
| 89 | 94 | $position = $Satellite->position($sat); |
| 90 | 95 | $ground_speed = $position['speed']; |
@@ -3,10 +3,15 @@ discard block |
||
| 3 | 3 | //gets the page file and stores it in a variable |
| 4 | 4 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
| 5 | 5 | $current_page = $file_path['filename']; |
| 6 | -if ($globalTimezone == '') $globalTimezone = 'UTC'; |
|
| 6 | +if ($globalTimezone == '') { |
|
| 7 | + $globalTimezone = 'UTC'; |
|
| 8 | +} |
|
| 7 | 9 | date_default_timezone_set($globalTimezone); |
| 8 | -if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
|
| 9 | -else $MapType = $globalMapProvider; |
|
| 10 | +if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') { |
|
| 11 | + $MapType = $_COOKIE['MapType']; |
|
| 12 | +} else { |
|
| 13 | + $MapType = $globalMapProvider; |
|
| 14 | +} |
|
| 10 | 15 | if (isset($_GET['3d'])) { |
| 11 | 16 | setcookie('MapFormat','3d'); |
| 12 | 17 | } else if (isset($_GET['2d'])) { |
@@ -231,7 +236,13 @@ discard block |
||
| 231 | 236 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
| 232 | 237 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
| 233 | 238 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
| 234 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
| 239 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
| 240 | + print '&latitude='.$latitude; |
|
| 241 | +} |
|
| 242 | +?><?php if(isset($longitude)) { |
|
| 243 | + print '&longitude='.$longitude; |
|
| 244 | +} |
|
| 245 | +?>&<?php print time(); ?>"></script> |
|
| 235 | 246 | <?php |
| 236 | 247 | if (!isset($type) || $type == 'aircraft') { |
| 237 | 248 | ?> |
@@ -300,7 +311,13 @@ discard block |
||
| 300 | 311 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
| 301 | 312 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
| 302 | 313 | <script src="<?php print $globalURL; ?>/js/map.common.js"></script> |
| 303 | -<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
| 314 | +<script src="<?php print $globalURL; ?>/js/map.2d.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
| 315 | + print '&latitude='.$latitude; |
|
| 316 | +} |
|
| 317 | +?><?php if(isset($longitude)) { |
|
| 318 | + print '&longitude='.$longitude; |
|
| 319 | +} |
|
| 320 | +?>&<?php print time(); ?>"></script> |
|
| 304 | 321 | <script src="<?php print $globalURL; ?>/js/map-aircraft.2d.js.php?flightaware_id=<?php print $flightaware_id; ?>&<?php print time(); ?>"></script> |
| 305 | 322 | <?php |
| 306 | 323 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
@@ -381,7 +398,12 @@ discard block |
||
| 381 | 398 | <span class="icon-bar"></span> |
| 382 | 399 | </button> |
| 383 | 400 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a> |
| 384 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
| 401 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
| 402 | + print '/'; |
|
| 403 | +} else { |
|
| 404 | + print $globalURL; |
|
| 405 | +} |
|
| 406 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
| 385 | 407 | </div> |
| 386 | 408 | <div class="collapse navbar-collapse"> |
| 387 | 409 | |
@@ -420,7 +442,10 @@ discard block |
||
| 420 | 442 | <?php |
| 421 | 443 | } |
| 422 | 444 | ?> |
| 423 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 445 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 446 | + echo 'right-'; |
|
| 447 | +} |
|
| 448 | +?>caret"></b></a> |
|
| 424 | 449 | <ul class="dropdown-menu"> |
| 425 | 450 | <li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircrafts Types"); ?></a></li> |
| 426 | 451 | <?php |
@@ -491,8 +516,14 @@ discard block |
||
| 491 | 516 | </li> |
| 492 | 517 | <li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li> |
| 493 | 518 | <li><a href="<?php print $globalURL; ?>/statistics"><?php echo _("Statistics"); ?></a></li> |
| 494 | - <li class="dropdown<?php if ($sub) echo '-submenu'; ?>"> |
|
| 495 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 519 | + <li class="dropdown<?php if ($sub) { |
|
| 520 | + echo '-submenu'; |
|
| 521 | +} |
|
| 522 | +?>"> |
|
| 523 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Tools"); ?> <b class="<?php if ($sub) { |
|
| 524 | + echo 'right-'; |
|
| 525 | +} |
|
| 526 | +?>caret"></b></a> |
|
| 496 | 527 | <ul class="dropdown-menu"> |
| 497 | 528 | <li><a href="<?php print $globalURL; ?>/tools/acars"><?php echo _("ACARS translator"); ?></a></li> |
| 498 | 529 | <li><a href="<?php print $globalURL; ?>/tools/metar"><?php echo _("METAR translator"); ?></a></li> |
@@ -528,7 +559,10 @@ discard block |
||
| 528 | 559 | <?php |
| 529 | 560 | } |
| 530 | 561 | ?> |
| 531 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 562 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 563 | + echo 'right-'; |
|
| 564 | +} |
|
| 565 | +?>caret"></b></a> |
|
| 532 | 566 | <ul class="dropdown-menu"> |
| 533 | 567 | <li><a href="<?php print $globalURL; ?>/marine/currently"><?php echo _("Current Activity"); ?></a></li> |
| 534 | 568 | <li><a href="<?php print $globalURL; ?>/marine/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -560,7 +594,10 @@ discard block |
||
| 560 | 594 | <?php |
| 561 | 595 | } |
| 562 | 596 | ?> |
| 563 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 597 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 598 | + echo 'right-'; |
|
| 599 | +} |
|
| 600 | +?>caret"></b></a> |
|
| 564 | 601 | <ul class="dropdown-menu"> |
| 565 | 602 | <li><a href="<?php print $globalURL; ?>/tracker/currently"><?php echo _("Current Activity"); ?></a></li> |
| 566 | 603 | <li><a href="<?php print $globalURL; ?>/tracker/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -593,7 +630,10 @@ discard block |
||
| 593 | 630 | } |
| 594 | 631 | ?> |
| 595 | 632 | <!-- |
| 596 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) echo 'right-'; ?>caret"></b></a> |
|
| 633 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Explore"); ?> <b class="<?php if ($sub) { |
|
| 634 | + echo 'right-'; |
|
| 635 | +} |
|
| 636 | +?>caret"></b></a> |
|
| 597 | 637 | <ul class="dropdown-menu"> |
| 598 | 638 | <li><a href="<?php print $globalURL; ?>/satellite/currently"><?php echo _("Current Activity"); ?></a></li> |
| 599 | 639 | <li><a href="<?php print $globalURL; ?>/satellite/latest"><?php echo _("Latest Activity"); ?></a></li> |
@@ -650,7 +690,9 @@ discard block |
||
| 650 | 690 | $alllang = $Language->getLanguages(); |
| 651 | 691 | foreach ($alllang as $key => $lang) { |
| 652 | 692 | print '<option value="'.$key.'"'; |
| 653 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
| 693 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
| 694 | + print ' selected '; |
|
| 695 | + } |
|
| 654 | 696 | print '>'.$lang[0].'</option>'; |
| 655 | 697 | } |
| 656 | 698 | ?> |
@@ -790,9 +832,24 @@ discard block |
||
| 790 | 832 | $customid = $globalMapProvider; |
| 791 | 833 | ?> |
| 792 | 834 | L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', { |
| 793 | - maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '18'; ?>, |
|
| 794 | - minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
| 795 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
| 835 | + maxZoom: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
| 836 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
| 837 | +} else { |
|
| 838 | + print '18'; |
|
| 839 | +} |
|
| 840 | +?>, |
|
| 841 | + minZoom: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
| 842 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
| 843 | +} else { |
|
| 844 | + print '0'; |
|
| 845 | +} |
|
| 846 | +?>, |
|
| 847 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
| 848 | + print 'false'; |
|
| 849 | +} else { |
|
| 850 | + print 'true'; |
|
| 851 | +} |
|
| 852 | +?>, |
|
| 796 | 853 | attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
| 797 | 854 | }).addTo(map); |
| 798 | 855 | <?php |
@@ -815,4 +872,7 @@ discard block |
||
| 815 | 872 | |
| 816 | 873 | ?> |
| 817 | 874 | |
| 818 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
| 875 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
| 876 | + print 'index '; |
|
| 877 | +} |
|
| 878 | +?>clear"> |
|
@@ -6,7 +6,13 @@ discard block |
||
| 6 | 6 | if (!isset($type) || $type != 'satellite') { |
| 7 | 7 | ?> |
| 8 | 8 | <form id="changedate" method="post"> |
| 9 | - <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') echo $year.'-'; ?><?php if (isset($month) && $month != '') echo $month; ?>" /> |
|
| 9 | + <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') { |
|
| 10 | + echo $year.'-'; |
|
| 11 | +} |
|
| 12 | +?><?php if (isset($month) && $month != '') { |
|
| 13 | + echo $month; |
|
| 14 | +} |
|
| 15 | +?>" /> |
|
| 10 | 16 | </form> |
| 11 | 17 | <?php |
| 12 | 18 | } |
@@ -38,7 +44,9 @@ discard block |
||
| 38 | 44 | print '<option disabled>──────────</option>'; |
| 39 | 45 | } |
| 40 | 46 | $Stats = new Stats(); |
| 41 | - if (!isset($filter_name)) $filter_name = ''; |
|
| 47 | + if (!isset($filter_name)) { |
|
| 48 | + $filter_name = ''; |
|
| 49 | + } |
|
| 42 | 50 | $airlines = $Stats->getAllAirlineNames($filter_name); |
| 43 | 51 | foreach($airlines as $airline) { |
| 44 | 52 | if (isset($airline_icao) && $airline_icao == $airline['airline_icao']) { |
@@ -67,10 +75,22 @@ discard block |
||
| 67 | 75 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
| 68 | 76 | </a> |
| 69 | 77 | <ul class="dropdown-menu"> |
| 70 | - <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
| 71 | - <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Registration"); ?></a></li> |
|
| 72 | - <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
| 73 | - <li><a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Country"); ?></a></li> |
|
| 78 | + <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 79 | + echo '/'.$airline_icao; |
|
| 80 | +} |
|
| 81 | +?>"><?php echo _("Aircraft"); ?></a></li> |
|
| 82 | + <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 83 | + echo '/'.$airline_icao; |
|
| 84 | +} |
|
| 85 | +?>"><?php echo _("Registration"); ?></a></li> |
|
| 86 | + <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 87 | + echo '/'.$airline_icao; |
|
| 88 | +} |
|
| 89 | +?>"><?php echo _("Manufacturer"); ?></a></li> |
|
| 90 | + <li><a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 91 | + echo '/'.$airline_icao; |
|
| 92 | +} |
|
| 93 | +?>"><?php echo _("Country"); ?></a></li> |
|
| 74 | 94 | </ul> |
| 75 | 95 | </li> |
| 76 | 96 | <li class="dropdown"> |
@@ -81,12 +101,21 @@ discard block |
||
| 81 | 101 | <?php |
| 82 | 102 | if (!isset($airline_icao) || $airline_icao == 'all') { |
| 83 | 103 | ?> |
| 84 | - <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Airline"); ?></a></li> |
|
| 85 | - <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
| 104 | + <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 105 | + echo '/'.$airline_icao; |
|
| 106 | +} |
|
| 107 | +?>"><?php echo _("Airline"); ?></a></li> |
|
| 108 | + <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 109 | + echo '/'.$airline_icao; |
|
| 110 | +} |
|
| 111 | +?>"><?php echo _("Airline by Country"); ?></a></li> |
|
| 86 | 112 | <?php |
| 87 | 113 | } |
| 88 | 114 | ?> |
| 89 | - <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Callsign"); ?></a></li> |
|
| 115 | + <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 116 | + echo '/'.$airline_icao; |
|
| 117 | +} |
|
| 118 | +?>"><?php echo _("Callsign"); ?></a></li> |
|
| 90 | 119 | </ul> |
| 91 | 120 | </li> |
| 92 | 121 | <li class="dropdown"> |
@@ -94,10 +123,22 @@ discard block |
||
| 94 | 123 | <?php echo _("Airport"); ?> <span class="caret"></span> |
| 95 | 124 | </a> |
| 96 | 125 | <ul class="dropdown-menu" role="menu"> |
| 97 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
| 98 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
| 99 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
| 100 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
| 126 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 127 | + echo '/'.$airline_icao; |
|
| 128 | +} |
|
| 129 | +?>"><?php echo _("Departure Airport"); ?></a></li> |
|
| 130 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 131 | + echo '/'.$airline_icao; |
|
| 132 | +} |
|
| 133 | +?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
| 134 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 135 | + echo '/'.$airline_icao; |
|
| 136 | +} |
|
| 137 | +?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
| 138 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 139 | + echo '/'.$airline_icao; |
|
| 140 | +} |
|
| 141 | +?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
| 101 | 142 | </ul> |
| 102 | 143 | </li> |
| 103 | 144 | <li class="dropdown"> |
@@ -105,8 +146,14 @@ discard block |
||
| 105 | 146 | <?php echo _("Route"); ?> <span class="caret"></span> |
| 106 | 147 | </a> |
| 107 | 148 | <ul class="dropdown-menu" role="menu"> |
| 108 | - <li><a href="<?php print $globalURL; ?>/statistics/route-airport<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Route by Airport"); ?></a></li> |
|
| 109 | - <li><a href="<?php print $globalURL; ?>/statistics/route-waypoint<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Route by Waypoint"); ?></a></li> |
|
| 149 | + <li><a href="<?php print $globalURL; ?>/statistics/route-airport<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 150 | + echo '/'.$airline_icao; |
|
| 151 | +} |
|
| 152 | +?>"><?php echo _("Route by Airport"); ?></a></li> |
|
| 153 | + <li><a href="<?php print $globalURL; ?>/statistics/route-waypoint<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 154 | + echo '/'.$airline_icao; |
|
| 155 | +} |
|
| 156 | +?>"><?php echo _("Route by Waypoint"); ?></a></li> |
|
| 110 | 157 | </ul> |
| 111 | 158 | </li> |
| 112 | 159 | <li class="dropdown"> |
@@ -114,8 +161,14 @@ discard block |
||
| 114 | 161 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
| 115 | 162 | </a> |
| 116 | 163 | <ul class="dropdown-menu" role="menu"> |
| 117 | - <li><a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Date"); ?></a></li> |
|
| 118 | - <li><a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Time"); ?></a></li> |
|
| 164 | + <li><a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 165 | + echo '/'.$airline_icao; |
|
| 166 | +} |
|
| 167 | +?>"><?php echo _("Date"); ?></a></li> |
|
| 168 | + <li><a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 169 | + echo '/'.$airline_icao; |
|
| 170 | +} |
|
| 171 | +?>"><?php echo _("Time"); ?></a></li> |
|
| 119 | 172 | </ul> |
| 120 | 173 | </li> |
| 121 | 174 | <?php |
@@ -163,9 +216,18 @@ discard block |
||
| 163 | 216 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
| 164 | 217 | </a> |
| 165 | 218 | <ul class="dropdown-menu"> |
| 166 | - <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
| 167 | - <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Registration"); ?></a></li> |
|
| 168 | - <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
| 219 | + <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 220 | + echo '/'.$airline_icao; |
|
| 221 | +} |
|
| 222 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
| 223 | + <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 224 | + echo '/'.$airline_icao; |
|
| 225 | +} |
|
| 226 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Registration"); ?></a></li> |
|
| 227 | + <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 228 | + echo '/'.$airline_icao; |
|
| 229 | +} |
|
| 230 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
| 169 | 231 | <!-- <li><a href="<?php print $globalURL; ?>/statistics/country"><?php echo _("Country"); ?></a></li> --> |
| 170 | 232 | </ul> |
| 171 | 233 | </li> |
@@ -177,12 +239,21 @@ discard block |
||
| 177 | 239 | <?php |
| 178 | 240 | if (!isset($airline_icao) || $airline_icao == 'all') { |
| 179 | 241 | ?> |
| 180 | - <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline"); ?></a></li> |
|
| 181 | - <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
| 242 | + <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 243 | + echo '/'.$airline_icao; |
|
| 244 | +} |
|
| 245 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline"); ?></a></li> |
|
| 246 | + <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 247 | + echo '/'.$airline_icao; |
|
| 248 | +} |
|
| 249 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
| 182 | 250 | <?php |
| 183 | 251 | } |
| 184 | 252 | ?> |
| 185 | - <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Callsign"); ?></a></li> |
|
| 253 | + <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 254 | + echo '/'.$airline_icao; |
|
| 255 | +} |
|
| 256 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Callsign"); ?></a></li> |
|
| 186 | 257 | </ul> |
| 187 | 258 | </li> |
| 188 | 259 | <li class="dropdown"> |
@@ -190,10 +261,22 @@ discard block |
||
| 190 | 261 | <?php echo _("Airport"); ?> <span class="caret"></span> |
| 191 | 262 | </a> |
| 192 | 263 | <ul class="dropdown-menu" role="menu"> |
| 193 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
| 194 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
| 195 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
| 196 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
| 264 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 265 | + echo '/'.$airline_icao; |
|
| 266 | +} |
|
| 267 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
| 268 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 269 | + echo '/'.$airline_icao; |
|
| 270 | +} |
|
| 271 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
| 272 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 273 | + echo '/'.$airline_icao; |
|
| 274 | +} |
|
| 275 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
| 276 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
| 277 | + echo '/'.$airline_icao; |
|
| 278 | +} |
|
| 279 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
| 197 | 280 | </ul> |
| 198 | 281 | </li> |
| 199 | 282 | <!-- |
@@ -257,7 +257,12 @@ discard block |
||
| 257 | 257 | // viewer.dataSources.get(dsn).entities.remove(entity); |
| 258 | 258 | // } |
| 259 | 259 | //console.log(entity.lastupdate); |
| 260 | - if (parseInt(entity.lastupdate) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
| 260 | + if (parseInt(entity.lastupdate) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
| 261 | + print $globalMapRefresh*2000; |
|
| 262 | +} else { |
|
| 263 | + print '60000'; |
|
| 264 | +} |
|
| 265 | +?>)) { |
|
| 261 | 266 | // console.log('Remove an entity date'); |
| 262 | 267 | viewer.dataSources.get(dsn).entities.remove(entity); |
| 263 | 268 | } else { |
@@ -544,7 +549,12 @@ discard block |
||
| 544 | 549 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
| 545 | 550 | ?> |
| 546 | 551 | update_polarLayer(); |
| 547 | -setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 552 | +setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 553 | + print $globalMapRefresh*1000*2; |
|
| 554 | +} else { |
|
| 555 | + print '60000'; |
|
| 556 | +} |
|
| 557 | +?>); |
|
| 548 | 558 | <?php |
| 549 | 559 | } |
| 550 | 560 | ?> |
@@ -642,7 +652,12 @@ discard block |
||
| 642 | 652 | } |
| 643 | 653 | } |
| 644 | 654 | } |
| 645 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
| 655 | + ,<?php if (isset($globalMapRefresh)) { |
|
| 656 | + print $globalMapRefresh*1000; |
|
| 657 | +} else { |
|
| 658 | + print '30000'; |
|
| 659 | +} |
|
| 660 | +?>); |
|
| 646 | 661 | } else { |
| 647 | 662 | //var widget = new Cesium.CesiumWidget('archivebox'); |
| 648 | 663 | // var timeline = new Cesium.Timeline(viewer); |
@@ -661,7 +676,12 @@ discard block |
||
| 661 | 676 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
| 662 | 677 | ?> |
| 663 | 678 | update_atcLayer(); |
| 664 | -setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 679 | +setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 680 | + print $globalMapRefresh*1000*2; |
|
| 681 | +} else { |
|
| 682 | + print '60000'; |
|
| 683 | +} |
|
| 684 | +?>); |
|
| 665 | 685 | <?php |
| 666 | 686 | } |
| 667 | 687 | ?> |
@@ -52,7 +52,12 @@ |
||
| 52 | 52 | } else { |
| 53 | 53 | for (var i = 0; i < viewer.dataSources.get(dsn).entities.values.length; i++) { |
| 54 | 54 | var entity = viewer.dataSources.get(dsn).entities.values[i]; |
| 55 | - if (parseInt(entity.lastupdatesat) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
| 55 | + if (parseInt(entity.lastupdatesat) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
| 56 | + print $globalMapRefresh*2000; |
|
| 57 | +} else { |
|
| 58 | + print '60000'; |
|
| 59 | +} |
|
| 60 | +?>)) { |
|
| 56 | 61 | viewer.dataSources.get(dsn).entities.remove(entity); |
| 57 | 62 | } |
| 58 | 63 | } |
@@ -131,45 +131,72 @@ discard block |
||
| 131 | 131 | </div> |
| 132 | 132 | <p> |
| 133 | 133 | <label for="dbhost">Database hostname</label> |
| 134 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
| 134 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
| 135 | + print $globalDBhost; |
|
| 136 | +} |
|
| 137 | +?>" /> |
|
| 135 | 138 | </p> |
| 136 | 139 | <p> |
| 137 | 140 | <label for="dbport">Database port</label> |
| 138 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
| 141 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
| 142 | + print $globalDBport; |
|
| 143 | +} |
|
| 144 | +?>" /> |
|
| 139 | 145 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
| 140 | 146 | </p> |
| 141 | 147 | <p> |
| 142 | 148 | <label for="dbname">Database name</label> |
| 143 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
| 149 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
| 150 | + print $globalDBname; |
|
| 151 | +} |
|
| 152 | +?>" /> |
|
| 144 | 153 | </p> |
| 145 | 154 | <p> |
| 146 | 155 | <label for="dbuser">Database user</label> |
| 147 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
| 156 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
| 157 | + print $globalDBuser; |
|
| 158 | +} |
|
| 159 | +?>" /> |
|
| 148 | 160 | </p> |
| 149 | 161 | <p> |
| 150 | 162 | <label for="dbuserpass">Database user password</label> |
| 151 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
| 163 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
| 164 | + print $globalDBpass; |
|
| 165 | +} |
|
| 166 | +?>" /> |
|
| 152 | 167 | </p> |
| 153 | 168 | </fieldset> |
| 154 | 169 | <fieldset id="site"> |
| 155 | 170 | <legend>Site configuration</legend> |
| 156 | 171 | <p> |
| 157 | 172 | <label for="sitename">Site name</label> |
| 158 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
| 173 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
| 174 | + print $globalName; |
|
| 175 | +} |
|
| 176 | +?>" /> |
|
| 159 | 177 | </p> |
| 160 | 178 | <p> |
| 161 | 179 | <label for="siteurl">Site directory</label> |
| 162 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
| 180 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
| 181 | + print $globalURL; |
|
| 182 | +} |
|
| 183 | +?>" /> |
|
| 163 | 184 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
| 164 | 185 | </p> |
| 165 | 186 | <p> |
| 166 | 187 | <label for="timezone">Timezone</label> |
| 167 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
| 188 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
| 189 | + print $globalTimezone; |
|
| 190 | +} |
|
| 191 | +?>" /> |
|
| 168 | 192 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
| 169 | 193 | </p> |
| 170 | 194 | <p> |
| 171 | 195 | <label for="language">Language</label> |
| 172 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
| 196 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
| 197 | + print $globalLanguage; |
|
| 198 | +} |
|
| 199 | +?>" /> |
|
| 173 | 200 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
| 174 | 201 | </p> |
| 175 | 202 | </fieldset> |
@@ -190,11 +217,17 @@ discard block |
||
| 190 | 217 | <div id="mapbox_data"> |
| 191 | 218 | <p> |
| 192 | 219 | <label for="mapboxid">Mapbox id</label> |
| 193 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
| 220 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
| 221 | + print $globalMapboxId; |
|
| 222 | +} |
|
| 223 | +?>" /> |
|
| 194 | 224 | </p> |
| 195 | 225 | <p> |
| 196 | 226 | <label for="mapboxtoken">Mapbox token</label> |
| 197 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
| 227 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
| 228 | + print $globalMapboxToken; |
|
| 229 | +} |
|
| 230 | +?>" /> |
|
| 198 | 231 | </p> |
| 199 | 232 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
| 200 | 233 | </div> |
@@ -202,7 +235,10 @@ discard block |
||
| 202 | 235 | <div id="google_data"> |
| 203 | 236 | <p> |
| 204 | 237 | <label for="googlekey">Google API key</label> |
| 205 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
| 238 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
| 239 | + print $globalGoogleAPIKey; |
|
| 240 | +} |
|
| 241 | +?>" /> |
|
| 206 | 242 | <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> |
| 207 | 243 | </p> |
| 208 | 244 | </div> |
@@ -210,7 +246,10 @@ discard block |
||
| 210 | 246 | <div id="bing_data"> |
| 211 | 247 | <p> |
| 212 | 248 | <label for="bingkey">Bing Map key</label> |
| 213 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
| 249 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
| 250 | + print $globalBingMapKey; |
|
| 251 | +} |
|
| 252 | +?>" /> |
|
| 214 | 253 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
| 215 | 254 | </p> |
| 216 | 255 | </div> |
@@ -218,7 +257,10 @@ discard block |
||
| 218 | 257 | <div id="mapquest_data"> |
| 219 | 258 | <p> |
| 220 | 259 | <label for="mapquestkey">MapQuest key</label> |
| 221 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
| 260 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
| 261 | + print $globalMapQuestKey; |
|
| 262 | +} |
|
| 263 | +?>" /> |
|
| 222 | 264 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
| 223 | 265 | </p> |
| 224 | 266 | </div> |
@@ -226,11 +268,17 @@ discard block |
||
| 226 | 268 | <div id="here_data"> |
| 227 | 269 | <p> |
| 228 | 270 | <label for="hereappid">Here App_Id</label> |
| 229 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
| 271 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
| 272 | + print $globalHereappId; |
|
| 273 | +} |
|
| 274 | +?>" /> |
|
| 230 | 275 | </p> |
| 231 | 276 | <p> |
| 232 | 277 | <label for="hereappcode">Here App_Code</label> |
| 233 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
| 278 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
| 279 | + print $globalHereappCode; |
|
| 280 | +} |
|
| 281 | +?>" /> |
|
| 234 | 282 | </p> |
| 235 | 283 | <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> |
| 236 | 284 | </div> |
@@ -238,7 +286,10 @@ discard block |
||
| 238 | 286 | <div id="openweathermap_data"> |
| 239 | 287 | <p> |
| 240 | 288 | <label for="openweathermapkey">OpenWeatherMap key (weather layer)</label> |
| 241 | - <input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" /> |
|
| 289 | + <input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) { |
|
| 290 | + print $globalOpenWeatherMapKey; |
|
| 291 | +} |
|
| 292 | +?>" /> |
|
| 242 | 293 | <p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p> |
| 243 | 294 | </p> |
| 244 | 295 | </div> |
@@ -248,42 +299,86 @@ discard block |
||
| 248 | 299 | <legend>Coverage area</legend> |
| 249 | 300 | <p> |
| 250 | 301 | <label for="latitudemax">The maximum latitude (north)</label> |
| 251 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
| 302 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
| 303 | + print $globalLatitudeMax; |
|
| 304 | +} |
|
| 305 | +?>" /> |
|
| 252 | 306 | </p> |
| 253 | 307 | <p> |
| 254 | 308 | <label for="latitudemin">The minimum latitude (south)</label> |
| 255 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
| 309 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
| 310 | + print $globalLatitudeMin; |
|
| 311 | +} |
|
| 312 | +?>" /> |
|
| 256 | 313 | </p> |
| 257 | 314 | <p> |
| 258 | 315 | <label for="longitudemax">The maximum longitude (west)</label> |
| 259 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
| 316 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
| 317 | + print $globalLongitudeMax; |
|
| 318 | +} |
|
| 319 | +?>" /> |
|
| 260 | 320 | </p> |
| 261 | 321 | <p> |
| 262 | 322 | <label for="longitudemin">The minimum longitude (east)</label> |
| 263 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
| 323 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
| 324 | + print $globalLongitudeMin; |
|
| 325 | +} |
|
| 326 | +?>" /> |
|
| 264 | 327 | </p> |
| 265 | 328 | <p> |
| 266 | 329 | <label for="latitudecenter">The latitude center</label> |
| 267 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
| 330 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
| 331 | + print $globalCenterLatitude; |
|
| 332 | +} |
|
| 333 | +?>" /> |
|
| 268 | 334 | </p> |
| 269 | 335 | <p> |
| 270 | 336 | <label for="longitudecenter">The longitude center</label> |
| 271 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
| 337 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
| 338 | + print $globalCenterLongitude; |
|
| 339 | +} |
|
| 340 | +?>" /> |
|
| 272 | 341 | </p> |
| 273 | 342 | <p> |
| 274 | 343 | <label for="livezoom">Default Zoom on live map</label> |
| 275 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
| 344 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
| 345 | + print $globalLiveZoom; |
|
| 346 | +} else { |
|
| 347 | + print '9'; |
|
| 348 | +} |
|
| 349 | +?>" /> |
|
| 276 | 350 | </p> |
| 277 | 351 | <p> |
| 278 | 352 | <label for="squawk_country">Country for squawk usage</label> |
| 279 | 353 | <select name="squawk_country" id="squawk_country"> |
| 280 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
| 281 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
| 282 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
| 283 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
| 284 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
| 285 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
| 286 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
| 354 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
| 355 | + print ' selected '; |
|
| 356 | +} |
|
| 357 | +?>>UK</option> |
|
| 358 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
| 359 | + print ' selected '; |
|
| 360 | +} |
|
| 361 | +?>>NZ</option> |
|
| 362 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
| 363 | + print ' selected '; |
|
| 364 | +} |
|
| 365 | +?>>US</option> |
|
| 366 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
| 367 | + print ' selected '; |
|
| 368 | +} |
|
| 369 | +?>>AU</option> |
|
| 370 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
| 371 | + print ' selected '; |
|
| 372 | +} |
|
| 373 | +?>>NL</option> |
|
| 374 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
| 375 | + print ' selected '; |
|
| 376 | +} |
|
| 377 | +?>>FR</option> |
|
| 378 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
| 379 | + print ' selected '; |
|
| 380 | +} |
|
| 381 | +?>>TR</option> |
|
| 287 | 382 | </select> |
| 288 | 383 | </p> |
| 289 | 384 | </fieldset> |
@@ -292,15 +387,24 @@ discard block |
||
| 292 | 387 | <p><i>Only put in DB flights that are inside a circle</i></p> |
| 293 | 388 | <p> |
| 294 | 389 | <label for="latitude">Center latitude</label> |
| 295 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
| 390 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
| 391 | + echo $globalDistanceIgnore['latitude']; |
|
| 392 | +} |
|
| 393 | +?>" /> |
|
| 296 | 394 | </p> |
| 297 | 395 | <p> |
| 298 | 396 | <label for="longitude">Center longitude</label> |
| 299 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
| 397 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
| 398 | + echo $globalDistanceIgnore['longitude']; |
|
| 399 | +} |
|
| 400 | +?>" /> |
|
| 300 | 401 | </p> |
| 301 | 402 | <p> |
| 302 | 403 | <label for="Distance">Distance (in km)</label> |
| 303 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
| 404 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
| 405 | + echo $globalDistanceIgnore['distance']; |
|
| 406 | +} |
|
| 407 | +?>" /> |
|
| 304 | 408 | </p> |
| 305 | 409 | </fieldset> |
| 306 | 410 | <fieldset id="sourceloc"> |
@@ -411,11 +515,17 @@ discard block |
||
| 411 | 515 | <div id="flightaware_data"> |
| 412 | 516 | <p> |
| 413 | 517 | <label for="flightawareusername">FlightAware username</label> |
| 414 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
| 518 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
| 519 | + print $globalFlightAwareUsername; |
|
| 520 | +} |
|
| 521 | +?>" /> |
|
| 415 | 522 | </p> |
| 416 | 523 | <p> |
| 417 | 524 | <label for="flightawarepassword">FlightAware password/API key</label> |
| 418 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
| 525 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
| 526 | + print $globalFlightAwarePassword; |
|
| 527 | +} |
|
| 528 | +?>" /> |
|
| 419 | 529 | </p> |
| 420 | 530 | </div> |
| 421 | 531 | --> |
@@ -457,7 +567,10 @@ discard block |
||
| 457 | 567 | if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
| 458 | 568 | ?> |
| 459 | 569 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
| 460 | - <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
|
| 570 | + <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) { |
|
| 571 | + print $source['port']; |
|
| 572 | +} |
|
| 573 | +?>" /></td> |
|
| 461 | 574 | <?php |
| 462 | 575 | } else { |
| 463 | 576 | $hostport = explode(':',$source['host']); |
@@ -476,33 +589,102 @@ discard block |
||
| 476 | 589 | ?> |
| 477 | 590 | <td> |
| 478 | 591 | <select name="format[]" id="format"> |
| 479 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
| 480 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
| 481 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
| 482 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
| 483 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
| 484 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
| 485 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
| 486 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
| 487 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
| 488 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
| 489 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
| 490 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
| 491 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
| 492 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
| 493 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
| 494 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
| 495 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
| 496 | - <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option> |
|
| 497 | - <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option> |
|
| 498 | - <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option> |
|
| 592 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
| 593 | + print 'selected'; |
|
| 594 | +} |
|
| 595 | +?>>Auto</option> |
|
| 596 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
| 597 | + print 'selected'; |
|
| 598 | +} |
|
| 599 | +?>>SBS</option> |
|
| 600 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
| 601 | + print 'selected'; |
|
| 602 | +} |
|
| 603 | +?>>TSV</option> |
|
| 604 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
| 605 | + print 'selected'; |
|
| 606 | +} |
|
| 607 | +?>>Raw</option> |
|
| 608 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
| 609 | + print 'selected'; |
|
| 610 | +} |
|
| 611 | +?>>APRS</option> |
|
| 612 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
| 613 | + print 'selected'; |
|
| 614 | +} |
|
| 615 | +?>>Radarcape deltadb.txt</option> |
|
| 616 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
| 617 | + print 'selected'; |
|
| 618 | +} |
|
| 619 | +?>>Vatsim</option> |
|
| 620 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
| 621 | + print 'selected'; |
|
| 622 | +} |
|
| 623 | +?>>Virtual Radar Server AircraftList.json</option> |
|
| 624 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
| 625 | + print 'selected'; |
|
| 626 | +} |
|
| 627 | +?>>Virtual Radar Server TCP</option> |
|
| 628 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
| 629 | + print 'selected'; |
|
| 630 | +} |
|
| 631 | +?>>phpVMS</option> |
|
| 632 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
| 633 | + print 'selected'; |
|
| 634 | +} |
|
| 635 | +?>>Virtual Airlines Manager</option> |
|
| 636 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
| 637 | + print 'selected'; |
|
| 638 | +} |
|
| 639 | +?>>IVAO</option> |
|
| 640 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
| 641 | + print 'selected'; |
|
| 642 | +} |
|
| 643 | +?>>FlightGear Multiplayer</option> |
|
| 644 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
| 645 | + print 'selected'; |
|
| 646 | +} |
|
| 647 | +?>>FlightGear Singleplayer</option> |
|
| 648 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
| 649 | + print 'selected'; |
|
| 650 | +} |
|
| 651 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
| 652 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
| 653 | + print 'selected'; |
|
| 654 | +} |
|
| 655 | +?>>ACARS SBS-3 over TCP</option> |
|
| 656 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
| 657 | + print 'selected'; |
|
| 658 | +} |
|
| 659 | +?>>NMEA AIS over TCP</option> |
|
| 660 | + <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') { |
|
| 661 | + print 'selected'; |
|
| 662 | +} |
|
| 663 | +?>>AirWhere website</option> |
|
| 664 | + <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') { |
|
| 665 | + print 'selected'; |
|
| 666 | +} |
|
| 667 | +?>>HidnSeek Callback</option> |
|
| 668 | + <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') { |
|
| 669 | + print 'selected'; |
|
| 670 | +} |
|
| 671 | +?>>Blitzortung</option> |
|
| 499 | 672 | </select> |
| 500 | 673 | </td> |
| 501 | 674 | <td> |
| 502 | - <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /> |
|
| 675 | + <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
| 676 | + print $source['name']; |
|
| 677 | +} |
|
| 678 | +?>" /> |
|
| 503 | 679 | </td> |
| 504 | - <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> |
|
| 505 | - <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td> |
|
| 680 | + <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']) { |
|
| 681 | + print 'checked'; |
|
| 682 | +} |
|
| 683 | +?> /></td> |
|
| 684 | + <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) { |
|
| 685 | + print 'checked'; |
|
| 686 | +} |
|
| 687 | +?> /></td> |
|
| 506 | 688 | <td> |
| 507 | 689 | <select name="timezones[]" id="timezones"> |
| 508 | 690 | <?php |
@@ -512,7 +694,9 @@ discard block |
||
| 512 | 694 | print '<option selected>'.$timezones.'</option>'; |
| 513 | 695 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
| 514 | 696 | print '<option selected>'.$timezones.'</option>'; |
| 515 | - } else print '<option>'.$timezones.'</option>'; |
|
| 697 | + } else { |
|
| 698 | + print '<option>'.$timezones.'</option>'; |
|
| 699 | + } |
|
| 516 | 700 | } |
| 517 | 701 | ?> |
| 518 | 702 | </select> |
@@ -562,7 +746,9 @@ discard block |
||
| 562 | 746 | foreach($timezonelist as $timezones){ |
| 563 | 747 | if ($timezones == 'UTC') { |
| 564 | 748 | print '<option selected>'.$timezones.'</option>'; |
| 565 | - } else print '<option>'.$timezones.'</option>'; |
|
| 749 | + } else { |
|
| 750 | + print '<option>'.$timezones.'</option>'; |
|
| 751 | + } |
|
| 566 | 752 | } |
| 567 | 753 | ?> |
| 568 | 754 | </select> |
@@ -585,11 +771,17 @@ discard block |
||
| 585 | 771 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
| 586 | 772 | <p> |
| 587 | 773 | <label for="acarshost">ACARS UDP host</label> |
| 588 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
| 774 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
| 775 | + print $globalACARSHost; |
|
| 776 | +} |
|
| 777 | +?>" /> |
|
| 589 | 778 | </p> |
| 590 | 779 | <p> |
| 591 | 780 | <label for="acarsport">ACARS UDP port</label> |
| 592 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
| 781 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
| 782 | + print $globalACARSPort; |
|
| 783 | +} |
|
| 784 | +?>" /> |
|
| 593 | 785 | </p> |
| 594 | 786 | </fieldset> |
| 595 | 787 | </div> |
@@ -671,13 +863,19 @@ discard block |
||
| 671 | 863 | <div id="schedules_options"> |
| 672 | 864 | <p> |
| 673 | 865 | <label for="britishairways">British Airways API Key</label> |
| 674 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
| 866 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
| 867 | + print $globalBritishAirwaysKey; |
|
| 868 | +} |
|
| 869 | +?>" /> |
|
| 675 | 870 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
| 676 | 871 | </p> |
| 677 | 872 | <!-- |
| 678 | 873 | <p> |
| 679 | 874 | <label for="transavia">Transavia Test API Consumer Key</label> |
| 680 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
| 875 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
| 876 | + print $globalTransaviaKey; |
|
| 877 | +} |
|
| 878 | +?>" /> |
|
| 681 | 879 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
| 682 | 880 | </p> |
| 683 | 881 | --> |
@@ -686,10 +884,16 @@ discard block |
||
| 686 | 884 | <b>Lufthansa API Key</b> |
| 687 | 885 | <p> |
| 688 | 886 | <label for="lufthansakey">Key</label> |
| 689 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
| 887 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
| 888 | + print $globalLufthansaKey['key']; |
|
| 889 | +} |
|
| 890 | +?>" /> |
|
| 690 | 891 | </p><p> |
| 691 | 892 | <label for="lufthansasecret">Secret</label> |
| 692 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
| 893 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
| 894 | + print $globalLufthansaKey['secret']; |
|
| 895 | +} |
|
| 896 | +?>" /> |
|
| 693 | 897 | </p> |
| 694 | 898 | </div> |
| 695 | 899 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -709,7 +913,10 @@ discard block |
||
| 709 | 913 | </p> |
| 710 | 914 | <p> |
| 711 | 915 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
| 712 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
| 916 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
| 917 | + print $globalNOTAMSource; |
|
| 918 | +} |
|
| 919 | +?>" /> |
|
| 713 | 920 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
| 714 | 921 | </p> |
| 715 | 922 | <br /> |
@@ -725,14 +932,20 @@ discard block |
||
| 725 | 932 | <div id="metarsrc"> |
| 726 | 933 | <p> |
| 727 | 934 | <label for="metarsource">URL of your METAR source</label> |
| 728 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
| 935 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
| 936 | + print $globalMETARurl; |
|
| 937 | +} |
|
| 938 | +?>" /> |
|
| 729 | 939 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
| 730 | 940 | </p> |
| 731 | 941 | </div> |
| 732 | 942 | <br /> |
| 733 | 943 | <p> |
| 734 | 944 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
| 735 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
| 945 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
| 946 | + print $globalBitlyAccessToken; |
|
| 947 | +} |
|
| 948 | +?>" /> |
|
| 736 | 949 | </p> |
| 737 | 950 | <br /> |
| 738 | 951 | <p> |
@@ -748,11 +961,26 @@ discard block |
||
| 748 | 961 | <p> |
| 749 | 962 | <label for="geoid_source">Geoid Source</label> |
| 750 | 963 | <select name="geoid_source" id="geoid_source"> |
| 751 | - <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option> |
|
| 752 | - <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option> |
|
| 753 | - <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option> |
|
| 754 | - <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option> |
|
| 755 | - <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option> |
|
| 964 | + <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') { |
|
| 965 | + print ' selected="selected"'; |
|
| 966 | +} |
|
| 967 | +?>>EGM96 15' (2.1MB)</option> |
|
| 968 | + <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') { |
|
| 969 | + print ' selected="selected"'; |
|
| 970 | +} |
|
| 971 | +?>>EGM96 5' (19MB)</option> |
|
| 972 | + <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') { |
|
| 973 | + print ' selected="selected"'; |
|
| 974 | +} |
|
| 975 | +?>>EGM2008 5' (19MB)</option> |
|
| 976 | + <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') { |
|
| 977 | + print ' selected="selected"'; |
|
| 978 | +} |
|
| 979 | +?>>EGM2008 2.5' (75MB)</option> |
|
| 980 | + <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') { |
|
| 981 | + print ' selected="selected"'; |
|
| 982 | +} |
|
| 983 | +?>>EGM2008 1' (470MB)</option> |
|
| 756 | 984 | </select> |
| 757 | 985 | <p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p> |
| 758 | 986 | </p> |
@@ -770,7 +998,12 @@ discard block |
||
| 770 | 998 | </p> |
| 771 | 999 | <p> |
| 772 | 1000 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
| 773 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" /> |
|
| 1001 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
| 1002 | + print $globalArchiveMonths; |
|
| 1003 | +} else { |
|
| 1004 | + echo '1'; |
|
| 1005 | +} |
|
| 1006 | +?>" /> |
|
| 774 | 1007 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
| 775 | 1008 | </p> |
| 776 | 1009 | <p> |
@@ -780,12 +1013,22 @@ discard block |
||
| 780 | 1013 | </p> |
| 781 | 1014 | <p> |
| 782 | 1015 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
| 783 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" /> |
|
| 1016 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
| 1017 | + print $globalArchiveKeepMonths; |
|
| 1018 | +} else { |
|
| 1019 | + echo '1'; |
|
| 1020 | +} |
|
| 1021 | +?>" /> |
|
| 784 | 1022 | <p class="help-block">0 to disable</p> |
| 785 | 1023 | </p> |
| 786 | 1024 | <p> |
| 787 | 1025 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
| 788 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" /> |
|
| 1026 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
| 1027 | + print $globalArchiveKeepTrackMonths; |
|
| 1028 | +} else { |
|
| 1029 | + echo '1'; |
|
| 1030 | +} |
|
| 1031 | +?>" /> |
|
| 789 | 1032 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
| 790 | 1033 | </p> |
| 791 | 1034 | <br /> |
@@ -795,7 +1038,12 @@ discard block |
||
| 795 | 1038 | <p class="help-block">Uncheck if the script is running as cron job</p> |
| 796 | 1039 | <div id="cronends"> |
| 797 | 1040 | <label for="cronend">Run script for xx seconds</label> |
| 798 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
| 1041 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
| 1042 | + print $globalCronEnd; |
|
| 1043 | +} else { |
|
| 1044 | + print '0'; |
|
| 1045 | +} |
|
| 1046 | +?>" /> |
|
| 799 | 1047 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
| 800 | 1048 | </div> |
| 801 | 1049 | </p> |
@@ -848,15 +1096,30 @@ discard block |
||
| 848 | 1096 | <br /> |
| 849 | 1097 | <p> |
| 850 | 1098 | <label for="refresh">Show flights detected since xxx seconds</label> |
| 851 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
| 1099 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
| 1100 | + echo $globalLiveInterval; |
|
| 1101 | +} else { |
|
| 1102 | + echo '200'; |
|
| 1103 | +} |
|
| 1104 | +?>" /> |
|
| 852 | 1105 | </p> |
| 853 | 1106 | <p> |
| 854 | 1107 | <label for="maprefresh">Live map refresh (in seconds)</label> |
| 855 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
| 1108 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
| 1109 | + echo $globalMapRefresh; |
|
| 1110 | +} else { |
|
| 1111 | + echo '30'; |
|
| 1112 | +} |
|
| 1113 | +?>" /> |
|
| 856 | 1114 | </p> |
| 857 | 1115 | <p> |
| 858 | 1116 | <label for="mapidle">Map idle timeout (in minutes)</label> |
| 859 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
| 1117 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
| 1118 | + echo $globalMapIdleTimeout; |
|
| 1119 | +} else { |
|
| 1120 | + echo '30'; |
|
| 1121 | +} |
|
| 1122 | +?>" /> |
|
| 860 | 1123 | <p class="help-block">0 to disable</p> |
| 861 | 1124 | </p> |
| 862 | 1125 | <p> |
@@ -871,12 +1134,20 @@ discard block |
||
| 871 | 1134 | <br /> |
| 872 | 1135 | <p> |
| 873 | 1136 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
| 874 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
| 1137 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
| 1138 | + echo $globalClosestMinDist; |
|
| 1139 | +} else { |
|
| 1140 | + echo '50'; |
|
| 1141 | +} |
|
| 1142 | +?>" /> |
|
| 875 | 1143 | </p> |
| 876 | 1144 | <br /> |
| 877 | 1145 | <p> |
| 878 | 1146 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
| 879 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
| 1147 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
| 1148 | + echo $globalAircraftSize; |
|
| 1149 | +} |
|
| 1150 | +?>" /> |
|
| 880 | 1151 | </p> |
| 881 | 1152 | <br /> |
| 882 | 1153 | <p> |
@@ -889,7 +1160,12 @@ discard block |
||
| 889 | 1160 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 890 | 1161 | ?> |
| 891 | 1162 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
| 892 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
| 1163 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
| 1164 | + echo $globalAircraftIconColor; |
|
| 1165 | +} else { |
|
| 1166 | + echo '1a3151'; |
|
| 1167 | +} |
|
| 1168 | +?>" /> |
|
| 893 | 1169 | <?php |
| 894 | 1170 | if (!is_writable('../cache')) { |
| 895 | 1171 | ?> |
@@ -907,14 +1183,27 @@ discard block |
||
| 907 | 1183 | <p> |
| 908 | 1184 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
| 909 | 1185 | <div class="range"> |
| 910 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
| 911 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
| 1186 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
| 1187 | + echo $globalAirportZoom; |
|
| 1188 | +} else { |
|
| 1189 | + echo '7'; |
|
| 1190 | +} |
|
| 1191 | +?>" /> |
|
| 1192 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
| 1193 | + echo $globalAirportZoom; |
|
| 1194 | +} else { |
|
| 1195 | + echo '7'; |
|
| 1196 | +} |
|
| 1197 | +?></output> |
|
| 912 | 1198 | </div> |
| 913 | 1199 | </p> |
| 914 | 1200 | <br /> |
| 915 | 1201 | <p> |
| 916 | 1202 | <label for="customcss">Custom CSS web path</label> |
| 917 | - <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" /> |
|
| 1203 | + <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) { |
|
| 1204 | + echo $globalCustomCSS; |
|
| 1205 | +} |
|
| 1206 | +?>" /> |
|
| 918 | 1207 | </p> |
| 919 | 1208 | </fieldset> |
| 920 | 1209 | <input type="submit" name="submit" value="Create/Update database & write setup" /> |
@@ -941,8 +1230,12 @@ discard block |
||
| 941 | 1230 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
| 942 | 1231 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
| 943 | 1232 | |
| 944 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
| 945 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1233 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
| 1234 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
| 1235 | + } |
|
| 1236 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
| 1237 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1238 | + } |
|
| 946 | 1239 | |
| 947 | 1240 | $_SESSION['database_root'] = $dbroot; |
| 948 | 1241 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -1010,15 +1303,23 @@ discard block |
||
| 1010 | 1303 | $source_city = $_POST['source_city']; |
| 1011 | 1304 | $source_country = $_POST['source_country']; |
| 1012 | 1305 | $source_ref = $_POST['source_ref']; |
| 1013 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
| 1014 | - else $source_id = array(); |
|
| 1306 | + if (isset($source_id)) { |
|
| 1307 | + $source_id = $_POST['source_id']; |
|
| 1308 | + } else { |
|
| 1309 | + $source_id = array(); |
|
| 1310 | + } |
|
| 1015 | 1311 | |
| 1016 | 1312 | $sources = array(); |
| 1017 | 1313 | foreach ($source_name as $keys => $name) { |
| 1018 | - 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]); |
|
| 1019 | - 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]); |
|
| 1314 | + if (isset($source_id[$keys])) { |
|
| 1315 | + $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]); |
|
| 1316 | + } else { |
|
| 1317 | + $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]); |
|
| 1318 | + } |
|
| 1319 | + } |
|
| 1320 | + if (count($sources) > 0) { |
|
| 1321 | + $_SESSION['sources'] = $sources; |
|
| 1020 | 1322 | } |
| 1021 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
| 1022 | 1323 | |
| 1023 | 1324 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
| 1024 | 1325 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -1039,17 +1340,29 @@ discard block |
||
| 1039 | 1340 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
| 1040 | 1341 | |
| 1041 | 1342 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
| 1042 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 1043 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1343 | + if ($globalaircraft == 'aircraft') { |
|
| 1344 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 1345 | + } else { |
|
| 1346 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1347 | + } |
|
| 1044 | 1348 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
| 1045 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 1046 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1349 | + if ($globaltracker == 'tracker') { |
|
| 1350 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 1351 | + } else { |
|
| 1352 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1353 | + } |
|
| 1047 | 1354 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
| 1048 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 1049 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1355 | + if ($globalmarine == 'marine') { |
|
| 1356 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 1357 | + } else { |
|
| 1358 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1359 | + } |
|
| 1050 | 1360 | $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING); |
| 1051 | - if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
| 1052 | - else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
| 1361 | + if ($globalsatellite == 'satellite') { |
|
| 1362 | + $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
| 1363 | + } else { |
|
| 1364 | + $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
| 1365 | + } |
|
| 1053 | 1366 | |
| 1054 | 1367 | /* |
| 1055 | 1368 | $globalSBS1Hosts = array(); |
@@ -1071,23 +1384,37 @@ discard block |
||
| 1071 | 1384 | $name = $_POST['name']; |
| 1072 | 1385 | $format = $_POST['format']; |
| 1073 | 1386 | $timezones = $_POST['timezones']; |
| 1074 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
| 1075 | - else $sourcestats = array(); |
|
| 1076 | - if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive']; |
|
| 1077 | - else $noarchive = array(); |
|
| 1387 | + if (isset($_POST['sourcestats'])) { |
|
| 1388 | + $sourcestats = $_POST['sourcestats']; |
|
| 1389 | + } else { |
|
| 1390 | + $sourcestats = array(); |
|
| 1391 | + } |
|
| 1392 | + if (isset($_POST['noarchive'])) { |
|
| 1393 | + $noarchive = $_POST['noarchive']; |
|
| 1394 | + } else { |
|
| 1395 | + $noarchive = array(); |
|
| 1396 | + } |
|
| 1078 | 1397 | $gSources = array(); |
| 1079 | 1398 | $forcepilots = false; |
| 1080 | 1399 | foreach ($host as $key => $h) { |
| 1081 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
| 1082 | - else $cov = 'FALSE'; |
|
| 1083 | - if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
|
| 1084 | - else $arch = 'FALSE'; |
|
| 1400 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
| 1401 | + $cov = 'TRUE'; |
|
| 1402 | + } else { |
|
| 1403 | + $cov = 'FALSE'; |
|
| 1404 | + } |
|
| 1405 | + if (isset($noarchive[$key]) && $noarchive[$key] == 1) { |
|
| 1406 | + $arch = 'TRUE'; |
|
| 1407 | + } else { |
|
| 1408 | + $arch = 'FALSE'; |
|
| 1409 | + } |
|
| 1085 | 1410 | if (strpos($format[$key],'_callback')) { |
| 1086 | 1411 | $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
| 1087 | 1412 | } elseif ($h != '' || $name[$key] != '') { |
| 1088 | 1413 | $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
| 1089 | 1414 | } |
| 1090 | - if ($format[$key] == 'airwhere') $forcepilots = true; |
|
| 1415 | + if ($format[$key] == 'airwhere') { |
|
| 1416 | + $forcepilots = true; |
|
| 1417 | + } |
|
| 1091 | 1418 | } |
| 1092 | 1419 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
| 1093 | 1420 | |
@@ -1115,7 +1442,9 @@ discard block |
||
| 1115 | 1442 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
| 1116 | 1443 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
| 1117 | 1444 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
| 1118 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1445 | + } else { |
|
| 1446 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1447 | + } |
|
| 1119 | 1448 | |
| 1120 | 1449 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
| 1121 | 1450 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1154,7 +1483,9 @@ discard block |
||
| 1154 | 1483 | |
| 1155 | 1484 | // Create in settings.php keys not yet configurable if not already here |
| 1156 | 1485 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
| 1157 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1486 | + if (!isset($globalDebug)) { |
|
| 1487 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1488 | + } |
|
| 1158 | 1489 | |
| 1159 | 1490 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
| 1160 | 1491 | if ($resetyearstats == 'resetyearstats') { |
@@ -1191,37 +1522,56 @@ discard block |
||
| 1191 | 1522 | } |
| 1192 | 1523 | */ |
| 1193 | 1524 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
| 1194 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1195 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1196 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1197 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1525 | + if ($globalsbs == 'sbs') { |
|
| 1526 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1527 | + } else { |
|
| 1528 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1529 | + } |
|
| 1530 | + if ($globalaprs == 'aprs') { |
|
| 1531 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1532 | + } else { |
|
| 1533 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1534 | + } |
|
| 1198 | 1535 | $va = false; |
| 1199 | 1536 | if ($globalivao == 'ivao') { |
| 1200 | 1537 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
| 1201 | 1538 | $va = true; |
| 1202 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1539 | + } else { |
|
| 1540 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1541 | + } |
|
| 1203 | 1542 | if ($globalvatsim == 'vatsim') { |
| 1204 | 1543 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
| 1205 | 1544 | $va = true; |
| 1206 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1545 | + } else { |
|
| 1546 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1547 | + } |
|
| 1207 | 1548 | if ($globalphpvms == 'phpvms') { |
| 1208 | 1549 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
| 1209 | 1550 | $va = true; |
| 1210 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1551 | + } else { |
|
| 1552 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1553 | + } |
|
| 1211 | 1554 | if ($globalvam == 'vam') { |
| 1212 | 1555 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
| 1213 | 1556 | $va = true; |
| 1214 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1557 | + } else { |
|
| 1558 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1559 | + } |
|
| 1215 | 1560 | if ($va) { |
| 1216 | 1561 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
| 1217 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1562 | + } else { |
|
| 1563 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1564 | + } |
|
| 1218 | 1565 | if ($globalva == 'va' || $va) { |
| 1219 | 1566 | $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
| 1220 | 1567 | $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
| 1221 | 1568 | } else { |
| 1222 | 1569 | $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
| 1223 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1224 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
| 1570 | + if ($forcepilots) { |
|
| 1571 | + $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1572 | + } else { |
|
| 1573 | + $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
| 1574 | + } |
|
| 1225 | 1575 | } |
| 1226 | 1576 | |
| 1227 | 1577 | |
@@ -1397,7 +1747,9 @@ discard block |
||
| 1397 | 1747 | $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
| 1398 | 1748 | } |
| 1399 | 1749 | |
| 1400 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1750 | + if (!isset($globalTransaction)) { |
|
| 1751 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1752 | + } |
|
| 1401 | 1753 | |
| 1402 | 1754 | // Set some defaults values... |
| 1403 | 1755 | if (!isset($globalAircraftImageSources)) { |
@@ -1412,15 +1764,23 @@ discard block |
||
| 1412 | 1764 | |
| 1413 | 1765 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
| 1414 | 1766 | |
| 1415 | - if ($error == '') settings::modify_settings($settings); |
|
| 1416 | - if ($error == '') settings::comment_settings($settings_comment); |
|
| 1767 | + if ($error == '') { |
|
| 1768 | + settings::modify_settings($settings); |
|
| 1769 | + } |
|
| 1770 | + if ($error == '') { |
|
| 1771 | + settings::comment_settings($settings_comment); |
|
| 1772 | + } |
|
| 1417 | 1773 | if ($error != '') { |
| 1418 | 1774 | print '<div class="info column">'.$error.'</div>'; |
| 1419 | 1775 | require('../footer.php'); |
| 1420 | 1776 | exit; |
| 1421 | 1777 | } else { |
| 1422 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
| 1423 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
| 1778 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
| 1779 | + $_SESSION['waypoints'] = 1; |
|
| 1780 | + } |
|
| 1781 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
| 1782 | + $_SESSION['owner'] = 1; |
|
| 1783 | + } |
|
| 1424 | 1784 | if (isset($_POST['createdb'])) { |
| 1425 | 1785 | $_SESSION['install'] = 'database_create'; |
| 1426 | 1786 | } else { |
@@ -1456,10 +1816,18 @@ discard block |
||
| 1456 | 1816 | $popw = false; |
| 1457 | 1817 | foreach ($_SESSION['done'] as $done) { |
| 1458 | 1818 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
| 1459 | - if ($done == 'Create database') $pop = true; |
|
| 1460 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
| 1461 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
| 1462 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
| 1819 | + if ($done == 'Create database') { |
|
| 1820 | + $pop = true; |
|
| 1821 | + } |
|
| 1822 | + if ($_SESSION['install'] == 'database_create') { |
|
| 1823 | + $pop = true; |
|
| 1824 | + } |
|
| 1825 | + if ($_SESSION['install'] == 'database_import') { |
|
| 1826 | + $popi = true; |
|
| 1827 | + } |
|
| 1828 | + if ($_SESSION['install'] == 'waypoints') { |
|
| 1829 | + $popw = true; |
|
| 1830 | + } |
|
| 1463 | 1831 | } |
| 1464 | 1832 | if ($pop) { |
| 1465 | 1833 | sleep(5); |
@@ -1470,7 +1838,9 @@ discard block |
||
| 1470 | 1838 | } else if ($popw) { |
| 1471 | 1839 | sleep(5); |
| 1472 | 1840 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
| 1473 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 1841 | + } else { |
|
| 1842 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 1843 | + } |
|
| 1474 | 1844 | print '</div></ul>'; |
| 1475 | 1845 | print '<div id="error"></div>'; |
| 1476 | 1846 | /* foreach ($_SESSION['done'] as $done) { |
@@ -258,7 +258,9 @@ discard block |
||
| 258 | 258 | // Update table countries |
| 259 | 259 | if ($Connection->tableExists('airspace')) { |
| 260 | 260 | $error .= update_db::update_countries(); |
| 261 | - if ($error != '') return $error; |
|
| 261 | + if ($error != '') { |
|
| 262 | + return $error; |
|
| 263 | + } |
|
| 262 | 264 | } |
| 263 | 265 | // Update schema_version to 7 |
| 264 | 266 | $query = "UPDATE `config` SET `value` = '7' WHERE `name` = 'schema_version'"; |
@@ -314,7 +316,9 @@ discard block |
||
| 314 | 316 | $error = ''; |
| 315 | 317 | // Update table aircraft |
| 316 | 318 | $error .= create_db::import_file('../db/source_location.sql'); |
| 317 | - if ($error != '') return $error; |
|
| 319 | + if ($error != '') { |
|
| 320 | + return $error; |
|
| 321 | + } |
|
| 318 | 322 | // Update schema_version to 6 |
| 319 | 323 | $query = "UPDATE `config` SET `value` = '8' WHERE `name` = 'schema_version'"; |
| 320 | 324 | try { |
@@ -331,7 +335,9 @@ discard block |
||
| 331 | 335 | $error = ''; |
| 332 | 336 | // Update table aircraft |
| 333 | 337 | $error .= create_db::import_file('../db/notam.sql'); |
| 334 | - if ($error != '') return $error; |
|
| 338 | + if ($error != '') { |
|
| 339 | + return $error; |
|
| 340 | + } |
|
| 335 | 341 | $query = "DELETE FROM config WHERE name = 'last_update_db'; |
| 336 | 342 | INSERT INTO config (name,value) VALUES ('last_update_db',NOW()); |
| 337 | 343 | DELETE FROM config WHERE name = 'last_update_notam_db'; |
@@ -365,7 +371,9 @@ discard block |
||
| 365 | 371 | $error = ''; |
| 366 | 372 | // Update table atc |
| 367 | 373 | $error .= create_db::import_file('../db/atc.sql'); |
| 368 | - if ($error != '') return $error; |
|
| 374 | + if ($error != '') { |
|
| 375 | + return $error; |
|
| 376 | + } |
|
| 369 | 377 | |
| 370 | 378 | $query = "UPDATE `config` SET `value` = '10' WHERE `name` = 'schema_version'"; |
| 371 | 379 | try { |
@@ -389,13 +397,21 @@ discard block |
||
| 389 | 397 | $error = ''; |
| 390 | 398 | // Add tables |
| 391 | 399 | $error .= create_db::import_file('../db/aircraft_owner.sql'); |
| 392 | - if ($error != '') return $error; |
|
| 400 | + if ($error != '') { |
|
| 401 | + return $error; |
|
| 402 | + } |
|
| 393 | 403 | $error .= create_db::import_file('../db/metar.sql'); |
| 394 | - if ($error != '') return $error; |
|
| 404 | + if ($error != '') { |
|
| 405 | + return $error; |
|
| 406 | + } |
|
| 395 | 407 | $error .= create_db::import_file('../db/taf.sql'); |
| 396 | - if ($error != '') return $error; |
|
| 408 | + if ($error != '') { |
|
| 409 | + return $error; |
|
| 410 | + } |
|
| 397 | 411 | $error .= create_db::import_file('../db/airport.sql'); |
| 398 | - if ($error != '') return $error; |
|
| 412 | + if ($error != '') { |
|
| 413 | + return $error; |
|
| 414 | + } |
|
| 399 | 415 | |
| 400 | 416 | $query = "UPDATE `config` SET `value` = '11' WHERE `name` = 'schema_version'"; |
| 401 | 417 | try { |
@@ -469,19 +485,33 @@ discard block |
||
| 469 | 485 | $error = ''; |
| 470 | 486 | // Add tables |
| 471 | 487 | $error .= create_db::import_file('../db/stats.sql'); |
| 472 | - if ($error != '') return $error; |
|
| 488 | + if ($error != '') { |
|
| 489 | + return $error; |
|
| 490 | + } |
|
| 473 | 491 | $error .= create_db::import_file('../db/stats_aircraft.sql'); |
| 474 | - if ($error != '') return $error; |
|
| 492 | + if ($error != '') { |
|
| 493 | + return $error; |
|
| 494 | + } |
|
| 475 | 495 | $error .= create_db::import_file('../db/stats_airline.sql'); |
| 476 | - if ($error != '') return $error; |
|
| 496 | + if ($error != '') { |
|
| 497 | + return $error; |
|
| 498 | + } |
|
| 477 | 499 | $error .= create_db::import_file('../db/stats_airport.sql'); |
| 478 | - if ($error != '') return $error; |
|
| 500 | + if ($error != '') { |
|
| 501 | + return $error; |
|
| 502 | + } |
|
| 479 | 503 | $error .= create_db::import_file('../db/stats_owner.sql'); |
| 480 | - if ($error != '') return $error; |
|
| 504 | + if ($error != '') { |
|
| 505 | + return $error; |
|
| 506 | + } |
|
| 481 | 507 | $error .= create_db::import_file('../db/stats_pilot.sql'); |
| 482 | - if ($error != '') return $error; |
|
| 508 | + if ($error != '') { |
|
| 509 | + return $error; |
|
| 510 | + } |
|
| 483 | 511 | $error .= create_db::import_file('../db/spotter_archive_output.sql'); |
| 484 | - if ($error != '') return $error; |
|
| 512 | + if ($error != '') { |
|
| 513 | + return $error; |
|
| 514 | + } |
|
| 485 | 515 | |
| 486 | 516 | $query = "UPDATE `config` SET `value` = '13' WHERE `name` = 'schema_version'"; |
| 487 | 517 | try { |
@@ -521,7 +551,9 @@ discard block |
||
| 521 | 551 | // Add tables |
| 522 | 552 | if (!$Connection->tableExists('stats_flight')) { |
| 523 | 553 | $error .= create_db::import_file('../db/stats_flight.sql'); |
| 524 | - if ($error != '') return $error; |
|
| 554 | + if ($error != '') { |
|
| 555 | + return $error; |
|
| 556 | + } |
|
| 525 | 557 | } |
| 526 | 558 | $query = "UPDATE `config` SET `value` = '15' WHERE `name` = 'schema_version'"; |
| 527 | 559 | try { |
@@ -545,7 +577,9 @@ discard block |
||
| 545 | 577 | } catch(PDOException $e) { |
| 546 | 578 | return "error (update stats) : ".$e->getMessage()."\n"; |
| 547 | 579 | } |
| 548 | - if ($error != '') return $error; |
|
| 580 | + if ($error != '') { |
|
| 581 | + return $error; |
|
| 582 | + } |
|
| 549 | 583 | $query = "UPDATE `config` SET `value` = '16' WHERE `name` = 'schema_version'"; |
| 550 | 584 | try { |
| 551 | 585 | $sth = $Connection->db->prepare($query); |
@@ -566,7 +600,9 @@ discard block |
||
| 566 | 600 | if (!$Connection->tableExists('stats_callsign')) { |
| 567 | 601 | $error .= create_db::import_file('../db/stats_callsign.sql'); |
| 568 | 602 | } |
| 569 | - if ($error != '') return $error; |
|
| 603 | + if ($error != '') { |
|
| 604 | + return $error; |
|
| 605 | + } |
|
| 570 | 606 | $query = "UPDATE `config` SET `value` = '17' WHERE `name` = 'schema_version'"; |
| 571 | 607 | try { |
| 572 | 608 | $sth = $Connection->db->prepare($query); |
@@ -584,7 +620,9 @@ discard block |
||
| 584 | 620 | if (!$Connection->tableExists('stats_country')) { |
| 585 | 621 | $error .= create_db::import_file('../db/stats_country.sql'); |
| 586 | 622 | } |
| 587 | - if ($error != '') return $error; |
|
| 623 | + if ($error != '') { |
|
| 624 | + return $error; |
|
| 625 | + } |
|
| 588 | 626 | $query = "UPDATE `config` SET `value` = '18' WHERE `name` = 'schema_version'"; |
| 589 | 627 | try { |
| 590 | 628 | $sth = $Connection->db->prepare($query); |
@@ -607,7 +645,9 @@ discard block |
||
| 607 | 645 | return "error (update stats) : ".$e->getMessage()."\n"; |
| 608 | 646 | } |
| 609 | 647 | } |
| 610 | - if ($error != '') return $error; |
|
| 648 | + if ($error != '') { |
|
| 649 | + return $error; |
|
| 650 | + } |
|
| 611 | 651 | $query = "UPDATE `config` SET `value` = '19' WHERE `name` = 'schema_version'"; |
| 612 | 652 | try { |
| 613 | 653 | $sth = $Connection->db->prepare($query); |
@@ -623,7 +663,9 @@ discard block |
||
| 623 | 663 | $error = ''; |
| 624 | 664 | // Update airport table |
| 625 | 665 | $error .= create_db::import_file('../db/airport.sql'); |
| 626 | - if ($error != '') return 'Import airport.sql : '.$error; |
|
| 666 | + if ($error != '') { |
|
| 667 | + return 'Import airport.sql : '.$error; |
|
| 668 | + } |
|
| 627 | 669 | // Remove primary key on Spotter_Archive |
| 628 | 670 | $query = "alter table spotter_archive drop spotter_archive_id"; |
| 629 | 671 | try { |
@@ -699,7 +741,9 @@ discard block |
||
| 699 | 741 | return "error (add source_name column) : ".$e->getMessage()."\n"; |
| 700 | 742 | } |
| 701 | 743 | } |
| 702 | - if ($error != '') return $error; |
|
| 744 | + if ($error != '') { |
|
| 745 | + return $error; |
|
| 746 | + } |
|
| 703 | 747 | $query = "UPDATE `config` SET `value` = '20' WHERE `name` = 'schema_version'"; |
| 704 | 748 | try { |
| 705 | 749 | $sth = $Connection->db->prepare($query); |
@@ -717,7 +761,9 @@ discard block |
||
| 717 | 761 | // Update airline table |
| 718 | 762 | if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
| 719 | 763 | $error .= create_db::import_file('../db/airlines.sql'); |
| 720 | - if ($error != '') return 'Import airlines.sql : '.$error; |
|
| 764 | + if ($error != '') { |
|
| 765 | + return 'Import airlines.sql : '.$error; |
|
| 766 | + } |
|
| 721 | 767 | } |
| 722 | 768 | if (!$Connection->checkColumnName('aircraft_modes','type_flight')) { |
| 723 | 769 | // Add column over_country |
@@ -729,7 +775,9 @@ discard block |
||
| 729 | 775 | return "error (add over_country) : ".$e->getMessage()."\n"; |
| 730 | 776 | } |
| 731 | 777 | } |
| 732 | - if ($error != '') return $error; |
|
| 778 | + if ($error != '') { |
|
| 779 | + return $error; |
|
| 780 | + } |
|
| 733 | 781 | /* |
| 734 | 782 | if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
| 735 | 783 | // Force update ModeS (this will put type_flight data |
@@ -759,7 +807,9 @@ discard block |
||
| 759 | 807 | } catch(PDOException $e) { |
| 760 | 808 | return "error (rename type to stats_type on stats*) : ".$e->getMessage()."\n"; |
| 761 | 809 | } |
| 762 | - if ($error != '') return $error; |
|
| 810 | + if ($error != '') { |
|
| 811 | + return $error; |
|
| 812 | + } |
|
| 763 | 813 | } |
| 764 | 814 | $query = "UPDATE `config` SET `value` = '22' WHERE `name` = 'schema_version'"; |
| 765 | 815 | try { |
@@ -782,7 +832,9 @@ discard block |
||
| 782 | 832 | } else { |
| 783 | 833 | $error .= create_db::import_file('../db/pgsql/stats_source.sql'); |
| 784 | 834 | } |
| 785 | - if ($error != '') return $error; |
|
| 835 | + if ($error != '') { |
|
| 836 | + return $error; |
|
| 837 | + } |
|
| 786 | 838 | } |
| 787 | 839 | $query = "UPDATE config SET value = '23' WHERE name = 'schema_version'"; |
| 788 | 840 | try { |
@@ -804,12 +856,16 @@ discard block |
||
| 804 | 856 | if ($globalDBdriver == 'mysql') { |
| 805 | 857 | if (!$Connection->tableExists('tle')) { |
| 806 | 858 | $error .= create_db::import_file('../db/tle.sql'); |
| 807 | - if ($error != '') return $error; |
|
| 859 | + if ($error != '') { |
|
| 860 | + return $error; |
|
| 861 | + } |
|
| 808 | 862 | } |
| 809 | 863 | } else { |
| 810 | 864 | if (!$Connection->tableExists('tle')) { |
| 811 | 865 | $error .= create_db::import_file('../db/pgsql/tle.sql'); |
| 812 | - if ($error != '') return $error; |
|
| 866 | + if ($error != '') { |
|
| 867 | + return $error; |
|
| 868 | + } |
|
| 813 | 869 | } |
| 814 | 870 | $query = "create index flightaware_id_idx ON spotter_archive USING btree(flightaware_id)"; |
| 815 | 871 | try { |
@@ -849,7 +905,9 @@ discard block |
||
| 849 | 905 | } else { |
| 850 | 906 | $error .= create_db::import_file('../db/pgsql/airlines.sql'); |
| 851 | 907 | } |
| 852 | - if ($error != '') return 'Import airlines.sql : '.$error; |
|
| 908 | + if ($error != '') { |
|
| 909 | + return 'Import airlines.sql : '.$error; |
|
| 910 | + } |
|
| 853 | 911 | if (!$Connection->checkColumnName('airlines','forsource')) { |
| 854 | 912 | // Add forsource to airlines |
| 855 | 913 | $query = "ALTER TABLE airlines ADD forsource VARCHAR(255) NULL DEFAULT NULL"; |
@@ -1332,20 +1390,28 @@ discard block |
||
| 1332 | 1390 | } |
| 1333 | 1391 | if ($globalDBdriver == 'mysql') { |
| 1334 | 1392 | $error .= create_db::import_file('../db/airlines.sql'); |
| 1335 | - if ($error != '') return $error; |
|
| 1393 | + if ($error != '') { |
|
| 1394 | + return $error; |
|
| 1395 | + } |
|
| 1336 | 1396 | } else { |
| 1337 | 1397 | $error .= create_db::import_file('../db/pgsql/airlines.sql'); |
| 1338 | - if ($error != '') return $error; |
|
| 1398 | + if ($error != '') { |
|
| 1399 | + return $error; |
|
| 1400 | + } |
|
| 1339 | 1401 | } |
| 1340 | 1402 | if ((isset($globalVATSIM) && $globalVATSIM) || (isset($globalIVAO) && $globalIVAO)) { |
| 1341 | 1403 | include_once(dirname(__FILE__).'/class.update_db.php'); |
| 1342 | 1404 | if (isset($globalVATSIM) && $globalVATSIM) { |
| 1343 | 1405 | $error .= update_db::update_vatsim(); |
| 1344 | - if ($error != '') return $error; |
|
| 1406 | + if ($error != '') { |
|
| 1407 | + return $error; |
|
| 1408 | + } |
|
| 1345 | 1409 | } |
| 1346 | 1410 | if (isset($globalIVAO) && $globalIVAO && file_exists('tmp/ivae_feb2013.zip')) { |
| 1347 | 1411 | $error .= update_db::update_IVAO(); |
| 1348 | - if ($error != '') return $error; |
|
| 1412 | + if ($error != '') { |
|
| 1413 | + return $error; |
|
| 1414 | + } |
|
| 1349 | 1415 | } |
| 1350 | 1416 | } |
| 1351 | 1417 | |
@@ -1608,41 +1674,65 @@ discard block |
||
| 1608 | 1674 | if ($globalDBdriver == 'mysql') { |
| 1609 | 1675 | if (!$Connection->tableExists('tracker_output')) { |
| 1610 | 1676 | $error .= create_db::import_file('../db/tracker_output.sql'); |
| 1611 | - if ($error != '') return $error; |
|
| 1677 | + if ($error != '') { |
|
| 1678 | + return $error; |
|
| 1679 | + } |
|
| 1612 | 1680 | } |
| 1613 | 1681 | if (!$Connection->tableExists('tracker_live')) { |
| 1614 | 1682 | $error .= create_db::import_file('../db/tracker_live.sql'); |
| 1615 | - if ($error != '') return $error; |
|
| 1683 | + if ($error != '') { |
|
| 1684 | + return $error; |
|
| 1685 | + } |
|
| 1616 | 1686 | } |
| 1617 | 1687 | if (!$Connection->tableExists('marine_output')) { |
| 1618 | 1688 | $error .= create_db::import_file('../db/marine_output.sql'); |
| 1619 | - if ($error != '') return $error; |
|
| 1689 | + if ($error != '') { |
|
| 1690 | + return $error; |
|
| 1691 | + } |
|
| 1620 | 1692 | } |
| 1621 | 1693 | if (!$Connection->tableExists('marine_live')) { |
| 1622 | 1694 | $error .= create_db::import_file('../db/marine_live.sql'); |
| 1623 | - if ($error != '') return $error; |
|
| 1695 | + if ($error != '') { |
|
| 1696 | + return $error; |
|
| 1697 | + } |
|
| 1624 | 1698 | } |
| 1625 | 1699 | if (!$Connection->tableExists('marine_identity')) { |
| 1626 | 1700 | $error .= create_db::import_file('../db/marine_identity.sql'); |
| 1627 | - if ($error != '') return $error; |
|
| 1701 | + if ($error != '') { |
|
| 1702 | + return $error; |
|
| 1703 | + } |
|
| 1628 | 1704 | } |
| 1629 | 1705 | if (!$Connection->tableExists('marine_mid')) { |
| 1630 | 1706 | $error .= create_db::import_file('../db/marine_mid.sql'); |
| 1631 | - if ($error != '') return $error; |
|
| 1707 | + if ($error != '') { |
|
| 1708 | + return $error; |
|
| 1709 | + } |
|
| 1632 | 1710 | } |
| 1633 | 1711 | } else { |
| 1634 | 1712 | $error .= create_db::import_file('../db/pgsql/tracker_output.sql'); |
| 1635 | - if ($error != '') return $error; |
|
| 1713 | + if ($error != '') { |
|
| 1714 | + return $error; |
|
| 1715 | + } |
|
| 1636 | 1716 | $error .= create_db::import_file('../db/pgsql/tracker_live.sql'); |
| 1637 | - if ($error != '') return $error; |
|
| 1717 | + if ($error != '') { |
|
| 1718 | + return $error; |
|
| 1719 | + } |
|
| 1638 | 1720 | $error .= create_db::import_file('../db/pgsql/marine_output.sql'); |
| 1639 | - if ($error != '') return $error; |
|
| 1721 | + if ($error != '') { |
|
| 1722 | + return $error; |
|
| 1723 | + } |
|
| 1640 | 1724 | $error .= create_db::import_file('../db/pgsql/marine_live.sql'); |
| 1641 | - if ($error != '') return $error; |
|
| 1725 | + if ($error != '') { |
|
| 1726 | + return $error; |
|
| 1727 | + } |
|
| 1642 | 1728 | $error .= create_db::import_file('../db/pgsql/marine_identity.sql'); |
| 1643 | - if ($error != '') return $error; |
|
| 1729 | + if ($error != '') { |
|
| 1730 | + return $error; |
|
| 1731 | + } |
|
| 1644 | 1732 | $error .= create_db::import_file('../db/pgsql/marine_mid.sql'); |
| 1645 | - if ($error != '') return $error; |
|
| 1733 | + if ($error != '') { |
|
| 1734 | + return $error; |
|
| 1735 | + } |
|
| 1646 | 1736 | } |
| 1647 | 1737 | $query = "UPDATE config SET value = '37' WHERE name = 'schema_version'"; |
| 1648 | 1738 | try { |
@@ -1661,39 +1751,61 @@ discard block |
||
| 1661 | 1751 | if ($globalDBdriver == 'mysql') { |
| 1662 | 1752 | if (!$Connection->tableExists('marine_image')) { |
| 1663 | 1753 | $error .= create_db::import_file('../db/marine_image.sql'); |
| 1664 | - if ($error != '') return $error; |
|
| 1754 | + if ($error != '') { |
|
| 1755 | + return $error; |
|
| 1756 | + } |
|
| 1665 | 1757 | } |
| 1666 | 1758 | if (!$Connection->tableExists('marine_archive')) { |
| 1667 | 1759 | $error .= create_db::import_file('../db/marine_archive.sql'); |
| 1668 | - if ($error != '') return $error; |
|
| 1760 | + if ($error != '') { |
|
| 1761 | + return $error; |
|
| 1762 | + } |
|
| 1669 | 1763 | } |
| 1670 | 1764 | if (!$Connection->tableExists('marine_archive_output')) { |
| 1671 | 1765 | $error .= create_db::import_file('../db/marine_archive_output.sql'); |
| 1672 | - if ($error != '') return $error; |
|
| 1766 | + if ($error != '') { |
|
| 1767 | + return $error; |
|
| 1768 | + } |
|
| 1673 | 1769 | } |
| 1674 | 1770 | if (!$Connection->tableExists('tracker_archive')) { |
| 1675 | 1771 | $error .= create_db::import_file('../db/tracker_archive.sql'); |
| 1676 | - if ($error != '') return $error; |
|
| 1772 | + if ($error != '') { |
|
| 1773 | + return $error; |
|
| 1774 | + } |
|
| 1677 | 1775 | } |
| 1678 | 1776 | if (!$Connection->tableExists('tracker_archive_output')) { |
| 1679 | 1777 | $error .= create_db::import_file('../db/tracker_archive_output.sql'); |
| 1680 | - if ($error != '') return $error; |
|
| 1778 | + if ($error != '') { |
|
| 1779 | + return $error; |
|
| 1780 | + } |
|
| 1681 | 1781 | } |
| 1682 | 1782 | if (!$Connection->tableExists('marine_archive_output')) { |
| 1683 | 1783 | $error .= create_db::import_file('../db/tracker_archive_output.sql'); |
| 1684 | - if ($error != '') return $error; |
|
| 1784 | + if ($error != '') { |
|
| 1785 | + return $error; |
|
| 1786 | + } |
|
| 1685 | 1787 | } |
| 1686 | 1788 | } else { |
| 1687 | 1789 | $error .= create_db::import_file('../db/pgsql/marine_image.sql'); |
| 1688 | - if ($error != '') return $error; |
|
| 1790 | + if ($error != '') { |
|
| 1791 | + return $error; |
|
| 1792 | + } |
|
| 1689 | 1793 | $error .= create_db::import_file('../db/pgsql/marine_archive.sql'); |
| 1690 | - if ($error != '') return $error; |
|
| 1794 | + if ($error != '') { |
|
| 1795 | + return $error; |
|
| 1796 | + } |
|
| 1691 | 1797 | $error .= create_db::import_file('../db/pgsql/marine_archive_output.sql'); |
| 1692 | - if ($error != '') return $error; |
|
| 1798 | + if ($error != '') { |
|
| 1799 | + return $error; |
|
| 1800 | + } |
|
| 1693 | 1801 | $error .= create_db::import_file('../db/pgsql/tracker_archive.sql'); |
| 1694 | - if ($error != '') return $error; |
|
| 1802 | + if ($error != '') { |
|
| 1803 | + return $error; |
|
| 1804 | + } |
|
| 1695 | 1805 | $error .= create_db::import_file('../db/pgsql/tracker_archive_output.sql'); |
| 1696 | - if ($error != '') return $error; |
|
| 1806 | + if ($error != '') { |
|
| 1807 | + return $error; |
|
| 1808 | + } |
|
| 1697 | 1809 | } |
| 1698 | 1810 | if ($globalDBdriver == 'mysql') { |
| 1699 | 1811 | $query = "SELECT ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '".$globalDBname."' AND TABLE_NAME = 'spotter_archive'"; |
@@ -2064,7 +2176,9 @@ discard block |
||
| 2064 | 2176 | if ($globalDBdriver == 'mysql') { |
| 2065 | 2177 | if (!$Connection->tableExists('tracker_archive_output')) { |
| 2066 | 2178 | $error .= create_db::import_file('../db/tracker_archive_output.sql'); |
| 2067 | - if ($error != '') return $error; |
|
| 2179 | + if ($error != '') { |
|
| 2180 | + return $error; |
|
| 2181 | + } |
|
| 2068 | 2182 | } |
| 2069 | 2183 | $query = "ALTER TABLE tracker_live MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN last_altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_archive MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_archive_output MODIFY COLUMN last_altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN altitude float DEFAULT NULL;"; |
| 2070 | 2184 | } else { |
@@ -2092,14 +2206,22 @@ discard block |
||
| 2092 | 2206 | $error = ''; |
| 2093 | 2207 | if ($globalDBdriver == 'mysql') { |
| 2094 | 2208 | $error .= create_db::import_file('../db/airport.sql'); |
| 2095 | - if ($error != '') return $error; |
|
| 2209 | + if ($error != '') { |
|
| 2210 | + return $error; |
|
| 2211 | + } |
|
| 2096 | 2212 | $error .= create_db::import_file('../db/airlines.sql'); |
| 2097 | - if ($error != '') return $error; |
|
| 2213 | + if ($error != '') { |
|
| 2214 | + return $error; |
|
| 2215 | + } |
|
| 2098 | 2216 | } else { |
| 2099 | 2217 | $error .= create_db::import_file('../db/pgsql/airport.sql'); |
| 2100 | - if ($error != '') return $error; |
|
| 2218 | + if ($error != '') { |
|
| 2219 | + return $error; |
|
| 2220 | + } |
|
| 2101 | 2221 | $error .= create_db::import_file('../db/pgsql/airlines.sql'); |
| 2102 | - if ($error != '') return $error; |
|
| 2222 | + if ($error != '') { |
|
| 2223 | + return $error; |
|
| 2224 | + } |
|
| 2103 | 2225 | } |
| 2104 | 2226 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 2105 | 2227 | if (file_exists('tmp/ivae_feb2013.zip')) { |
@@ -2116,7 +2238,9 @@ discard block |
||
| 2116 | 2238 | $error .= update_db::update_vatsim(); |
| 2117 | 2239 | } |
| 2118 | 2240 | } |
| 2119 | - if ($error != '') return $error; |
|
| 2241 | + if ($error != '') { |
|
| 2242 | + return $error; |
|
| 2243 | + } |
|
| 2120 | 2244 | $query = "UPDATE config SET value = '45' WHERE name = 'schema_version'"; |
| 2121 | 2245 | try { |
| 2122 | 2246 | $sth = $Connection->db->prepare($query); |
@@ -2134,10 +2258,14 @@ discard block |
||
| 2134 | 2258 | if (!$Connection->tableExists('satellite')) { |
| 2135 | 2259 | if ($globalDBdriver == 'mysql') { |
| 2136 | 2260 | $error .= create_db::import_file('../db/satellite.sql'); |
| 2137 | - if ($error != '') return $error; |
|
| 2261 | + if ($error != '') { |
|
| 2262 | + return $error; |
|
| 2263 | + } |
|
| 2138 | 2264 | } else { |
| 2139 | 2265 | $error .= create_db::import_file('../db/pgsql/satellite.sql'); |
| 2140 | - if ($error != '') return $error; |
|
| 2266 | + if ($error != '') { |
|
| 2267 | + return $error; |
|
| 2268 | + } |
|
| 2141 | 2269 | } |
| 2142 | 2270 | } |
| 2143 | 2271 | $query = "UPDATE config SET value = '46' WHERE name = 'schema_version'"; |
@@ -2159,8 +2287,11 @@ discard block |
||
| 2159 | 2287 | if ($Connection->tableExists('aircraft')) { |
| 2160 | 2288 | if (!$Connection->tableExists('config')) { |
| 2161 | 2289 | $version = '1'; |
| 2162 | - if ($update) return self::update_from_1(); |
|
| 2163 | - else return $version; |
|
| 2290 | + if ($update) { |
|
| 2291 | + return self::update_from_1(); |
|
| 2292 | + } else { |
|
| 2293 | + return $version; |
|
| 2294 | + } |
|
| 2164 | 2295 | } else { |
| 2165 | 2296 | $Connection = new Connection(); |
| 2166 | 2297 | $query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1"; |
@@ -2174,187 +2305,326 @@ discard block |
||
| 2174 | 2305 | if ($update) { |
| 2175 | 2306 | if ($result['value'] == '2') { |
| 2176 | 2307 | $error = self::update_from_2(); |
| 2177 | - if ($error != '') return $error; |
|
| 2178 | - else return self::check_version(true); |
|
| 2308 | + if ($error != '') { |
|
| 2309 | + return $error; |
|
| 2310 | + } else { |
|
| 2311 | + return self::check_version(true); |
|
| 2312 | + } |
|
| 2179 | 2313 | } elseif ($result['value'] == '3') { |
| 2180 | 2314 | $error = self::update_from_3(); |
| 2181 | - if ($error != '') return $error; |
|
| 2182 | - else return self::check_version(true); |
|
| 2315 | + if ($error != '') { |
|
| 2316 | + return $error; |
|
| 2317 | + } else { |
|
| 2318 | + return self::check_version(true); |
|
| 2319 | + } |
|
| 2183 | 2320 | } elseif ($result['value'] == '4') { |
| 2184 | 2321 | $error = self::update_from_4(); |
| 2185 | - if ($error != '') return $error; |
|
| 2186 | - else return self::check_version(true); |
|
| 2322 | + if ($error != '') { |
|
| 2323 | + return $error; |
|
| 2324 | + } else { |
|
| 2325 | + return self::check_version(true); |
|
| 2326 | + } |
|
| 2187 | 2327 | } elseif ($result['value'] == '5') { |
| 2188 | 2328 | $error = self::update_from_5(); |
| 2189 | - if ($error != '') return $error; |
|
| 2190 | - else return self::check_version(true); |
|
| 2329 | + if ($error != '') { |
|
| 2330 | + return $error; |
|
| 2331 | + } else { |
|
| 2332 | + return self::check_version(true); |
|
| 2333 | + } |
|
| 2191 | 2334 | } elseif ($result['value'] == '6') { |
| 2192 | 2335 | $error = self::update_from_6(); |
| 2193 | - if ($error != '') return $error; |
|
| 2194 | - else return self::check_version(true); |
|
| 2336 | + if ($error != '') { |
|
| 2337 | + return $error; |
|
| 2338 | + } else { |
|
| 2339 | + return self::check_version(true); |
|
| 2340 | + } |
|
| 2195 | 2341 | } elseif ($result['value'] == '7') { |
| 2196 | 2342 | $error = self::update_from_7(); |
| 2197 | - if ($error != '') return $error; |
|
| 2198 | - else return self::check_version(true); |
|
| 2343 | + if ($error != '') { |
|
| 2344 | + return $error; |
|
| 2345 | + } else { |
|
| 2346 | + return self::check_version(true); |
|
| 2347 | + } |
|
| 2199 | 2348 | } elseif ($result['value'] == '8') { |
| 2200 | 2349 | $error = self::update_from_8(); |
| 2201 | - if ($error != '') return $error; |
|
| 2202 | - else return self::check_version(true); |
|
| 2350 | + if ($error != '') { |
|
| 2351 | + return $error; |
|
| 2352 | + } else { |
|
| 2353 | + return self::check_version(true); |
|
| 2354 | + } |
|
| 2203 | 2355 | } elseif ($result['value'] == '9') { |
| 2204 | 2356 | $error = self::update_from_9(); |
| 2205 | - if ($error != '') return $error; |
|
| 2206 | - else return self::check_version(true); |
|
| 2357 | + if ($error != '') { |
|
| 2358 | + return $error; |
|
| 2359 | + } else { |
|
| 2360 | + return self::check_version(true); |
|
| 2361 | + } |
|
| 2207 | 2362 | } elseif ($result['value'] == '10') { |
| 2208 | 2363 | $error = self::update_from_10(); |
| 2209 | - if ($error != '') return $error; |
|
| 2210 | - else return self::check_version(true); |
|
| 2364 | + if ($error != '') { |
|
| 2365 | + return $error; |
|
| 2366 | + } else { |
|
| 2367 | + return self::check_version(true); |
|
| 2368 | + } |
|
| 2211 | 2369 | } elseif ($result['value'] == '11') { |
| 2212 | 2370 | $error = self::update_from_11(); |
| 2213 | - if ($error != '') return $error; |
|
| 2214 | - else return self::check_version(true); |
|
| 2371 | + if ($error != '') { |
|
| 2372 | + return $error; |
|
| 2373 | + } else { |
|
| 2374 | + return self::check_version(true); |
|
| 2375 | + } |
|
| 2215 | 2376 | } elseif ($result['value'] == '12') { |
| 2216 | 2377 | $error = self::update_from_12(); |
| 2217 | - if ($error != '') return $error; |
|
| 2218 | - else return self::check_version(true); |
|
| 2378 | + if ($error != '') { |
|
| 2379 | + return $error; |
|
| 2380 | + } else { |
|
| 2381 | + return self::check_version(true); |
|
| 2382 | + } |
|
| 2219 | 2383 | } elseif ($result['value'] == '13') { |
| 2220 | 2384 | $error = self::update_from_13(); |
| 2221 | - if ($error != '') return $error; |
|
| 2222 | - else return self::check_version(true); |
|
| 2385 | + if ($error != '') { |
|
| 2386 | + return $error; |
|
| 2387 | + } else { |
|
| 2388 | + return self::check_version(true); |
|
| 2389 | + } |
|
| 2223 | 2390 | } elseif ($result['value'] == '14') { |
| 2224 | 2391 | $error = self::update_from_14(); |
| 2225 | - if ($error != '') return $error; |
|
| 2226 | - else return self::check_version(true); |
|
| 2392 | + if ($error != '') { |
|
| 2393 | + return $error; |
|
| 2394 | + } else { |
|
| 2395 | + return self::check_version(true); |
|
| 2396 | + } |
|
| 2227 | 2397 | } elseif ($result['value'] == '15') { |
| 2228 | 2398 | $error = self::update_from_15(); |
| 2229 | - if ($error != '') return $error; |
|
| 2230 | - else return self::check_version(true); |
|
| 2399 | + if ($error != '') { |
|
| 2400 | + return $error; |
|
| 2401 | + } else { |
|
| 2402 | + return self::check_version(true); |
|
| 2403 | + } |
|
| 2231 | 2404 | } elseif ($result['value'] == '16') { |
| 2232 | 2405 | $error = self::update_from_16(); |
| 2233 | - if ($error != '') return $error; |
|
| 2234 | - else return self::check_version(true); |
|
| 2406 | + if ($error != '') { |
|
| 2407 | + return $error; |
|
| 2408 | + } else { |
|
| 2409 | + return self::check_version(true); |
|
| 2410 | + } |
|
| 2235 | 2411 | } elseif ($result['value'] == '17') { |
| 2236 | 2412 | $error = self::update_from_17(); |
| 2237 | - if ($error != '') return $error; |
|
| 2238 | - else return self::check_version(true); |
|
| 2413 | + if ($error != '') { |
|
| 2414 | + return $error; |
|
| 2415 | + } else { |
|
| 2416 | + return self::check_version(true); |
|
| 2417 | + } |
|
| 2239 | 2418 | } elseif ($result['value'] == '18') { |
| 2240 | 2419 | $error = self::update_from_18(); |
| 2241 | - if ($error != '') return $error; |
|
| 2242 | - else return self::check_version(true); |
|
| 2420 | + if ($error != '') { |
|
| 2421 | + return $error; |
|
| 2422 | + } else { |
|
| 2423 | + return self::check_version(true); |
|
| 2424 | + } |
|
| 2243 | 2425 | } elseif ($result['value'] == '19') { |
| 2244 | 2426 | $error = self::update_from_19(); |
| 2245 | - if ($error != '') return $error; |
|
| 2246 | - else return self::check_version(true); |
|
| 2427 | + if ($error != '') { |
|
| 2428 | + return $error; |
|
| 2429 | + } else { |
|
| 2430 | + return self::check_version(true); |
|
| 2431 | + } |
|
| 2247 | 2432 | } elseif ($result['value'] == '20') { |
| 2248 | 2433 | $error = self::update_from_20(); |
| 2249 | - if ($error != '') return $error; |
|
| 2250 | - else return self::check_version(true); |
|
| 2434 | + if ($error != '') { |
|
| 2435 | + return $error; |
|
| 2436 | + } else { |
|
| 2437 | + return self::check_version(true); |
|
| 2438 | + } |
|
| 2251 | 2439 | } elseif ($result['value'] == '21') { |
| 2252 | 2440 | $error = self::update_from_21(); |
| 2253 | - if ($error != '') return $error; |
|
| 2254 | - else return self::check_version(true); |
|
| 2441 | + if ($error != '') { |
|
| 2442 | + return $error; |
|
| 2443 | + } else { |
|
| 2444 | + return self::check_version(true); |
|
| 2445 | + } |
|
| 2255 | 2446 | } elseif ($result['value'] == '22') { |
| 2256 | 2447 | $error = self::update_from_22(); |
| 2257 | - if ($error != '') return $error; |
|
| 2258 | - else return self::check_version(true); |
|
| 2448 | + if ($error != '') { |
|
| 2449 | + return $error; |
|
| 2450 | + } else { |
|
| 2451 | + return self::check_version(true); |
|
| 2452 | + } |
|
| 2259 | 2453 | } elseif ($result['value'] == '23') { |
| 2260 | 2454 | $error = self::update_from_23(); |
| 2261 | - if ($error != '') return $error; |
|
| 2262 | - else return self::check_version(true); |
|
| 2455 | + if ($error != '') { |
|
| 2456 | + return $error; |
|
| 2457 | + } else { |
|
| 2458 | + return self::check_version(true); |
|
| 2459 | + } |
|
| 2263 | 2460 | } elseif ($result['value'] == '24') { |
| 2264 | 2461 | $error = self::update_from_24(); |
| 2265 | - if ($error != '') return $error; |
|
| 2266 | - else return self::check_version(true); |
|
| 2462 | + if ($error != '') { |
|
| 2463 | + return $error; |
|
| 2464 | + } else { |
|
| 2465 | + return self::check_version(true); |
|
| 2466 | + } |
|
| 2267 | 2467 | } elseif ($result['value'] == '25') { |
| 2268 | 2468 | $error = self::update_from_25(); |
| 2269 | - if ($error != '') return $error; |
|
| 2270 | - else return self::check_version(true); |
|
| 2469 | + if ($error != '') { |
|
| 2470 | + return $error; |
|
| 2471 | + } else { |
|
| 2472 | + return self::check_version(true); |
|
| 2473 | + } |
|
| 2271 | 2474 | } elseif ($result['value'] == '26') { |
| 2272 | 2475 | $error = self::update_from_26(); |
| 2273 | - if ($error != '') return $error; |
|
| 2274 | - else return self::check_version(true); |
|
| 2476 | + if ($error != '') { |
|
| 2477 | + return $error; |
|
| 2478 | + } else { |
|
| 2479 | + return self::check_version(true); |
|
| 2480 | + } |
|
| 2275 | 2481 | } elseif ($result['value'] == '27') { |
| 2276 | 2482 | $error = self::update_from_27(); |
| 2277 | - if ($error != '') return $error; |
|
| 2278 | - else return self::check_version(true); |
|
| 2483 | + if ($error != '') { |
|
| 2484 | + return $error; |
|
| 2485 | + } else { |
|
| 2486 | + return self::check_version(true); |
|
| 2487 | + } |
|
| 2279 | 2488 | } elseif ($result['value'] == '28') { |
| 2280 | 2489 | $error = self::update_from_28(); |
| 2281 | - if ($error != '') return $error; |
|
| 2282 | - else return self::check_version(true); |
|
| 2490 | + if ($error != '') { |
|
| 2491 | + return $error; |
|
| 2492 | + } else { |
|
| 2493 | + return self::check_version(true); |
|
| 2494 | + } |
|
| 2283 | 2495 | } elseif ($result['value'] == '29') { |
| 2284 | 2496 | $error = self::update_from_29(); |
| 2285 | - if ($error != '') return $error; |
|
| 2286 | - else return self::check_version(true); |
|
| 2497 | + if ($error != '') { |
|
| 2498 | + return $error; |
|
| 2499 | + } else { |
|
| 2500 | + return self::check_version(true); |
|
| 2501 | + } |
|
| 2287 | 2502 | } elseif ($result['value'] == '30') { |
| 2288 | 2503 | $error = self::update_from_30(); |
| 2289 | - if ($error != '') return $error; |
|
| 2290 | - else return self::check_version(true); |
|
| 2504 | + if ($error != '') { |
|
| 2505 | + return $error; |
|
| 2506 | + } else { |
|
| 2507 | + return self::check_version(true); |
|
| 2508 | + } |
|
| 2291 | 2509 | } elseif ($result['value'] == '31') { |
| 2292 | 2510 | $error = self::update_from_31(); |
| 2293 | - if ($error != '') return $error; |
|
| 2294 | - else return self::check_version(true); |
|
| 2511 | + if ($error != '') { |
|
| 2512 | + return $error; |
|
| 2513 | + } else { |
|
| 2514 | + return self::check_version(true); |
|
| 2515 | + } |
|
| 2295 | 2516 | } elseif ($result['value'] == '32') { |
| 2296 | 2517 | $error = self::update_from_32(); |
| 2297 | - if ($error != '') return $error; |
|
| 2298 | - else return self::check_version(true); |
|
| 2518 | + if ($error != '') { |
|
| 2519 | + return $error; |
|
| 2520 | + } else { |
|
| 2521 | + return self::check_version(true); |
|
| 2522 | + } |
|
| 2299 | 2523 | } elseif ($result['value'] == '33') { |
| 2300 | 2524 | $error = self::update_from_33(); |
| 2301 | - if ($error != '') return $error; |
|
| 2302 | - else return self::check_version(true); |
|
| 2525 | + if ($error != '') { |
|
| 2526 | + return $error; |
|
| 2527 | + } else { |
|
| 2528 | + return self::check_version(true); |
|
| 2529 | + } |
|
| 2303 | 2530 | } elseif ($result['value'] == '34') { |
| 2304 | 2531 | $error = self::update_from_34(); |
| 2305 | - if ($error != '') return $error; |
|
| 2306 | - else return self::check_version(true); |
|
| 2532 | + if ($error != '') { |
|
| 2533 | + return $error; |
|
| 2534 | + } else { |
|
| 2535 | + return self::check_version(true); |
|
| 2536 | + } |
|
| 2307 | 2537 | } elseif ($result['value'] == '35') { |
| 2308 | 2538 | $error = self::update_from_35(); |
| 2309 | - if ($error != '') return $error; |
|
| 2310 | - else return self::check_version(true); |
|
| 2539 | + if ($error != '') { |
|
| 2540 | + return $error; |
|
| 2541 | + } else { |
|
| 2542 | + return self::check_version(true); |
|
| 2543 | + } |
|
| 2311 | 2544 | } elseif ($result['value'] == '36') { |
| 2312 | 2545 | $error = self::update_from_36(); |
| 2313 | - if ($error != '') return $error; |
|
| 2314 | - else return self::check_version(true); |
|
| 2546 | + if ($error != '') { |
|
| 2547 | + return $error; |
|
| 2548 | + } else { |
|
| 2549 | + return self::check_version(true); |
|
| 2550 | + } |
|
| 2315 | 2551 | } elseif ($result['value'] == '37') { |
| 2316 | 2552 | $error = self::update_from_37(); |
| 2317 | - if ($error != '') return $error; |
|
| 2318 | - else return self::check_version(true); |
|
| 2553 | + if ($error != '') { |
|
| 2554 | + return $error; |
|
| 2555 | + } else { |
|
| 2556 | + return self::check_version(true); |
|
| 2557 | + } |
|
| 2319 | 2558 | } elseif ($result['value'] == '38') { |
| 2320 | 2559 | $error = self::update_from_38(); |
| 2321 | - if ($error != '') return $error; |
|
| 2322 | - else return self::check_version(true); |
|
| 2560 | + if ($error != '') { |
|
| 2561 | + return $error; |
|
| 2562 | + } else { |
|
| 2563 | + return self::check_version(true); |
|
| 2564 | + } |
|
| 2323 | 2565 | } elseif ($result['value'] == '39') { |
| 2324 | 2566 | $error = self::update_from_39(); |
| 2325 | - if ($error != '') return $error; |
|
| 2326 | - else return self::check_version(true); |
|
| 2567 | + if ($error != '') { |
|
| 2568 | + return $error; |
|
| 2569 | + } else { |
|
| 2570 | + return self::check_version(true); |
|
| 2571 | + } |
|
| 2327 | 2572 | } elseif ($result['value'] == '40') { |
| 2328 | 2573 | $error = self::update_from_40(); |
| 2329 | - if ($error != '') return $error; |
|
| 2330 | - else return self::check_version(true); |
|
| 2574 | + if ($error != '') { |
|
| 2575 | + return $error; |
|
| 2576 | + } else { |
|
| 2577 | + return self::check_version(true); |
|
| 2578 | + } |
|
| 2331 | 2579 | } elseif ($result['value'] == '41') { |
| 2332 | 2580 | $error = self::update_from_41(); |
| 2333 | - if ($error != '') return $error; |
|
| 2334 | - else return self::check_version(true); |
|
| 2581 | + if ($error != '') { |
|
| 2582 | + return $error; |
|
| 2583 | + } else { |
|
| 2584 | + return self::check_version(true); |
|
| 2585 | + } |
|
| 2335 | 2586 | } elseif ($result['value'] == '42') { |
| 2336 | 2587 | $error = self::update_from_42(); |
| 2337 | - if ($error != '') return $error; |
|
| 2338 | - else return self::check_version(true); |
|
| 2588 | + if ($error != '') { |
|
| 2589 | + return $error; |
|
| 2590 | + } else { |
|
| 2591 | + return self::check_version(true); |
|
| 2592 | + } |
|
| 2339 | 2593 | } elseif ($result['value'] == '43') { |
| 2340 | 2594 | $error = self::update_from_43(); |
| 2341 | - if ($error != '') return $error; |
|
| 2342 | - else return self::check_version(true); |
|
| 2595 | + if ($error != '') { |
|
| 2596 | + return $error; |
|
| 2597 | + } else { |
|
| 2598 | + return self::check_version(true); |
|
| 2599 | + } |
|
| 2343 | 2600 | } elseif ($result['value'] == '44') { |
| 2344 | 2601 | $error = self::update_from_44(); |
| 2345 | - if ($error != '') return $error; |
|
| 2346 | - else return self::check_version(true); |
|
| 2602 | + if ($error != '') { |
|
| 2603 | + return $error; |
|
| 2604 | + } else { |
|
| 2605 | + return self::check_version(true); |
|
| 2606 | + } |
|
| 2347 | 2607 | } elseif ($result['value'] == '45') { |
| 2348 | 2608 | $error = self::update_from_45(); |
| 2349 | - if ($error != '') return $error; |
|
| 2350 | - else return self::check_version(true); |
|
| 2351 | - } else return ''; |
|
| 2609 | + if ($error != '') { |
|
| 2610 | + return $error; |
|
| 2611 | + } else { |
|
| 2612 | + return self::check_version(true); |
|
| 2613 | + } |
|
| 2614 | + } else { |
|
| 2615 | + return ''; |
|
| 2616 | + } |
|
| 2352 | 2617 | } else { |
| 2353 | - if (isset($result['value']) && $result['value'] != '') return $result['value']; |
|
| 2354 | - else return 0; |
|
| 2618 | + if (isset($result['value']) && $result['value'] != '') { |
|
| 2619 | + return $result['value']; |
|
| 2620 | + } else { |
|
| 2621 | + return 0; |
|
| 2622 | + } |
|
| 2355 | 2623 | } |
| 2356 | 2624 | |
| 2357 | - } else return $version; |
|
| 2625 | + } else { |
|
| 2626 | + return $version; |
|
| 2627 | + } |
|
| 2358 | 2628 | } |
| 2359 | 2629 | |
| 2360 | 2630 | } |