@@ -11,7 +11,9 @@ discard block |
||
| 11 | 11 | $lines = file($filename); |
| 12 | 12 | foreach ($lines as $line) |
| 13 | 13 | { |
| 14 | - if (substr($line,0,2) == '--' || $line == '') continue; |
|
| 14 | + if (substr($line,0,2) == '--' || $line == '') { |
|
| 15 | + continue; |
|
| 16 | + } |
|
| 15 | 17 | $templine .= $line; |
| 16 | 18 | if (substr(trim($line), -1,1) == ';') |
| 17 | 19 | { |
@@ -35,7 +37,9 @@ discard block |
||
| 35 | 37 | //foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename) |
| 36 | 38 | while(false !== ($filename = readdir($dh))) |
| 37 | 39 | { |
| 38 | - if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename); |
|
| 40 | + if (preg_match('/\.sql$/',$filename)) { |
|
| 41 | + $error .= create_db::import_file($directory.$filename); |
|
| 42 | + } |
|
| 39 | 43 | } |
| 40 | 44 | return $error; |
| 41 | 45 | } |
@@ -51,13 +55,17 @@ discard block |
||
| 51 | 55 | // Dirty hack |
| 52 | 56 | if ($host != 'localhost' && $host != '127.0.0.1') { |
| 53 | 57 | $grantright = $_SERVER['SERVER_ADDR']; |
| 54 | - } else $grantright = 'localhost'; |
|
| 58 | + } else { |
|
| 59 | + $grantright = 'localhost'; |
|
| 60 | + } |
|
| 55 | 61 | try { |
| 56 | 62 | $dbh = new PDO($db_type.':host='.$host,$root,$root_pass); |
| 57 | 63 | $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 58 | 64 | if ($db_type == 'mysql') { |
| 59 | 65 | $dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
| 60 | - if ($grantright == 'localhost') $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
| 66 | + if ($grantright == 'localhost') { |
|
| 67 | + $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
| 68 | + } |
|
| 61 | 69 | } else if ($db_type == 'pgsql') { |
| 62 | 70 | $dbh->exec("CREATE DATABASE ".$db.";"); |
| 63 | 71 | $dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."'; |
@@ -117,40 +117,64 @@ discard block |
||
| 117 | 117 | </div> |
| 118 | 118 | <p> |
| 119 | 119 | <label for="dbhost">Database hostname</label> |
| 120 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
| 120 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
| 121 | + print $globalDBhost; |
|
| 122 | +} |
|
| 123 | +?>" /> |
|
| 121 | 124 | </p> |
| 122 | 125 | <p> |
| 123 | 126 | <label for="dbname">Database name</label> |
| 124 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
| 127 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
| 128 | + print $globalDBname; |
|
| 129 | +} |
|
| 130 | +?>" /> |
|
| 125 | 131 | </p> |
| 126 | 132 | <p> |
| 127 | 133 | <label for="dbuser">Database user</label> |
| 128 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
| 134 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
| 135 | + print $globalDBuser; |
|
| 136 | +} |
|
| 137 | +?>" /> |
|
| 129 | 138 | </p> |
| 130 | 139 | <p> |
| 131 | 140 | <label for="dbuserpass">Database user password</label> |
| 132 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
| 141 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
| 142 | + print $globalDBpass; |
|
| 143 | +} |
|
| 144 | +?>" /> |
|
| 133 | 145 | </p> |
| 134 | 146 | </fieldset> |
| 135 | 147 | <fieldset> |
| 136 | 148 | <legend>Site configuration</legend> |
| 137 | 149 | <p> |
| 138 | 150 | <label for="sitename">Site name</label> |
| 139 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
| 151 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
| 152 | + print $globalName; |
|
| 153 | +} |
|
| 154 | +?>" /> |
|
| 140 | 155 | </p> |
| 141 | 156 | <p> |
| 142 | 157 | <label for="siteurl">Site directory</label> |
| 143 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
| 158 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
| 159 | + print $globalURL; |
|
| 160 | +} |
|
| 161 | +?>" /> |
|
| 144 | 162 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
| 145 | 163 | </p> |
| 146 | 164 | <p> |
| 147 | 165 | <label for="timezone">Timezone</label> |
| 148 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
| 166 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
| 167 | + print $globalTimezone; |
|
| 168 | +} |
|
| 169 | +?>" /> |
|
| 149 | 170 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
| 150 | 171 | </p> |
| 151 | 172 | <p> |
| 152 | 173 | <label for="language">Language</label> |
| 153 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
| 174 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
| 175 | + print $globalLanguage; |
|
| 176 | +} |
|
| 177 | +?>" /> |
|
| 154 | 178 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
| 155 | 179 | </p> |
| 156 | 180 | </fieldset> |
@@ -171,18 +195,27 @@ discard block |
||
| 171 | 195 | <div id="mapbox_data"> |
| 172 | 196 | <p> |
| 173 | 197 | <label for="mapboxid">Mapbox id</label> |
| 174 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
| 198 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
| 199 | + print $globalMapboxId; |
|
| 200 | +} |
|
| 201 | +?>" /> |
|
| 175 | 202 | </p> |
| 176 | 203 | <p> |
| 177 | 204 | <label for="mapboxtoken">Mapbox token</label> |
| 178 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
| 205 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
| 206 | + print $globalMapboxToken; |
|
| 207 | +} |
|
| 208 | +?>" /> |
|
| 179 | 209 | </p> |
| 180 | 210 | </div> |
| 181 | 211 | <br /> |
| 182 | 212 | <div id="google_data"> |
| 183 | 213 | <p> |
| 184 | 214 | <label for="googlekey">Google API key</label> |
| 185 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
| 215 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
| 216 | + print $globalGoogleAPIKey; |
|
| 217 | +} |
|
| 218 | +?>" /> |
|
| 186 | 219 | <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> |
| 187 | 220 | </p> |
| 188 | 221 | </div> |
@@ -190,7 +223,10 @@ discard block |
||
| 190 | 223 | <div id="bing_data"> |
| 191 | 224 | <p> |
| 192 | 225 | <label for="bingkey">Bing Map key</label> |
| 193 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
| 226 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
| 227 | + print $globalBingMapKey; |
|
| 228 | +} |
|
| 229 | +?>" /> |
|
| 194 | 230 | <p class="help-block">Get a key <a href="https://msdn.microsoft.com/en-us/library/ff428642.aspx">here</a></p> |
| 195 | 231 | </p> |
| 196 | 232 | </div> |
@@ -198,7 +234,10 @@ discard block |
||
| 198 | 234 | <div id="mapquest_data"> |
| 199 | 235 | <p> |
| 200 | 236 | <label for="mapquestkey">MapQuest key</label> |
| 201 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
| 237 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
| 238 | + print $globalMapQuestKey; |
|
| 239 | +} |
|
| 240 | +?>" /> |
|
| 202 | 241 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
| 203 | 242 | </p> |
| 204 | 243 | </div> |
@@ -206,11 +245,17 @@ discard block |
||
| 206 | 245 | <div id="here_data"> |
| 207 | 246 | <p> |
| 208 | 247 | <label for="hereappid">Here App_Id</label> |
| 209 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
| 248 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
| 249 | + print $globalHereappId; |
|
| 250 | +} |
|
| 251 | +?>" /> |
|
| 210 | 252 | </p> |
| 211 | 253 | <p> |
| 212 | 254 | <label for="hereappcode">Here App_Code</label> |
| 213 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
| 255 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
| 256 | + print $globalHereappCode; |
|
| 257 | +} |
|
| 258 | +?>" /> |
|
| 214 | 259 | </p> |
| 215 | 260 | <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> |
| 216 | 261 | </div> |
@@ -219,42 +264,86 @@ discard block |
||
| 219 | 264 | <legend>Coverage area</legend> |
| 220 | 265 | <p> |
| 221 | 266 | <label for="latitudemax">The maximum latitude (north)</label> |
| 222 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
| 267 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
| 268 | + print $globalLatitudeMax; |
|
| 269 | +} |
|
| 270 | +?>" /> |
|
| 223 | 271 | </p> |
| 224 | 272 | <p> |
| 225 | 273 | <label for="latitudemin">The minimum latitude (south)</label> |
| 226 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
| 274 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
| 275 | + print $globalLatitudeMin; |
|
| 276 | +} |
|
| 277 | +?>" /> |
|
| 227 | 278 | </p> |
| 228 | 279 | <p> |
| 229 | 280 | <label for="longitudemax">The maximum longitude (west)</label> |
| 230 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
| 281 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
| 282 | + print $globalLongitudeMax; |
|
| 283 | +} |
|
| 284 | +?>" /> |
|
| 231 | 285 | </p> |
| 232 | 286 | <p> |
| 233 | 287 | <label for="longitudemin">The minimum longitude (east)</label> |
| 234 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
| 288 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
| 289 | + print $globalLongitudeMin; |
|
| 290 | +} |
|
| 291 | +?>" /> |
|
| 235 | 292 | </p> |
| 236 | 293 | <p> |
| 237 | 294 | <label for="latitudecenter">The latitude center</label> |
| 238 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
| 295 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
| 296 | + print $globalCenterLatitude; |
|
| 297 | +} |
|
| 298 | +?>" /> |
|
| 239 | 299 | </p> |
| 240 | 300 | <p> |
| 241 | 301 | <label for="longitudecenter">The longitude center</label> |
| 242 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
| 302 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
| 303 | + print $globalCenterLongitude; |
|
| 304 | +} |
|
| 305 | +?>" /> |
|
| 243 | 306 | </p> |
| 244 | 307 | <p> |
| 245 | 308 | <label for="livezoom">Default Zoom on live map</label> |
| 246 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
| 309 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
| 310 | + print $globalLiveZoom; |
|
| 311 | +} else { |
|
| 312 | + print '9'; |
|
| 313 | +} |
|
| 314 | +?>" /> |
|
| 247 | 315 | </p> |
| 248 | 316 | <p> |
| 249 | 317 | <label for="squawk_country">Country for squawk usage</label> |
| 250 | 318 | <select name="squawk_country" id="squawk_country"> |
| 251 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
| 252 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
| 253 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
| 254 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
| 255 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
| 256 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
| 257 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
| 319 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
| 320 | + print ' selected '; |
|
| 321 | +} |
|
| 322 | +?>>UK</option> |
|
| 323 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
| 324 | + print ' selected '; |
|
| 325 | +} |
|
| 326 | +?>>NZ</option> |
|
| 327 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
| 328 | + print ' selected '; |
|
| 329 | +} |
|
| 330 | +?>>US</option> |
|
| 331 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
| 332 | + print ' selected '; |
|
| 333 | +} |
|
| 334 | +?>>AU</option> |
|
| 335 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
| 336 | + print ' selected '; |
|
| 337 | +} |
|
| 338 | +?>>NL</option> |
|
| 339 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
| 340 | + print ' selected '; |
|
| 341 | +} |
|
| 342 | +?>>FR</option> |
|
| 343 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
| 344 | + print ' selected '; |
|
| 345 | +} |
|
| 346 | +?>>TR</option> |
|
| 258 | 347 | </select> |
| 259 | 348 | </p> |
| 260 | 349 | </fieldset> |
@@ -263,15 +352,24 @@ discard block |
||
| 263 | 352 | <p><i>Only put in DB flights that are inside a circle</i></p> |
| 264 | 353 | <p> |
| 265 | 354 | <label for="latitude">Center latitude</label> |
| 266 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
| 355 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
| 356 | + echo $globalDistanceIgnore['latitude']; |
|
| 357 | +} |
|
| 358 | +?>" /> |
|
| 267 | 359 | </p> |
| 268 | 360 | <p> |
| 269 | 361 | <label for="longitude">Center longitude</label> |
| 270 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
| 362 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
| 363 | + echo $globalDistanceIgnore['longitude']; |
|
| 364 | +} |
|
| 365 | +?>" /> |
|
| 271 | 366 | </p> |
| 272 | 367 | <p> |
| 273 | 368 | <label for="Distance">Distance (in km)</label> |
| 274 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
| 369 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
| 370 | + echo $globalDistanceIgnore['distance']; |
|
| 371 | +} |
|
| 372 | +?>" /> |
|
| 275 | 373 | </p> |
| 276 | 374 | </fieldset> |
| 277 | 375 | <fieldset> |
@@ -360,11 +458,17 @@ discard block |
||
| 360 | 458 | <div id="flightaware_data"> |
| 361 | 459 | <p> |
| 362 | 460 | <label for="flightawareusername">FlightAware username</label> |
| 363 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
| 461 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
| 462 | + print $globalFlightAwareUsername; |
|
| 463 | +} |
|
| 464 | +?>" /> |
|
| 364 | 465 | </p> |
| 365 | 466 | <p> |
| 366 | 467 | <label for="flightawarepassword">FlightAware password/API key</label> |
| 367 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
| 468 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
| 469 | + print $globalFlightAwarePassword; |
|
| 470 | +} |
|
| 471 | +?>" /> |
|
| 368 | 472 | </p> |
| 369 | 473 | </div> |
| 370 | 474 | --> |
@@ -517,20 +621,56 @@ discard block |
||
| 517 | 621 | ?> |
| 518 | 622 | <td> |
| 519 | 623 | <select name="format[]" id="format"> |
| 520 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
| 521 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
| 522 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
| 523 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
| 524 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
| 525 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
| 526 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
| 527 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server</option> |
|
| 528 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
| 529 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
| 624 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
| 625 | + print 'selected'; |
|
| 626 | +} |
|
| 627 | +?>>Auto</option> |
|
| 628 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
| 629 | + print 'selected'; |
|
| 630 | +} |
|
| 631 | +?>>SBS</option> |
|
| 632 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
| 633 | + print 'selected'; |
|
| 634 | +} |
|
| 635 | +?>>TSV</option> |
|
| 636 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
| 637 | + print 'selected'; |
|
| 638 | +} |
|
| 639 | +?>>Raw</option> |
|
| 640 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
| 641 | + print 'selected'; |
|
| 642 | +} |
|
| 643 | +?>>APRS</option> |
|
| 644 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
| 645 | + print 'selected'; |
|
| 646 | +} |
|
| 647 | +?>>Radarcape deltadb.txt</option> |
|
| 648 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
| 649 | + print 'selected'; |
|
| 650 | +} |
|
| 651 | +?>>Vatsim</option> |
|
| 652 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
| 653 | + print 'selected'; |
|
| 654 | +} |
|
| 655 | +?>>Virtual Radar Server</option> |
|
| 656 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
| 657 | + print 'selected'; |
|
| 658 | +} |
|
| 659 | +?>>phpVMS</option> |
|
| 660 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
| 661 | + print 'selected'; |
|
| 662 | +} |
|
| 663 | +?>>IVAO</option> |
|
| 530 | 664 | </select> |
| 531 | 665 | </td> |
| 532 | - <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /></td> |
|
| 533 | - <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> |
|
| 666 | + <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
| 667 | + print $source['name']; |
|
| 668 | +} |
|
| 669 | +?>" /></td> |
|
| 670 | + <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']) { |
|
| 671 | + print 'checked'; |
|
| 672 | +} |
|
| 673 | +?> /></td> |
|
| 534 | 674 | <td><input type="button" id="delhost" value="Delete" onclick="deleteRow(this)" /> <input type="button" id="addhost" value="Add" onclick="insRow()" /></td> |
| 535 | 675 | </tr> |
| 536 | 676 | <?php |
@@ -569,11 +709,17 @@ discard block |
||
| 569 | 709 | <p>Listen UDP server for acarsdec/acarsdeco2/...</p> |
| 570 | 710 | <p> |
| 571 | 711 | <label for="acarshost">ACARS UDP host</label> |
| 572 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
| 712 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
| 713 | + print $globalACARSHost; |
|
| 714 | +} |
|
| 715 | +?>" /> |
|
| 573 | 716 | </p> |
| 574 | 717 | <p> |
| 575 | 718 | <label for="acarsport">ACARS UDP port</label> |
| 576 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
| 719 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
| 720 | + print $globalACARSPort; |
|
| 721 | +} |
|
| 722 | +?>" /> |
|
| 577 | 723 | </p> |
| 578 | 724 | </fieldset> |
| 579 | 725 | </div> |
@@ -627,12 +773,18 @@ discard block |
||
| 627 | 773 | <div id="schedules_options"> |
| 628 | 774 | <p> |
| 629 | 775 | <label for="britishairways">British Airways API Key</label> |
| 630 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
| 776 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
| 777 | + print $globalBritishAirwaysKey; |
|
| 778 | +} |
|
| 779 | +?>" /> |
|
| 631 | 780 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
| 632 | 781 | </p> |
| 633 | 782 | <p> |
| 634 | 783 | <label for="transavia">Transavia Test API Consumer Key</label> |
| 635 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
| 784 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
| 785 | + print $globalTransaviaKey; |
|
| 786 | +} |
|
| 787 | +?>" /> |
|
| 636 | 788 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
| 637 | 789 | </p> |
| 638 | 790 | <p> |
@@ -640,10 +792,16 @@ discard block |
||
| 640 | 792 | <b>Lufthansa API Key</b> |
| 641 | 793 | <p> |
| 642 | 794 | <label for="lufthansakey">Key</label> |
| 643 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
| 795 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
| 796 | + print $globalLufthansaKey['key']; |
|
| 797 | +} |
|
| 798 | +?>" /> |
|
| 644 | 799 | </p><p> |
| 645 | 800 | <label for="lufthansasecret">Secret</label> |
| 646 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
| 801 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
| 802 | + print $globalLufthansaKey['secret']; |
|
| 803 | +} |
|
| 804 | +?>" /> |
|
| 647 | 805 | </p> |
| 648 | 806 | </div> |
| 649 | 807 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -663,7 +821,10 @@ discard block |
||
| 663 | 821 | </p> |
| 664 | 822 | <p> |
| 665 | 823 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
| 666 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
| 824 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
| 825 | + print $globalNOTAMSource; |
|
| 826 | +} |
|
| 827 | +?>" /> |
|
| 667 | 828 | </p> |
| 668 | 829 | <br /> |
| 669 | 830 | <p> |
@@ -678,14 +839,20 @@ discard block |
||
| 678 | 839 | <div id="metarsrc"> |
| 679 | 840 | <p> |
| 680 | 841 | <label for="metarsource">URL of your METAR source</label> |
| 681 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
| 842 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
| 843 | + print $globalMETARurl; |
|
| 844 | +} |
|
| 845 | +?>" /> |
|
| 682 | 846 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
| 683 | 847 | </p> |
| 684 | 848 | </div> |
| 685 | 849 | <br /> |
| 686 | 850 | <p> |
| 687 | 851 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
| 688 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
| 852 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
| 853 | + print $globalBitlyAccessToken; |
|
| 854 | +} |
|
| 855 | +?>" /> |
|
| 689 | 856 | </p> |
| 690 | 857 | <br /> |
| 691 | 858 | <p> |
@@ -699,7 +866,12 @@ discard block |
||
| 699 | 866 | </p> |
| 700 | 867 | <p> |
| 701 | 868 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
| 702 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" /> |
|
| 869 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
| 870 | + print $globalArchiveMonths; |
|
| 871 | +} else { |
|
| 872 | + echo '0'; |
|
| 873 | +} |
|
| 874 | +?>" /> |
|
| 703 | 875 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
| 704 | 876 | </p> |
| 705 | 877 | <p> |
@@ -709,12 +881,22 @@ discard block |
||
| 709 | 881 | </p> |
| 710 | 882 | <p> |
| 711 | 883 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
| 712 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" /> |
|
| 884 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
| 885 | + print $globalArchiveKeepMonths; |
|
| 886 | +} else { |
|
| 887 | + echo '0'; |
|
| 888 | +} |
|
| 889 | +?>" /> |
|
| 713 | 890 | <p class="help-block">0 to disable</p> |
| 714 | 891 | </p> |
| 715 | 892 | <p> |
| 716 | 893 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
| 717 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" /> |
|
| 894 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
| 895 | + print $globalArchiveKeepTrackMonths; |
|
| 896 | +} else { |
|
| 897 | + echo '0'; |
|
| 898 | +} |
|
| 899 | +?>" /> |
|
| 718 | 900 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
| 719 | 901 | </p> |
| 720 | 902 | <br /> |
@@ -723,7 +905,12 @@ discard block |
||
| 723 | 905 | <input type="checkbox" name="daemon" id="daemon" value="daemon"<?php if ((isset($globalDaemon) && $globalDaemon) || !isset($globalDaemon)) { ?> checked="checked"<?php } ?> onClick="daemon_js()" /> |
| 724 | 906 | <div id="cronends"> |
| 725 | 907 | <label for="cronend">Run script for xx seconds</label> |
| 726 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
| 908 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
| 909 | + print $globalCronEnd; |
|
| 910 | +} else { |
|
| 911 | + print '0'; |
|
| 912 | +} |
|
| 913 | +?>" /> |
|
| 727 | 914 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
| 728 | 915 | </div> |
| 729 | 916 | <p class="help-block">Uncheck if the script is running as cron job</p> |
@@ -764,26 +951,49 @@ discard block |
||
| 764 | 951 | <br /> |
| 765 | 952 | <p> |
| 766 | 953 | <label for="refresh">Show flights detected since xxx seconds</label> |
| 767 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
| 954 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
| 955 | + echo $globalLiveInterval; |
|
| 956 | +} else { |
|
| 957 | + echo '200'; |
|
| 958 | +} |
|
| 959 | +?>" /> |
|
| 768 | 960 | </p> |
| 769 | 961 | <p> |
| 770 | 962 | <label for="maprefresh">Live map refresh (in seconds)</label> |
| 771 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
| 963 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
| 964 | + echo $globalMapRefresh; |
|
| 965 | +} else { |
|
| 966 | + echo '30'; |
|
| 967 | +} |
|
| 968 | +?>" /> |
|
| 772 | 969 | </p> |
| 773 | 970 | <p> |
| 774 | 971 | <label for="mapidle">Map idle timeout (in minutes)</label> |
| 775 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
| 972 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
| 973 | + echo $globalMapIdleTimeout; |
|
| 974 | +} else { |
|
| 975 | + echo '30'; |
|
| 976 | +} |
|
| 977 | +?>" /> |
|
| 776 | 978 | <p class="help-block">0 to disable</p> |
| 777 | 979 | </p> |
| 778 | 980 | <br /> |
| 779 | 981 | <p> |
| 780 | 982 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
| 781 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
| 983 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
| 984 | + echo $globalClosestMinDist; |
|
| 985 | +} else { |
|
| 986 | + echo '50'; |
|
| 987 | +} |
|
| 988 | +?>" /> |
|
| 782 | 989 | </p> |
| 783 | 990 | <br /> |
| 784 | 991 | <p> |
| 785 | 992 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
| 786 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
| 993 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
| 994 | + echo $globalAircraftSize; |
|
| 995 | +} |
|
| 996 | +?>" /> |
|
| 787 | 997 | </p> |
| 788 | 998 | <br /> |
| 789 | 999 | <p> |
@@ -791,7 +1001,12 @@ discard block |
||
| 791 | 1001 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 792 | 1002 | ?> |
| 793 | 1003 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
| 794 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
| 1004 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
| 1005 | + echo $globalAircraftIconColor; |
|
| 1006 | +} else { |
|
| 1007 | + echo '1a3151'; |
|
| 1008 | +} |
|
| 1009 | +?>" /> |
|
| 795 | 1010 | <?php |
| 796 | 1011 | if (!is_writable('../cache')) { |
| 797 | 1012 | ?> |
@@ -809,8 +1024,18 @@ discard block |
||
| 809 | 1024 | <p> |
| 810 | 1025 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
| 811 | 1026 | <div class="range"> |
| 812 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
| 813 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
| 1027 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
| 1028 | + echo $globalAirportZoom; |
|
| 1029 | +} else { |
|
| 1030 | + echo '7'; |
|
| 1031 | +} |
|
| 1032 | +?>" /> |
|
| 1033 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
| 1034 | + echo $globalAirportZoom; |
|
| 1035 | +} else { |
|
| 1036 | + echo '7'; |
|
| 1037 | +} |
|
| 1038 | +?></output> |
|
| 814 | 1039 | </div> |
| 815 | 1040 | </p> |
| 816 | 1041 | </fieldset> |
@@ -837,19 +1062,27 @@ discard block |
||
| 837 | 1062 | $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
| 838 | 1063 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
| 839 | 1064 | |
| 840 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
| 841 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1065 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
| 1066 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
| 1067 | + } |
|
| 1068 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
| 1069 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1070 | + } |
|
| 842 | 1071 | |
| 843 | 1072 | if ($error == '' && isset($_POST['createdb']) && $dbname != '' && $dbuser != '' && $dbuserpass != '') { |
| 844 | 1073 | if ($dbroot != '' && $dbrootpass != '') { |
| 845 | 1074 | $result = create_db::create_database($dbroot,$dbrootpass,$dbuser,$dbuserpass,$dbname,$dbtype,$dbhost); |
| 846 | - if ($result != '') $error .= $result; |
|
| 1075 | + if ($result != '') { |
|
| 1076 | + $error .= $result; |
|
| 1077 | + } |
|
| 847 | 1078 | } |
| 848 | 1079 | if ($error == '') { |
| 849 | 1080 | //$error .= create_db::import_all_db('../db/'); |
| 850 | 1081 | $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
| 851 | 1082 | } |
| 852 | - } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
| 1083 | + } else { |
|
| 1084 | + $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
| 1085 | + } |
|
| 853 | 1086 | |
| 854 | 1087 | $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
| 855 | 1088 | $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
@@ -899,15 +1132,23 @@ discard block |
||
| 899 | 1132 | $source_city = $_POST['source_city']; |
| 900 | 1133 | $source_country = $_POST['source_country']; |
| 901 | 1134 | $source_ref = $_POST['source_ref']; |
| 902 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
| 903 | - else $source_id = array(); |
|
| 1135 | + if (isset($source_id)) { |
|
| 1136 | + $source_id = $_POST['source_id']; |
|
| 1137 | + } else { |
|
| 1138 | + $source_id = array(); |
|
| 1139 | + } |
|
| 904 | 1140 | |
| 905 | 1141 | $sources = array(); |
| 906 | 1142 | foreach ($source_name as $keys => $name) { |
| 907 | - 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]); |
|
| 908 | - 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]); |
|
| 1143 | + if (isset($source_id[$keys])) { |
|
| 1144 | + $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]); |
|
| 1145 | + } else { |
|
| 1146 | + $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]); |
|
| 1147 | + } |
|
| 1148 | + } |
|
| 1149 | + if (count($sources) > 0) { |
|
| 1150 | + $_SESSION['sources'] = $sources; |
|
| 909 | 1151 | } |
| 910 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
| 911 | 1152 | |
| 912 | 1153 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
| 913 | 1154 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -947,9 +1188,14 @@ discard block |
||
| 947 | 1188 | $sourcestats = $_POST['sourcestats']; |
| 948 | 1189 | $gSources = array(); |
| 949 | 1190 | foreach ($host as $key => $h) { |
| 950 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
| 951 | - else $cov = 'FALSE'; |
|
| 952 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
| 1191 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
| 1192 | + $cov = 'TRUE'; |
|
| 1193 | + } else { |
|
| 1194 | + $cov = 'FALSE'; |
|
| 1195 | + } |
|
| 1196 | + if ($h != '') { |
|
| 1197 | + $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
| 1198 | + } |
|
| 953 | 1199 | } |
| 954 | 1200 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
| 955 | 1201 | |
@@ -973,7 +1219,9 @@ discard block |
||
| 973 | 1219 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
| 974 | 1220 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
| 975 | 1221 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
| 976 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1222 | + } else { |
|
| 1223 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1224 | + } |
|
| 977 | 1225 | |
| 978 | 1226 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
| 979 | 1227 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1012,7 +1260,9 @@ discard block |
||
| 1012 | 1260 | |
| 1013 | 1261 | // Create in settings.php keys not yet configurable if not already here |
| 1014 | 1262 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
| 1015 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1263 | + if (!isset($globalDebug)) { |
|
| 1264 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1265 | + } |
|
| 1016 | 1266 | |
| 1017 | 1267 | $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
| 1018 | 1268 | if ($archive == 'archive') { |
@@ -1042,24 +1292,38 @@ discard block |
||
| 1042 | 1292 | } |
| 1043 | 1293 | */ |
| 1044 | 1294 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
| 1045 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1046 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1047 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1048 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1295 | + if ($globalsbs == 'sbs') { |
|
| 1296 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1297 | + } else { |
|
| 1298 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1299 | + } |
|
| 1300 | + if ($globalaprs == 'aprs') { |
|
| 1301 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1302 | + } else { |
|
| 1303 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1304 | + } |
|
| 1049 | 1305 | if ($globalivao == 'ivao') { |
| 1050 | 1306 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
| 1051 | 1307 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
| 1052 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1308 | + } else { |
|
| 1309 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1310 | + } |
|
| 1053 | 1311 | if ($globalvatsim == 'vatsim') { |
| 1054 | 1312 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
| 1055 | 1313 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
| 1056 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1314 | + } else { |
|
| 1315 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1316 | + } |
|
| 1057 | 1317 | if ($globalphpvms == 'phpvms') { |
| 1058 | 1318 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
| 1059 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1319 | + } else { |
|
| 1320 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1321 | + } |
|
| 1060 | 1322 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
| 1061 | 1323 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
| 1062 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1324 | + } else { |
|
| 1325 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1326 | + } |
|
| 1063 | 1327 | |
| 1064 | 1328 | |
| 1065 | 1329 | |
@@ -1153,7 +1417,9 @@ discard block |
||
| 1153 | 1417 | $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
| 1154 | 1418 | } |
| 1155 | 1419 | |
| 1156 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1420 | + if (!isset($globalTransaction)) { |
|
| 1421 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1422 | + } |
|
| 1157 | 1423 | |
| 1158 | 1424 | // Set some defaults values... |
| 1159 | 1425 | if (!isset($globalAircraftImageSources)) { |
@@ -1168,15 +1434,23 @@ discard block |
||
| 1168 | 1434 | |
| 1169 | 1435 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
| 1170 | 1436 | |
| 1171 | - if ($error == '') settings::modify_settings($settings); |
|
| 1172 | - if ($error == '') settings::comment_settings($settings_comment); |
|
| 1437 | + if ($error == '') { |
|
| 1438 | + settings::modify_settings($settings); |
|
| 1439 | + } |
|
| 1440 | + if ($error == '') { |
|
| 1441 | + settings::comment_settings($settings_comment); |
|
| 1442 | + } |
|
| 1173 | 1443 | if ($error != '') { |
| 1174 | 1444 | print '<div class="info column">'.$error.'</div>'; |
| 1175 | 1445 | require('../footer.php'); |
| 1176 | 1446 | exit; |
| 1177 | 1447 | } else { |
| 1178 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
| 1179 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
| 1448 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
| 1449 | + $_SESSION['waypoints'] = 1; |
|
| 1450 | + } |
|
| 1451 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
| 1452 | + $_SESSION['owner'] = 1; |
|
| 1453 | + } |
|
| 1180 | 1454 | $_SESSION['install'] = 'database_import'; |
| 1181 | 1455 | //require('../footer.php'); |
| 1182 | 1456 | print '<div class="info column"><ul>'; |
@@ -1184,7 +1458,9 @@ discard block |
||
| 1184 | 1458 | if (isset($_POST['createdb'])) { |
| 1185 | 1459 | $_SESSION['done'] = array('Create database','Write configuration'); |
| 1186 | 1460 | print '<li>Create database....<strong>SUCCESS</strong></li>'; |
| 1187 | - } else $_SESSION['done'] = array('Write configuration'); |
|
| 1461 | + } else { |
|
| 1462 | + $_SESSION['done'] = array('Write configuration'); |
|
| 1463 | + } |
|
| 1188 | 1464 | print '<li>Write configuration....<img src="../images/loading.gif" /></li></ul></div>'; |
| 1189 | 1465 | # flush(); |
| 1190 | 1466 | # @ob_flush(); |
@@ -1199,12 +1475,16 @@ discard block |
||
| 1199 | 1475 | $pop = false; |
| 1200 | 1476 | foreach ($_SESSION['done'] as $done) { |
| 1201 | 1477 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
| 1202 | - if ($done == 'Create database') $pop = true; |
|
| 1478 | + if ($done == 'Create database') { |
|
| 1479 | + $pop = true; |
|
| 1480 | + } |
|
| 1203 | 1481 | } |
| 1204 | 1482 | if ($pop) { |
| 1205 | 1483 | sleep(5); |
| 1206 | 1484 | print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
| 1207 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 1485 | + } else { |
|
| 1486 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 1487 | + } |
|
| 1208 | 1488 | print '</div></ul>'; |
| 1209 | 1489 | print '<div id="error"></div>'; |
| 1210 | 1490 | /* foreach ($_SESSION['done'] as $done) { |
@@ -215,14 +215,7 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | $r = null; |
| 217 | 217 | |
| 218 | - if( $code == "select" ) { $r = $this->test_select(); } |
|
| 219 | - elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } |
|
| 220 | - elseif( $code == "math_as" ) { $r = $this->test_math_as(); } |
|
| 221 | - elseif( $code == "count" ) { $r = $this->test_count(); } |
|
| 222 | - elseif( $code == "max" ) { $r = $this->test_max(); } |
|
| 223 | - elseif( $code == "load" ) { $r = $this->test_load(); } |
|
| 224 | - elseif( $code == "sample" ) { $r = $this->test_sample(); } |
|
| 225 | - else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
|
| 218 | + if( $code == "select" ) { $r = $this->test_select(); } elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } elseif( $code == "math_as" ) { $r = $this->test_math_as(); } elseif( $code == "count" ) { $r = $this->test_count(); } elseif( $code == "max" ) { $r = $this->test_max(); } elseif( $code == "load" ) { $r = $this->test_load(); } elseif( $code == "sample" ) { $r = $this->test_sample(); } else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
|
| 226 | 219 | $this->caps[$code] = $r; |
| 227 | 220 | if( isset( $this->caps_cache ) ) |
| 228 | 221 | { |
@@ -231,8 +224,7 @@ discard block |
||
| 231 | 224 | if( $was_cached ) |
| 232 | 225 | { |
| 233 | 226 | dba_replace( $db_key, $db_val, $this->caps_cache ); |
| 234 | - } |
|
| 235 | - else |
|
| 227 | + } else |
|
| 236 | 228 | { |
| 237 | 229 | dba_insert( $db_key, $db_val, $this->caps_cache ); |
| 238 | 230 | } |
@@ -164,15 +164,21 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 166 | 166 | $_SESSION['install'] = 'vatsim'; |
| 167 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 168 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 167 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 168 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 169 | + } else { |
|
| 170 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 171 | + } |
|
| 169 | 172 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
| 170 | 173 | $_SESSION['install'] = 'vatsim'; |
| 171 | 174 | $_SESSION['next'] = 'Insert VATSIM data'; |
| 172 | 175 | } elseif (isset($globalIVAO) && $globalIVAO) { |
| 173 | 176 | $_SESSION['install'] = 'vatsim'; |
| 174 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 175 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 177 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 178 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 179 | + } else { |
|
| 180 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 181 | + } |
|
| 176 | 182 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
| 177 | 183 | $_SESSION['install'] = 'vatsim'; |
| 178 | 184 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -303,7 +309,9 @@ discard block |
||
| 303 | 309 | $Source = new Source(); |
| 304 | 310 | $Source->deleteAllLocation(); |
| 305 | 311 | foreach ($sources as $src) { |
| 306 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
| 312 | + if (isset($src['latitude']) && $src['latitude'] != '') { |
|
| 313 | + $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
| 314 | + } |
|
| 307 | 315 | } |
| 308 | 316 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
| 309 | 317 | unset($_SESSION['sources']); |
@@ -314,15 +322,21 @@ discard block |
||
| 314 | 322 | */ |
| 315 | 323 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 316 | 324 | $_SESSION['install'] = 'vatsim'; |
| 317 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 318 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 325 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 326 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 327 | + } else { |
|
| 328 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 329 | + } |
|
| 319 | 330 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
| 320 | 331 | $_SESSION['install'] = 'vatsim'; |
| 321 | 332 | $_SESSION['next'] = 'Insert VATSIM data'; |
| 322 | 333 | } elseif (isset($globalIVAO) && $globalIVAO) { |
| 323 | 334 | $_SESSION['install'] = 'vatsim'; |
| 324 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 325 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 335 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 336 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 337 | + } else { |
|
| 338 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 339 | + } |
|
| 326 | 340 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
| 327 | 341 | $_SESSION['install'] = 'vatsim'; |
| 328 | 342 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -70,7 +70,9 @@ |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | - if (!isset($array_value)) $array_value = ''; |
|
| 73 | + if (!isset($array_value)) { |
|
| 74 | + $array_value = ''; |
|
| 75 | + } |
|
| 74 | 76 | $replace = "\n".'\$'.$settingname." = array(".$array_value.")"; |
| 75 | 77 | unset($array_value); |
| 76 | 78 | } else { |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $limit_start = 0; |
| 16 | 16 | $limit_end = 25; |
| 17 | 17 | $absolute_difference = 25; |
| 18 | - } else { |
|
| 18 | + } else { |
|
| 19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
| 20 | 20 | $limit_start = $limit_explode[0]; |
| 21 | 21 | $limit_end = $limit_explode[1]; |
@@ -45,7 +45,9 @@ discard block |
||
| 45 | 45 | $METAR = new METAR(); |
| 46 | 46 | $metar_info = $METAR->getMETAR($airport_icao); |
| 47 | 47 | //print_r($metar_info); |
| 48 | - if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
| 48 | + if (isset($metar_info[0]['metar'])) { |
|
| 49 | + $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
| 50 | + } |
|
| 49 | 51 | //print_r($metar_parse); |
| 50 | 52 | } |
| 51 | 53 | |
@@ -90,7 +92,9 @@ discard block |
||
| 90 | 92 | $all_data = $Stats->getLast7DaysAirports($airport_icao); |
| 91 | 93 | if (isset($globalTimezone)) { |
| 92 | 94 | date_default_timezone_set($globalTimezone); |
| 93 | - } else date_default_timezone_set('UTC'); |
|
| 95 | + } else { |
|
| 96 | + date_default_timezone_set('UTC'); |
|
| 97 | + } |
|
| 94 | 98 | if (count($all_data) > 0) { |
| 95 | 99 | print '<div id="chart6" class="chart" width="100%"></div> |
| 96 | 100 | <script> |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | print '<fieldset class="form-group">'; |
| 24 | 24 | print '<label for="notam_message">'._("NOTAM Message").'</label>'; |
| 25 | 25 | print '<textarea class="form-control" name="notam_message" id="notam_message" rows="5">'; |
| 26 | -if ($message != '') print $message; |
|
| 26 | +if ($message != '') { |
|
| 27 | + print $message; |
|
| 28 | +} |
|
| 27 | 29 | print '</textarea>'; |
| 28 | 30 | print '</fieldset>'; |
| 29 | 31 | print '<button type="submit" class="btn btn-primary">Submit</button>'; |
@@ -63,7 +63,10 @@ |
||
| 63 | 63 | imagedestroy($image); |
| 64 | 64 | } else { |
| 65 | 65 | header('Content-type: image/png'); |
| 66 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
| 67 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
| 68 | -} |
|
| 66 | + if ($color == 'FF0000') { |
|
| 67 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
| 68 | + } else { |
|
| 69 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
| 70 | + } |
|
| 71 | + } |
|
| 69 | 72 | ?> |
| 70 | 73 | \ No newline at end of file |
@@ -4,8 +4,11 @@ |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 7 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 8 | -else $spotter_array = array(); |
|
| 7 | +if (isset($_GET['date'])) { |
|
| 8 | + $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 9 | +} else { |
|
| 10 | + $spotter_array = array(); |
|
| 11 | +} |
|
| 9 | 12 | |
| 10 | 13 | if (!empty($spotter_array)) |
| 11 | 14 | { |