@@ -3,10 +3,10 @@ discard block |
||
| 3 | 3 | </span> |
| 4 | 4 | <div class="sub-menu sub-menu-container"> |
| 5 | 5 | <ul class="nav nav-pills"> |
| 6 | - <li><a href="<?php print $globalURL; ?>/aircraft/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
| 7 | - <li><a href="<?php print $globalURL; ?>/aircraft/statistics/registration/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-registration"){ print 'class="active"'; } ?>><?php echo _("Registration"); ?></a></li> |
|
| 6 | + <li><a href="<?php print $globalURL; ?>/aircraft/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-detailed") { print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
| 7 | + <li><a href="<?php print $globalURL; ?>/aircraft/statistics/registration/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-registration") { print 'class="active"'; } ?>><?php echo _("Registration"); ?></a></li> |
|
| 8 | 8 | <li class="dropdown"> |
| 9 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "aircraft-statistics-airline" || strtolower($current_page) == "aircraft-statistics-airline-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 9 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "aircraft-statistics-airline" || strtolower($current_page) == "aircraft-statistics-airline-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 10 | 10 | <?php echo _("Airline"); ?> <span class="caret"></span> |
| 11 | 11 | </a> |
| 12 | 12 | <ul class="dropdown-menu" role="menu"> |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | </ul> |
| 16 | 16 | </li> |
| 17 | 17 | <li class="dropdown"> |
| 18 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "aircraft-statistics-departure-airport" || strtolower($current_page) == "aircraft-statistics-departure-airport-country" || strtolower($current_page) == "aircraft-statistics-arrival-airport" || strtolower($current_page) == "aircraft-statistics-arrival-airport-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 18 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "aircraft-statistics-departure-airport" || strtolower($current_page) == "aircraft-statistics-departure-airport-country" || strtolower($current_page) == "aircraft-statistics-arrival-airport" || strtolower($current_page) == "aircraft-statistics-arrival-airport-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
| 19 | 19 | <?php echo _("Airport"); ?> <span class="caret"></span> |
| 20 | 20 | </a> |
| 21 | 21 | <ul class="dropdown-menu" role="menu"> |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | <li><a href="<?php print $globalURL; ?>/aircraft/statistics/arrival-airport-country/<?php print $_GET['aircraft_type']; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
| 26 | 26 | </ul> |
| 27 | 27 | </li> |
| 28 | - <li><a href="<?php print $globalURL; ?>/aircraft/statistics/route/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> |
|
| 29 | - <li><a href="<?php print $globalURL; ?>/aircraft/statistics/time/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-time"){ print 'class="active"'; } ?>><?php echo ("Time"); ?></a></li> |
|
| 28 | + <li><a href="<?php print $globalURL; ?>/aircraft/statistics/route/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-route") { print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> |
|
| 29 | + <li><a href="<?php print $globalURL; ?>/aircraft/statistics/time/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-time") { print 'class="active"'; } ?>><?php echo ("Time"); ?></a></li> |
|
| 30 | 30 | </ul> |
| 31 | 31 | </div> |
| 32 | 32 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | function drawChart() { |
| 36 | 36 | var data = google.visualization.arrayToDataTable([ |
| 37 | 37 | ["'._("Country").'", "'._("# of times").'"], '; |
| 38 | - $country_data = ''; |
|
| 38 | + $country_data = ''; |
|
| 39 | 39 | foreach($airline_array as $airline_item) |
| 40 | 40 | { |
| 41 | 41 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
@@ -8,12 +8,12 @@ discard block |
||
| 8 | 8 | require_once('require/class.Spotter.php'); |
| 9 | 9 | require_once('require/class.Language.php'); |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 12 | 12 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
| 13 | 13 | |
| 14 | 14 | if (!empty($spotter_array)) |
| 15 | 15 | { |
| 16 | - $title = sprintf(_("Most Common Airlines by Country 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']); |
|
| 16 | + $title = sprintf(_("Most Common Airlines by Country 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']); |
|
| 17 | 17 | require_once('header.php'); |
| 18 | 18 | print '<div class="info column">'; |
| 19 | 19 | 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>'; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | include('route-sub-menu.php'); |
| 25 | 25 | print '<div class="column">'; |
| 26 | 26 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
| 27 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin 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>'; |
|
| 27 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin 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>'; |
|
| 28 | 28 | |
| 29 | 29 | $airline_array = $Spotter->countAllAirlineCountriesByRoute($_GET['departure_airport'], $_GET['arrival_airport']); |
| 30 | 30 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | var data = google.visualization.arrayToDataTable([ |
| 37 | 37 | ["'._("Country").'", "'._("# of times").'"], '; |
| 38 | 38 | $country_data = ''; |
| 39 | - foreach($airline_array as $airline_item) |
|
| 39 | + foreach ($airline_array as $airline_item) |
|
| 40 | 40 | { |
| 41 | 41 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
| 42 | 42 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | print '</thead>'; |
| 71 | 71 | print '<tbody>'; |
| 72 | 72 | $i = 1; |
| 73 | - foreach($airline_array as $airline_item) |
|
| 73 | + foreach ($airline_array as $airline_item) |
|
| 74 | 74 | { |
| 75 | 75 | print '<tr>'; |
| 76 | 76 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -1,30 +1,30 @@ |
||
| 1 | 1 | #!/usr/bin/php |
| 2 | 2 | <?php |
| 3 | - require_once('../require/settings.php'); |
|
| 4 | - if ($globalInstalled) { |
|
| 5 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
| 6 | - exit; |
|
| 7 | - } |
|
| 8 | - require('class.create_db.php'); |
|
| 9 | - echo "Create and import all tables..."; |
|
| 10 | - create_db::import_all_db('../db/'); |
|
| 11 | - echo "Done !\n"; |
|
| 3 | + require_once('../require/settings.php'); |
|
| 4 | + if ($globalInstalled) { |
|
| 5 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
| 6 | + exit; |
|
| 7 | + } |
|
| 8 | + require('class.create_db.php'); |
|
| 9 | + echo "Create and import all tables..."; |
|
| 10 | + create_db::import_all_db('../db/'); |
|
| 11 | + echo "Done !\n"; |
|
| 12 | 12 | |
| 13 | - require('class.update_db.php'); |
|
| 14 | - echo "Populate all tables...\n"; |
|
| 15 | - update_db::update_all(); |
|
| 16 | - echo "\nInstall waypoints...(VERY slow!)"; |
|
| 17 | - update_db::update_waypoints(); |
|
| 18 | - echo "Done !\n"; |
|
| 19 | - echo "Install airspace..."; |
|
| 20 | - update_db::update_airspace(); |
|
| 21 | - echo "Done !\n"; |
|
| 22 | - echo 'All is now installed ! Thanks'."\n"; |
|
| 23 | - if ($globalSBS1) { |
|
| 24 | - echo 'You need to run cron-sbs.php as a daemon. You can use init script in the install/init directory.'."\n"; |
|
| 25 | - } |
|
| 26 | - if ($globalACARS) { |
|
| 27 | - echo 'You need to run cron-acars.php as a daemon. You can use init script in the install/init directory.'."\n"; |
|
| 28 | - } |
|
| 13 | + require('class.update_db.php'); |
|
| 14 | + echo "Populate all tables...\n"; |
|
| 15 | + update_db::update_all(); |
|
| 16 | + echo "\nInstall waypoints...(VERY slow!)"; |
|
| 17 | + update_db::update_waypoints(); |
|
| 18 | + echo "Done !\n"; |
|
| 19 | + echo "Install airspace..."; |
|
| 20 | + update_db::update_airspace(); |
|
| 21 | + echo "Done !\n"; |
|
| 22 | + echo 'All is now installed ! Thanks'."\n"; |
|
| 23 | + if ($globalSBS1) { |
|
| 24 | + echo 'You need to run cron-sbs.php as a daemon. You can use init script in the install/init directory.'."\n"; |
|
| 25 | + } |
|
| 26 | + if ($globalACARS) { |
|
| 27 | + echo 'You need to run cron-acars.php as a daemon. You can use init script in the install/init directory.'."\n"; |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | 30 | ?> |
| 31 | 31 | \ No newline at end of file |
@@ -1,23 +1,23 @@ |
||
| 1 | 1 | #!/usr/bin/php |
| 2 | 2 | <?php |
| 3 | - require_once('../require/settings.php'); |
|
| 4 | - if ($globalInstalled) { |
|
| 5 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
| 6 | - exit; |
|
| 7 | - } |
|
| 8 | - require('class.update_db.php'); |
|
| 9 | - if (isset($globalVATSIM) && $globalVATSIM) { |
|
| 3 | + require_once('../require/settings.php'); |
|
| 4 | + if ($globalInstalled) { |
|
| 5 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
| 6 | + exit; |
|
| 7 | + } |
|
| 8 | + require('class.update_db.php'); |
|
| 9 | + if (isset($globalVATSIM) && $globalVATSIM) { |
|
| 10 | 10 | echo "Install VATSIM airlines..."; |
| 11 | 11 | update_db::update_vatsim(); |
| 12 | 12 | echo "Done !\n"; |
| 13 | - } |
|
| 14 | - if (isset($globalIVAO) && $globalIVAO) { |
|
| 13 | + } |
|
| 14 | + if (isset($globalIVAO) && $globalIVAO) { |
|
| 15 | 15 | if (!file_exists('tmp/ivae_feb2013.zip')) { |
| 16 | 16 | echo "You have to download the file ivae_feb2013.zip from https://www.ivao.aero/softdev/mirrors.asp?software=IvAeDataUp and put it in install/tmp directory"; |
| 17 | 17 | } else { |
| 18 | - echo "Install IVAO airlines and logos..."; |
|
| 19 | - update_db::update_IVAO(); |
|
| 18 | + echo "Install IVAO airlines and logos..."; |
|
| 19 | + update_db::update_IVAO(); |
|
| 20 | 20 | echo "Done !\n"; |
| 21 | 21 | } |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | ?> |
| 24 | 24 | \ No newline at end of file |
@@ -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 | |
@@ -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 | } |
@@ -54,7 +54,9 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | if (!isset($array_value)) { |
| 57 | - if (!isset($arrayd_value)) $arrayd_value = ''; |
|
| 57 | + if (!isset($arrayd_value)) { |
|
| 58 | + $arrayd_value = ''; |
|
| 59 | + } |
|
| 58 | 60 | //$array_value = "'".$key."' => array(".$arrayd_value.")"; |
| 59 | 61 | $array_value = "array(".$arrayd_value.")"; |
| 60 | 62 | } elseif (isset($arrayd_value)) { |
@@ -71,7 +73,9 @@ discard block |
||
| 71 | 73 | } |
| 72 | 74 | } |
| 73 | 75 | } |
| 74 | - if (!isset($array_value)) $array_value = ''; |
|
| 76 | + if (!isset($array_value)) { |
|
| 77 | + $array_value = ''; |
|
| 78 | + } |
|
| 75 | 79 | $replace = "\n".'\$'.$settingname." = array(".$array_value.")"; |
| 76 | 80 | unset($array_value); |
| 77 | 81 | } else { |
@@ -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 | |
@@ -59,7 +61,9 @@ discard block |
||
| 59 | 61 | print '<option></option>'; |
| 60 | 62 | $Stats = new Stats(); |
| 61 | 63 | $airport_names = $Stats->getAllAirportNames(); |
| 62 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
| 64 | + if (empty($airport_names)) { |
|
| 65 | + $airport_names = $Spotter->getAllAirportNames(); |
|
| 66 | + } |
|
| 63 | 67 | ksort($airport_names); |
| 64 | 68 | foreach($airport_names as $airport_name) |
| 65 | 69 | { |
@@ -100,7 +104,9 @@ discard block |
||
| 100 | 104 | $all_data = $Stats->getLast7DaysAirports($airport_icao); |
| 101 | 105 | if (isset($globalTimezone)) { |
| 102 | 106 | date_default_timezone_set($globalTimezone); |
| 103 | - } else date_default_timezone_set('UTC'); |
|
| 107 | + } else { |
|
| 108 | + date_default_timezone_set('UTC'); |
|
| 109 | + } |
|
| 104 | 110 | if (count($all_data) > 0) { |
| 105 | 111 | print '<div id="chart6" class="chart" width="100%"></div> |
| 106 | 112 | <script> |