@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <meta property="og:site_name" content="<?php print $globalName; ?>"/> |
40 | 40 | |
41 | 41 | <?php |
42 | - if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
42 | + if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
43 | 43 | ?> |
44 | 44 | <script language="JavaScript" type="text/javascript"> |
45 | 45 | function datasource_js() { |
@@ -120,22 +120,22 @@ discard block |
||
120 | 120 | } |
121 | 121 | </script> |
122 | 122 | <?php |
123 | - } |
|
123 | + } |
|
124 | 124 | ?> |
125 | 125 | |
126 | 126 | </head> |
127 | 127 | |
128 | 128 | <?php |
129 | - if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
129 | + if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
130 | 130 | ?> |
131 | 131 | |
132 | 132 | <body class="page-<?php print strtolower($current_page); ?>" onload="datasource_js(); metarcycle_js(); create_database_js(); daemon_js(); schedule_js()"> |
133 | 133 | <?php |
134 | - } else { |
|
134 | + } else { |
|
135 | 135 | ?> |
136 | 136 | <body class="page-<?php print strtolower($current_page); ?>"> |
137 | 137 | <?php |
138 | - } |
|
138 | + } |
|
139 | 139 | ?> |
140 | 140 | <div class="navbar navbar-fixed-top" role="navigation"> |
141 | 141 | <div class="container"> |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | |
155 | 155 | <?php |
156 | 156 | if (isset($top_header)) { |
157 | - if ($top_header != "") |
|
158 | - { |
|
157 | + if ($top_header != "") |
|
158 | + { |
|
159 | 159 | print '<div class="top-header container clear" role="main">'; |
160 | 160 | print '<img src="../images/'.$top_header.'" alt="'.$title.'" title="'.$title.'" />'; |
161 | 161 | print '</div>'; |
162 | - } |
|
162 | + } |
|
163 | 163 | } |
164 | 164 | ?> |
165 | 165 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | print '</ul>You <strong>must</strong> add these modules.</div>'; |
87 | 87 | require('../footer.php'); |
88 | - exit; |
|
88 | + exit; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | if (!isset($_SESSION['install']) && !isset($_POST['dbtype']) && (count($error) == 0)) { |
@@ -287,14 +287,14 @@ discard block |
||
287 | 287 | <th>Source name</th> |
288 | 288 | </tr> |
289 | 289 | <?php |
290 | - require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
291 | - $Connection = new Connection(); |
|
292 | - if ($Connection->db != NULL) { |
|
290 | + require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
291 | + $Connection = new Connection(); |
|
292 | + if ($Connection->db != NULL) { |
|
293 | 293 | if ($Connection->tableExists('source_location')) { |
294 | - require_once(dirname(__FILE__).'/../require/class.Source.php'); |
|
295 | - $Source = new Source(); |
|
296 | - $alllocations = $Source->getAllLocationInfo(); |
|
297 | - foreach ($alllocations as $location) { |
|
294 | + require_once(dirname(__FILE__).'/../require/class.Source.php'); |
|
295 | + $Source = new Source(); |
|
296 | + $alllocations = $Source->getAllLocationInfo(); |
|
297 | + foreach ($alllocations as $location) { |
|
298 | 298 | ?> |
299 | 299 | <tr> |
300 | 300 | <input type="hidden" name="source_id[]" value="<?php print $location['id']; ?>" /> |
@@ -308,9 +308,9 @@ discard block |
||
308 | 308 | </tr> |
309 | 309 | |
310 | 310 | <?php |
311 | - } |
|
311 | + } |
|
312 | + } |
|
312 | 313 | } |
313 | - } |
|
314 | 314 | ?> |
315 | 315 | |
316 | 316 | <tr> |
@@ -495,12 +495,12 @@ discard block |
||
495 | 495 | ?> |
496 | 496 | <tr> |
497 | 497 | <?php |
498 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
498 | + if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
499 | 499 | ?> |
500 | 500 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
501 | 501 | <td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td> |
502 | 502 | <?php |
503 | - } else { |
|
503 | + } else { |
|
504 | 504 | $hostport = explode(':',$source['host']); |
505 | 505 | if (isset($hostport[1])) { |
506 | 506 | $host = $hostport[0]; |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | <td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td> |
514 | 514 | <td><input type="number" name="port[]" id="port" value="<?php print $port; ?>" /></td> |
515 | 515 | <?php |
516 | - } |
|
516 | + } |
|
517 | 517 | ?> |
518 | 518 | <td> |
519 | 519 | <select name="format[]" id="format"> |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | <br /> |
789 | 789 | <p> |
790 | 790 | <?php |
791 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
791 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
792 | 792 | ?> |
793 | 793 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
794 | 794 | <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
@@ -798,11 +798,11 @@ discard block |
||
798 | 798 | <b>The directory cache is not writable, aircraft icon will not be cached</b> |
799 | 799 | <?php |
800 | 800 | } |
801 | - } else { |
|
801 | + } else { |
|
802 | 802 | ?> |
803 | 803 | <b>PHP GD is not installed, you can t change color of aircraft icon on map</b> |
804 | 804 | <?php |
805 | - } |
|
805 | + } |
|
806 | 806 | ?> |
807 | 807 | </p> |
808 | 808 | <br /> |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | </p> |
822 | 822 | <?php |
823 | 823 | require('../footer.php'); |
824 | - exit; |
|
824 | + exit; |
|
825 | 825 | } |
826 | 826 | |
827 | 827 | $settings = array(); |
@@ -904,8 +904,8 @@ discard block |
||
904 | 904 | |
905 | 905 | $sources = array(); |
906 | 906 | 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]); |
|
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]); |
|
909 | 909 | } |
910 | 910 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
911 | 911 | |
@@ -1157,14 +1157,14 @@ discard block |
||
1157 | 1157 | |
1158 | 1158 | // Set some defaults values... |
1159 | 1159 | if (!isset($globalAircraftImageSources)) { |
1160 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1161 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1160 | + $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1161 | + $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1162 | 1162 | } |
1163 | 1163 | |
1164 | 1164 | if (!isset($globalSchedulesSources)) { |
1165 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1166 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1167 | - } |
|
1165 | + $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1166 | + $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1167 | + } |
|
1168 | 1168 | |
1169 | 1169 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1170 | 1170 | |
@@ -1198,12 +1198,12 @@ discard block |
||
1198 | 1198 | print '<ul><div id="step">'; |
1199 | 1199 | $pop = false; |
1200 | 1200 | foreach ($_SESSION['done'] as $done) { |
1201 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1202 | - if ($done == 'Create database') $pop = true; |
|
1201 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1202 | + if ($done == 'Create database') $pop = true; |
|
1203 | 1203 | } |
1204 | 1204 | if ($pop) { |
1205 | - sleep(5); |
|
1206 | - print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
1205 | + sleep(5); |
|
1206 | + print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
1207 | 1207 | } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
1208 | 1208 | print '</div></ul>'; |
1209 | 1209 | print '<div id="error"></div>'; |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | unset($_COOKIE['install']); |
1266 | 1266 | print '<div class="info column"><ul>'; |
1267 | 1267 | foreach ($_SESSION['done'] as $done) { |
1268 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1268 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1269 | 1269 | } |
1270 | 1270 | print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>'; |
1271 | 1271 | print '</ul></div>'; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | require_once(dirname(__FILE__).'/class.create_db.php'); |
13 | 13 | require_once(dirname(__FILE__).'/class.update_schema.php'); |
14 | 14 | require_once(dirname(__FILE__).'/class.settings.php'); |
15 | -$title="Install"; |
|
15 | +$title = "Install"; |
|
16 | 16 | require(dirname(__FILE__).'/header.php'); |
17 | 17 | require(dirname(__FILE__).'/../require/settings.php'); |
18 | 18 | |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | if (!extension_loaded('curl')) { |
67 | 67 | $error[] = "Curl is not loaded."; |
68 | 68 | } |
69 | -if(function_exists('apache_get_modules') ){ |
|
70 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
69 | +if (function_exists('apache_get_modules')) { |
|
70 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
71 | 71 | $error[] = "mod_rewrite is not available."; |
72 | 72 | } |
73 | 73 | if (!isset($_SERVER['HTACCESS'])) { |
@@ -499,13 +499,13 @@ discard block |
||
499 | 499 | ?> |
500 | 500 | <tr> |
501 | 501 | <?php |
502 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
502 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
503 | 503 | ?> |
504 | 504 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
505 | 505 | <td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td> |
506 | 506 | <?php |
507 | 507 | } else { |
508 | - $hostport = explode(':',$source['host']); |
|
508 | + $hostport = explode(':', $source['host']); |
|
509 | 509 | if (isset($hostport[1])) { |
510 | 510 | $host = $hostport[0]; |
511 | 511 | $port = $hostport[1]; |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | <br /> |
788 | 788 | <p> |
789 | 789 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
790 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
790 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
791 | 791 | </p> |
792 | 792 | <br /> |
793 | 793 | <p> |
@@ -833,14 +833,14 @@ discard block |
||
833 | 833 | $error = ''; |
834 | 834 | |
835 | 835 | if (isset($_POST['dbtype'])) { |
836 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
837 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
838 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
839 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
840 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
841 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
842 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
843 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
836 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
837 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
838 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
839 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
840 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
841 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
842 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
843 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
844 | 844 | |
845 | 845 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
846 | 846 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -860,48 +860,48 @@ discard block |
||
860 | 860 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
861 | 861 | */ |
862 | 862 | |
863 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
863 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
864 | 864 | |
865 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
866 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
867 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
868 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
869 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
865 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
866 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
867 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
868 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
869 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
870 | 870 | |
871 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
872 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
873 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
874 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
875 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
876 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
877 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
878 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
879 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey)); |
|
871 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
872 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
873 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
874 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
875 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
876 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
877 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
878 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
879 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey)); |
|
880 | 880 | |
881 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
882 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
883 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
884 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
885 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
886 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
881 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
882 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
883 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
884 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
885 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
886 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
887 | 887 | |
888 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
889 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
888 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
889 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
890 | 890 | |
891 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
892 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
893 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
891 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
892 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
893 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
894 | 894 | |
895 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
895 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
896 | 896 | if ($acars == 'acars') { |
897 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
897 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
898 | 898 | } else { |
899 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
899 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
900 | 900 | } |
901 | 901 | |
902 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
903 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
904 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
902 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
903 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
904 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
905 | 905 | |
906 | 906 | $source_name = $_POST['source_name']; |
907 | 907 | $source_latitude = $_POST['source_latitude']; |
@@ -915,8 +915,8 @@ discard block |
||
915 | 915 | |
916 | 916 | $sources = array(); |
917 | 917 | foreach ($source_name as $keys => $name) { |
918 | - 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]); |
|
919 | - 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]); |
|
918 | + 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]); |
|
919 | + 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]); |
|
920 | 920 | } |
921 | 921 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
922 | 922 | |
@@ -929,12 +929,12 @@ discard block |
||
929 | 929 | $sbsurl = $_POST['sbsurl']; |
930 | 930 | */ |
931 | 931 | |
932 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
933 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
934 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
935 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
936 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
937 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
932 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
933 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
934 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
935 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
936 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
937 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
938 | 938 | |
939 | 939 | /* |
940 | 940 | $globalSBS1Hosts = array(); |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | } |
951 | 951 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
952 | 952 | */ |
953 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
953 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
954 | 954 | $host = $_POST['host']; |
955 | 955 | $port = $_POST['port']; |
956 | 956 | $name = $_POST['name']; |
@@ -960,88 +960,88 @@ discard block |
||
960 | 960 | foreach ($host as $key => $h) { |
961 | 961 | if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
962 | 962 | else $cov = 'FALSE'; |
963 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
963 | + if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov); |
|
964 | 964 | } |
965 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
965 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
966 | 966 | |
967 | - $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
|
968 | - $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
|
967 | + $sbstimeout = filter_input(INPUT_POST, 'sbstimeout', FILTER_SANITIZE_NUMBER_INT); |
|
968 | + $settings = array_merge($settings, array('globalSourcesTimeOut' => $sbstimeout)); |
|
969 | 969 | |
970 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
971 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
972 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
970 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
971 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
972 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
973 | 973 | |
974 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
975 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
974 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
975 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
976 | 976 | |
977 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
978 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
979 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
980 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
977 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
978 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
979 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
980 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
981 | 981 | |
982 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
983 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
984 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
982 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
983 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
984 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
985 | 985 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
986 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
987 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
986 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
987 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
988 | 988 | |
989 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
990 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
991 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
992 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
993 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
994 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
995 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
996 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
989 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
990 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
991 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
992 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
993 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
994 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
995 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
996 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
997 | 997 | |
998 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
999 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
998 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
999 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
1000 | 1000 | |
1001 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
1002 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
1001 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
1002 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
1003 | 1003 | |
1004 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
1004 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
1005 | 1005 | if ($archiveyear == "archiveyear") { |
1006 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
1006 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
1007 | 1007 | } else { |
1008 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
1008 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
1009 | 1009 | } |
1010 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1011 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1012 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1013 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1010 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1011 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1012 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1013 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1014 | 1014 | |
1015 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
1016 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
1017 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
1018 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
1015 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
1016 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
1017 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
1018 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
1019 | 1019 | |
1020 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
1021 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
1022 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
1020 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
1021 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
1022 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
1023 | 1023 | |
1024 | 1024 | // Create in settings.php keys not yet configurable if not already here |
1025 | 1025 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1026 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1026 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
1027 | 1027 | |
1028 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
1028 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
1029 | 1029 | if ($archive == 'archive') { |
1030 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
1030 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
1031 | 1031 | } else { |
1032 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
1032 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
1033 | 1033 | } |
1034 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
1034 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
1035 | 1035 | if ($daemon == 'daemon') { |
1036 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
1036 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
1037 | 1037 | } else { |
1038 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
1038 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
1039 | 1039 | } |
1040 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
1040 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
1041 | 1041 | if ($schedules == 'schedules') { |
1042 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
1042 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
1043 | 1043 | } else { |
1044 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
1044 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
1045 | 1045 | } |
1046 | 1046 | |
1047 | 1047 | /* |
@@ -1052,132 +1052,132 @@ discard block |
||
1052 | 1052 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
1053 | 1053 | } |
1054 | 1054 | */ |
1055 | - $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
|
1056 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1057 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1058 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1059 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1055 | + $settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); |
|
1056 | + if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); |
|
1057 | + else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); |
|
1058 | + if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); |
|
1059 | + else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); |
|
1060 | 1060 | if ($globalivao == 'ivao') { |
1061 | 1061 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
1062 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
1063 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1062 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
1063 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
1064 | 1064 | if ($globalvatsim == 'vatsim') { |
1065 | 1065 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
1066 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
1067 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1066 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
1067 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
1068 | 1068 | if ($globalphpvms == 'phpvms') { |
1069 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
1070 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1069 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
1070 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
1071 | 1071 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
1072 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
1073 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1072 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
1073 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
1074 | 1074 | |
1075 | 1075 | |
1076 | 1076 | |
1077 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
1077 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
1078 | 1078 | if ($notam == 'notam') { |
1079 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
1079 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
1080 | 1080 | } else { |
1081 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
1081 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
1082 | 1082 | } |
1083 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
1083 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
1084 | 1084 | if ($owner == 'owner') { |
1085 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
1085 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
1086 | 1086 | } else { |
1087 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
1087 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
1088 | 1088 | } |
1089 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
1089 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
1090 | 1090 | if ($translate == 'translate') { |
1091 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
1091 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
1092 | 1092 | } else { |
1093 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
1093 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
1094 | 1094 | } |
1095 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
1095 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
1096 | 1096 | if ($estimation == 'estimation') { |
1097 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
1097 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
1098 | 1098 | } else { |
1099 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
1099 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
1100 | 1100 | } |
1101 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
1101 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
1102 | 1102 | if ($metar == 'metar') { |
1103 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
1103 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
1104 | 1104 | } else { |
1105 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
1105 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
1106 | 1106 | } |
1107 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
1107 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
1108 | 1108 | if ($metarcycle == 'metarcycle') { |
1109 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
1109 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
1110 | 1110 | } else { |
1111 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
1111 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
1112 | 1112 | } |
1113 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
1113 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
1114 | 1114 | if ($fork == 'fork') { |
1115 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
1115 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
1116 | 1116 | } else { |
1117 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
1117 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
1118 | 1118 | } |
1119 | 1119 | |
1120 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
1120 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
1121 | 1121 | if ($colormap == 'colormap') { |
1122 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
1122 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
1123 | 1123 | } else { |
1124 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
1124 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
1125 | 1125 | } |
1126 | 1126 | |
1127 | 1127 | if (isset($_POST['aircrafticoncolor'])) { |
1128 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
1129 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
1128 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
1129 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
1130 | 1130 | } |
1131 | 1131 | |
1132 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
1133 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
1132 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
1133 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
1134 | 1134 | |
1135 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
1136 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
1137 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
1138 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
1139 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
1140 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
1135 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
1136 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
1137 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
1138 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
1139 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
1140 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
1141 | 1141 | |
1142 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
1142 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
1143 | 1143 | if ($mappopup == 'mappopup') { |
1144 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
1144 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
1145 | 1145 | } else { |
1146 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
1146 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
1147 | 1147 | } |
1148 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
1148 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
1149 | 1149 | if ($airportpopup == 'airportpopup') { |
1150 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
1150 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
1151 | 1151 | } else { |
1152 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
1152 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
1153 | 1153 | } |
1154 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
1154 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
1155 | 1155 | if ($maphistory == 'maphistory') { |
1156 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
1156 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
1157 | 1157 | } else { |
1158 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
1158 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
1159 | 1159 | } |
1160 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
1160 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
1161 | 1161 | if ($flightroute == 'flightroute') { |
1162 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
1162 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
1163 | 1163 | } else { |
1164 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
1164 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
1165 | 1165 | } |
1166 | 1166 | |
1167 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1167 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
1168 | 1168 | |
1169 | 1169 | // Set some defaults values... |
1170 | 1170 | if (!isset($globalAircraftImageSources)) { |
1171 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1172 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1171 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
1172 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1173 | 1173 | } |
1174 | 1174 | |
1175 | 1175 | if (!isset($globalSchedulesSources)) { |
1176 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1177 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1176 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
1177 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1178 | 1178 | } |
1179 | 1179 | |
1180 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
1180 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
1181 | 1181 | |
1182 | 1182 | if ($error == '') settings::modify_settings($settings); |
1183 | 1183 | if ($error == '') settings::comment_settings($settings_comment); |
@@ -117,44 +117,71 @@ 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="dbport">Database port</label> |
124 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
127 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
128 | + print $globalDBport; |
|
129 | +} |
|
130 | +?>" /> |
|
125 | 131 | </p> |
126 | 132 | <p> |
127 | 133 | <label for="dbname">Database name</label> |
128 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
134 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
135 | + print $globalDBname; |
|
136 | +} |
|
137 | +?>" /> |
|
129 | 138 | </p> |
130 | 139 | <p> |
131 | 140 | <label for="dbuser">Database user</label> |
132 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
141 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
142 | + print $globalDBuser; |
|
143 | +} |
|
144 | +?>" /> |
|
133 | 145 | </p> |
134 | 146 | <p> |
135 | 147 | <label for="dbuserpass">Database user password</label> |
136 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
148 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
149 | + print $globalDBpass; |
|
150 | +} |
|
151 | +?>" /> |
|
137 | 152 | </p> |
138 | 153 | </fieldset> |
139 | 154 | <fieldset> |
140 | 155 | <legend>Site configuration</legend> |
141 | 156 | <p> |
142 | 157 | <label for="sitename">Site name</label> |
143 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
158 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
159 | + print $globalName; |
|
160 | +} |
|
161 | +?>" /> |
|
144 | 162 | </p> |
145 | 163 | <p> |
146 | 164 | <label for="siteurl">Site directory</label> |
147 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
165 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
166 | + print $globalURL; |
|
167 | +} |
|
168 | +?>" /> |
|
148 | 169 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
149 | 170 | </p> |
150 | 171 | <p> |
151 | 172 | <label for="timezone">Timezone</label> |
152 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
173 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
174 | + print $globalTimezone; |
|
175 | +} |
|
176 | +?>" /> |
|
153 | 177 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
154 | 178 | </p> |
155 | 179 | <p> |
156 | 180 | <label for="language">Language</label> |
157 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
181 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
182 | + print $globalLanguage; |
|
183 | +} |
|
184 | +?>" /> |
|
158 | 185 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
159 | 186 | </p> |
160 | 187 | </fieldset> |
@@ -175,18 +202,27 @@ discard block |
||
175 | 202 | <div id="mapbox_data"> |
176 | 203 | <p> |
177 | 204 | <label for="mapboxid">Mapbox id</label> |
178 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
205 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
206 | + print $globalMapboxId; |
|
207 | +} |
|
208 | +?>" /> |
|
179 | 209 | </p> |
180 | 210 | <p> |
181 | 211 | <label for="mapboxtoken">Mapbox token</label> |
182 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
212 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
213 | + print $globalMapboxToken; |
|
214 | +} |
|
215 | +?>" /> |
|
183 | 216 | </p> |
184 | 217 | </div> |
185 | 218 | <br /> |
186 | 219 | <div id="google_data"> |
187 | 220 | <p> |
188 | 221 | <label for="googlekey">Google API key</label> |
189 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
222 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
223 | + print $globalGoogleAPIKey; |
|
224 | +} |
|
225 | +?>" /> |
|
190 | 226 | <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> |
191 | 227 | </p> |
192 | 228 | </div> |
@@ -194,7 +230,10 @@ discard block |
||
194 | 230 | <div id="bing_data"> |
195 | 231 | <p> |
196 | 232 | <label for="bingkey">Bing Map key</label> |
197 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
233 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
234 | + print $globalBingMapKey; |
|
235 | +} |
|
236 | +?>" /> |
|
198 | 237 | <p class="help-block">Get a key <a href="https://msdn.microsoft.com/en-us/library/ff428642.aspx">here</a></p> |
199 | 238 | </p> |
200 | 239 | </div> |
@@ -202,7 +241,10 @@ discard block |
||
202 | 241 | <div id="mapquest_data"> |
203 | 242 | <p> |
204 | 243 | <label for="mapquestkey">MapQuest key</label> |
205 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
244 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
245 | + print $globalMapQuestKey; |
|
246 | +} |
|
247 | +?>" /> |
|
206 | 248 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
207 | 249 | </p> |
208 | 250 | </div> |
@@ -210,11 +252,17 @@ discard block |
||
210 | 252 | <div id="here_data"> |
211 | 253 | <p> |
212 | 254 | <label for="hereappid">Here App_Id</label> |
213 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
255 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
256 | + print $globalHereappId; |
|
257 | +} |
|
258 | +?>" /> |
|
214 | 259 | </p> |
215 | 260 | <p> |
216 | 261 | <label for="hereappcode">Here App_Code</label> |
217 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
262 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
263 | + print $globalHereappCode; |
|
264 | +} |
|
265 | +?>" /> |
|
218 | 266 | </p> |
219 | 267 | <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> |
220 | 268 | </div> |
@@ -223,42 +271,86 @@ discard block |
||
223 | 271 | <legend>Coverage area</legend> |
224 | 272 | <p> |
225 | 273 | <label for="latitudemax">The maximum latitude (north)</label> |
226 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
274 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
275 | + print $globalLatitudeMax; |
|
276 | +} |
|
277 | +?>" /> |
|
227 | 278 | </p> |
228 | 279 | <p> |
229 | 280 | <label for="latitudemin">The minimum latitude (south)</label> |
230 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
281 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
282 | + print $globalLatitudeMin; |
|
283 | +} |
|
284 | +?>" /> |
|
231 | 285 | </p> |
232 | 286 | <p> |
233 | 287 | <label for="longitudemax">The maximum longitude (west)</label> |
234 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
288 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
289 | + print $globalLongitudeMax; |
|
290 | +} |
|
291 | +?>" /> |
|
235 | 292 | </p> |
236 | 293 | <p> |
237 | 294 | <label for="longitudemin">The minimum longitude (east)</label> |
238 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
295 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
296 | + print $globalLongitudeMin; |
|
297 | +} |
|
298 | +?>" /> |
|
239 | 299 | </p> |
240 | 300 | <p> |
241 | 301 | <label for="latitudecenter">The latitude center</label> |
242 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
302 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
303 | + print $globalCenterLatitude; |
|
304 | +} |
|
305 | +?>" /> |
|
243 | 306 | </p> |
244 | 307 | <p> |
245 | 308 | <label for="longitudecenter">The longitude center</label> |
246 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
309 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
310 | + print $globalCenterLongitude; |
|
311 | +} |
|
312 | +?>" /> |
|
247 | 313 | </p> |
248 | 314 | <p> |
249 | 315 | <label for="livezoom">Default Zoom on live map</label> |
250 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
316 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
317 | + print $globalLiveZoom; |
|
318 | +} else { |
|
319 | + print '9'; |
|
320 | +} |
|
321 | +?>" /> |
|
251 | 322 | </p> |
252 | 323 | <p> |
253 | 324 | <label for="squawk_country">Country for squawk usage</label> |
254 | 325 | <select name="squawk_country" id="squawk_country"> |
255 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
256 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
257 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
258 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
259 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
260 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
261 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
326 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
327 | + print ' selected '; |
|
328 | +} |
|
329 | +?>>UK</option> |
|
330 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
331 | + print ' selected '; |
|
332 | +} |
|
333 | +?>>NZ</option> |
|
334 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
335 | + print ' selected '; |
|
336 | +} |
|
337 | +?>>US</option> |
|
338 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
339 | + print ' selected '; |
|
340 | +} |
|
341 | +?>>AU</option> |
|
342 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
343 | + print ' selected '; |
|
344 | +} |
|
345 | +?>>NL</option> |
|
346 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
347 | + print ' selected '; |
|
348 | +} |
|
349 | +?>>FR</option> |
|
350 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
351 | + print ' selected '; |
|
352 | +} |
|
353 | +?>>TR</option> |
|
262 | 354 | </select> |
263 | 355 | </p> |
264 | 356 | </fieldset> |
@@ -267,15 +359,24 @@ discard block |
||
267 | 359 | <p><i>Only put in DB flights that are inside a circle</i></p> |
268 | 360 | <p> |
269 | 361 | <label for="latitude">Center latitude</label> |
270 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
362 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
363 | + echo $globalDistanceIgnore['latitude']; |
|
364 | +} |
|
365 | +?>" /> |
|
271 | 366 | </p> |
272 | 367 | <p> |
273 | 368 | <label for="longitude">Center longitude</label> |
274 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
369 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
370 | + echo $globalDistanceIgnore['longitude']; |
|
371 | +} |
|
372 | +?>" /> |
|
275 | 373 | </p> |
276 | 374 | <p> |
277 | 375 | <label for="Distance">Distance (in km)</label> |
278 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
376 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
377 | + echo $globalDistanceIgnore['distance']; |
|
378 | +} |
|
379 | +?>" /> |
|
279 | 380 | </p> |
280 | 381 | </fieldset> |
281 | 382 | <fieldset> |
@@ -364,11 +465,17 @@ discard block |
||
364 | 465 | <div id="flightaware_data"> |
365 | 466 | <p> |
366 | 467 | <label for="flightawareusername">FlightAware username</label> |
367 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
468 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
469 | + print $globalFlightAwareUsername; |
|
470 | +} |
|
471 | +?>" /> |
|
368 | 472 | </p> |
369 | 473 | <p> |
370 | 474 | <label for="flightawarepassword">FlightAware password/API key</label> |
371 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
475 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
476 | + print $globalFlightAwarePassword; |
|
477 | +} |
|
478 | +?>" /> |
|
372 | 479 | </p> |
373 | 480 | </div> |
374 | 481 | --> |
@@ -521,20 +628,56 @@ discard block |
||
521 | 628 | ?> |
522 | 629 | <td> |
523 | 630 | <select name="format[]" id="format"> |
524 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
525 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
526 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
527 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
528 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
529 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
530 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
531 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server</option> |
|
532 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
533 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
631 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
632 | + print 'selected'; |
|
633 | +} |
|
634 | +?>>Auto</option> |
|
635 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
636 | + print 'selected'; |
|
637 | +} |
|
638 | +?>>SBS</option> |
|
639 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
640 | + print 'selected'; |
|
641 | +} |
|
642 | +?>>TSV</option> |
|
643 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
644 | + print 'selected'; |
|
645 | +} |
|
646 | +?>>Raw</option> |
|
647 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
648 | + print 'selected'; |
|
649 | +} |
|
650 | +?>>APRS</option> |
|
651 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
652 | + print 'selected'; |
|
653 | +} |
|
654 | +?>>Radarcape deltadb.txt</option> |
|
655 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
656 | + print 'selected'; |
|
657 | +} |
|
658 | +?>>Vatsim</option> |
|
659 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
660 | + print 'selected'; |
|
661 | +} |
|
662 | +?>>Virtual Radar Server</option> |
|
663 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
664 | + print 'selected'; |
|
665 | +} |
|
666 | +?>>phpVMS</option> |
|
667 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
668 | + print 'selected'; |
|
669 | +} |
|
670 | +?>>IVAO</option> |
|
534 | 671 | </select> |
535 | 672 | </td> |
536 | - <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /></td> |
|
537 | - <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> |
|
673 | + <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
674 | + print $source['name']; |
|
675 | +} |
|
676 | +?>" /></td> |
|
677 | + <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']) { |
|
678 | + print 'checked'; |
|
679 | +} |
|
680 | +?> /></td> |
|
538 | 681 | <td><input type="button" id="delhost" value="Delete" onclick="deleteRow(this)" /> <input type="button" id="addhost" value="Add" onclick="insRow()" /></td> |
539 | 682 | </tr> |
540 | 683 | <?php |
@@ -573,11 +716,17 @@ discard block |
||
573 | 716 | <p>Listen UDP server for acarsdec/acarsdeco2/...</p> |
574 | 717 | <p> |
575 | 718 | <label for="acarshost">ACARS UDP host</label> |
576 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
719 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
720 | + print $globalACARSHost; |
|
721 | +} |
|
722 | +?>" /> |
|
577 | 723 | </p> |
578 | 724 | <p> |
579 | 725 | <label for="acarsport">ACARS UDP port</label> |
580 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
726 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
727 | + print $globalACARSPort; |
|
728 | +} |
|
729 | +?>" /> |
|
581 | 730 | </p> |
582 | 731 | </fieldset> |
583 | 732 | </div> |
@@ -631,12 +780,18 @@ discard block |
||
631 | 780 | <div id="schedules_options"> |
632 | 781 | <p> |
633 | 782 | <label for="britishairways">British Airways API Key</label> |
634 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
783 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
784 | + print $globalBritishAirwaysKey; |
|
785 | +} |
|
786 | +?>" /> |
|
635 | 787 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
636 | 788 | </p> |
637 | 789 | <p> |
638 | 790 | <label for="transavia">Transavia Test API Consumer Key</label> |
639 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
791 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
792 | + print $globalTransaviaKey; |
|
793 | +} |
|
794 | +?>" /> |
|
640 | 795 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
641 | 796 | </p> |
642 | 797 | <p> |
@@ -644,10 +799,16 @@ discard block |
||
644 | 799 | <b>Lufthansa API Key</b> |
645 | 800 | <p> |
646 | 801 | <label for="lufthansakey">Key</label> |
647 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
802 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
803 | + print $globalLufthansaKey['key']; |
|
804 | +} |
|
805 | +?>" /> |
|
648 | 806 | </p><p> |
649 | 807 | <label for="lufthansasecret">Secret</label> |
650 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
808 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
809 | + print $globalLufthansaKey['secret']; |
|
810 | +} |
|
811 | +?>" /> |
|
651 | 812 | </p> |
652 | 813 | </div> |
653 | 814 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -667,7 +828,10 @@ discard block |
||
667 | 828 | </p> |
668 | 829 | <p> |
669 | 830 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
670 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
831 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
832 | + print $globalNOTAMSource; |
|
833 | +} |
|
834 | +?>" /> |
|
671 | 835 | </p> |
672 | 836 | <br /> |
673 | 837 | <p> |
@@ -682,14 +846,20 @@ discard block |
||
682 | 846 | <div id="metarsrc"> |
683 | 847 | <p> |
684 | 848 | <label for="metarsource">URL of your METAR source</label> |
685 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
849 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
850 | + print $globalMETARurl; |
|
851 | +} |
|
852 | +?>" /> |
|
686 | 853 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
687 | 854 | </p> |
688 | 855 | </div> |
689 | 856 | <br /> |
690 | 857 | <p> |
691 | 858 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
692 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
859 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
860 | + print $globalBitlyAccessToken; |
|
861 | +} |
|
862 | +?>" /> |
|
693 | 863 | </p> |
694 | 864 | <br /> |
695 | 865 | <p> |
@@ -703,7 +873,12 @@ discard block |
||
703 | 873 | </p> |
704 | 874 | <p> |
705 | 875 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
706 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" /> |
|
876 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
877 | + print $globalArchiveMonths; |
|
878 | +} else { |
|
879 | + echo '0'; |
|
880 | +} |
|
881 | +?>" /> |
|
707 | 882 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
708 | 883 | </p> |
709 | 884 | <p> |
@@ -713,12 +888,22 @@ discard block |
||
713 | 888 | </p> |
714 | 889 | <p> |
715 | 890 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
716 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" /> |
|
891 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
892 | + print $globalArchiveKeepMonths; |
|
893 | +} else { |
|
894 | + echo '0'; |
|
895 | +} |
|
896 | +?>" /> |
|
717 | 897 | <p class="help-block">0 to disable</p> |
718 | 898 | </p> |
719 | 899 | <p> |
720 | 900 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
721 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" /> |
|
901 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
902 | + print $globalArchiveKeepTrackMonths; |
|
903 | +} else { |
|
904 | + echo '0'; |
|
905 | +} |
|
906 | +?>" /> |
|
722 | 907 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
723 | 908 | </p> |
724 | 909 | <br /> |
@@ -727,7 +912,12 @@ discard block |
||
727 | 912 | <input type="checkbox" name="daemon" id="daemon" value="daemon"<?php if ((isset($globalDaemon) && $globalDaemon) || !isset($globalDaemon)) { ?> checked="checked"<?php } ?> onClick="daemon_js()" /> |
728 | 913 | <div id="cronends"> |
729 | 914 | <label for="cronend">Run script for xx seconds</label> |
730 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
915 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
916 | + print $globalCronEnd; |
|
917 | +} else { |
|
918 | + print '0'; |
|
919 | +} |
|
920 | +?>" /> |
|
731 | 921 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
732 | 922 | </div> |
733 | 923 | <p class="help-block">Uncheck if the script is running as cron job</p> |
@@ -768,26 +958,49 @@ discard block |
||
768 | 958 | <br /> |
769 | 959 | <p> |
770 | 960 | <label for="refresh">Show flights detected since xxx seconds</label> |
771 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
961 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
962 | + echo $globalLiveInterval; |
|
963 | +} else { |
|
964 | + echo '200'; |
|
965 | +} |
|
966 | +?>" /> |
|
772 | 967 | </p> |
773 | 968 | <p> |
774 | 969 | <label for="maprefresh">Live map refresh (in seconds)</label> |
775 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
970 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
971 | + echo $globalMapRefresh; |
|
972 | +} else { |
|
973 | + echo '30'; |
|
974 | +} |
|
975 | +?>" /> |
|
776 | 976 | </p> |
777 | 977 | <p> |
778 | 978 | <label for="mapidle">Map idle timeout (in minutes)</label> |
779 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
979 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
980 | + echo $globalMapIdleTimeout; |
|
981 | +} else { |
|
982 | + echo '30'; |
|
983 | +} |
|
984 | +?>" /> |
|
780 | 985 | <p class="help-block">0 to disable</p> |
781 | 986 | </p> |
782 | 987 | <br /> |
783 | 988 | <p> |
784 | 989 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
785 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
990 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
991 | + echo $globalClosestMinDist; |
|
992 | +} else { |
|
993 | + echo '50'; |
|
994 | +} |
|
995 | +?>" /> |
|
786 | 996 | </p> |
787 | 997 | <br /> |
788 | 998 | <p> |
789 | 999 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
790 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
1000 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
1001 | + echo $globalAircraftSize; |
|
1002 | +} |
|
1003 | +?>" /> |
|
791 | 1004 | </p> |
792 | 1005 | <br /> |
793 | 1006 | <p> |
@@ -795,7 +1008,12 @@ discard block |
||
795 | 1008 | if (extension_loaded('gd') && function_exists('gd_info')) { |
796 | 1009 | ?> |
797 | 1010 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
798 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
1011 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
1012 | + echo $globalAircraftIconColor; |
|
1013 | +} else { |
|
1014 | + echo '1a3151'; |
|
1015 | +} |
|
1016 | +?>" /> |
|
799 | 1017 | <?php |
800 | 1018 | if (!is_writable('../cache')) { |
801 | 1019 | ?> |
@@ -813,8 +1031,18 @@ discard block |
||
813 | 1031 | <p> |
814 | 1032 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
815 | 1033 | <div class="range"> |
816 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
817 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
1034 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
1035 | + echo $globalAirportZoom; |
|
1036 | +} else { |
|
1037 | + echo '7'; |
|
1038 | +} |
|
1039 | +?>" /> |
|
1040 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
1041 | + echo $globalAirportZoom; |
|
1042 | +} else { |
|
1043 | + echo '7'; |
|
1044 | +} |
|
1045 | +?></output> |
|
818 | 1046 | </div> |
819 | 1047 | </p> |
820 | 1048 | </fieldset> |
@@ -842,8 +1070,12 @@ discard block |
||
842 | 1070 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
843 | 1071 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
844 | 1072 | |
845 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
846 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1073 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
1074 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
1075 | + } |
|
1076 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
1077 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1078 | + } |
|
847 | 1079 | |
848 | 1080 | $_SESSION['database_root'] = $dbroot; |
849 | 1081 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -910,15 +1142,23 @@ discard block |
||
910 | 1142 | $source_city = $_POST['source_city']; |
911 | 1143 | $source_country = $_POST['source_country']; |
912 | 1144 | $source_ref = $_POST['source_ref']; |
913 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
914 | - else $source_id = array(); |
|
1145 | + if (isset($source_id)) { |
|
1146 | + $source_id = $_POST['source_id']; |
|
1147 | + } else { |
|
1148 | + $source_id = array(); |
|
1149 | + } |
|
915 | 1150 | |
916 | 1151 | $sources = array(); |
917 | 1152 | foreach ($source_name as $keys => $name) { |
918 | - 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]); |
|
919 | - 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]); |
|
1153 | + if (isset($source_id[$keys])) { |
|
1154 | + $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]); |
|
1155 | + } else { |
|
1156 | + $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]); |
|
1157 | + } |
|
1158 | + } |
|
1159 | + if (count($sources) > 0) { |
|
1160 | + $_SESSION['sources'] = $sources; |
|
920 | 1161 | } |
921 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
922 | 1162 | |
923 | 1163 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
924 | 1164 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -958,9 +1198,14 @@ discard block |
||
958 | 1198 | $sourcestats = $_POST['sourcestats']; |
959 | 1199 | $gSources = array(); |
960 | 1200 | foreach ($host as $key => $h) { |
961 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
962 | - else $cov = 'FALSE'; |
|
963 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
1201 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
1202 | + $cov = 'TRUE'; |
|
1203 | + } else { |
|
1204 | + $cov = 'FALSE'; |
|
1205 | + } |
|
1206 | + if ($h != '') { |
|
1207 | + $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
1208 | + } |
|
964 | 1209 | } |
965 | 1210 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
966 | 1211 | |
@@ -984,7 +1229,9 @@ discard block |
||
984 | 1229 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
985 | 1230 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
986 | 1231 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
987 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1232 | + } else { |
|
1233 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1234 | + } |
|
988 | 1235 | |
989 | 1236 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
990 | 1237 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1023,7 +1270,9 @@ discard block |
||
1023 | 1270 | |
1024 | 1271 | // Create in settings.php keys not yet configurable if not already here |
1025 | 1272 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1026 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1273 | + if (!isset($globalDebug)) { |
|
1274 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1275 | + } |
|
1027 | 1276 | |
1028 | 1277 | $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
1029 | 1278 | if ($archive == 'archive') { |
@@ -1053,24 +1302,38 @@ discard block |
||
1053 | 1302 | } |
1054 | 1303 | */ |
1055 | 1304 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
1056 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1057 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1058 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1059 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1305 | + if ($globalsbs == 'sbs') { |
|
1306 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1307 | + } else { |
|
1308 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1309 | + } |
|
1310 | + if ($globalaprs == 'aprs') { |
|
1311 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1312 | + } else { |
|
1313 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1314 | + } |
|
1060 | 1315 | if ($globalivao == 'ivao') { |
1061 | 1316 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
1062 | 1317 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
1063 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1318 | + } else { |
|
1319 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1320 | + } |
|
1064 | 1321 | if ($globalvatsim == 'vatsim') { |
1065 | 1322 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
1066 | 1323 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
1067 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1324 | + } else { |
|
1325 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1326 | + } |
|
1068 | 1327 | if ($globalphpvms == 'phpvms') { |
1069 | 1328 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
1070 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1329 | + } else { |
|
1330 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1331 | + } |
|
1071 | 1332 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
1072 | 1333 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
1073 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1334 | + } else { |
|
1335 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1336 | + } |
|
1074 | 1337 | |
1075 | 1338 | |
1076 | 1339 | |
@@ -1164,7 +1427,9 @@ discard block |
||
1164 | 1427 | $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
1165 | 1428 | } |
1166 | 1429 | |
1167 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1430 | + if (!isset($globalTransaction)) { |
|
1431 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1432 | + } |
|
1168 | 1433 | |
1169 | 1434 | // Set some defaults values... |
1170 | 1435 | if (!isset($globalAircraftImageSources)) { |
@@ -1179,15 +1444,23 @@ discard block |
||
1179 | 1444 | |
1180 | 1445 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1181 | 1446 | |
1182 | - if ($error == '') settings::modify_settings($settings); |
|
1183 | - if ($error == '') settings::comment_settings($settings_comment); |
|
1447 | + if ($error == '') { |
|
1448 | + settings::modify_settings($settings); |
|
1449 | + } |
|
1450 | + if ($error == '') { |
|
1451 | + settings::comment_settings($settings_comment); |
|
1452 | + } |
|
1184 | 1453 | if ($error != '') { |
1185 | 1454 | print '<div class="info column">'.$error.'</div>'; |
1186 | 1455 | require('../footer.php'); |
1187 | 1456 | exit; |
1188 | 1457 | } else { |
1189 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
1190 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
1458 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
1459 | + $_SESSION['waypoints'] = 1; |
|
1460 | + } |
|
1461 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
1462 | + $_SESSION['owner'] = 1; |
|
1463 | + } |
|
1191 | 1464 | if (isset($_POST['createdb'])) { |
1192 | 1465 | $_SESSION['install'] = 'database_create'; |
1193 | 1466 | } else { |
@@ -1216,12 +1489,16 @@ discard block |
||
1216 | 1489 | $pop = false; |
1217 | 1490 | foreach ($_SESSION['done'] as $done) { |
1218 | 1491 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
1219 | - if ($done == 'Create database') $pop = true; |
|
1492 | + if ($done == 'Create database') { |
|
1493 | + $pop = true; |
|
1494 | + } |
|
1220 | 1495 | } |
1221 | 1496 | if ($pop) { |
1222 | 1497 | sleep(5); |
1223 | 1498 | print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
1224 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1499 | + } else { |
|
1500 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1501 | + } |
|
1225 | 1502 | print '</div></ul>'; |
1226 | 1503 | print '<div id="error"></div>'; |
1227 | 1504 | /* foreach ($_SESSION['done'] as $done) { |
@@ -68,27 +68,27 @@ discard block |
||
68 | 68 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') { |
69 | 69 | if (update_schema::check_version(false) == '0') { |
70 | 70 | if ($globalDBdriver == 'mysql') { |
71 | - $error .= create_db::import_all_db('../db/'); |
|
71 | + $error .= create_db::import_all_db('../db/'); |
|
72 | 72 | } elseif ($globalDBdriver == 'pgsql') { |
73 | - $error .= create_db::import_all_db('../db/pgsql/'); |
|
73 | + $error .= create_db::import_all_db('../db/pgsql/'); |
|
74 | 74 | } |
75 | 75 | if ($error != '') { |
76 | - $_SESSION['error'] = $error; |
|
76 | + $_SESSION['error'] = $error; |
|
77 | 77 | } |
78 | 78 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
79 | 79 | if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
80 | 80 | $_SESSION['install'] = 'populate'; |
81 | 81 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B'; |
82 | 82 | } else { |
83 | - $_SESSION['install'] = 'sources'; |
|
84 | - $_SESSION['next'] = 'Insert data in source table'; |
|
83 | + $_SESSION['install'] = 'sources'; |
|
84 | + $_SESSION['next'] = 'Insert data in source table'; |
|
85 | 85 | } |
86 | 86 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
87 | 87 | print json_encode($result); |
88 | 88 | } else { |
89 | 89 | $error .= update_schema::check_version(true); |
90 | 90 | if ($error != '') { |
91 | - $_SESSION['error'] = $error; |
|
91 | + $_SESSION['error'] = $error; |
|
92 | 92 | } |
93 | 93 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
94 | 94 | $_SESSION['install'] = 'sources'; |
@@ -118,25 +118,25 @@ discard block |
||
118 | 118 | $error .= update_db::update_countries(); |
119 | 119 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
120 | 120 | if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
121 | - $_SESSION['install'] = 'notam'; |
|
122 | - $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
|
123 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
124 | - print json_encode($result); |
|
121 | + $_SESSION['install'] = 'notam'; |
|
122 | + $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
|
123 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
124 | + print json_encode($result); |
|
125 | 125 | } elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
126 | - $_SESSION['install'] = 'owner'; |
|
127 | - $_SESSION['next'] = 'Populate owner table with externals data'; |
|
128 | - unset($_SESSION['owner']); |
|
129 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
130 | - print json_encode($result); |
|
126 | + $_SESSION['install'] = 'owner'; |
|
127 | + $_SESSION['next'] = 'Populate owner table with externals data'; |
|
128 | + unset($_SESSION['owner']); |
|
129 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
130 | + print json_encode($result); |
|
131 | 131 | } else { |
132 | - $_SESSION['install'] = 'sources'; |
|
133 | - $_SESSION['next'] = 'Insert data in source table'; |
|
134 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
135 | - print json_encode($result); |
|
132 | + $_SESSION['install'] = 'sources'; |
|
133 | + $_SESSION['next'] = 'Insert data in source table'; |
|
134 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
135 | + print json_encode($result); |
|
136 | 136 | } |
137 | 137 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') { |
138 | 138 | if (!is_writable('tmp')) { |
139 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
139 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
140 | 140 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
141 | 141 | print json_encode($result); |
142 | 142 | } else { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') { |
154 | 154 | if (!is_writable('tmp')) { |
155 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
155 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
156 | 156 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
157 | 157 | print json_encode($result); |
158 | 158 | } else { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') { |
187 | 187 | if (!is_writable('tmp')) { |
188 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
188 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
189 | 189 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
190 | 190 | print json_encode($result); |
191 | 191 | } else { |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') { |
202 | 202 | if (!is_writable('tmp')) { |
203 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
203 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
204 | 204 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
205 | 205 | print json_encode($result); |
206 | 206 | } else { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') { |
231 | 231 | if (!is_writable('tmp')) { |
232 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
232 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
233 | 233 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
234 | 234 | print json_encode($result); |
235 | 235 | } else { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') { |
246 | 246 | if (!is_writable('tmp')) { |
247 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
247 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
248 | 248 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
249 | 249 | print json_encode($result); |
250 | 250 | } else { |
@@ -296,17 +296,17 @@ discard block |
||
296 | 296 | */ |
297 | 297 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'sources') { |
298 | 298 | if (isset($_SESSION['sources']) && count($_SESSION['sources']) > 0) { |
299 | - $sources = $_SESSION['sources']; |
|
299 | + $sources = $_SESSION['sources']; |
|
300 | 300 | |
301 | - include_once('../require/class.Source.php'); |
|
302 | - $globalDebug = FALSE; |
|
303 | - $Source = new Source(); |
|
304 | - $Source->deleteAllLocation(); |
|
305 | - foreach ($sources as $src) { |
|
301 | + include_once('../require/class.Source.php'); |
|
302 | + $globalDebug = FALSE; |
|
303 | + $Source = new Source(); |
|
304 | + $Source->deleteAllLocation(); |
|
305 | + foreach ($sources as $src) { |
|
306 | 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'); |
307 | - } |
|
308 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
309 | - unset($_SESSION['sources']); |
|
307 | + } |
|
308 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
309 | + unset($_SESSION['sources']); |
|
310 | 310 | } |
311 | 311 | /* |
312 | 312 | if (isset($globalIVAO) && $globalIVAO) $_SESSION['install'] = 'ivao'; |
@@ -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'; |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_create') { |
69 | 69 | $dbroot = $_SESSION['database_root']; |
70 | 70 | $dbrootpass = $_SESSION['database_rootpass']; |
71 | - $error .= create_db::create_database($dbroot,$dbrootpass,$globalDBuser,$globalDBpass,$globalDBname,$globalDBdriver,$globalDBhost); |
|
71 | + $error .= create_db::create_database($dbroot, $dbrootpass, $globalDBuser, $globalDBpass, $globalDBname, $globalDBdriver, $globalDBhost); |
|
72 | 72 | if ($error != '') { |
73 | 73 | $_SESSION['error'] = $error; |
74 | 74 | } |
75 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Create database')); |
|
75 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Create database')); |
|
76 | 76 | $_SESSION['install'] = 'database_import'; |
77 | 77 | $_SESSION['next'] = 'Create and import tables'; |
78 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
78 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
79 | 79 | print json_encode($result); |
80 | 80 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') { |
81 | 81 | if (update_schema::check_version(false) == '0') { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if ($error != '') { |
88 | 88 | $_SESSION['error'] = $error; |
89 | 89 | } |
90 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
|
90 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Create and import tables')); |
|
91 | 91 | if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
92 | 92 | $_SESSION['install'] = 'populate'; |
93 | 93 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B'; |
@@ -95,84 +95,84 @@ discard block |
||
95 | 95 | $_SESSION['install'] = 'sources'; |
96 | 96 | $_SESSION['next'] = 'Insert data in source table'; |
97 | 97 | } |
98 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
98 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
99 | 99 | print json_encode($result); |
100 | 100 | } else { |
101 | 101 | $error .= update_schema::check_version(true); |
102 | 102 | if ($error != '') { |
103 | 103 | $_SESSION['error'] = $error; |
104 | 104 | } |
105 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
|
105 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Update schema if needed')); |
|
106 | 106 | $_SESSION['install'] = 'sources'; |
107 | 107 | $_SESSION['next'] = 'Insert data in source table'; |
108 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
108 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
109 | 109 | print json_encode($result); |
110 | 110 | } |
111 | 111 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'waypoints') { |
112 | 112 | include_once('class.update_db.php'); |
113 | 113 | $error .= update_db::update_waypoints(); |
114 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate waypoints database')); |
|
114 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate waypoints database')); |
|
115 | 115 | |
116 | 116 | $_SESSION['install'] = 'airspace'; |
117 | 117 | $_SESSION['next'] = 'Populate airspace table'; |
118 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
118 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
119 | 119 | print json_encode($result); |
120 | 120 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'airspace') { |
121 | 121 | include_once('class.update_db.php'); |
122 | 122 | $error .= update_db::update_airspace(); |
123 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate airspace database')); |
|
123 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate airspace database')); |
|
124 | 124 | $_SESSION['install'] = 'countries'; |
125 | 125 | $_SESSION['next'] = 'Populate countries table'; |
126 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
126 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
127 | 127 | print json_encode($result); |
128 | 128 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'countries') { |
129 | 129 | include_once('class.update_db.php'); |
130 | 130 | $error .= update_db::update_countries(); |
131 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
|
131 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate countries database')); |
|
132 | 132 | if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
133 | 133 | $_SESSION['install'] = 'notam'; |
134 | 134 | $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
135 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
135 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
136 | 136 | print json_encode($result); |
137 | 137 | } elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
138 | 138 | $_SESSION['install'] = 'owner'; |
139 | 139 | $_SESSION['next'] = 'Populate owner table with externals data'; |
140 | 140 | unset($_SESSION['owner']); |
141 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
141 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
142 | 142 | print json_encode($result); |
143 | 143 | } else { |
144 | 144 | $_SESSION['install'] = 'sources'; |
145 | 145 | $_SESSION['next'] = 'Insert data in source table'; |
146 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
146 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
147 | 147 | print json_encode($result); |
148 | 148 | } |
149 | 149 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') { |
150 | 150 | if (!is_writable('tmp')) { |
151 | 151 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
152 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
152 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
153 | 153 | print json_encode($result); |
154 | 154 | } else { |
155 | 155 | include_once('class.update_db.php'); |
156 | 156 | $globalDebug = FALSE; |
157 | 157 | $error .= update_db::update_ModeS(); |
158 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for ADS-B')); |
|
158 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for ADS-B')); |
|
159 | 159 | |
160 | 160 | $_SESSION['install'] = 'populate_flarm'; |
161 | 161 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for FLARM'; |
162 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
162 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
163 | 163 | print json_encode($result); |
164 | 164 | } |
165 | 165 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') { |
166 | 166 | if (!is_writable('tmp')) { |
167 | 167 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
168 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
168 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
169 | 169 | print json_encode($result); |
170 | 170 | } else { |
171 | 171 | include_once('class.update_db.php'); |
172 | 172 | $globalDebug = FALSE; |
173 | 173 | $error .= update_db::update_ModeS_flarm(); |
174 | 174 | $error .= update_db::update_ModeS_ogn(); |
175 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for FLARM')); |
|
175 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for FLARM')); |
|
176 | 176 | |
177 | 177 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
178 | 178 | $_SESSION['install'] = 'vatsim'; |
@@ -192,34 +192,34 @@ discard block |
||
192 | 192 | $_SESSION['install'] = 'routes'; |
193 | 193 | $_SESSION['next'] = 'Populate routes table with externals data'; |
194 | 194 | } |
195 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
195 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
196 | 196 | print json_encode($result); |
197 | 197 | } |
198 | 198 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') { |
199 | 199 | if (!is_writable('tmp')) { |
200 | 200 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
201 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
201 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
202 | 202 | print json_encode($result); |
203 | 203 | } else { |
204 | 204 | include_once('class.update_db.php'); |
205 | 205 | $globalDebug = FALSE; |
206 | 206 | $error .= update_db::update_routes(); |
207 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate routes table with externals data')); |
|
207 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate routes table with externals data')); |
|
208 | 208 | $_SESSION['install'] = 'translation'; |
209 | 209 | $_SESSION['next'] = 'Populate translation table with externals data'; |
210 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
210 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
211 | 211 | print json_encode($result); |
212 | 212 | } |
213 | 213 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') { |
214 | 214 | if (!is_writable('tmp')) { |
215 | 215 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
216 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
216 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
217 | 217 | print json_encode($result); |
218 | 218 | } else { |
219 | 219 | include_once('class.update_db.php'); |
220 | 220 | $globalDebug = FALSE; |
221 | 221 | $error .= update_db::update_translation(); |
222 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate translation table with externals data')); |
|
222 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate translation table with externals data')); |
|
223 | 223 | |
224 | 224 | if ($_SESSION['waypoints'] == 1) { |
225 | 225 | $_SESSION['install'] = 'waypoints'; |
@@ -236,48 +236,48 @@ discard block |
||
236 | 236 | $_SESSION['install'] = 'sources'; |
237 | 237 | $_SESSION['next'] = 'Insert data in source table'; |
238 | 238 | } |
239 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
239 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
240 | 240 | print json_encode($result); |
241 | 241 | } |
242 | 242 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') { |
243 | 243 | if (!is_writable('tmp')) { |
244 | 244 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
245 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
245 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
246 | 246 | print json_encode($result); |
247 | 247 | } else { |
248 | 248 | include_once('class.update_db.php'); |
249 | 249 | $globalDebug = FALSE; |
250 | 250 | $error = update_db::update_owner(); |
251 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate owner table with externals data')); |
|
251 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate owner table with externals data')); |
|
252 | 252 | $_SESSION['install'] = 'sources'; |
253 | 253 | $_SESSION['next'] = 'Insert data in source table'; |
254 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
254 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
255 | 255 | print json_encode($result); |
256 | 256 | } |
257 | 257 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') { |
258 | 258 | if (!is_writable('tmp')) { |
259 | 259 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
260 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
260 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
261 | 261 | print json_encode($result); |
262 | 262 | } else { |
263 | 263 | include_once('class.update_db.php'); |
264 | 264 | $globalDebug = FALSE; |
265 | 265 | if (isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
266 | 266 | $error .= update_db::update_notam(); |
267 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data')); |
|
267 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data')); |
|
268 | 268 | } else { |
269 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data (no source defined)')); |
|
269 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data (no source defined)')); |
|
270 | 270 | } |
271 | 271 | if (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
272 | 272 | $_SESSION['install'] = 'owner'; |
273 | 273 | $_SESSION['next'] = 'Populate owner table'; |
274 | 274 | unset($_SESSION['owner']); |
275 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
275 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
276 | 276 | print json_encode($result); |
277 | 277 | } else { |
278 | 278 | $_SESSION['install'] = 'sources'; |
279 | 279 | $_SESSION['next'] = 'Insert data in source table'; |
280 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
280 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
281 | 281 | print json_encode($result); |
282 | 282 | } |
283 | 283 | } |
@@ -315,9 +315,9 @@ discard block |
||
315 | 315 | $Source = new Source(); |
316 | 316 | $Source->deleteAllLocation(); |
317 | 317 | foreach ($sources as $src) { |
318 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
318 | + if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'], $src['latitude'], $src['longitude'], $src['altitude'], $src['city'], $src['country'], $src['source'], 'antenna.png'); |
|
319 | 319 | } |
320 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
320 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert data in source table')); |
|
321 | 321 | unset($_SESSION['sources']); |
322 | 322 | } |
323 | 323 | /* |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $_SESSION['install'] = 'finish'; |
343 | 343 | $_SESSION['next'] = 'finish'; |
344 | 344 | } |
345 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
345 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
346 | 346 | print json_encode($result); |
347 | 347 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'vatsim') { |
348 | 348 | include_once('../install/class.create_db.php'); |
@@ -352,36 +352,36 @@ discard block |
||
352 | 352 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
353 | 353 | if (file_exists('tmp/ivae_feb2013.zip')) { |
354 | 354 | $error .= update_db::update_IVAO(); |
355 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
355 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data')); |
|
356 | 356 | } else { |
357 | 357 | $error .= update_db::update_vatsim(); |
358 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
358 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data')); |
|
359 | 359 | } |
360 | 360 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
361 | 361 | $error .= update_db::update_vatsim(); |
362 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
362 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data')); |
|
363 | 363 | } elseif (isset($globalIVAO) && $globalIVAO) { |
364 | 364 | if (file_exists('tmp/ivae_feb2013.zip')) { |
365 | 365 | $error .= update_db::update_IVAO(); |
366 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
366 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data')); |
|
367 | 367 | } else { |
368 | 368 | $error .= update_db::update_vatsim(); |
369 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data (IVAO not found)')); |
|
369 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data (IVAO not found)')); |
|
370 | 370 | } |
371 | 371 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
372 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert phpVMS data')); |
|
372 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert phpVMS data')); |
|
373 | 373 | } |
374 | 374 | //$_SESSION['install'] = 'routes'; |
375 | 375 | //$_SESSION['next'] = 'Populate routes table with externals data'; |
376 | 376 | $_SESSION['install'] = 'finish'; |
377 | 377 | $_SESSION['next'] = 'finish'; |
378 | 378 | |
379 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
379 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
380 | 380 | print json_encode($result); |
381 | 381 | } else { |
382 | 382 | //unset($_SESSION['install']); |
383 | 383 | $_SESSION['error'] = 'Unknwon task : '.$_SESSION['install']; |
384 | - $result = array('error' => 'Unknwon task : '.$_SESSION['install'],'done' => $_SESSION['done'],'next' => 'finish','install' => 'finish'); |
|
384 | + $result = array('error' => 'Unknwon task : '.$_SESSION['install'], 'done' => $_SESSION['done'], 'next' => 'finish', 'install' => 'finish'); |
|
385 | 385 | print json_encode($result); |
386 | 386 | } |
387 | 387 | ?> |
388 | 388 | \ No newline at end of file |
@@ -4,13 +4,13 @@ |
||
4 | 4 | * This Script will try to find all real arrival airports for all flights in DB |
5 | 5 | * |
6 | 6 | */ |
7 | - require_once('../require/settings.php'); |
|
8 | - if ($globalInstalled) { |
|
9 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
10 | - exit; |
|
11 | - } |
|
12 | - require('../require/class.Spotter.php'); |
|
13 | - $Spotter = new Spotter(); |
|
14 | - $Spotter->updateArrivalAirports(); |
|
7 | + require_once('../require/settings.php'); |
|
8 | + if ($globalInstalled) { |
|
9 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
10 | + exit; |
|
11 | + } |
|
12 | + require('../require/class.Spotter.php'); |
|
13 | + $Spotter = new Spotter(); |
|
14 | + $Spotter->updateArrivalAirports(); |
|
15 | 15 | |
16 | 16 | ?> |
17 | 17 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $Common = new Common(); |
13 | 13 | $settings_filename = '../require/settings.php'; |
14 | 14 | $content = file_get_contents($settings_filename); |
15 | - $fh = fopen($settings_filename,'w'); |
|
15 | + $fh = fopen($settings_filename, 'w'); |
|
16 | 16 | foreach ($settings as $settingname => $value) { |
17 | 17 | if ($value == 'TRUE' || $value == 'FALSE') { |
18 | 18 | $pattern = '/\R\$'.$settingname." = ".'(TRUE|FALSE)'."/"; |
@@ -78,21 +78,21 @@ discard block |
||
78 | 78 | $replace = "\n".'\$'.$settingname." = '".$value."'"; |
79 | 79 | } |
80 | 80 | $rep_cnt = 0; |
81 | - $content = preg_replace($pattern,$replace,$content,1,$rep_cnt); |
|
81 | + $content = preg_replace($pattern, $replace, $content, 1, $rep_cnt); |
|
82 | 82 | |
83 | 83 | /// If setting was a string and is now an array |
84 | 84 | if ($rep_cnt == 0 && is_array($value)) { |
85 | 85 | $pattern = '/\R\$'.$settingname." = '".'(.*)'."'/"; |
86 | - $content = preg_replace($pattern,$replace,$content,1,$rep_cnt); |
|
86 | + $content = preg_replace($pattern, $replace, $content, 1, $rep_cnt); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | // If setting is not in settings.php (for update) |
90 | 90 | if ($rep_cnt == 0) { |
91 | - $content = preg_replace('/\?>/',$replace.";\n?>",$content,1,$rep_cnt); |
|
91 | + $content = preg_replace('/\?>/', $replace.";\n?>", $content, 1, $rep_cnt); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | } |
95 | - fwrite($fh,$content); |
|
95 | + fwrite($fh, $content); |
|
96 | 96 | fclose($fh); |
97 | 97 | } |
98 | 98 | |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | $Common = new Common(); |
105 | 105 | $settings_filename = '../require/settings.php'; |
106 | 106 | $content = file_get_contents($settings_filename); |
107 | - $fh = fopen($settings_filename,'w'); |
|
107 | + $fh = fopen($settings_filename, 'w'); |
|
108 | 108 | foreach ($settings as $settingname) { |
109 | 109 | $pattern = '/\R\$'.$settingname." = /"; |
110 | 110 | $replace = '//$'.$settingname." = "; |
111 | - $content = preg_replace($pattern,$replace,$content); |
|
111 | + $content = preg_replace($pattern, $replace, $content); |
|
112 | 112 | } |
113 | - fwrite($fh,$content); |
|
113 | + fwrite($fh, $content); |
|
114 | 114 | fclose($fh); |
115 | 115 | } |
116 | 116 | } |
@@ -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 { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $metar_info = $METAR->getMETAR($airport_icao); |
47 | 47 | //print_r($metar_info); |
48 | 48 | if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
49 | - //print_r($metar_parse); |
|
49 | + //print_r($metar_parse); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | function drawChart6() { |
100 | 100 | var data = google.visualization.arrayToDataTable([ |
101 | 101 | ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], '; |
102 | - $airport_data = ''; |
|
103 | - foreach($all_data as $data) |
|
104 | - { |
|
105 | - $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],'; |
|
106 | - } |
|
107 | - $airport_data = substr($airport_data, 0, -1); |
|
108 | - print $airport_data.']); |
|
102 | + $airport_data = ''; |
|
103 | + foreach($all_data as $data) |
|
104 | + { |
|
105 | + $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],'; |
|
106 | + } |
|
107 | + $airport_data = substr($airport_data, 0, -1); |
|
108 | + print $airport_data.']); |
|
109 | 109 | |
110 | 110 | var options = { |
111 | 111 | legend: {position: "none"}, |
@@ -5,17 +5,17 @@ discard block |
||
5 | 5 | require_once('require/class.Stats.php'); |
6 | 6 | require_once('require/class.METAR.php'); |
7 | 7 | |
8 | -if (!isset($_GET['airport'])){ |
|
8 | +if (!isset($_GET['airport'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/airport'); |
10 | 10 | } else { |
11 | 11 | $Spotter = new Spotter(); |
12 | 12 | //calculuation for the pagination |
13 | - if(!isset($_GET['limit'])) |
|
13 | + if (!isset($_GET['limit'])) |
|
14 | 14 | { |
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]; |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | $limit_next = $limit_end + $absolute_difference; |
29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
31 | - $airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
31 | + $airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/airport/'.$airport_icao; |
33 | 33 | |
34 | 34 | if (isset($_GET['sort'])) { |
35 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $_GET['sort']); |
|
35 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $_GET['sort']); |
|
36 | 36 | } else { |
37 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, ''); |
|
37 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, ''); |
|
38 | 38 | } |
39 | 39 | $airport_array = $Spotter->getAllAirportInfo($airport_icao); |
40 | 40 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | //print_r($metar_parse); |
50 | 50 | } |
51 | 51 | |
52 | - $title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
52 | + $title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
53 | 53 | |
54 | 54 | require_once('header.php'); |
55 | 55 | print '<div class="select-item">'; |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | print '<option></option>'; |
59 | 59 | $airport_names = $Spotter->getAllAirportNames(); |
60 | 60 | ksort($airport_names); |
61 | - foreach($airport_names as $airport_name) |
|
61 | + foreach ($airport_names as $airport_name) |
|
62 | 62 | { |
63 | - if($airport_icao == $airport_name['airport_icao']) |
|
63 | + if ($airport_icao == $airport_name['airport_icao']) |
|
64 | 64 | { |
65 | 65 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
66 | 66 | } else { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | var data = google.visualization.arrayToDataTable([ |
101 | 101 | ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], '; |
102 | 102 | $airport_data = ''; |
103 | - foreach($all_data as $data) |
|
103 | + foreach ($all_data as $data) |
|
104 | 104 | { |
105 | 105 | $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],'; |
106 | 106 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | print _("Dew point:").' '.$metar_parse['dew'].' °C'." - "; |
154 | 154 | } |
155 | 155 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
156 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
156 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
157 | 157 | print _("Humidity:").' '.$humidity.'%'." - "; |
158 | 158 | } |
159 | 159 | if (isset($metar_parse['QNH'])) { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | print '<div class="table column">'; |
170 | 170 | if ($airport_array[0]['iata'] != "NA") |
171 | 171 | { |
172 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
172 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
173 | 173 | } |
174 | 174 | include('table-output.php'); |
175 | 175 | print '<div class="pagination">'; |
@@ -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,7 @@ discard block |
||
23 | 23 | ["'._("Month").'", "'._("# of Flights").'"], '; |
24 | 24 | |
25 | 25 | $date_data = ''; |
26 | -foreach($date_array as $date_item) |
|
26 | +foreach ($date_array as $date_item) |
|
27 | 27 | { |
28 | 28 | $date_data .= '[ "'.date("F j, Y", strtotime($date_item['date_name'])).'",'.$date_item['date_count'].'],'; |
29 | 29 | } |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | print '</thead>'; |
61 | 61 | print '<tbody>'; |
62 | 62 | $i = 1; |
63 | - foreach($date_array as $date_item) |
|
63 | + foreach ($date_array as $date_item) |
|
64 | 64 | { |
65 | 65 | print '<tr>'; |
66 | 66 | print '<td><strong>'.$i.'</strong></td>'; |
67 | 67 | print '<td>'; |
68 | - print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
68 | + print '<a href="'.$globalURL.'/date/'.date('Y-m-d', strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
69 | 69 | print '</td>'; |
70 | 70 | print '<td>'; |
71 | 71 | print $date_item['date_count']; |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | require_once('require/class.Language.php'); |
10 | 10 | |
11 | 11 | $Spotter = new Spotter(); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
15 | 15 | } else $spotter_array = array(); |
16 | 16 | |
17 | 17 | if (!empty($spotter_array)) |
18 | 18 | { |
19 | - $title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
19 | + $title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
20 | 20 | require_once('header.php'); |
21 | 21 | print '<div class="info column">'; |
22 | 22 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | include('route-sub-menu.php'); |
28 | 28 | print '<div class="column">'; |
29 | 29 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
30 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>'; |
|
30 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>'; |
|
31 | 31 | |
32 | 32 | $hour_array = $Spotter->countAllHoursByRoute($_GET['departure_airport'], $_GET['arrival_airport']); |
33 | 33 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | var data = google.visualization.arrayToDataTable([ |
40 | 40 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
41 | 41 | $hour_data = ''; |
42 | - foreach($hour_array as $hour_item) |
|
42 | + foreach ($hour_array as $hour_item) |
|
43 | 43 | { |
44 | 44 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
45 | 45 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | function drawChart() { |
35 | 35 | var data = google.visualization.arrayToDataTable([ |
36 | 36 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
37 | - $hour_data = ''; |
|
37 | + $hour_data = ''; |
|
38 | 38 | foreach($hour_array as $hour_item) |
39 | 39 | { |
40 | 40 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
@@ -12,7 +12,9 @@ |
||
12 | 12 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
13 | 13 | if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
15 | -} else $spotter_array = array(); |
|
15 | +} else { |
|
16 | + $spotter_array = array(); |
|
17 | +} |
|
16 | 18 | |
17 | 19 | if (!empty($spotter_array)) |
18 | 20 | { |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Departure Airports of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Departure Airports of %s"), $spotter_array[0]['ident']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('ident-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | $airport_airport_array = $Spotter->countAllDepartureAirportsByIdent($ident); |
29 | 29 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
30 | 30 | <script> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ["'._("Airport").'", "'._("# of times").'"],'; |
40 | 40 | |
41 | 41 | $airport_data = ''; |
42 | - foreach($airport_airport_array as $airport_item) |
|
42 | + foreach ($airport_airport_array as $airport_item) |
|
43 | 43 | { |
44 | 44 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
45 | 45 | $name = str_replace("'", "", $name); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | print '</thead>'; |
79 | 79 | print '<tbody>'; |
80 | 80 | $i = 1; |
81 | - foreach($airport_airport_array as $airport_item) |
|
81 | + foreach ($airport_airport_array as $airport_item) |
|
82 | 82 | { |
83 | 83 | print '<tr>'; |
84 | 84 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['ident'])) { |
6 | - header('Location: '.$globalURL.'/ident'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/ident'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |