@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once(dirname(__FILE__).'/settings.php'); |
| 3 | 3 | |
| 4 | -class Connection{ |
|
| 4 | +class Connection { |
|
| 5 | 5 | public $db = null; |
| 6 | 6 | public $dbs = array(); |
| 7 | 7 | public $latest_schema = 46; |
| 8 | 8 | |
| 9 | - public function __construct($dbc = null,$dbname = null,$user = null,$pass = null) { |
|
| 9 | + public function __construct($dbc = null, $dbname = null, $user = null, $pass = null) { |
|
| 10 | 10 | global $globalNoDB; |
| 11 | 11 | if (isset($globalNoDB) && $globalNoDB === TRUE) { |
| 12 | 12 | $this->db = null; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | if ($user === null && $pass === null) { |
| 17 | 17 | $this->createDBConnection(); |
| 18 | 18 | } else { |
| 19 | - $this->createDBConnection(null,$user,$pass); |
|
| 19 | + $this->createDBConnection(null, $user, $pass); |
|
| 20 | 20 | } |
| 21 | 21 | } else { |
| 22 | 22 | $this->createDBConnection($dbname); |
@@ -100,14 +100,14 @@ discard block |
||
| 100 | 100 | while (true) { |
| 101 | 101 | try { |
| 102 | 102 | if ($globalDBSdriver == 'mysql') { |
| 103 | - $this->dbs[$DBname] = new PDO("$globalDBSdriver:host=$globalDBShost;port=$globalDBSport;dbname=$globalDBSname;charset=utf8", $globalDBSuser, $globalDBSpass); |
|
| 103 | + $this->dbs[$DBname] = new PDO("$globalDBSdriver:host=$globalDBShost;port=$globalDBSport;dbname=$globalDBSname;charset=utf8", $globalDBSuser, $globalDBSpass); |
|
| 104 | 104 | $this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); |
| 105 | 105 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 106 | - $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); |
|
| 106 | + $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); |
|
| 111 | 111 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); |
| 112 | 112 | $this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); |
| 113 | 113 | // Workaround against "ONLY_FULL_GROUP_BY" mode |
@@ -117,19 +117,19 @@ discard block |
||
| 117 | 117 | $this->dbs[$DBname]->exec('SET SESSION time_zone = "+00:00"'); |
| 118 | 118 | //$this->dbs[$DBname]->exec('SET @@session.time_zone = "+00:00"'); |
| 119 | 119 | } else { |
| 120 | - $this->dbs[$DBname] = new PDO("$globalDBSdriver:host=$globalDBShost;port=$globalDBSport;dbname=$globalDBSname;options='--client_encoding=utf8'", $globalDBSuser, $globalDBSpass); |
|
| 120 | + $this->dbs[$DBname] = new PDO("$globalDBSdriver:host=$globalDBShost;port=$globalDBSport;dbname=$globalDBSname;options='--client_encoding=utf8'", $globalDBSuser, $globalDBSpass); |
|
| 121 | 121 | //$this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); |
| 122 | 122 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 123 | - $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); |
|
| 123 | + $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); |
|
| 128 | 128 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); |
| 129 | 129 | $this->dbs[$DBname]->exec('SET timezone="UTC"'); |
| 130 | 130 | } |
| 131 | 131 | break; |
| 132 | - } catch(PDOException $e) { |
|
| 132 | + } catch (PDOException $e) { |
|
| 133 | 133 | $i++; |
| 134 | 134 | if (isset($globalDebug) && $globalDebug) echo 'Error connecting to DB: '.$globalDBSname.' - Error: '.$e->getMessage()."\n"; |
| 135 | 135 | //exit; |
@@ -154,10 +154,10 @@ discard block |
||
| 154 | 154 | try { |
| 155 | 155 | //$Connection = new Connection(); |
| 156 | 156 | $results = $this->db->query($query); |
| 157 | - } catch(PDOException $e) { |
|
| 157 | + } catch (PDOException $e) { |
|
| 158 | 158 | return false; |
| 159 | 159 | } |
| 160 | - if($results->rowCount()>0) { |
|
| 160 | + if ($results->rowCount() > 0) { |
|
| 161 | 161 | return true; |
| 162 | 162 | } |
| 163 | 163 | else return false; |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | return false; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - } catch(PDOException $e) { |
|
| 183 | - if($e->getCode() != 'HY000' || !stristr($e->getMessage(), 'server has gone away')) { |
|
| 182 | + } catch (PDOException $e) { |
|
| 183 | + if ($e->getCode() != 'HY000' || !stristr($e->getMessage(), 'server has gone away')) { |
|
| 184 | 184 | throw $e; |
| 185 | 185 | } |
| 186 | 186 | //echo 'error ! '.$e->getMessage(); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | /* |
| 193 | 193 | * Check if index exist |
| 194 | 194 | */ |
| 195 | - public function indexExists($table,$index) |
|
| 195 | + public function indexExists($table, $index) |
|
| 196 | 196 | { |
| 197 | 197 | global $globalDBdriver, $globalDBname; |
| 198 | 198 | if ($globalDBdriver == 'mysql') { |
@@ -203,11 +203,11 @@ discard block |
||
| 203 | 203 | try { |
| 204 | 204 | //$Connection = new Connection(); |
| 205 | 205 | $results = $this->db->query($query); |
| 206 | - } catch(PDOException $e) { |
|
| 206 | + } catch (PDOException $e) { |
|
| 207 | 207 | return false; |
| 208 | 208 | } |
| 209 | 209 | $nb = $results->fetchAll(PDO::FETCH_ASSOC); |
| 210 | - if($nb[0]['nb'] > 0) { |
|
| 210 | + if ($nb[0]['nb'] > 0) { |
|
| 211 | 211 | return true; |
| 212 | 212 | } |
| 213 | 213 | else return false; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $query = "SELECT * FROM ".$table." LIMIT 0"; |
| 223 | 223 | try { |
| 224 | 224 | $results = $this->db->query($query); |
| 225 | - } catch(PDOException $e) { |
|
| 225 | + } catch (PDOException $e) { |
|
| 226 | 226 | return "error : ".$e->getMessage()."\n"; |
| 227 | 227 | } |
| 228 | 228 | $columns = array(); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | return $columns; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - public function getColumnType($table,$column) { |
|
| 237 | + public function getColumnType($table, $column) { |
|
| 238 | 238 | $select = $this->db->query('SELECT '.$column.' FROM '.$table); |
| 239 | 239 | $tomet = $select->getColumnMeta(0); |
| 240 | 240 | return $tomet['native_type']; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | * Check if a column name exist in a table |
| 245 | 245 | * @return Boolean column exist or not |
| 246 | 246 | */ |
| 247 | - public function checkColumnName($table,$name) |
|
| 247 | + public function checkColumnName($table, $name) |
|
| 248 | 248 | { |
| 249 | 249 | global $globalDBdriver, $globalDBname; |
| 250 | 250 | if ($globalDBdriver == 'mysql') { |
@@ -254,8 +254,8 @@ discard block |
||
| 254 | 254 | } |
| 255 | 255 | try { |
| 256 | 256 | $sth = $this->db()->prepare($query); |
| 257 | - $sth->execute(array(':database' => $globalDBname,':table' => $table,':name' => $name)); |
|
| 258 | - } catch(PDOException $e) { |
|
| 257 | + $sth->execute(array(':database' => $globalDBname, ':table' => $table, ':name' => $name)); |
|
| 258 | + } catch (PDOException $e) { |
|
| 259 | 259 | echo "error : ".$e->getMessage()."\n"; |
| 260 | 260 | } |
| 261 | 261 | $result = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | try { |
| 295 | 295 | $sth = $this->db->prepare($query); |
| 296 | 296 | $sth->execute(); |
| 297 | - } catch(PDOException $e) { |
|
| 297 | + } catch (PDOException $e) { |
|
| 298 | 298 | return "error : ".$e->getMessage()."\n"; |
| 299 | 299 | } |
| 300 | 300 | $result = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -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 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | try { |
| 20 | 20 | $sth = $this->db->prepare($query); |
| 21 | 21 | $sth->execute(array(':name' => $name)); |
| 22 | - } catch(PDOException $e) { |
|
| 22 | + } catch (PDOException $e) { |
|
| 23 | 23 | echo $e->getMessage(); |
| 24 | 24 | } |
| 25 | 25 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | try { |
| 32 | 32 | $sth = $this->db->prepare($query); |
| 33 | 33 | $sth->execute(); |
| 34 | - } catch(PDOException $e) { |
|
| 34 | + } catch (PDOException $e) { |
|
| 35 | 35 | echo $e->getMessage(); |
| 36 | 36 | } |
| 37 | 37 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | try { |
| 44 | 44 | $sth = $this->db->prepare($query); |
| 45 | 45 | $sth->execute(); |
| 46 | - } catch(PDOException $e) { |
|
| 46 | + } catch (PDOException $e) { |
|
| 47 | 47 | echo $e->getMessage(); |
| 48 | 48 | } |
| 49 | 49 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | try { |
| 56 | 56 | $sth = $this->db->prepare($query); |
| 57 | 57 | $sth->execute(array(':type' => $type)); |
| 58 | - } catch(PDOException $e) { |
|
| 58 | + } catch (PDOException $e) { |
|
| 59 | 59 | echo $e->getMessage(); |
| 60 | 60 | } |
| 61 | 61 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -63,48 +63,48 @@ discard block |
||
| 63 | 63 | else return array(); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
| 66 | + public function position_all($timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
| 67 | 67 | $all_sat = $this->get_tle_names(); |
| 68 | 68 | $result = array(); |
| 69 | 69 | foreach ($all_sat as $sat) { |
| 70 | - $position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second); |
|
| 71 | - $result = array_merge($position,$result); |
|
| 70 | + $position = $this->position($sat['tle_name'], $timestamp_begin, $timestamp_end, $second); |
|
| 71 | + $result = array_merge($position, $result); |
|
| 72 | 72 | } |
| 73 | 73 | return $result; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function position_all_type($type,$timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
| 76 | + public function position_all_type($type, $timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
| 77 | 77 | $all_sat = $this->get_tle_names_type($type); |
| 78 | 78 | $result = array(); |
| 79 | 79 | foreach ($all_sat as $sat) { |
| 80 | - $position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second); |
|
| 81 | - $result = array_merge($position,$result); |
|
| 80 | + $position = $this->position($sat['tle_name'], $timestamp_begin, $timestamp_end, $second); |
|
| 81 | + $result = array_merge($position, $result); |
|
| 82 | 82 | } |
| 83 | 83 | return $result; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - public function position($name,$timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
| 86 | + public function position($name, $timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
| 87 | 87 | $qth = new Predict_QTH(); |
| 88 | 88 | $qth->lat = floatval(37.790252); |
| 89 | 89 | $qth->lon = floatval(-122.419968); |
| 90 | 90 | |
| 91 | 91 | $tle_file = $this->get_tle($name); |
| 92 | 92 | $type = $tle_file['tle_type']; |
| 93 | - $tle = new Predict_TLE($tle_file['tle_name'],$tle_file['tle_tle1'],$tle_file['tle_tle2']); |
|
| 93 | + $tle = new Predict_TLE($tle_file['tle_name'], $tle_file['tle_tle1'], $tle_file['tle_tle2']); |
|
| 94 | 94 | $sat = new Predict_Sat($tle); |
| 95 | 95 | $predict = new Predict(); |
| 96 | 96 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
| 97 | 97 | if ($timestamp_begin == '') $timestamp_begin = time(); |
| 98 | 98 | if ($timestamp_end == '') { |
| 99 | 99 | $now = Predict_Time::unix2daynum($timestamp_begin); |
| 100 | - $predict->predict_calc($sat,$qth,$now); |
|
| 101 | - return array('name' => $name, 'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp_begin,'type' => $type); |
|
| 100 | + $predict->predict_calc($sat, $qth, $now); |
|
| 101 | + return array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp_begin, 'type' => $type); |
|
| 102 | 102 | } else { |
| 103 | 103 | $result = array(); |
| 104 | - for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp=$timestamp+$second) { |
|
| 104 | + for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp = $timestamp + $second) { |
|
| 105 | 105 | $now = Predict_Time::unix2daynum($timestamp); |
| 106 | - $predict->predict_calc($sat,$qth,$now); |
|
| 107 | - $result[] = array('name' => $name,'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp,'type' => $type); |
|
| 106 | + $predict->predict_calc($sat, $qth, $now); |
|
| 107 | + $result[] = array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp, 'type' => $type); |
|
| 108 | 108 | } |
| 109 | 109 | return $result; |
| 110 | 110 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | try { |
| 116 | 116 | $sth = $this->db->prepare($query); |
| 117 | 117 | $sth->execute(array(':name' => $name.'%')); |
| 118 | - } catch(PDOException $e) { |
|
| 118 | + } catch (PDOException $e) { |
|
| 119 | 119 | echo $e->getMessage(); |
| 120 | 120 | } |
| 121 | 121 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $sth->execute($query_values); |
| 144 | 144 | $launch_site_array = array(); |
| 145 | 145 | $temp_array = array(); |
| 146 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 146 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 147 | 147 | { |
| 148 | 148 | $temp_array['launch_site'] = $row['launch_site']; |
| 149 | 149 | $temp_array['launch_site_count'] = $row['launch_site_count']; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $sth->execute($query_values); |
| 173 | 173 | $owner_array = array(); |
| 174 | 174 | $temp_array = array(); |
| 175 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 175 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 176 | 176 | { |
| 177 | 177 | $temp_array['owner_name'] = $row['owner_name']; |
| 178 | 178 | $temp_array['owner_count'] = $row['owner_count']; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $sth->execute($query_values); |
| 202 | 202 | $owner_array = array(); |
| 203 | 203 | $temp_array = array(); |
| 204 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 204 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 205 | 205 | { |
| 206 | 206 | $temp_array['country_name'] = $row['country_name']; |
| 207 | 207 | $temp_array['country_count'] = $row['country_count']; |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $sth->execute($query_data); |
| 246 | 246 | $date_array = array(); |
| 247 | 247 | $temp_array = array(); |
| 248 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 248 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 249 | 249 | { |
| 250 | 250 | $temp_array['year_name'] = $row['year_name']; |
| 251 | 251 | $temp_array['month_name'] = $row['month_name']; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $sth->execute($query_data); |
| 291 | 291 | $date_array = array(); |
| 292 | 292 | $temp_array = array(); |
| 293 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 293 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
| 294 | 294 | { |
| 295 | 295 | $temp_array['year_name'] = $row['year_name']; |
| 296 | 296 | $temp_array['date_count'] = $row['date_count']; |
@@ -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); |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | <button type="button" class="close">×</button> |
| 10 | 10 | <?php |
| 11 | 11 | |
| 12 | -$sat = filter_input(INPUT_GET,'sat',FILTER_SANITIZE_STRING); |
|
| 12 | +$sat = filter_input(INPUT_GET, 'sat', FILTER_SANITIZE_STRING); |
|
| 13 | 13 | $sat = urldecode($sat); |
| 14 | 14 | //$info = $Satellite->get_info(str_replace(' ','-',$sat)); |
| 15 | 15 | //print_r($info); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $aircraft_name = 'INTEGRAL'; |
| 49 | 49 | // $ground_speed = 14970; |
| 50 | 50 | $launch_date = '17 October 2002'; |
| 51 | -} elseif (strpos($sat,'IRIDIUM') !== false) { |
|
| 51 | +} elseif (strpos($sat, 'IRIDIUM') !== false) { |
|
| 52 | 52 | $image = 'https://upload.wikimedia.org/wikipedia/commons/b/b6/Iridium_Satellite.jpg'; |
| 53 | 53 | $image_copyright = 'Cliff'; |
| 54 | 54 | $ident = 'Iridium satellite constellation'; |
@@ -56,23 +56,23 @@ discard block |
||
| 56 | 56 | $aircraft_name = $sat; |
| 57 | 57 | // $ground_speed = 14970; |
| 58 | 58 | // $launch_date = '29 september 2011'; |
| 59 | -} elseif (strpos($sat,'ORBCOMM') !== false) { |
|
| 59 | +} elseif (strpos($sat, 'ORBCOMM') !== false) { |
|
| 60 | 60 | $ident = 'Orbcomm'; |
| 61 | 61 | $aircraft_wiki = 'https://en.wikipedia.org/wiki/Orbcomm_(satellite)'; |
| 62 | 62 | $aircraft_name = $sat; |
| 63 | -} elseif (strpos($sat,'GLOBALSTAR') !== false) { |
|
| 63 | +} elseif (strpos($sat, 'GLOBALSTAR') !== false) { |
|
| 64 | 64 | $ident = 'Globalstar'; |
| 65 | 65 | $aircraft_wiki = 'https://en.wikipedia.org/wiki/Globalstar'; |
| 66 | 66 | $aircraft_name = $sat; |
| 67 | - $satname = str_replace(array('[+]','[-]'),'',$sat); |
|
| 68 | -} elseif (strpos($sat,'OSCAR 7') !== false) { |
|
| 67 | + $satname = str_replace(array('[+]', '[-]'), '', $sat); |
|
| 68 | +} elseif (strpos($sat, 'OSCAR 7') !== false) { |
|
| 69 | 69 | $image = 'https://upload.wikimedia.org/wikipedia/en/a/ad/AMSAT-OSCAR_7.jpg'; |
| 70 | 70 | $image_copyright = 'Amsat.org'; |
| 71 | 71 | $ident = 'AMSAT-OSCAR 7'; |
| 72 | 72 | $aircraft_wiki = 'https://en.wikipedia.org/wiki/AMSAT-OSCAR_7'; |
| 73 | 73 | $aircraft_name = $sat; |
| 74 | 74 | $launch_date = '15 November 1974'; |
| 75 | -} elseif (strpos($sat,'santaclaus') !== false) { |
|
| 75 | +} elseif (strpos($sat, 'santaclaus') !== false) { |
|
| 76 | 76 | $image = 'https://upload.wikimedia.org/wikipedia/commons/4/49/Jonathan_G_Meath_portrays_Santa_Claus.jpg'; |
| 77 | 77 | $image_copyright = 'Jonathan G Meath'; |
| 78 | 78 | $ident = 'Santa Claus'; |
@@ -81,8 +81,8 @@ discard block |
||
| 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, '(')) $satname = $sat; |
|
| 85 | + else $satname = str_replace(array(' '), '-', $sat); |
|
| 86 | 86 | } |
| 87 | 87 | if (!isset($satname)) $satname = $sat; |
| 88 | 88 | $info = $Satellite->get_info(strtolower(trim($satname))); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | print '<div><span>'._("Orbit").'</span>'.$info['orbit'].'</div>'; |
| 146 | 146 | } |
| 147 | 147 | if ($info['launch_date'] != '') { |
| 148 | - print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d',strtotime($info['launch_date'])).'</div>'; |
|
| 148 | + print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d', strtotime($info['launch_date'])).'</div>'; |
|
| 149 | 149 | } |
| 150 | 150 | if ($info['launch_site'] != '') { |
| 151 | 151 | print '<div><span>'._("Launch Site").'</span>'.$info['launch_site'].'</div>'; |
@@ -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 | } |
@@ -20,17 +20,17 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $spotter_array = array(); |
| 22 | 22 | if (isset($_COOKIE['sattypes']) && $_COOKIE['sattypes'] != '') { |
| 23 | - $sattypes = explode(',',$_COOKIE['sattypes']); |
|
| 23 | + $sattypes = explode(',', $_COOKIE['sattypes']); |
|
| 24 | 24 | foreach ($sattypes as $sattype) { |
| 25 | - $spotter_array = array_merge($Satellite->position_all_type($sattype,$timeb-$globalLiveInterval,$timeb),$spotter_array); |
|
| 25 | + $spotter_array = array_merge($Satellite->position_all_type($sattype, $timeb - $globalLiveInterval, $timeb), $spotter_array); |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss']) { |
| 29 | - $spotter_array = array_merge($Satellite->position('ISS (ZARYA)',time()-$globalLiveInterval,time()),$spotter_array); |
|
| 30 | - $spotter_array = array_merge($Satellite->position('TIANGONG 1',time()-$globalLiveInterval,time()),$spotter_array); |
|
| 31 | - $spotter_array = array_merge($Satellite->position('TIANGONG-2',time()-$globalLiveInterval,time()),$spotter_array); |
|
| 29 | + $spotter_array = array_merge($Satellite->position('ISS (ZARYA)', time() - $globalLiveInterval, time()), $spotter_array); |
|
| 30 | + $spotter_array = array_merge($Satellite->position('TIANGONG 1', time() - $globalLiveInterval, time()), $spotter_array); |
|
| 31 | + $spotter_array = array_merge($Satellite->position('TIANGONG-2', time() - $globalLiveInterval, time()), $spotter_array); |
|
| 32 | 32 | } |
| 33 | -$spotter_array = array_unique($spotter_array,SORT_REGULAR); |
|
| 33 | +$spotter_array = array_unique($spotter_array, SORT_REGULAR); |
|
| 34 | 34 | /* |
| 35 | 35 | $modelsdb = array(); |
| 36 | 36 | if (file_exists('models/space/space_modelsdb')) { |
@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
| 55 | 55 | |
| 56 | 56 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
| 57 | -$output .= ',"clock": {"currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
|
| 57 | +$output .= ',"clock": {"currentTime" : "'.date("c", time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
|
| 58 | 58 | //$output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
| 59 | 59 | |
| 60 | 60 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
| 61 | 61 | $output .= '},'; |
| 62 | 62 | if (!empty($spotter_array) && is_array($spotter_array)) |
| 63 | 63 | { |
| 64 | - foreach($spotter_array as $spotter_item) |
|
| 64 | + foreach ($spotter_array as $spotter_item) |
|
| 65 | 65 | { |
| 66 | 66 | $j++; |
| 67 | 67 | date_default_timezone_set('UTC'); |
@@ -115,23 +115,23 @@ discard block |
||
| 115 | 115 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/cubiesat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 116 | 116 | } elseif ($spotter_item['name'] == 'TERRA') { |
| 117 | 117 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/terra.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 118 | - } elseif (strpos($spotter_item['name'],'O3B') !== false) { |
|
| 118 | + } elseif (strpos($spotter_item['name'], 'O3B') !== false) { |
|
| 119 | 119 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/o3b.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 120 | - } elseif (strpos($spotter_item['name'],'GLOBALSTAR') !== false) { |
|
| 120 | + } elseif (strpos($spotter_item['name'], 'GLOBALSTAR') !== false) { |
|
| 121 | 121 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/globalstar.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 122 | - } elseif (strpos($spotter_item['name'],'GPS') !== false) { |
|
| 122 | + } elseif (strpos($spotter_item['name'], 'GPS') !== false) { |
|
| 123 | 123 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/gps.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 124 | - } elseif (strpos($spotter_item['name'],'GENESIS') !== false) { |
|
| 124 | + } elseif (strpos($spotter_item['name'], 'GENESIS') !== false) { |
|
| 125 | 125 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/genesis.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 126 | - } elseif (strpos($spotter_item['name'],'OSCAR 7') !== false) { |
|
| 126 | + } elseif (strpos($spotter_item['name'], 'OSCAR 7') !== false) { |
|
| 127 | 127 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/oscar7.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 128 | - } elseif (strpos($spotter_item['name'],'FLOCK') !== false) { |
|
| 128 | + } elseif (strpos($spotter_item['name'], 'FLOCK') !== false) { |
|
| 129 | 129 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/cubesat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 130 | - } elseif (strpos($spotter_item['name'],'PLEIADES') !== false) { |
|
| 130 | + } elseif (strpos($spotter_item['name'], 'PLEIADES') !== false) { |
|
| 131 | 131 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/pleiades.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 132 | - } elseif (strpos($spotter_item['name'],'DUCHIFAT') !== false) { |
|
| 132 | + } elseif (strpos($spotter_item['name'], 'DUCHIFAT') !== false) { |
|
| 133 | 133 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/duchifat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 134 | - } elseif (strpos($spotter_item['name'],'FORMOSAT-2') !== false) { |
|
| 134 | + } elseif (strpos($spotter_item['name'], 'FORMOSAT-2') !== false) { |
|
| 135 | 135 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/formosat2.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
| 136 | 136 | } elseif ($spotter_item['type'] == 'iridium') { |
| 137 | 137 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/iridium.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
@@ -153,14 +153,14 @@ discard block |
||
| 153 | 153 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
| 154 | 154 | $output .= '"interpolationAlgorithm":"HERMITE","interpolationDegree":3,'; |
| 155 | 155 | $output .= '"cartographicDegrees": ['; |
| 156 | - $output .= '"'.date("c",$spotter_item['timestamp']).'", '; |
|
| 156 | + $output .= '"'.date("c", $spotter_item['timestamp']).'", '; |
|
| 157 | 157 | $output .= $spotter_item['longitude'].', '; |
| 158 | 158 | $output .= $spotter_item['latitude'].', '; |
| 159 | 159 | $output .= $spotter_item['altitude']*1000; |
| 160 | 160 | $orientation = '"orientation" : { '; |
| 161 | 161 | $orientation .= '"unitQuaternion": ['; |
| 162 | 162 | } else { |
| 163 | - $output .= ',"'.date("c",$spotter_item['timestamp']).'", '; |
|
| 163 | + $output .= ',"'.date("c", $spotter_item['timestamp']).'", '; |
|
| 164 | 164 | $output .= $spotter_item['longitude'].', '; |
| 165 | 165 | $output .= $spotter_item['latitude'].', '; |
| 166 | 166 | $output .= $spotter_item['altitude']*1000; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | require_once(dirname(__FILE__).'/class.create_db.php'); |
| 11 | 11 | require_once(dirname(__FILE__).'/class.update_schema.php'); |
| 12 | 12 | require_once(dirname(__FILE__).'/class.settings.php'); |
| 13 | -$title="Install"; |
|
| 13 | +$title = "Install"; |
|
| 14 | 14 | require(dirname(__FILE__).'/../require/settings.php'); |
| 15 | 15 | require(dirname(__FILE__).'/header.php'); |
| 16 | 16 | |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | if (!extension_loaded('curl')) { |
| 70 | 70 | $error[] = "Curl is not loaded."; |
| 71 | 71 | } |
| 72 | -if(function_exists('apache_get_modules') ){ |
|
| 73 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
| 72 | +if (function_exists('apache_get_modules')) { |
|
| 73 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
| 74 | 74 | $error[] = "mod_rewrite is not available."; |
| 75 | 75 | } |
| 76 | 76 | /* |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>'; |
| 87 | 87 | if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { |
| 88 | 88 | if (function_exists('get_headers')) { |
| 89 | - $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); |
|
| 90 | - if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { |
|
| 89 | + $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); |
|
| 90 | + if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { |
|
| 91 | 91 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>'; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -454,13 +454,13 @@ discard block |
||
| 454 | 454 | ?> |
| 455 | 455 | <tr> |
| 456 | 456 | <?php |
| 457 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
| 457 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
| 458 | 458 | ?> |
| 459 | 459 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
| 460 | 460 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
| 461 | 461 | <?php |
| 462 | 462 | } else { |
| 463 | - $hostport = explode(':',$source['host']); |
|
| 463 | + $hostport = explode(':', $source['host']); |
|
| 464 | 464 | if (isset($hostport[1])) { |
| 465 | 465 | $host = $hostport[0]; |
| 466 | 466 | $port = $hostport[1]; |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | <select name="timezones[]" id="timezones"> |
| 508 | 508 | <?php |
| 509 | 509 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
| 510 | - foreach($timezonelist as $timezones){ |
|
| 510 | + foreach ($timezonelist as $timezones) { |
|
| 511 | 511 | if (isset($source['timezone']) && $source['timezone'] == $timezones) { |
| 512 | 512 | print '<option selected>'.$timezones.'</option>'; |
| 513 | 513 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | <select name="timezones[]" id="timezones"> |
| 560 | 560 | <?php |
| 561 | 561 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
| 562 | - foreach($timezonelist as $timezones){ |
|
| 562 | + foreach ($timezonelist as $timezones) { |
|
| 563 | 563 | if ($timezones == 'UTC') { |
| 564 | 564 | print '<option selected>'.$timezones.'</option>'; |
| 565 | 565 | } else print '<option>'.$timezones.'</option>'; |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | <br /> |
| 877 | 877 | <p> |
| 878 | 878 | <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;?>" /> |
|
| 879 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
| 880 | 880 | </p> |
| 881 | 881 | <br /> |
| 882 | 882 | <p> |
@@ -932,14 +932,14 @@ discard block |
||
| 932 | 932 | $error = ''; |
| 933 | 933 | |
| 934 | 934 | if (isset($_POST['dbtype'])) { |
| 935 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
| 936 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
| 937 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
| 938 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
| 939 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
| 940 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
| 941 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
| 942 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
| 935 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
| 936 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
| 937 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
| 938 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
| 939 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
| 940 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
| 941 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
| 942 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
| 943 | 943 | |
| 944 | 944 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
| 945 | 945 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -959,49 +959,49 @@ discard block |
||
| 959 | 959 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
| 960 | 960 | */ |
| 961 | 961 | |
| 962 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
| 962 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
| 963 | 963 | |
| 964 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
| 965 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
| 966 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
| 967 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
| 968 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
| 964 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
| 965 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
| 966 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
| 967 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
| 968 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
| 969 | 969 | |
| 970 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
| 971 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
| 972 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
| 973 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
| 974 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
| 975 | - $openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING); |
|
| 976 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
| 977 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
| 978 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
| 979 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
| 970 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
| 971 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
| 972 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
| 973 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
| 974 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
| 975 | + $openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING); |
|
| 976 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
| 977 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
| 978 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
| 979 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
| 980 | 980 | |
| 981 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
| 982 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
| 983 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
| 984 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
| 985 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
| 986 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
| 981 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
| 982 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
| 983 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
| 984 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
| 985 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
| 986 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
| 987 | 987 | |
| 988 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
| 989 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
| 988 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
| 989 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
| 990 | 990 | |
| 991 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
| 992 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
| 993 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
| 991 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
| 992 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
| 993 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
| 994 | 994 | |
| 995 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
| 995 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
| 996 | 996 | if ($acars == 'acars') { |
| 997 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
| 997 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
| 998 | 998 | } else { |
| 999 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
| 999 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
| 1000 | 1000 | } |
| 1001 | 1001 | |
| 1002 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
| 1003 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
| 1004 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
| 1002 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
| 1003 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
| 1004 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
| 1005 | 1005 | |
| 1006 | 1006 | $source_name = $_POST['source_name']; |
| 1007 | 1007 | $source_latitude = $_POST['source_latitude']; |
@@ -1015,8 +1015,8 @@ discard block |
||
| 1015 | 1015 | |
| 1016 | 1016 | $sources = array(); |
| 1017 | 1017 | 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]); |
|
| 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]); |
|
| 1020 | 1020 | } |
| 1021 | 1021 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
| 1022 | 1022 | |
@@ -1029,27 +1029,27 @@ discard block |
||
| 1029 | 1029 | $sbsurl = $_POST['sbsurl']; |
| 1030 | 1030 | */ |
| 1031 | 1031 | |
| 1032 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
| 1033 | - $globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING); |
|
| 1034 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
| 1035 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
| 1036 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING); |
|
| 1037 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
| 1038 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
| 1039 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
| 1032 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
| 1033 | + $globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING); |
|
| 1034 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
| 1035 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
| 1036 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING); |
|
| 1037 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
| 1038 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
| 1039 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
| 1040 | 1040 | |
| 1041 | - $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')); |
|
| 1044 | - $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')); |
|
| 1047 | - $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')); |
|
| 1050 | - $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')); |
|
| 1041 | + $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')); |
|
| 1044 | + $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')); |
|
| 1047 | + $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')); |
|
| 1050 | + $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')); |
|
| 1053 | 1053 | |
| 1054 | 1054 | /* |
| 1055 | 1055 | $globalSBS1Hosts = array(); |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | } |
| 1066 | 1066 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
| 1067 | 1067 | */ |
| 1068 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
| 1068 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
| 1069 | 1069 | $host = $_POST['host']; |
| 1070 | 1070 | $port = $_POST['port']; |
| 1071 | 1071 | $name = $_POST['name']; |
@@ -1082,104 +1082,104 @@ discard block |
||
| 1082 | 1082 | else $cov = 'FALSE'; |
| 1083 | 1083 | if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
| 1084 | 1084 | else $arch = 'FALSE'; |
| 1085 | - if (strpos($format[$key],'_callback')) { |
|
| 1086 | - $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
|
| 1085 | + if (strpos($format[$key], '_callback')) { |
|
| 1086 | + $gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE'); |
|
| 1087 | 1087 | } elseif ($h != '' || $name[$key] != '') { |
| 1088 | - $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
|
| 1088 | + $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE'); |
|
| 1089 | 1089 | } |
| 1090 | 1090 | if ($format[$key] == 'airwhere') $forcepilots = true; |
| 1091 | 1091 | } |
| 1092 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
| 1092 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
| 1093 | 1093 | |
| 1094 | 1094 | /* |
| 1095 | 1095 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
| 1096 | 1096 | $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
| 1097 | 1097 | */ |
| 1098 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
| 1099 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
| 1100 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
| 1098 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
| 1099 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
| 1100 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
| 1101 | 1101 | |
| 1102 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
| 1103 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
| 1102 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
| 1103 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
| 1104 | 1104 | |
| 1105 | - $customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING); |
|
| 1106 | - $settings = array_merge($settings,array('globalCustomCSS' => $customcss)); |
|
| 1105 | + $customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING); |
|
| 1106 | + $settings = array_merge($settings, array('globalCustomCSS' => $customcss)); |
|
| 1107 | 1107 | |
| 1108 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
| 1109 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
| 1110 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
| 1111 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
| 1108 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
| 1109 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
| 1110 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
| 1111 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
| 1112 | 1112 | |
| 1113 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
| 1114 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
| 1115 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
| 1113 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
| 1114 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
| 1115 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
| 1116 | 1116 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
| 1117 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
| 1118 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1117 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
| 1118 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
| 1119 | 1119 | |
| 1120 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
| 1121 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
| 1122 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
| 1123 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
| 1124 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
| 1125 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
| 1126 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
| 1127 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
| 1120 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
| 1121 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
| 1122 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
| 1123 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
| 1124 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
| 1125 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
| 1126 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
| 1127 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
| 1128 | 1128 | |
| 1129 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
| 1130 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
| 1129 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
| 1130 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
| 1131 | 1131 | |
| 1132 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1133 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
| 1132 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1133 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
| 1134 | 1134 | |
| 1135 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
| 1135 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
| 1136 | 1136 | if ($archiveyear == "archiveyear") { |
| 1137 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
| 1137 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
| 1138 | 1138 | } else { |
| 1139 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
| 1139 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
| 1140 | 1140 | } |
| 1141 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1142 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
| 1143 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1144 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
| 1141 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1142 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
| 1143 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1144 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
| 1145 | 1145 | |
| 1146 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
| 1147 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
| 1148 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
| 1149 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
| 1146 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
| 1147 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
| 1148 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
| 1149 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
| 1150 | 1150 | |
| 1151 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
| 1152 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
| 1153 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
| 1151 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
| 1152 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
| 1153 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
| 1154 | 1154 | |
| 1155 | 1155 | // Create in settings.php keys not yet configurable if not already here |
| 1156 | 1156 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
| 1157 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1157 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
| 1158 | 1158 | |
| 1159 | - $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
|
| 1159 | + $resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING); |
|
| 1160 | 1160 | if ($resetyearstats == 'resetyearstats') { |
| 1161 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE')); |
|
| 1161 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE')); |
|
| 1162 | 1162 | } else { |
| 1163 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE')); |
|
| 1163 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE')); |
|
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
| 1166 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
| 1167 | 1167 | if ($archive == 'archive') { |
| 1168 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
| 1168 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
| 1169 | 1169 | } else { |
| 1170 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
| 1170 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
| 1171 | 1171 | } |
| 1172 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
| 1172 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
| 1173 | 1173 | if ($daemon == 'daemon') { |
| 1174 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
| 1174 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
| 1175 | 1175 | } else { |
| 1176 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
| 1176 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
| 1177 | 1177 | } |
| 1178 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
| 1178 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
| 1179 | 1179 | if ($schedules == 'schedules') { |
| 1180 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
| 1180 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
| 1181 | 1181 | } else { |
| 1182 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
| 1182 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
| 1183 | 1183 | } |
| 1184 | 1184 | |
| 1185 | 1185 | /* |
@@ -1190,227 +1190,227 @@ discard block |
||
| 1190 | 1190 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
| 1191 | 1191 | } |
| 1192 | 1192 | */ |
| 1193 | - $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')); |
|
| 1193 | + $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')); |
|
| 1198 | 1198 | $va = false; |
| 1199 | 1199 | if ($globalivao == 'ivao') { |
| 1200 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
| 1200 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
| 1201 | 1201 | $va = true; |
| 1202 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1202 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
| 1203 | 1203 | if ($globalvatsim == 'vatsim') { |
| 1204 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
| 1204 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
| 1205 | 1205 | $va = true; |
| 1206 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1206 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
| 1207 | 1207 | if ($globalphpvms == 'phpvms') { |
| 1208 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
| 1208 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
| 1209 | 1209 | $va = true; |
| 1210 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1210 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
| 1211 | 1211 | if ($globalvam == 'vam') { |
| 1212 | - $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
|
| 1212 | + $settings = array_merge($settings, array('globalVAM' => 'TRUE')); |
|
| 1213 | 1213 | $va = true; |
| 1214 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1214 | + } else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); |
|
| 1215 | 1215 | if ($va) { |
| 1216 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
| 1217 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1216 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
| 1217 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
| 1218 | 1218 | if ($globalva == 'va' || $va) { |
| 1219 | - $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
|
| 1220 | - $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
| 1219 | + $settings = array_merge($settings, array('globalVA' => 'TRUE')); |
|
| 1220 | + $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
| 1221 | 1221 | } else { |
| 1222 | - $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')); |
|
| 1222 | + $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')); |
|
| 1225 | 1225 | } |
| 1226 | 1226 | |
| 1227 | 1227 | |
| 1228 | 1228 | |
| 1229 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
| 1229 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
| 1230 | 1230 | if ($notam == 'notam') { |
| 1231 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
| 1231 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
| 1232 | 1232 | } else { |
| 1233 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
| 1233 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
| 1234 | 1234 | } |
| 1235 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
| 1235 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
| 1236 | 1236 | if ($owner == 'owner') { |
| 1237 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
| 1237 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
| 1238 | 1238 | } else { |
| 1239 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
| 1239 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
| 1240 | 1240 | } |
| 1241 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING); |
|
| 1241 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING); |
|
| 1242 | 1242 | if ($map3d == 'map3d') { |
| 1243 | - $settings = array_merge($settings,array('globalMap3D' => 'TRUE')); |
|
| 1243 | + $settings = array_merge($settings, array('globalMap3D' => 'TRUE')); |
|
| 1244 | 1244 | } else { |
| 1245 | - $settings = array_merge($settings,array('globalMap3D' => 'FALSE')); |
|
| 1245 | + $settings = array_merge($settings, array('globalMap3D' => 'FALSE')); |
|
| 1246 | 1246 | } |
| 1247 | - $crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING); |
|
| 1247 | + $crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING); |
|
| 1248 | 1248 | if ($crash == 'crash') { |
| 1249 | - $settings = array_merge($settings,array('globalAccidents' => 'TRUE')); |
|
| 1249 | + $settings = array_merge($settings, array('globalAccidents' => 'TRUE')); |
|
| 1250 | 1250 | } else { |
| 1251 | - $settings = array_merge($settings,array('globalAccidents' => 'FALSE')); |
|
| 1251 | + $settings = array_merge($settings, array('globalAccidents' => 'FALSE')); |
|
| 1252 | 1252 | } |
| 1253 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING); |
|
| 1253 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING); |
|
| 1254 | 1254 | if ($mapsatellites == 'mapsatellites') { |
| 1255 | - $settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); |
|
| 1255 | + $settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); |
|
| 1256 | 1256 | } else { |
| 1257 | - $settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); |
|
| 1257 | + $settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); |
|
| 1258 | 1258 | } |
| 1259 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING); |
|
| 1259 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING); |
|
| 1260 | 1260 | if ($map3ddefault == 'map3ddefault') { |
| 1261 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); |
|
| 1261 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); |
|
| 1262 | 1262 | } else { |
| 1263 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); |
|
| 1263 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); |
|
| 1264 | 1264 | } |
| 1265 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
| 1265 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
| 1266 | 1266 | if ($translate == 'translate') { |
| 1267 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
| 1267 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
| 1268 | 1268 | } else { |
| 1269 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
| 1269 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
| 1270 | 1270 | } |
| 1271 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING); |
|
| 1271 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING); |
|
| 1272 | 1272 | if ($realairlines == 'realairlines') { |
| 1273 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); |
|
| 1273 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); |
|
| 1274 | 1274 | } else { |
| 1275 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); |
|
| 1275 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); |
|
| 1276 | 1276 | } |
| 1277 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
| 1277 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
| 1278 | 1278 | if ($estimation == 'estimation') { |
| 1279 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
| 1279 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
| 1280 | 1280 | } else { |
| 1281 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
| 1281 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
| 1282 | 1282 | } |
| 1283 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
| 1283 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
| 1284 | 1284 | if ($metar == 'metar') { |
| 1285 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
| 1285 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
| 1286 | 1286 | } else { |
| 1287 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
| 1287 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
| 1288 | 1288 | } |
| 1289 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
| 1289 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
| 1290 | 1290 | if ($metarcycle == 'metarcycle') { |
| 1291 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
| 1291 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
| 1292 | 1292 | } else { |
| 1293 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
| 1293 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
| 1294 | 1294 | } |
| 1295 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
| 1295 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
| 1296 | 1296 | if ($fork == 'fork') { |
| 1297 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
| 1297 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
| 1298 | 1298 | } else { |
| 1299 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
| 1299 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
| 1300 | 1300 | } |
| 1301 | 1301 | |
| 1302 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
| 1302 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
| 1303 | 1303 | if ($colormap == 'colormap') { |
| 1304 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
| 1304 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
| 1305 | 1305 | } else { |
| 1306 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
| 1306 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
| 1307 | 1307 | } |
| 1308 | 1308 | |
| 1309 | 1309 | if (isset($_POST['aircrafticoncolor'])) { |
| 1310 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
| 1311 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
| 1310 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
| 1311 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
| 1312 | 1312 | } |
| 1313 | 1313 | |
| 1314 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
| 1315 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
| 1314 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
| 1315 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
| 1316 | 1316 | |
| 1317 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
| 1318 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
| 1319 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
| 1320 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
| 1321 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
| 1322 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
| 1317 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
| 1318 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
| 1319 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
| 1320 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
| 1321 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
| 1322 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
| 1323 | 1323 | |
| 1324 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
| 1324 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
| 1325 | 1325 | if ($mappopup == 'mappopup') { |
| 1326 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
| 1326 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
| 1327 | 1327 | } else { |
| 1328 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
| 1328 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
| 1329 | 1329 | } |
| 1330 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
| 1330 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
| 1331 | 1331 | if ($airportpopup == 'airportpopup') { |
| 1332 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
| 1332 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
| 1333 | 1333 | } else { |
| 1334 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
| 1334 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
| 1335 | 1335 | } |
| 1336 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
| 1336 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
| 1337 | 1337 | if ($maphistory == 'maphistory') { |
| 1338 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
| 1338 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
| 1339 | 1339 | } else { |
| 1340 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
| 1340 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
| 1341 | 1341 | } |
| 1342 | - $maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING); |
|
| 1342 | + $maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING); |
|
| 1343 | 1343 | if ($maptooltip == 'maptooltip') { |
| 1344 | - $settings = array_merge($settings,array('globalMapTooltip' => 'TRUE')); |
|
| 1344 | + $settings = array_merge($settings, array('globalMapTooltip' => 'TRUE')); |
|
| 1345 | 1345 | } else { |
| 1346 | - $settings = array_merge($settings,array('globalMapTooltip' => 'FALSE')); |
|
| 1346 | + $settings = array_merge($settings, array('globalMapTooltip' => 'FALSE')); |
|
| 1347 | 1347 | } |
| 1348 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
| 1348 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
| 1349 | 1349 | if ($flightroute == 'flightroute') { |
| 1350 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
| 1350 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
| 1351 | 1351 | } else { |
| 1352 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
| 1352 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
| 1353 | 1353 | } |
| 1354 | - $flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING); |
|
| 1354 | + $flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING); |
|
| 1355 | 1355 | if ($flightremainingroute == 'flightremainingroute') { |
| 1356 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE')); |
|
| 1356 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE')); |
|
| 1357 | 1357 | } else { |
| 1358 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE')); |
|
| 1358 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE')); |
|
| 1359 | 1359 | } |
| 1360 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING); |
|
| 1360 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING); |
|
| 1361 | 1361 | if ($allflights == 'allflights') { |
| 1362 | - $settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); |
|
| 1362 | + $settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); |
|
| 1363 | 1363 | } else { |
| 1364 | - $settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); |
|
| 1364 | + $settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); |
|
| 1365 | 1365 | } |
| 1366 | - $bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING); |
|
| 1366 | + $bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING); |
|
| 1367 | 1367 | if ($bbox == 'bbox') { |
| 1368 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE')); |
|
| 1368 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE')); |
|
| 1369 | 1369 | } else { |
| 1370 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE')); |
|
| 1370 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE')); |
|
| 1371 | 1371 | } |
| 1372 | - $groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING); |
|
| 1372 | + $groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING); |
|
| 1373 | 1373 | if ($groundaltitude == 'groundaltitude') { |
| 1374 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE')); |
|
| 1374 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE')); |
|
| 1375 | 1375 | } else { |
| 1376 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE')); |
|
| 1376 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE')); |
|
| 1377 | 1377 | } |
| 1378 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING); |
|
| 1378 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING); |
|
| 1379 | 1379 | if ($waypoints == 'waypoints') { |
| 1380 | - $settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); |
|
| 1380 | + $settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); |
|
| 1381 | 1381 | } else { |
| 1382 | - $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
|
| 1382 | + $settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); |
|
| 1383 | 1383 | } |
| 1384 | - $geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING); |
|
| 1384 | + $geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING); |
|
| 1385 | 1385 | if ($geoid == 'geoid') { |
| 1386 | - $settings = array_merge($settings,array('globalGeoid' => 'TRUE')); |
|
| 1386 | + $settings = array_merge($settings, array('globalGeoid' => 'TRUE')); |
|
| 1387 | 1387 | } else { |
| 1388 | - $settings = array_merge($settings,array('globalGeoid' => 'FALSE')); |
|
| 1388 | + $settings = array_merge($settings, array('globalGeoid' => 'FALSE')); |
|
| 1389 | 1389 | } |
| 1390 | - $geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING); |
|
| 1391 | - $settings = array_merge($settings,array('globalGeoidSource' => $geoid_source)); |
|
| 1390 | + $geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING); |
|
| 1391 | + $settings = array_merge($settings, array('globalGeoidSource' => $geoid_source)); |
|
| 1392 | 1392 | |
| 1393 | - $noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING); |
|
| 1393 | + $noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING); |
|
| 1394 | 1394 | if ($noairlines == 'noairlines') { |
| 1395 | - $settings = array_merge($settings,array('globalNoAirlines' => 'TRUE')); |
|
| 1395 | + $settings = array_merge($settings, array('globalNoAirlines' => 'TRUE')); |
|
| 1396 | 1396 | } else { |
| 1397 | - $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
|
| 1397 | + $settings = array_merge($settings, array('globalNoAirlines' => 'FALSE')); |
|
| 1398 | 1398 | } |
| 1399 | 1399 | |
| 1400 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1400 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
| 1401 | 1401 | |
| 1402 | 1402 | // Set some defaults values... |
| 1403 | 1403 | if (!isset($globalAircraftImageSources)) { |
| 1404 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
| 1405 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
| 1404 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
| 1405 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
| 1406 | 1406 | } |
| 1407 | 1407 | |
| 1408 | 1408 | if (!isset($globalSchedulesSources)) { |
| 1409 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
| 1410 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
| 1409 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
| 1410 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
| 1411 | 1411 | } |
| 1412 | 1412 | |
| 1413 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
| 1413 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
| 1414 | 1414 | |
| 1415 | 1415 | if ($error == '') settings::modify_settings($settings); |
| 1416 | 1416 | if ($error == '') settings::comment_settings($settings_comment); |
@@ -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) { |