@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $limit_start = 0; |
| 14 | 14 | $limit_end = 25; |
| 15 | 15 | $absolute_difference = 25; |
| 16 | - } else { |
|
| 16 | + } else { |
|
| 17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
| 18 | 18 | $limit_start = $limit_explode[0]; |
| 19 | 19 | $limit_end = $limit_explode[1]; |
@@ -7,15 +7,15 @@ discard block |
||
| 7 | 7 | if (isset($_POST['airport'])) |
| 8 | 8 | { |
| 9 | 9 | header('Location: '.$globalURL.'/airport/'.$_POST['airport']); |
| 10 | -} else if (isset($_GET['airport'])){ |
|
| 10 | +} else if (isset($_GET['airport'])) { |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | 12 | //calculuation for the pagination |
| 13 | - if($_GET['limit'] == "") |
|
| 13 | + if ($_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]; |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | $limit_previous_1 = $limit_start - $absolute_difference; |
| 30 | 30 | $limit_previous_2 = $limit_end - $absolute_difference; |
| 31 | 31 | |
| 32 | - $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 33 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 32 | + $airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 33 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 34 | 34 | $page_url = $globalURL.'/airport/'.$airport; |
| 35 | - $spotter_array = $Spotter->getSpotterDataByAirport($airport,$limit_start.",".$absolute_difference, $sort); |
|
| 35 | + $spotter_array = $Spotter->getSpotterDataByAirport($airport, $limit_start.",".$absolute_difference, $sort); |
|
| 36 | 36 | $airport_array = $Spotter->getAllAirportInfo($airport); |
| 37 | 37 | |
| 38 | 38 | if (!empty($airport_array)) |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | $airport_names = $Spotter->getAllAirportNames(); |
| 52 | 52 | } |
| 53 | 53 | ksort($airport_names); |
| 54 | - foreach($airport_names as $airport_name) |
|
| 54 | + foreach ($airport_names as $airport_name) |
|
| 55 | 55 | { |
| 56 | - if($airport == $airport_name['airport_icao']) |
|
| 56 | + if ($airport == $airport_name['airport_icao']) |
|
| 57 | 57 | { |
| 58 | 58 | 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>'; |
| 59 | 59 | } else { |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | print '<div class="table column">'; |
| 87 | 87 | if ($airport_array[0]['iata'] != "NA") |
| 88 | 88 | { |
| 89 | - print '<p>'.sprintf(_("The table below shows the route(s) aircrafts have used to/from <strong>%s</strong>, sorted by the most recent one."),$airport_array[0]['name']).'</p>'; |
|
| 89 | + print '<p>'.sprintf(_("The table below shows the route(s) aircrafts have used to/from <strong>%s</strong>, sorted by the most recent one."), $airport_array[0]['name']).'</p>'; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | include('table-output.php'); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | print '<p>'._("Sorry, the airport does not exist in this database. :(").'</p>'; |
| 109 | 109 | } |
| 110 | 110 | } else { |
| 111 | - $Spotter= new Spotter(); |
|
| 111 | + $Spotter = new Spotter(); |
|
| 112 | 112 | $Stats = new Stats(); |
| 113 | 113 | $title = _("Airports"); |
| 114 | 114 | require_once('header.php'); |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | ksort($airport_names); |
| 122 | 122 | $previous = null; |
| 123 | 123 | print '<div class="alphabet-legend">'; |
| 124 | - foreach($airport_names as $value) { |
|
| 124 | + foreach ($airport_names as $value) { |
|
| 125 | 125 | $firstLetter = mb_strtoupper(mb_substr($value['airport_city'], 0, 1)); |
| 126 | - if($previous !== $firstLetter) |
|
| 126 | + if ($previous !== $firstLetter) |
|
| 127 | 127 | { |
| 128 | - if ($previous !== null){ |
|
| 128 | + if ($previous !== null) { |
|
| 129 | 129 | print ' | '; |
| 130 | 130 | } |
| 131 | 131 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | print '</div>'; |
| 136 | 136 | $previous = null; |
| 137 | - foreach($airport_names as $value) { |
|
| 137 | + foreach ($airport_names as $value) { |
|
| 138 | 138 | $firstLetter = mb_strtoupper(mb_substr($value['airport_city'], 0, 1)); |
| 139 | 139 | if ($firstLetter != "") |
| 140 | 140 | { |
| 141 | - if($previous !== $firstLetter) |
|
| 141 | + if ($previous !== $firstLetter) |
|
| 142 | 142 | { |
| 143 | - if ($previous !== null){ |
|
| 143 | + if ($previous !== null) { |
|
| 144 | 144 | print '</div>'; |
| 145 | 145 | } |
| 146 | 146 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
@@ -9,14 +9,14 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | $from_archive = false; |
| 11 | 11 | if (isset($_GET['ident'])) { |
| 12 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 12 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 13 | 13 | if (isset($_GET['currenttime'])) { |
| 14 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
| 14 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
| 15 | 15 | $currenttime = round($currenttime/1000); |
| 16 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident,$currenttime); |
|
| 16 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataByIdent($ident, $currenttime); |
|
| 17 | 17 | if (empty($spotter_array)) { |
| 18 | 18 | $from_archive = true; |
| 19 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident,$currenttime); |
|
| 19 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataByIdent($ident, $currenttime); |
|
| 20 | 20 | } |
| 21 | 21 | } else { |
| 22 | 22 | $spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident); |
@@ -27,15 +27,15 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | if (isset($_GET['flightaware_id'])) { |
| 30 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
| 30 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
| 31 | 31 | if (isset($_GET['currenttime'])) { |
| 32 | - $currenttime = filter_input(INPUT_GET,'currenttime',FILTER_SANITIZE_NUMBER_INT); |
|
| 32 | + $currenttime = filter_input(INPUT_GET, 'currenttime', FILTER_SANITIZE_NUMBER_INT); |
|
| 33 | 33 | $currenttime = round($currenttime/1000); |
| 34 | - $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id,$currenttime); |
|
| 34 | + $spotter_array = $SpotterLive->getDateLiveSpotterDataById($flightaware_id, $currenttime); |
|
| 35 | 35 | if (empty($spotter_array)) { |
| 36 | 36 | $from_archive = true; |
| 37 | 37 | // $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id); |
| 38 | - $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id,$currenttime); |
|
| 38 | + $spotter_array = $SpotterArchive->getDateArchiveSpotterDataById($flightaware_id, $currenttime); |
|
| 39 | 39 | } |
| 40 | 40 | } else { |
| 41 | 41 | $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "") |
| 55 | 55 | { |
| 56 | 56 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 57 | - $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
| 57 | + $image = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
| 58 | 58 | } else $image = $spotter_item['image_thumbnail']; |
| 59 | 59 | |
| 60 | 60 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
| 73 | 73 | if (isset($spotter_item['departure_airport_time'])) { |
| 74 | 74 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 75 | - print '<br /><span class="time">'.date('H:m',$spotter_item['departure_airport_time']).'</span>'; |
|
| 75 | + print '<br /><span class="time">'.date('H:m', $spotter_item['departure_airport_time']).'</span>'; |
|
| 76 | 76 | } else { |
| 77 | 77 | print '<br /><span class="time">'.$spotter_item['departure_airport_time'].'</span>'; |
| 78 | 78 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country']; |
| 82 | 82 | if (isset($spotter_item['arrival_airport_time'])) { |
| 83 | 83 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 84 | - print '<br /><span class="time">'.date('H:m',$spotter_item['arrival_airport_time']).'</span>'; |
|
| 84 | + print '<br /><span class="time">'.date('H:m', $spotter_item['arrival_airport_time']).'</span>'; |
|
| 85 | 85 | } else { |
| 86 | 86 | print '<br /><span class="time">'.$spotter_item['arrival_airport_time'].'</span>'; |
| 87 | 87 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | if (isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
| 151 | 151 | if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
| 152 | -if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 152 | +if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n", "\r", "\n", "\\r", "\\n", "\\r\\n"), '<br/>', $spotter_item['acars']['message'])).'</div>'; |
|
| 153 | 153 | if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
| 154 | 154 | print '</div>'; |
| 155 | 155 | ?> |
@@ -55,7 +55,9 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 57 | 57 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 58 | - } else $image = $spotter_item['image_thumbnail']; |
|
| 58 | + } else { |
|
| 59 | + $image = $spotter_item['image_thumbnail']; |
|
| 60 | + } |
|
| 59 | 61 | |
| 60 | 62 | } |
| 61 | 63 | /* else { |
@@ -67,7 +69,9 @@ discard block |
||
| 67 | 69 | print '<div class="left"><img src="'.$image.'" alt="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].'" title="'.$spotter_item['registration'].' '.$spotter_item['aircraft_name'].' Image © '.$spotter_item['image_copyright'].'"/><br />Image © '.$spotter_item['image_copyright'].'</div>'; |
| 68 | 70 | } |
| 69 | 71 | print '<div class="right"><div class="callsign-details"><div class="callsign"><a href="'.$globalURL.'/redirect/'.$spotter_item['flightaware_id'].'" target="_blank">'.$spotter_item['ident'].'</a></div>'; |
| 70 | -if (isset($spotter_item['airline_name'])) print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
| 72 | +if (isset($spotter_item['airline_name'])) { |
|
| 73 | + print '<div class="airline">'.$spotter_item['airline_name'].'</div>'; |
|
| 74 | +} |
|
| 71 | 75 | print '</div>'; |
| 72 | 76 | print '<div class="nomobile airports"><div class="airport"><span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'" target="_blank">'.$spotter_item['departure_airport'].'</a></span>'.$spotter_item['departure_airport_city'].' '.$spotter_item['departure_airport_country']; |
| 73 | 77 | if (isset($spotter_item['departure_airport_time'])) { |
@@ -95,9 +99,14 @@ discard block |
||
| 95 | 99 | print '<span class="code"><a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'" target="_blank">'.$spotter_item['arrival_airport'].'</a></span>'.$spotter_item['arrival_airport_city'].' '.$spotter_item['arrival_airport_country']; |
| 96 | 100 | print '</div></div><div>'; |
| 97 | 101 | print '<span>'._("Aircraft").'</span>'; |
| 98 | -if (isset($spotter_item['aircraft_wiki'])) print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
| 99 | -if (isset($spotter_item['aircraft_type'])) print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 100 | -else print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
| 102 | +if (isset($spotter_item['aircraft_wiki'])) { |
|
| 103 | + print '<a href="'.$spotter_item['aircraft_wiki'].'">'.$spotter_item['aircraft_name'].'</a>'; |
|
| 104 | +} |
|
| 105 | +if (isset($spotter_item['aircraft_type'])) { |
|
| 106 | + print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
|
| 107 | +} else { |
|
| 108 | + print $spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name']; |
|
| 109 | +} |
|
| 101 | 110 | print '</div>'; |
| 102 | 111 | print '<div><span>'._("Altitude").'</span>'; |
| 103 | 112 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
@@ -106,7 +115,9 @@ discard block |
||
| 106 | 115 | print round($spotter_item['altitude']*30.48).' m (FL'.$spotter_item['altitude'].')'; |
| 107 | 116 | } |
| 108 | 117 | print '</div>'; |
| 109 | -if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
| 118 | +if (isset($spotter_item['registration']) && $spotter_item['registration'] != '') { |
|
| 119 | + print '<div><span>'._("Registration").'</span><a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'" target="_blank">'.$spotter_item['registration'].'</a></div>'; |
|
| 120 | +} |
|
| 110 | 121 | print '<div><span>'._("Speed").'</span>'; |
| 111 | 122 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
| 112 | 123 | print round($spotter_item['ground_speed']*1.15078).' mph'; |
@@ -120,8 +131,11 @@ discard block |
||
| 120 | 131 | print '<div><span>'._("Heading").'</span>'.$spotter_item['heading'].'°</div>'; |
| 121 | 132 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != '') { |
| 122 | 133 | print '<div><span>'._("Pilot").'</span>'; |
| 123 | - if (isset($spotter_item['pilot_id'])) print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 124 | - else print $spotter_item['pilot_name']; |
|
| 134 | + if (isset($spotter_item['pilot_id'])) { |
|
| 135 | + print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
|
| 136 | + } else { |
|
| 137 | + print $spotter_item['pilot_name']; |
|
| 138 | + } |
|
| 125 | 139 | print '</div>'; |
| 126 | 140 | } |
| 127 | 141 | |
@@ -147,10 +161,18 @@ discard block |
||
| 147 | 161 | } |
| 148 | 162 | print '</div>'; |
| 149 | 163 | |
| 150 | -if (isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
| 151 | -if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
| 152 | -if (isset($spotter_item['acars']['message'])) print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 153 | -if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
| 164 | +if (isset($globalphpVMS) && $globalphpVMS && isset($globalVATSIM) && $globalVATSIM && isset($globalIVAO) && $globalIVAO && isset($spotter_item['format_source']) && $spotter_item['format_source'] != '' && $spotter_item['format_source'] != 'pireps') { |
|
| 165 | + print '<div class="waypoints"><span>'._("Source").'</span>'.$spotter_item['format_source'].'</div>'; |
|
| 166 | +} |
|
| 167 | +if (isset($spotter_item['waypoints']) && $spotter_item['waypoints'] != '') { |
|
| 168 | + print '<div class="waypoints"><span>'._("Route").'</span>'.$spotter_item['waypoints'].'</div>'; |
|
| 169 | +} |
|
| 170 | +if (isset($spotter_item['acars']['message'])) { |
|
| 171 | + print '<div class="acars"><span>'._("Latest ACARS message").'</span>'.trim(str_replace(array("\r\n","\r","\n","\\r","\\n","\\r\\n"),'<br/>',$spotter_item['acars']['message'])).'</div>'; |
|
| 172 | +} |
|
| 173 | +if (isset($spotter_item['squawk']) && $spotter_item['squawk'] != '' && $spotter_item['squawk'] != 0) { |
|
| 174 | + print '<div class="bottom">'._("Squawk:").' '.$spotter_item['squawk'].' - '.$spotter_item['squawk_usage'].'</div>'; |
|
| 175 | +} |
|
| 154 | 176 | print '</div>'; |
| 155 | 177 | ?> |
| 156 | 178 | </div> |
| 157 | 179 | \ No newline at end of file |
@@ -7,14 +7,14 @@ discard block |
||
| 7 | 7 | header('Location: '.$globalURL.'/airport'); |
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 10 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
| 13 | 13 | $airport_array = $Spotter->getAllAirportInfo($airport); |
| 14 | 14 | |
| 15 | 15 | if (!empty($airport_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Routes to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
| 17 | + $title = sprintf(_("Most Common Routes to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
| 18 | 18 | |
| 19 | 19 | require_once('header.php'); |
| 20 | 20 | print '<div class="select-item">'; |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
| 26 | 26 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
| 27 | 27 | ksort($airport_names); |
| 28 | - foreach($airport_names as $airport_name) |
|
| 28 | + foreach ($airport_names as $airport_name) |
|
| 29 | 29 | { |
| 30 | - if($airport == $airport_name['airport_icao']) |
|
| 30 | + if ($airport == $airport_name['airport_icao']) |
|
| 31 | 31 | { |
| 32 | 32 | 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>'; |
| 33 | 33 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | include('airport-sub-menu.php'); |
| 59 | 59 | print '<div class="column">'; |
| 60 | 60 | print '<h2>'._("Most Common Routes").'</h2>'; |
| 61 | - print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
| 61 | + print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
| 62 | 62 | |
| 63 | 63 | $route_array = $Spotter->countAllRoutesByAirport($airport); |
| 64 | 64 | if (!empty($route_array)) |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | print '</thead>'; |
| 75 | 75 | print '<tbody>'; |
| 76 | 76 | $i = 1; |
| 77 | - foreach($route_array as $route_item) |
|
| 77 | + foreach ($route_array as $route_item) |
|
| 78 | 78 | { |
| 79 | 79 | print '<tr>'; |
| 80 | 80 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airport'])) { |
| 7 | - header('Location: '.$globalURL.'/airport'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airport'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | print '<option></option>'; |
| 24 | 24 | $Stats = new Stats(); |
| 25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
| 26 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
| 26 | + if (empty($airport_names)) { |
|
| 27 | + $airport_names = $Spotter->getAllAirportNames(); |
|
| 28 | + } |
|
| 27 | 29 | ksort($airport_names); |
| 28 | 30 | foreach($airport_names as $airport_name) |
| 29 | 31 | { |
@@ -7,14 +7,14 @@ discard block |
||
| 7 | 7 | header('Location: '.$globalURL.'/airport'); |
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 10 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 11 | 11 | $Spotter = new Spotter(); |
| 12 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
| 13 | 13 | $airport_array = $Spotter->getAllAirportInfo($airport); |
| 14 | 14 | |
| 15 | 15 | if (!empty($airport_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Time of Day to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
| 17 | + $title = sprintf(_("Most Common Time of Day to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
| 18 | 18 | |
| 19 | 19 | require_once('header.php'); |
| 20 | 20 | print '<div class="select-item">'; |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
| 26 | 26 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
| 27 | 27 | ksort($airport_names); |
| 28 | - foreach($airport_names as $airport_name) |
|
| 28 | + foreach ($airport_names as $airport_name) |
|
| 29 | 29 | { |
| 30 | - if($airport == $airport_name['airport_icao']) |
|
| 30 | + if ($airport == $airport_name['airport_icao']) |
|
| 31 | 31 | { |
| 32 | 32 | 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>'; |
| 33 | 33 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | include('airport-sub-menu.php'); |
| 59 | 59 | print '<div class="column">'; |
| 60 | 60 | print '<h2>'._("Most Common Time of Day").'</h2>'; |
| 61 | - print '<p>'.sprintf(_("The statistic below shows the most common time of day to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
| 61 | + print '<p>'.sprintf(_("The statistic below shows the most common time of day to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
| 62 | 62 | |
| 63 | 63 | $hour_array = $Spotter->countAllHoursByAirport($airport); |
| 64 | 64 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | var data = google.visualization.arrayToDataTable([ |
| 71 | 71 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 72 | 72 | $hour_data = ''; |
| 73 | - foreach($hour_array as $hour_item) |
|
| 73 | + foreach ($hour_array as $hour_item) |
|
| 74 | 74 | { |
| 75 | 75 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
| 76 | 76 | } |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['airport'])) { |
| 7 | - header('Location: '.$globalURL.'/airport'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/airport'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | function drawChart() { |
| 70 | 70 | var data = google.visualization.arrayToDataTable([ |
| 71 | 71 | ["'._("Hour").'", "'._("# of Flights").'"], '; |
| 72 | - $hour_data = ''; |
|
| 72 | + $hour_data = ''; |
|
| 73 | 73 | foreach($hour_array as $hour_item) |
| 74 | 74 | { |
| 75 | 75 | $hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],'; |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | print '<option></option>'; |
| 24 | 24 | $Stats = new Stats(); |
| 25 | 25 | $airport_names = $Stats->getAllAirportNames(); |
| 26 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
| 26 | + if (empty($airport_names)) { |
|
| 27 | + $airport_names = $Spotter->getAllAirportNames(); |
|
| 28 | + } |
|
| 27 | 29 | ksort($airport_names); |
| 28 | 30 | foreach($airport_names as $airport_name) |
| 29 | 31 | { |
@@ -305,17 +305,17 @@ discard block |
||
| 305 | 305 | </tr> |
| 306 | 306 | <!-- |
| 307 | 307 | <?php |
| 308 | - require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
| 309 | - $Connection = new Connection(); |
|
| 308 | + require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
| 309 | + $Connection = new Connection(); |
|
| 310 | 310 | ?> |
| 311 | 311 | --> |
| 312 | 312 | <?php |
| 313 | - if ($Connection->db != NULL) { |
|
| 313 | + if ($Connection->db != NULL) { |
|
| 314 | 314 | if ($Connection->tableExists('source_location')) { |
| 315 | - require_once(dirname(__FILE__).'/../require/class.Source.php'); |
|
| 316 | - $Source = new Source(); |
|
| 317 | - $alllocations = $Source->getAllLocationInfo(); |
|
| 318 | - foreach ($alllocations as $location) { |
|
| 315 | + require_once(dirname(__FILE__).'/../require/class.Source.php'); |
|
| 316 | + $Source = new Source(); |
|
| 317 | + $alllocations = $Source->getAllLocationInfo(); |
|
| 318 | + foreach ($alllocations as $location) { |
|
| 319 | 319 | ?> |
| 320 | 320 | <tr> |
| 321 | 321 | <input type="hidden" name="source_id[]" value="<?php print $location['id']; ?>" /> |
@@ -329,9 +329,9 @@ discard block |
||
| 329 | 329 | </tr> |
| 330 | 330 | |
| 331 | 331 | <?php |
| 332 | - } |
|
| 332 | + } |
|
| 333 | + } |
|
| 333 | 334 | } |
| 334 | - } |
|
| 335 | 335 | ?> |
| 336 | 336 | |
| 337 | 337 | <tr> |
@@ -424,12 +424,12 @@ discard block |
||
| 424 | 424 | ?> |
| 425 | 425 | <tr> |
| 426 | 426 | <?php |
| 427 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
| 427 | + if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
| 428 | 428 | ?> |
| 429 | 429 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
| 430 | 430 | <td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td> |
| 431 | 431 | <?php |
| 432 | - } else { |
|
| 432 | + } else { |
|
| 433 | 433 | $hostport = explode(':',$source['host']); |
| 434 | 434 | if (isset($hostport[1])) { |
| 435 | 435 | $host = $hostport[0]; |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | <td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td> |
| 443 | 443 | <td><input type="number" name="port[]" id="port" value="<?php print $port; ?>" /></td> |
| 444 | 444 | <?php |
| 445 | - } |
|
| 445 | + } |
|
| 446 | 446 | ?> |
| 447 | 447 | <td> |
| 448 | 448 | <select name="format[]" id="format"> |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | <br /> |
| 759 | 759 | <p> |
| 760 | 760 | <?php |
| 761 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 761 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
| 762 | 762 | ?> |
| 763 | 763 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
| 764 | 764 | <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
@@ -768,11 +768,11 @@ discard block |
||
| 768 | 768 | <b>The directory cache is not writable, aircraft icon will not be cached</b> |
| 769 | 769 | <?php |
| 770 | 770 | } |
| 771 | - } else { |
|
| 771 | + } else { |
|
| 772 | 772 | ?> |
| 773 | 773 | <b>PHP GD is not installed, you can t change color of aircraft icon on map</b> |
| 774 | 774 | <?php |
| 775 | - } |
|
| 775 | + } |
|
| 776 | 776 | ?> |
| 777 | 777 | </p> |
| 778 | 778 | <br /> |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | </p> |
| 792 | 792 | <?php |
| 793 | 793 | require('../footer.php'); |
| 794 | - exit; |
|
| 794 | + exit; |
|
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | $settings = array(); |
@@ -881,8 +881,8 @@ discard block |
||
| 881 | 881 | |
| 882 | 882 | $sources = array(); |
| 883 | 883 | foreach ($source_name as $keys => $name) { |
| 884 | - 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]); |
|
| 885 | - 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]); |
|
| 884 | + 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]); |
|
| 885 | + 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]); |
|
| 886 | 886 | } |
| 887 | 887 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
| 888 | 888 | |
@@ -1176,14 +1176,14 @@ discard block |
||
| 1176 | 1176 | |
| 1177 | 1177 | // Set some defaults values... |
| 1178 | 1178 | if (!isset($globalAircraftImageSources)) { |
| 1179 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
| 1180 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
| 1179 | + $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
| 1180 | + $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
| 1181 | 1181 | } |
| 1182 | 1182 | |
| 1183 | 1183 | if (!isset($globalSchedulesSources)) { |
| 1184 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
| 1185 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
| 1186 | - } |
|
| 1184 | + $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
| 1185 | + $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
| 1186 | + } |
|
| 1187 | 1187 | |
| 1188 | 1188 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
| 1189 | 1189 | |
@@ -1235,21 +1235,21 @@ discard block |
||
| 1235 | 1235 | $popi = false; |
| 1236 | 1236 | $popw = false; |
| 1237 | 1237 | foreach ($_SESSION['done'] as $done) { |
| 1238 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
| 1239 | - if ($done == 'Create database') $pop = true; |
|
| 1240 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
| 1241 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
| 1242 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
| 1238 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
| 1239 | + if ($done == 'Create database') $pop = true; |
|
| 1240 | + if ($_SESSION['install'] == 'database_create') $pop = true; |
|
| 1241 | + if ($_SESSION['install'] == 'database_import') $popi = true; |
|
| 1242 | + if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
| 1243 | 1243 | } |
| 1244 | 1244 | if ($pop) { |
| 1245 | - sleep(5); |
|
| 1246 | - print '<li>Create database....<img src="../images/loading.gif" /></li>'; |
|
| 1245 | + sleep(5); |
|
| 1246 | + print '<li>Create database....<img src="../images/loading.gif" /></li>'; |
|
| 1247 | 1247 | } else if ($popi) { |
| 1248 | - sleep(5); |
|
| 1249 | - print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
| 1248 | + sleep(5); |
|
| 1249 | + print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
| 1250 | 1250 | } else if ($popw) { |
| 1251 | - sleep(5); |
|
| 1252 | - print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
|
| 1251 | + sleep(5); |
|
| 1252 | + print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
|
| 1253 | 1253 | } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
| 1254 | 1254 | print '</div></ul>'; |
| 1255 | 1255 | print '<div id="error"></div>'; |
@@ -1312,7 +1312,7 @@ discard block |
||
| 1312 | 1312 | unset($_COOKIE['install']); |
| 1313 | 1313 | print '<div class="info column"><ul>'; |
| 1314 | 1314 | foreach ($_SESSION['done'] as $done) { |
| 1315 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
| 1315 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
| 1316 | 1316 | } |
| 1317 | 1317 | print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>'; |
| 1318 | 1318 | print '</ul></div>'; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | require_once(dirname(__FILE__).'/class.create_db.php'); |
| 11 | 11 | require_once(dirname(__FILE__).'/class.update_schema.php'); |
| 12 | 12 | require_once(dirname(__FILE__).'/class.settings.php'); |
| 13 | -$title="Install"; |
|
| 13 | +$title = "Install"; |
|
| 14 | 14 | require(dirname(__FILE__).'/../require/settings.php'); |
| 15 | 15 | require(dirname(__FILE__).'/header.php'); |
| 16 | 16 | |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | if (!extension_loaded('curl')) { |
| 70 | 70 | $error[] = "Curl is not loaded."; |
| 71 | 71 | } |
| 72 | -if(function_exists('apache_get_modules') ){ |
|
| 73 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
| 72 | +if (function_exists('apache_get_modules')) { |
|
| 73 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
| 74 | 74 | $error[] = "mod_rewrite is not available."; |
| 75 | 75 | } |
| 76 | 76 | /* |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | print '<div class="info column"><p><strong>If you use MySQL or MariaDB, check that <i>max_allowed_packet</i> >= 8M, else import of some table can fail.</strong></p></div>'; |
| 87 | 87 | if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { |
| 88 | 88 | if (function_exists('get_headers')) { |
| 89 | - $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); |
|
| 90 | - if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { |
|
| 89 | + $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); |
|
| 90 | + if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { |
|
| 91 | 91 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>'; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -438,13 +438,13 @@ discard block |
||
| 438 | 438 | ?> |
| 439 | 439 | <tr> |
| 440 | 440 | <?php |
| 441 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
| 441 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
| 442 | 442 | ?> |
| 443 | 443 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
| 444 | 444 | <td><input type="number" name="port[]" id="port" value="<?php print $source['port']; ?>" /></td> |
| 445 | 445 | <?php |
| 446 | 446 | } else { |
| 447 | - $hostport = explode(':',$source['host']); |
|
| 447 | + $hostport = explode(':', $source['host']); |
|
| 448 | 448 | if (isset($hostport[1])) { |
| 449 | 449 | $host = $hostport[0]; |
| 450 | 450 | $port = $hostport[1]; |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | <br /> |
| 781 | 781 | <p> |
| 782 | 782 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
| 783 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
| 783 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
| 784 | 784 | </p> |
| 785 | 785 | <br /> |
| 786 | 786 | <p> |
@@ -826,14 +826,14 @@ discard block |
||
| 826 | 826 | $error = ''; |
| 827 | 827 | |
| 828 | 828 | if (isset($_POST['dbtype'])) { |
| 829 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
| 830 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
| 831 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
| 832 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
| 833 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
| 834 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
| 835 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
| 836 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
| 829 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
| 830 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
| 831 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
| 832 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
| 833 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
| 834 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
| 835 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
| 836 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
| 837 | 837 | |
| 838 | 838 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
| 839 | 839 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -853,48 +853,48 @@ discard block |
||
| 853 | 853 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
| 854 | 854 | */ |
| 855 | 855 | |
| 856 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
| 856 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
| 857 | 857 | |
| 858 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
| 859 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
| 860 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
| 861 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
| 862 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
| 858 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
| 859 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
| 860 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
| 861 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
| 862 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
| 863 | 863 | |
| 864 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
| 865 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
| 866 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
| 867 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
| 868 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
| 869 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
| 870 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
| 871 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
| 872 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey)); |
|
| 864 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
| 865 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
| 866 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
| 867 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
| 868 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
| 869 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
| 870 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
| 871 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
| 872 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey)); |
|
| 873 | 873 | |
| 874 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
| 875 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
| 876 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
| 877 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
| 878 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
| 879 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
| 874 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
| 875 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
| 876 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
| 877 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
| 878 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
| 879 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
| 880 | 880 | |
| 881 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
| 882 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
| 881 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
| 882 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
| 883 | 883 | |
| 884 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
| 885 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
| 886 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
| 884 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
| 885 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
| 886 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
| 887 | 887 | |
| 888 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
| 888 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
| 889 | 889 | if ($acars == 'acars') { |
| 890 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
| 890 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
| 891 | 891 | } else { |
| 892 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
| 892 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
| 893 | 893 | } |
| 894 | 894 | |
| 895 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
| 896 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
| 897 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
| 895 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
| 896 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
| 897 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
| 898 | 898 | |
| 899 | 899 | $source_name = $_POST['source_name']; |
| 900 | 900 | $source_latitude = $_POST['source_latitude']; |
@@ -908,8 +908,8 @@ discard block |
||
| 908 | 908 | |
| 909 | 909 | $sources = array(); |
| 910 | 910 | foreach ($source_name as $keys => $name) { |
| 911 | - 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]); |
|
| 912 | - 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]); |
|
| 911 | + 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]); |
|
| 912 | + 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]); |
|
| 913 | 913 | } |
| 914 | 914 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
| 915 | 915 | |
@@ -922,23 +922,23 @@ discard block |
||
| 922 | 922 | $sbsurl = $_POST['sbsurl']; |
| 923 | 923 | */ |
| 924 | 924 | |
| 925 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
| 926 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
| 927 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
| 928 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING); |
|
| 929 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
| 930 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
| 931 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
| 925 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
| 926 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
| 927 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
| 928 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING); |
|
| 929 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
| 930 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
| 931 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
| 932 | 932 | |
| 933 | - $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
|
| 934 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 935 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 936 | - $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
|
| 937 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 938 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 939 | - $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
|
| 940 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 941 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 933 | + $globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING); |
|
| 934 | + if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE')); |
|
| 935 | + else $settings = array_merge($settings, array('globalAircraft' => 'FALSE')); |
|
| 936 | + $globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING); |
|
| 937 | + if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE')); |
|
| 938 | + else $settings = array_merge($settings, array('globalTracker' => 'FALSE')); |
|
| 939 | + $globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING); |
|
| 940 | + if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE')); |
|
| 941 | + else $settings = array_merge($settings, array('globalMarine' => 'FALSE')); |
|
| 942 | 942 | |
| 943 | 943 | /* |
| 944 | 944 | $globalSBS1Hosts = array(); |
@@ -954,7 +954,7 @@ discard block |
||
| 954 | 954 | } |
| 955 | 955 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
| 956 | 956 | */ |
| 957 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
| 957 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
| 958 | 958 | $host = $_POST['host']; |
| 959 | 959 | $port = $_POST['port']; |
| 960 | 960 | $name = $_POST['name']; |
@@ -965,96 +965,96 @@ discard block |
||
| 965 | 965 | foreach ($host as $key => $h) { |
| 966 | 966 | if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
| 967 | 967 | else $cov = 'FALSE'; |
| 968 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
| 968 | + if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov); |
|
| 969 | 969 | } |
| 970 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
| 970 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
| 971 | 971 | |
| 972 | 972 | /* |
| 973 | 973 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
| 974 | 974 | $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
| 975 | 975 | */ |
| 976 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
| 977 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
| 978 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
| 976 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
| 977 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
| 978 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
| 979 | 979 | |
| 980 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
| 981 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
| 980 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
| 981 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
| 982 | 982 | |
| 983 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
| 984 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
| 985 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
| 986 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
| 983 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
| 984 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
| 985 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
| 986 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
| 987 | 987 | |
| 988 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
| 989 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
| 990 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
| 988 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
| 989 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
| 990 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
| 991 | 991 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
| 992 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
| 993 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 992 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
| 993 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
| 994 | 994 | |
| 995 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
| 996 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
| 997 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
| 998 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
| 999 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
| 1000 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
| 1001 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
| 1002 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
| 995 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
| 996 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
| 997 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
| 998 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
| 999 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
| 1000 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
| 1001 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
| 1002 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
| 1003 | 1003 | |
| 1004 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
| 1005 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
| 1004 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
| 1005 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
| 1006 | 1006 | |
| 1007 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1008 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
| 1007 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1008 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
| 1009 | 1009 | |
| 1010 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
| 1010 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
| 1011 | 1011 | if ($archiveyear == "archiveyear") { |
| 1012 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
| 1012 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
| 1013 | 1013 | } else { |
| 1014 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
| 1014 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
| 1015 | 1015 | } |
| 1016 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1017 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
| 1018 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
| 1019 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
| 1016 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1017 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
| 1018 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
| 1019 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
| 1020 | 1020 | |
| 1021 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
| 1022 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
| 1023 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
| 1024 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
| 1021 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
| 1022 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
| 1023 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
| 1024 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
| 1025 | 1025 | |
| 1026 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
| 1027 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
| 1028 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
| 1026 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
| 1027 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
| 1028 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
| 1029 | 1029 | |
| 1030 | 1030 | // Create in settings.php keys not yet configurable if not already here |
| 1031 | 1031 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
| 1032 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1032 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
| 1033 | 1033 | |
| 1034 | - $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
|
| 1034 | + $resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING); |
|
| 1035 | 1035 | if ($resetyearstats == 'resetyearstats') { |
| 1036 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE')); |
|
| 1036 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE')); |
|
| 1037 | 1037 | } else { |
| 1038 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE')); |
|
| 1038 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE')); |
|
| 1039 | 1039 | } |
| 1040 | 1040 | |
| 1041 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
| 1041 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
| 1042 | 1042 | if ($archive == 'archive') { |
| 1043 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
| 1043 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
| 1044 | 1044 | } else { |
| 1045 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
| 1045 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
| 1046 | 1046 | } |
| 1047 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
| 1047 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
| 1048 | 1048 | if ($daemon == 'daemon') { |
| 1049 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
| 1049 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
| 1050 | 1050 | } else { |
| 1051 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
| 1051 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
| 1052 | 1052 | } |
| 1053 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
| 1053 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
| 1054 | 1054 | if ($schedules == 'schedules') { |
| 1055 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
| 1055 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
| 1056 | 1056 | } else { |
| 1057 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
| 1057 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
| 1058 | 1058 | } |
| 1059 | 1059 | |
| 1060 | 1060 | /* |
@@ -1065,177 +1065,177 @@ discard block |
||
| 1065 | 1065 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
| 1066 | 1066 | } |
| 1067 | 1067 | */ |
| 1068 | - $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
|
| 1069 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1070 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1071 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1072 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1068 | + $settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); |
|
| 1069 | + if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); |
|
| 1070 | + else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); |
|
| 1071 | + if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); |
|
| 1072 | + else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); |
|
| 1073 | 1073 | if ($globalivao == 'ivao') { |
| 1074 | 1074 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
| 1075 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
| 1076 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1075 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
| 1076 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
| 1077 | 1077 | if ($globalvatsim == 'vatsim') { |
| 1078 | 1078 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
| 1079 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
| 1080 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1079 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
| 1080 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
| 1081 | 1081 | if ($globalphpvms == 'phpvms') { |
| 1082 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
| 1083 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1082 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
| 1083 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
| 1084 | 1084 | if ($globalvam == 'vam') { |
| 1085 | - $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
|
| 1086 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1085 | + $settings = array_merge($settings, array('globalVAM' => 'TRUE')); |
|
| 1086 | + } else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); |
|
| 1087 | 1087 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
| 1088 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
| 1089 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1088 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
| 1089 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
| 1090 | 1090 | |
| 1091 | 1091 | |
| 1092 | 1092 | |
| 1093 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
| 1093 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
| 1094 | 1094 | if ($notam == 'notam') { |
| 1095 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
| 1095 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
| 1096 | 1096 | } else { |
| 1097 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
| 1097 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
| 1098 | 1098 | } |
| 1099 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
| 1099 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
| 1100 | 1100 | if ($owner == 'owner') { |
| 1101 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
| 1101 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
| 1102 | 1102 | } else { |
| 1103 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
| 1103 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
| 1104 | 1104 | } |
| 1105 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING); |
|
| 1105 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING); |
|
| 1106 | 1106 | if ($map3d == 'map3d') { |
| 1107 | - $settings = array_merge($settings,array('globalMap3D' => 'TRUE')); |
|
| 1107 | + $settings = array_merge($settings, array('globalMap3D' => 'TRUE')); |
|
| 1108 | 1108 | } else { |
| 1109 | - $settings = array_merge($settings,array('globalMap3D' => 'FALSE')); |
|
| 1109 | + $settings = array_merge($settings, array('globalMap3D' => 'FALSE')); |
|
| 1110 | 1110 | } |
| 1111 | - $crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING); |
|
| 1111 | + $crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING); |
|
| 1112 | 1112 | if ($crash == 'crash') { |
| 1113 | - $settings = array_merge($settings,array('globalAccidents' => 'TRUE')); |
|
| 1113 | + $settings = array_merge($settings, array('globalAccidents' => 'TRUE')); |
|
| 1114 | 1114 | } else { |
| 1115 | - $settings = array_merge($settings,array('globalAccidents' => 'FALSE')); |
|
| 1115 | + $settings = array_merge($settings, array('globalAccidents' => 'FALSE')); |
|
| 1116 | 1116 | } |
| 1117 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING); |
|
| 1117 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING); |
|
| 1118 | 1118 | if ($mapsatellites == 'mapsatellites') { |
| 1119 | - $settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); |
|
| 1119 | + $settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); |
|
| 1120 | 1120 | } else { |
| 1121 | - $settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); |
|
| 1121 | + $settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); |
|
| 1122 | 1122 | } |
| 1123 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING); |
|
| 1123 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING); |
|
| 1124 | 1124 | if ($map3ddefault == 'map3ddefault') { |
| 1125 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); |
|
| 1125 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); |
|
| 1126 | 1126 | } else { |
| 1127 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); |
|
| 1127 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); |
|
| 1128 | 1128 | } |
| 1129 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
| 1129 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
| 1130 | 1130 | if ($translate == 'translate') { |
| 1131 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
| 1131 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
| 1132 | 1132 | } else { |
| 1133 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
| 1133 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
| 1134 | 1134 | } |
| 1135 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING); |
|
| 1135 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING); |
|
| 1136 | 1136 | if ($realairlines == 'realairlines') { |
| 1137 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); |
|
| 1137 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); |
|
| 1138 | 1138 | } else { |
| 1139 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); |
|
| 1139 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); |
|
| 1140 | 1140 | } |
| 1141 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
| 1141 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
| 1142 | 1142 | if ($estimation == 'estimation') { |
| 1143 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
| 1143 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
| 1144 | 1144 | } else { |
| 1145 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
| 1145 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
| 1146 | 1146 | } |
| 1147 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
| 1147 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
| 1148 | 1148 | if ($metar == 'metar') { |
| 1149 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
| 1149 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
| 1150 | 1150 | } else { |
| 1151 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
| 1151 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
| 1152 | 1152 | } |
| 1153 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
| 1153 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
| 1154 | 1154 | if ($metarcycle == 'metarcycle') { |
| 1155 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
| 1155 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
| 1156 | 1156 | } else { |
| 1157 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
| 1157 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
| 1158 | 1158 | } |
| 1159 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
| 1159 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
| 1160 | 1160 | if ($fork == 'fork') { |
| 1161 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
| 1161 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
| 1162 | 1162 | } else { |
| 1163 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
| 1163 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
| 1166 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
| 1167 | 1167 | if ($colormap == 'colormap') { |
| 1168 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
| 1168 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
| 1169 | 1169 | } else { |
| 1170 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
| 1170 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | 1173 | if (isset($_POST['aircrafticoncolor'])) { |
| 1174 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
| 1175 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
| 1174 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
| 1175 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
| 1176 | 1176 | } |
| 1177 | 1177 | |
| 1178 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
| 1179 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
| 1178 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
| 1179 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
| 1180 | 1180 | |
| 1181 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
| 1182 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
| 1183 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
| 1184 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
| 1185 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
| 1186 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
| 1181 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
| 1182 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
| 1183 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
| 1184 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
| 1185 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
| 1186 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
| 1187 | 1187 | |
| 1188 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
| 1188 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
| 1189 | 1189 | if ($mappopup == 'mappopup') { |
| 1190 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
| 1190 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
| 1191 | 1191 | } else { |
| 1192 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
| 1192 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
| 1193 | 1193 | } |
| 1194 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
| 1194 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
| 1195 | 1195 | if ($airportpopup == 'airportpopup') { |
| 1196 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
| 1196 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
| 1197 | 1197 | } else { |
| 1198 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
| 1198 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
| 1199 | 1199 | } |
| 1200 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
| 1200 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
| 1201 | 1201 | if ($maphistory == 'maphistory') { |
| 1202 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
| 1202 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
| 1203 | 1203 | } else { |
| 1204 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
| 1204 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
| 1205 | 1205 | } |
| 1206 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
| 1206 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
| 1207 | 1207 | if ($flightroute == 'flightroute') { |
| 1208 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
| 1208 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
| 1209 | 1209 | } else { |
| 1210 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
| 1210 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
| 1211 | 1211 | } |
| 1212 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING); |
|
| 1212 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING); |
|
| 1213 | 1213 | if ($allflights == 'allflights') { |
| 1214 | - $settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); |
|
| 1214 | + $settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); |
|
| 1215 | 1215 | } else { |
| 1216 | - $settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); |
|
| 1216 | + $settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); |
|
| 1217 | 1217 | } |
| 1218 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING); |
|
| 1218 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING); |
|
| 1219 | 1219 | if ($waypoints == 'waypoints') { |
| 1220 | - $settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); |
|
| 1220 | + $settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); |
|
| 1221 | 1221 | } else { |
| 1222 | - $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
|
| 1222 | + $settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); |
|
| 1223 | 1223 | } |
| 1224 | 1224 | |
| 1225 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1225 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
| 1226 | 1226 | |
| 1227 | 1227 | // Set some defaults values... |
| 1228 | 1228 | if (!isset($globalAircraftImageSources)) { |
| 1229 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
| 1230 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
| 1229 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
| 1230 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | 1233 | if (!isset($globalSchedulesSources)) { |
| 1234 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
| 1235 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
| 1234 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
| 1235 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
| 1236 | 1236 | } |
| 1237 | 1237 | |
| 1238 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
| 1238 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
| 1239 | 1239 | |
| 1240 | 1240 | if ($error == '') settings::modify_settings($settings); |
| 1241 | 1241 | if ($error == '') settings::comment_settings($settings_comment); |
@@ -131,45 +131,72 @@ discard block |
||
| 131 | 131 | </div> |
| 132 | 132 | <p> |
| 133 | 133 | <label for="dbhost">Database hostname</label> |
| 134 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
| 134 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
| 135 | + print $globalDBhost; |
|
| 136 | +} |
|
| 137 | +?>" /> |
|
| 135 | 138 | </p> |
| 136 | 139 | <p> |
| 137 | 140 | <label for="dbport">Database port</label> |
| 138 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
| 141 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
| 142 | + print $globalDBport; |
|
| 143 | +} |
|
| 144 | +?>" /> |
|
| 139 | 145 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
| 140 | 146 | </p> |
| 141 | 147 | <p> |
| 142 | 148 | <label for="dbname">Database name</label> |
| 143 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
| 149 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
| 150 | + print $globalDBname; |
|
| 151 | +} |
|
| 152 | +?>" /> |
|
| 144 | 153 | </p> |
| 145 | 154 | <p> |
| 146 | 155 | <label for="dbuser">Database user</label> |
| 147 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
| 156 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
| 157 | + print $globalDBuser; |
|
| 158 | +} |
|
| 159 | +?>" /> |
|
| 148 | 160 | </p> |
| 149 | 161 | <p> |
| 150 | 162 | <label for="dbuserpass">Database user password</label> |
| 151 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
| 163 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
| 164 | + print $globalDBpass; |
|
| 165 | +} |
|
| 166 | +?>" /> |
|
| 152 | 167 | </p> |
| 153 | 168 | </fieldset> |
| 154 | 169 | <fieldset id="site"> |
| 155 | 170 | <legend>Site configuration</legend> |
| 156 | 171 | <p> |
| 157 | 172 | <label for="sitename">Site name</label> |
| 158 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
| 173 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
| 174 | + print $globalName; |
|
| 175 | +} |
|
| 176 | +?>" /> |
|
| 159 | 177 | </p> |
| 160 | 178 | <p> |
| 161 | 179 | <label for="siteurl">Site directory</label> |
| 162 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
| 180 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
| 181 | + print $globalURL; |
|
| 182 | +} |
|
| 183 | +?>" /> |
|
| 163 | 184 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
| 164 | 185 | </p> |
| 165 | 186 | <p> |
| 166 | 187 | <label for="timezone">Timezone</label> |
| 167 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
| 188 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
| 189 | + print $globalTimezone; |
|
| 190 | +} |
|
| 191 | +?>" /> |
|
| 168 | 192 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
| 169 | 193 | </p> |
| 170 | 194 | <p> |
| 171 | 195 | <label for="language">Language</label> |
| 172 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
| 196 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
| 197 | + print $globalLanguage; |
|
| 198 | +} |
|
| 199 | +?>" /> |
|
| 173 | 200 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
| 174 | 201 | </p> |
| 175 | 202 | </fieldset> |
@@ -190,11 +217,17 @@ discard block |
||
| 190 | 217 | <div id="mapbox_data"> |
| 191 | 218 | <p> |
| 192 | 219 | <label for="mapboxid">Mapbox id</label> |
| 193 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
| 220 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
| 221 | + print $globalMapboxId; |
|
| 222 | +} |
|
| 223 | +?>" /> |
|
| 194 | 224 | </p> |
| 195 | 225 | <p> |
| 196 | 226 | <label for="mapboxtoken">Mapbox token</label> |
| 197 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
| 227 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
| 228 | + print $globalMapboxToken; |
|
| 229 | +} |
|
| 230 | +?>" /> |
|
| 198 | 231 | </p> |
| 199 | 232 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
| 200 | 233 | </div> |
@@ -202,7 +235,10 @@ discard block |
||
| 202 | 235 | <div id="google_data"> |
| 203 | 236 | <p> |
| 204 | 237 | <label for="googlekey">Google API key</label> |
| 205 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
| 238 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
| 239 | + print $globalGoogleAPIKey; |
|
| 240 | +} |
|
| 241 | +?>" /> |
|
| 206 | 242 | <p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p> |
| 207 | 243 | </p> |
| 208 | 244 | </div> |
@@ -210,7 +246,10 @@ discard block |
||
| 210 | 246 | <div id="bing_data"> |
| 211 | 247 | <p> |
| 212 | 248 | <label for="bingkey">Bing Map key</label> |
| 213 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
| 249 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
| 250 | + print $globalBingMapKey; |
|
| 251 | +} |
|
| 252 | +?>" /> |
|
| 214 | 253 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
| 215 | 254 | </p> |
| 216 | 255 | </div> |
@@ -218,7 +257,10 @@ discard block |
||
| 218 | 257 | <div id="mapquest_data"> |
| 219 | 258 | <p> |
| 220 | 259 | <label for="mapquestkey">MapQuest key</label> |
| 221 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
| 260 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
| 261 | + print $globalMapQuestKey; |
|
| 262 | +} |
|
| 263 | +?>" /> |
|
| 222 | 264 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
| 223 | 265 | </p> |
| 224 | 266 | </div> |
@@ -226,11 +268,17 @@ discard block |
||
| 226 | 268 | <div id="here_data"> |
| 227 | 269 | <p> |
| 228 | 270 | <label for="hereappid">Here App_Id</label> |
| 229 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
| 271 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
| 272 | + print $globalHereappId; |
|
| 273 | +} |
|
| 274 | +?>" /> |
|
| 230 | 275 | </p> |
| 231 | 276 | <p> |
| 232 | 277 | <label for="hereappcode">Here App_Code</label> |
| 233 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
| 278 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
| 279 | + print $globalHereappCode; |
|
| 280 | +} |
|
| 281 | +?>" /> |
|
| 234 | 282 | </p> |
| 235 | 283 | <p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p> |
| 236 | 284 | </div> |
@@ -239,42 +287,86 @@ discard block |
||
| 239 | 287 | <legend>Coverage area</legend> |
| 240 | 288 | <p> |
| 241 | 289 | <label for="latitudemax">The maximum latitude (north)</label> |
| 242 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
| 290 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
| 291 | + print $globalLatitudeMax; |
|
| 292 | +} |
|
| 293 | +?>" /> |
|
| 243 | 294 | </p> |
| 244 | 295 | <p> |
| 245 | 296 | <label for="latitudemin">The minimum latitude (south)</label> |
| 246 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
| 297 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
| 298 | + print $globalLatitudeMin; |
|
| 299 | +} |
|
| 300 | +?>" /> |
|
| 247 | 301 | </p> |
| 248 | 302 | <p> |
| 249 | 303 | <label for="longitudemax">The maximum longitude (west)</label> |
| 250 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
| 304 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
| 305 | + print $globalLongitudeMax; |
|
| 306 | +} |
|
| 307 | +?>" /> |
|
| 251 | 308 | </p> |
| 252 | 309 | <p> |
| 253 | 310 | <label for="longitudemin">The minimum longitude (east)</label> |
| 254 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
| 311 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
| 312 | + print $globalLongitudeMin; |
|
| 313 | +} |
|
| 314 | +?>" /> |
|
| 255 | 315 | </p> |
| 256 | 316 | <p> |
| 257 | 317 | <label for="latitudecenter">The latitude center</label> |
| 258 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
| 318 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
| 319 | + print $globalCenterLatitude; |
|
| 320 | +} |
|
| 321 | +?>" /> |
|
| 259 | 322 | </p> |
| 260 | 323 | <p> |
| 261 | 324 | <label for="longitudecenter">The longitude center</label> |
| 262 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
| 325 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
| 326 | + print $globalCenterLongitude; |
|
| 327 | +} |
|
| 328 | +?>" /> |
|
| 263 | 329 | </p> |
| 264 | 330 | <p> |
| 265 | 331 | <label for="livezoom">Default Zoom on live map</label> |
| 266 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
| 332 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
| 333 | + print $globalLiveZoom; |
|
| 334 | +} else { |
|
| 335 | + print '9'; |
|
| 336 | +} |
|
| 337 | +?>" /> |
|
| 267 | 338 | </p> |
| 268 | 339 | <p> |
| 269 | 340 | <label for="squawk_country">Country for squawk usage</label> |
| 270 | 341 | <select name="squawk_country" id="squawk_country"> |
| 271 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
| 272 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
| 273 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
| 274 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
| 275 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
| 276 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
| 277 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
| 342 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
| 343 | + print ' selected '; |
|
| 344 | +} |
|
| 345 | +?>>UK</option> |
|
| 346 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
| 347 | + print ' selected '; |
|
| 348 | +} |
|
| 349 | +?>>NZ</option> |
|
| 350 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
| 351 | + print ' selected '; |
|
| 352 | +} |
|
| 353 | +?>>US</option> |
|
| 354 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
| 355 | + print ' selected '; |
|
| 356 | +} |
|
| 357 | +?>>AU</option> |
|
| 358 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
| 359 | + print ' selected '; |
|
| 360 | +} |
|
| 361 | +?>>NL</option> |
|
| 362 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
| 363 | + print ' selected '; |
|
| 364 | +} |
|
| 365 | +?>>FR</option> |
|
| 366 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
| 367 | + print ' selected '; |
|
| 368 | +} |
|
| 369 | +?>>TR</option> |
|
| 278 | 370 | </select> |
| 279 | 371 | </p> |
| 280 | 372 | </fieldset> |
@@ -283,15 +375,24 @@ discard block |
||
| 283 | 375 | <p><i>Only put in DB flights that are inside a circle</i></p> |
| 284 | 376 | <p> |
| 285 | 377 | <label for="latitude">Center latitude</label> |
| 286 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
| 378 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
| 379 | + echo $globalDistanceIgnore['latitude']; |
|
| 380 | +} |
|
| 381 | +?>" /> |
|
| 287 | 382 | </p> |
| 288 | 383 | <p> |
| 289 | 384 | <label for="longitude">Center longitude</label> |
| 290 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
| 385 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
| 386 | + echo $globalDistanceIgnore['longitude']; |
|
| 387 | +} |
|
| 388 | +?>" /> |
|
| 291 | 389 | </p> |
| 292 | 390 | <p> |
| 293 | 391 | <label for="Distance">Distance (in km)</label> |
| 294 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
| 392 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
| 393 | + echo $globalDistanceIgnore['distance']; |
|
| 394 | +} |
|
| 395 | +?>" /> |
|
| 295 | 396 | </p> |
| 296 | 397 | </fieldset> |
| 297 | 398 | <fieldset id="sourceloc"> |
@@ -397,11 +498,17 @@ discard block |
||
| 397 | 498 | <div id="flightaware_data"> |
| 398 | 499 | <p> |
| 399 | 500 | <label for="flightawareusername">FlightAware username</label> |
| 400 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
| 501 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
| 502 | + print $globalFlightAwareUsername; |
|
| 503 | +} |
|
| 504 | +?>" /> |
|
| 401 | 505 | </p> |
| 402 | 506 | <p> |
| 403 | 507 | <label for="flightawarepassword">FlightAware password/API key</label> |
| 404 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
| 508 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
| 509 | + print $globalFlightAwarePassword; |
|
| 510 | +} |
|
| 511 | +?>" /> |
|
| 405 | 512 | </p> |
| 406 | 513 | </div> |
| 407 | 514 | --> |
@@ -460,27 +567,84 @@ discard block |
||
| 460 | 567 | ?> |
| 461 | 568 | <td> |
| 462 | 569 | <select name="format[]" id="format"> |
| 463 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
| 464 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
| 465 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
| 466 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
| 467 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
| 468 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
| 469 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
| 470 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
| 471 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
| 472 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
| 473 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
| 474 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
| 475 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
| 476 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
| 477 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
| 478 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
| 479 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
| 570 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
| 571 | + print 'selected'; |
|
| 572 | +} |
|
| 573 | +?>>Auto</option> |
|
| 574 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
| 575 | + print 'selected'; |
|
| 576 | +} |
|
| 577 | +?>>SBS</option> |
|
| 578 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
| 579 | + print 'selected'; |
|
| 580 | +} |
|
| 581 | +?>>TSV</option> |
|
| 582 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
| 583 | + print 'selected'; |
|
| 584 | +} |
|
| 585 | +?>>Raw</option> |
|
| 586 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
| 587 | + print 'selected'; |
|
| 588 | +} |
|
| 589 | +?>>APRS</option> |
|
| 590 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
| 591 | + print 'selected'; |
|
| 592 | +} |
|
| 593 | +?>>Radarcape deltadb.txt</option> |
|
| 594 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
| 595 | + print 'selected'; |
|
| 596 | +} |
|
| 597 | +?>>Vatsim</option> |
|
| 598 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
| 599 | + print 'selected'; |
|
| 600 | +} |
|
| 601 | +?>>Virtual Radar Server AircraftList.json</option> |
|
| 602 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
| 603 | + print 'selected'; |
|
| 604 | +} |
|
| 605 | +?>>Virtual Radar Server TCP</option> |
|
| 606 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
| 607 | + print 'selected'; |
|
| 608 | +} |
|
| 609 | +?>>phpVMS</option> |
|
| 610 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
| 611 | + print 'selected'; |
|
| 612 | +} |
|
| 613 | +?>>Virtual Airlines Manager</option> |
|
| 614 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
| 615 | + print 'selected'; |
|
| 616 | +} |
|
| 617 | +?>>IVAO</option> |
|
| 618 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
| 619 | + print 'selected'; |
|
| 620 | +} |
|
| 621 | +?>>FlightGear Multiplayer</option> |
|
| 622 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
| 623 | + print 'selected'; |
|
| 624 | +} |
|
| 625 | +?>>FlightGear Singleplayer</option> |
|
| 626 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
| 627 | + print 'selected'; |
|
| 628 | +} |
|
| 629 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
| 630 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
| 631 | + print 'selected'; |
|
| 632 | +} |
|
| 633 | +?>>ACARS SBS-3 over TCP</option> |
|
| 634 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
| 635 | + print 'selected'; |
|
| 636 | +} |
|
| 637 | +?>>NMEA AIS over TCP</option> |
|
| 480 | 638 | </select> |
| 481 | 639 | </td> |
| 482 | - <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /></td> |
|
| 483 | - <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> |
|
| 640 | + <td><input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
| 641 | + print $source['name']; |
|
| 642 | +} |
|
| 643 | +?>" /></td> |
|
| 644 | + <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']) { |
|
| 645 | + print 'checked'; |
|
| 646 | +} |
|
| 647 | +?> /></td> |
|
| 484 | 648 | <td><input type="button" id="delhost" value="Delete" onclick="deleteRow(this)" /> <input type="button" id="addhost" value="Add" onclick="insRow()" /></td> |
| 485 | 649 | </tr> |
| 486 | 650 | <?php |
@@ -528,11 +692,17 @@ discard block |
||
| 528 | 692 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
| 529 | 693 | <p> |
| 530 | 694 | <label for="acarshost">ACARS UDP host</label> |
| 531 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
| 695 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
| 696 | + print $globalACARSHost; |
|
| 697 | +} |
|
| 698 | +?>" /> |
|
| 532 | 699 | </p> |
| 533 | 700 | <p> |
| 534 | 701 | <label for="acarsport">ACARS UDP port</label> |
| 535 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
| 702 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
| 703 | + print $globalACARSPort; |
|
| 704 | +} |
|
| 705 | +?>" /> |
|
| 536 | 706 | </p> |
| 537 | 707 | </fieldset> |
| 538 | 708 | </div> |
@@ -612,13 +782,19 @@ discard block |
||
| 612 | 782 | <div id="schedules_options"> |
| 613 | 783 | <p> |
| 614 | 784 | <label for="britishairways">British Airways API Key</label> |
| 615 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
| 785 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
| 786 | + print $globalBritishAirwaysKey; |
|
| 787 | +} |
|
| 788 | +?>" /> |
|
| 616 | 789 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
| 617 | 790 | </p> |
| 618 | 791 | <!-- |
| 619 | 792 | <p> |
| 620 | 793 | <label for="transavia">Transavia Test API Consumer Key</label> |
| 621 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
| 794 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
| 795 | + print $globalTransaviaKey; |
|
| 796 | +} |
|
| 797 | +?>" /> |
|
| 622 | 798 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
| 623 | 799 | </p> |
| 624 | 800 | --> |
@@ -627,10 +803,16 @@ discard block |
||
| 627 | 803 | <b>Lufthansa API Key</b> |
| 628 | 804 | <p> |
| 629 | 805 | <label for="lufthansakey">Key</label> |
| 630 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
| 806 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
| 807 | + print $globalLufthansaKey['key']; |
|
| 808 | +} |
|
| 809 | +?>" /> |
|
| 631 | 810 | </p><p> |
| 632 | 811 | <label for="lufthansasecret">Secret</label> |
| 633 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
| 812 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
| 813 | + print $globalLufthansaKey['secret']; |
|
| 814 | +} |
|
| 815 | +?>" /> |
|
| 634 | 816 | </p> |
| 635 | 817 | </div> |
| 636 | 818 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -650,7 +832,10 @@ discard block |
||
| 650 | 832 | </p> |
| 651 | 833 | <p> |
| 652 | 834 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
| 653 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
| 835 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
| 836 | + print $globalNOTAMSource; |
|
| 837 | +} |
|
| 838 | +?>" /> |
|
| 654 | 839 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
| 655 | 840 | </p> |
| 656 | 841 | <br /> |
@@ -666,14 +851,20 @@ discard block |
||
| 666 | 851 | <div id="metarsrc"> |
| 667 | 852 | <p> |
| 668 | 853 | <label for="metarsource">URL of your METAR source</label> |
| 669 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
| 854 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
| 855 | + print $globalMETARurl; |
|
| 856 | +} |
|
| 857 | +?>" /> |
|
| 670 | 858 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
| 671 | 859 | </p> |
| 672 | 860 | </div> |
| 673 | 861 | <br /> |
| 674 | 862 | <p> |
| 675 | 863 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
| 676 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
| 864 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
| 865 | + print $globalBitlyAccessToken; |
|
| 866 | +} |
|
| 867 | +?>" /> |
|
| 677 | 868 | </p> |
| 678 | 869 | <br /> |
| 679 | 870 | <p> |
@@ -693,7 +884,12 @@ discard block |
||
| 693 | 884 | </p> |
| 694 | 885 | <p> |
| 695 | 886 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
| 696 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '0'; ?>" /> |
|
| 887 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
| 888 | + print $globalArchiveMonths; |
|
| 889 | +} else { |
|
| 890 | + echo '0'; |
|
| 891 | +} |
|
| 892 | +?>" /> |
|
| 697 | 893 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
| 698 | 894 | </p> |
| 699 | 895 | <p> |
@@ -703,12 +899,22 @@ discard block |
||
| 703 | 899 | </p> |
| 704 | 900 | <p> |
| 705 | 901 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
| 706 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '0'; ?>" /> |
|
| 902 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
| 903 | + print $globalArchiveKeepMonths; |
|
| 904 | +} else { |
|
| 905 | + echo '0'; |
|
| 906 | +} |
|
| 907 | +?>" /> |
|
| 707 | 908 | <p class="help-block">0 to disable</p> |
| 708 | 909 | </p> |
| 709 | 910 | <p> |
| 710 | 911 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
| 711 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '0'; ?>" /> |
|
| 912 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
| 913 | + print $globalArchiveKeepTrackMonths; |
|
| 914 | +} else { |
|
| 915 | + echo '0'; |
|
| 916 | +} |
|
| 917 | +?>" /> |
|
| 712 | 918 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
| 713 | 919 | </p> |
| 714 | 920 | <br /> |
@@ -718,7 +924,12 @@ discard block |
||
| 718 | 924 | <p class="help-block">Uncheck if the script is running as cron job</p> |
| 719 | 925 | <div id="cronends"> |
| 720 | 926 | <label for="cronend">Run script for xx seconds</label> |
| 721 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
| 927 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
| 928 | + print $globalCronEnd; |
|
| 929 | +} else { |
|
| 930 | + print '0'; |
|
| 931 | +} |
|
| 932 | +?>" /> |
|
| 722 | 933 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
| 723 | 934 | </div> |
| 724 | 935 | </p> |
@@ -763,26 +974,49 @@ discard block |
||
| 763 | 974 | <br /> |
| 764 | 975 | <p> |
| 765 | 976 | <label for="refresh">Show flights detected since xxx seconds</label> |
| 766 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
| 977 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
| 978 | + echo $globalLiveInterval; |
|
| 979 | +} else { |
|
| 980 | + echo '200'; |
|
| 981 | +} |
|
| 982 | +?>" /> |
|
| 767 | 983 | </p> |
| 768 | 984 | <p> |
| 769 | 985 | <label for="maprefresh">Live map refresh (in seconds)</label> |
| 770 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
| 986 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
| 987 | + echo $globalMapRefresh; |
|
| 988 | +} else { |
|
| 989 | + echo '30'; |
|
| 990 | +} |
|
| 991 | +?>" /> |
|
| 771 | 992 | </p> |
| 772 | 993 | <p> |
| 773 | 994 | <label for="mapidle">Map idle timeout (in minutes)</label> |
| 774 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
| 995 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
| 996 | + echo $globalMapIdleTimeout; |
|
| 997 | +} else { |
|
| 998 | + echo '30'; |
|
| 999 | +} |
|
| 1000 | +?>" /> |
|
| 775 | 1001 | <p class="help-block">0 to disable</p> |
| 776 | 1002 | </p> |
| 777 | 1003 | <br /> |
| 778 | 1004 | <p> |
| 779 | 1005 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
| 780 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
| 1006 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
| 1007 | + echo $globalClosestMinDist; |
|
| 1008 | +} else { |
|
| 1009 | + echo '50'; |
|
| 1010 | +} |
|
| 1011 | +?>" /> |
|
| 781 | 1012 | </p> |
| 782 | 1013 | <br /> |
| 783 | 1014 | <p> |
| 784 | 1015 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
| 785 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
| 1016 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
| 1017 | + echo $globalAircraftSize; |
|
| 1018 | +} |
|
| 1019 | +?>" /> |
|
| 786 | 1020 | </p> |
| 787 | 1021 | <br /> |
| 788 | 1022 | <p> |
@@ -790,7 +1024,12 @@ discard block |
||
| 790 | 1024 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 791 | 1025 | ?> |
| 792 | 1026 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
| 793 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
| 1027 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
| 1028 | + echo $globalAircraftIconColor; |
|
| 1029 | +} else { |
|
| 1030 | + echo '1a3151'; |
|
| 1031 | +} |
|
| 1032 | +?>" /> |
|
| 794 | 1033 | <?php |
| 795 | 1034 | if (!is_writable('../cache')) { |
| 796 | 1035 | ?> |
@@ -808,8 +1047,18 @@ discard block |
||
| 808 | 1047 | <p> |
| 809 | 1048 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
| 810 | 1049 | <div class="range"> |
| 811 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
| 812 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
| 1050 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
| 1051 | + echo $globalAirportZoom; |
|
| 1052 | +} else { |
|
| 1053 | + echo '7'; |
|
| 1054 | +} |
|
| 1055 | +?>" /> |
|
| 1056 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
| 1057 | + echo $globalAirportZoom; |
|
| 1058 | +} else { |
|
| 1059 | + echo '7'; |
|
| 1060 | +} |
|
| 1061 | +?></output> |
|
| 813 | 1062 | </div> |
| 814 | 1063 | </p> |
| 815 | 1064 | </fieldset> |
@@ -837,8 +1086,12 @@ discard block |
||
| 837 | 1086 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
| 838 | 1087 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
| 839 | 1088 | |
| 840 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
| 841 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1089 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
| 1090 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
| 1091 | + } |
|
| 1092 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
| 1093 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
| 1094 | + } |
|
| 842 | 1095 | |
| 843 | 1096 | $_SESSION['database_root'] = $dbroot; |
| 844 | 1097 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -905,15 +1158,23 @@ discard block |
||
| 905 | 1158 | $source_city = $_POST['source_city']; |
| 906 | 1159 | $source_country = $_POST['source_country']; |
| 907 | 1160 | $source_ref = $_POST['source_ref']; |
| 908 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
| 909 | - else $source_id = array(); |
|
| 1161 | + if (isset($source_id)) { |
|
| 1162 | + $source_id = $_POST['source_id']; |
|
| 1163 | + } else { |
|
| 1164 | + $source_id = array(); |
|
| 1165 | + } |
|
| 910 | 1166 | |
| 911 | 1167 | $sources = array(); |
| 912 | 1168 | foreach ($source_name as $keys => $name) { |
| 913 | - 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]); |
|
| 914 | - 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]); |
|
| 1169 | + if (isset($source_id[$keys])) { |
|
| 1170 | + $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]); |
|
| 1171 | + } else { |
|
| 1172 | + $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]); |
|
| 1173 | + } |
|
| 1174 | + } |
|
| 1175 | + if (count($sources) > 0) { |
|
| 1176 | + $_SESSION['sources'] = $sources; |
|
| 915 | 1177 | } |
| 916 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
| 917 | 1178 | |
| 918 | 1179 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
| 919 | 1180 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -933,14 +1194,23 @@ discard block |
||
| 933 | 1194 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
| 934 | 1195 | |
| 935 | 1196 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
| 936 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 937 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1197 | + if ($globalaircraft == 'aircraft') { |
|
| 1198 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
| 1199 | + } else { |
|
| 1200 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
| 1201 | + } |
|
| 938 | 1202 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
| 939 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 940 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1203 | + if ($globaltracker == 'tracker') { |
|
| 1204 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
| 1205 | + } else { |
|
| 1206 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
| 1207 | + } |
|
| 941 | 1208 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
| 942 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 943 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1209 | + if ($globalmarine == 'marine') { |
|
| 1210 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
| 1211 | + } else { |
|
| 1212 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
| 1213 | + } |
|
| 944 | 1214 | |
| 945 | 1215 | /* |
| 946 | 1216 | $globalSBS1Hosts = array(); |
@@ -961,13 +1231,21 @@ discard block |
||
| 961 | 1231 | $port = $_POST['port']; |
| 962 | 1232 | $name = $_POST['name']; |
| 963 | 1233 | $format = $_POST['format']; |
| 964 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
| 965 | - else $sourcestats = array(); |
|
| 1234 | + if (isset($_POST['sourcestats'])) { |
|
| 1235 | + $sourcestats = $_POST['sourcestats']; |
|
| 1236 | + } else { |
|
| 1237 | + $sourcestats = array(); |
|
| 1238 | + } |
|
| 966 | 1239 | $gSources = array(); |
| 967 | 1240 | foreach ($host as $key => $h) { |
| 968 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
| 969 | - else $cov = 'FALSE'; |
|
| 970 | - if ($h != '') $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
| 1241 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
| 1242 | + $cov = 'TRUE'; |
|
| 1243 | + } else { |
|
| 1244 | + $cov = 'FALSE'; |
|
| 1245 | + } |
|
| 1246 | + if ($h != '') { |
|
| 1247 | + $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov); |
|
| 1248 | + } |
|
| 971 | 1249 | } |
| 972 | 1250 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
| 973 | 1251 | |
@@ -992,7 +1270,9 @@ discard block |
||
| 992 | 1270 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
| 993 | 1271 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
| 994 | 1272 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
| 995 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1273 | + } else { |
|
| 1274 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
| 1275 | + } |
|
| 996 | 1276 | |
| 997 | 1277 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
| 998 | 1278 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1031,7 +1311,9 @@ discard block |
||
| 1031 | 1311 | |
| 1032 | 1312 | // Create in settings.php keys not yet configurable if not already here |
| 1033 | 1313 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
| 1034 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1314 | + if (!isset($globalDebug)) { |
|
| 1315 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
| 1316 | + } |
|
| 1035 | 1317 | |
| 1036 | 1318 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
| 1037 | 1319 | if ($resetyearstats == 'resetyearstats') { |
@@ -1068,27 +1350,43 @@ discard block |
||
| 1068 | 1350 | } |
| 1069 | 1351 | */ |
| 1070 | 1352 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
| 1071 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1072 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1073 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1074 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1353 | + if ($globalsbs == 'sbs') { |
|
| 1354 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
| 1355 | + } else { |
|
| 1356 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
| 1357 | + } |
|
| 1358 | + if ($globalaprs == 'aprs') { |
|
| 1359 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
| 1360 | + } else { |
|
| 1361 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
| 1362 | + } |
|
| 1075 | 1363 | if ($globalivao == 'ivao') { |
| 1076 | 1364 | //$settings = array_merge($settings,array('globalIVAO' => 'TRUE','globalVATSIM' => 'FALSE')); |
| 1077 | 1365 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
| 1078 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1366 | + } else { |
|
| 1367 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
| 1368 | + } |
|
| 1079 | 1369 | if ($globalvatsim == 'vatsim') { |
| 1080 | 1370 | //$settings = array_merge($settings,array('globalVATSIM' => 'TRUE','globalIVAO' => 'FALSE')); |
| 1081 | 1371 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
| 1082 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1372 | + } else { |
|
| 1373 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
| 1374 | + } |
|
| 1083 | 1375 | if ($globalphpvms == 'phpvms') { |
| 1084 | 1376 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
| 1085 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1377 | + } else { |
|
| 1378 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
| 1379 | + } |
|
| 1086 | 1380 | if ($globalvam == 'vam') { |
| 1087 | 1381 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
| 1088 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1382 | + } else { |
|
| 1383 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
| 1384 | + } |
|
| 1089 | 1385 | if ($globalvatsim == 'vatsim' || $globalivao == 'ivao' || $globalphpvms == 'phpvms') { |
| 1090 | 1386 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
| 1091 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1387 | + } else { |
|
| 1388 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
| 1389 | + } |
|
| 1092 | 1390 | |
| 1093 | 1391 | |
| 1094 | 1392 | |
@@ -1224,7 +1522,9 @@ discard block |
||
| 1224 | 1522 | $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
| 1225 | 1523 | } |
| 1226 | 1524 | |
| 1227 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1525 | + if (!isset($globalTransaction)) { |
|
| 1526 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
| 1527 | + } |
|
| 1228 | 1528 | |
| 1229 | 1529 | // Set some defaults values... |
| 1230 | 1530 | if (!isset($globalAircraftImageSources)) { |
@@ -1239,15 +1539,23 @@ discard block |
||
| 1239 | 1539 | |
| 1240 | 1540 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
| 1241 | 1541 | |
| 1242 | - if ($error == '') settings::modify_settings($settings); |
|
| 1243 | - if ($error == '') settings::comment_settings($settings_comment); |
|
| 1542 | + if ($error == '') { |
|
| 1543 | + settings::modify_settings($settings); |
|
| 1544 | + } |
|
| 1545 | + if ($error == '') { |
|
| 1546 | + settings::comment_settings($settings_comment); |
|
| 1547 | + } |
|
| 1244 | 1548 | if ($error != '') { |
| 1245 | 1549 | print '<div class="info column">'.$error.'</div>'; |
| 1246 | 1550 | require('../footer.php'); |
| 1247 | 1551 | exit; |
| 1248 | 1552 | } else { |
| 1249 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
| 1250 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
| 1553 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
| 1554 | + $_SESSION['waypoints'] = 1; |
|
| 1555 | + } |
|
| 1556 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
| 1557 | + $_SESSION['owner'] = 1; |
|
| 1558 | + } |
|
| 1251 | 1559 | if (isset($_POST['createdb'])) { |
| 1252 | 1560 | $_SESSION['install'] = 'database_create'; |
| 1253 | 1561 | } else { |
@@ -1288,10 +1596,18 @@ discard block |
||
| 1288 | 1596 | $popw = false; |
| 1289 | 1597 | foreach ($_SESSION['done'] as $done) { |
| 1290 | 1598 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
| 1291 | - if ($done == 'Create database') $pop = true; |
|
| 1292 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
| 1293 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
| 1294 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
| 1599 | + if ($done == 'Create database') { |
|
| 1600 | + $pop = true; |
|
| 1601 | + } |
|
| 1602 | + if ($_SESSION['install'] == 'database_create') { |
|
| 1603 | + $pop = true; |
|
| 1604 | + } |
|
| 1605 | + if ($_SESSION['install'] == 'database_import') { |
|
| 1606 | + $popi = true; |
|
| 1607 | + } |
|
| 1608 | + if ($_SESSION['install'] == 'waypoints') { |
|
| 1609 | + $popw = true; |
|
| 1610 | + } |
|
| 1295 | 1611 | } |
| 1296 | 1612 | if ($pop) { |
| 1297 | 1613 | sleep(5); |
@@ -1302,7 +1618,9 @@ discard block |
||
| 1302 | 1618 | } else if ($popw) { |
| 1303 | 1619 | sleep(5); |
| 1304 | 1620 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
| 1305 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 1621 | + } else { |
|
| 1622 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
| 1623 | + } |
|
| 1306 | 1624 | print '</div></ul>'; |
| 1307 | 1625 | print '<div id="error"></div>'; |
| 1308 | 1626 | /* foreach ($_SESSION['done'] as $done) { |
@@ -22,7 +22,9 @@ |
||
| 22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 25 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 25 | + if (empty($all_manufacturers)) { |
|
| 26 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 27 | + } |
|
| 26 | 28 | foreach($all_manufacturers as $all_manufacturer) |
| 27 | 29 | { |
| 28 | 30 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -8,13 +8,13 @@ discard block |
||
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
| 12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 13 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
| 11 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
| 12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 13 | +$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort); |
|
| 14 | 14 | |
| 15 | 15 | if (!empty($spotter_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Aircraft from %s"),$manufacturer); |
|
| 17 | + $title = sprintf(_("Most Common Aircraft from %s"), $manufacturer); |
|
| 18 | 18 | |
| 19 | 19 | require_once('header.php'); |
| 20 | 20 | print '<div class="select-item">'; |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 25 | 25 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
| 26 | - foreach($all_manufacturers as $all_manufacturer) |
|
| 26 | + foreach ($all_manufacturers as $all_manufacturer) |
|
| 27 | 27 | { |
| 28 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 28 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 29 | 29 | { |
| 30 | 30 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
| 31 | 31 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | include('manufacturer-sub-menu.php'); |
| 45 | 45 | print '<div class="column">'; |
| 46 | 46 | print '<h2>'._("Most Common Aircraft").'</h2>'; |
| 47 | - print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
| 47 | + print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
| 48 | 48 | |
| 49 | 49 | $aircraft_array = $Spotter->countAllAircraftTypesByManufacturer($manufacturer); |
| 50 | 50 | if (!empty($aircraft_array)) |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | print '</thead>'; |
| 60 | 60 | print '<tbody>'; |
| 61 | 61 | $i = 1; |
| 62 | - foreach($aircraft_array as $aircraft_item) |
|
| 62 | + foreach ($aircraft_array as $aircraft_item) |
|
| 63 | 63 | { |
| 64 | 64 | print '<tr>'; |
| 65 | 65 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['aircraft_manufacturer'])) { |
| 7 | - header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | 11 | $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
@@ -22,7 +22,9 @@ |
||
| 22 | 22 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 25 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 25 | + if (empty($all_manufacturers)) { |
|
| 26 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 27 | + } |
|
| 26 | 28 | foreach($all_manufacturers as $all_manufacturer) |
| 27 | 29 | { |
| 28 | 30 | if($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -8,13 +8,13 @@ discard block |
||
| 8 | 8 | die(); |
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
| 12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 13 | -$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,"0,1", $sort); |
|
| 11 | +$manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
| 12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 13 | +$spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, "0,1", $sort); |
|
| 14 | 14 | |
| 15 | 15 | if (!empty($spotter_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Airlines by Country from %s"),$manufacturer); |
|
| 17 | + $title = sprintf(_("Most Common Airlines by Country from %s"), $manufacturer); |
|
| 18 | 18 | |
| 19 | 19 | require_once('header.php'); |
| 20 | 20 | print '<div class="select-item">'; |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | $Stats = new Stats(); |
| 24 | 24 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 25 | 25 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
| 26 | - foreach($all_manufacturers as $all_manufacturer) |
|
| 26 | + foreach ($all_manufacturers as $all_manufacturer) |
|
| 27 | 27 | { |
| 28 | - if($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 28 | + if ($GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 29 | 29 | { |
| 30 | 30 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
| 31 | 31 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | include('manufacturer-sub-menu.php'); |
| 45 | 45 | print '<div class="column">'; |
| 46 | 46 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
| 47 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s</strong>."),$manufacturer).'</p>'; |
|
| 47 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s</strong>."), $manufacturer).'</p>'; |
|
| 48 | 48 | $airline_array = $Spotter->countAllAirlineCountriesByManufacturer($manufacturer); |
| 49 | 49 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
| 50 | 50 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ["'._("Country").'", "'._("# of times").'"], '; |
| 57 | 57 | |
| 58 | 58 | $country_data = ''; |
| 59 | - foreach($airline_array as $airline_item) |
|
| 59 | + foreach ($airline_array as $airline_item) |
|
| 60 | 60 | { |
| 61 | 61 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
| 62 | 62 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | print '</thead>'; |
| 91 | 91 | print '<tbody>'; |
| 92 | 92 | $i = 1; |
| 93 | - foreach($airline_array as $airline_item) |
|
| 93 | + foreach ($airline_array as $airline_item) |
|
| 94 | 94 | { |
| 95 | 95 | print '<tr>'; |
| 96 | 96 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | if (!isset($_GET['aircraft_manufacturer'])) { |
| 7 | - header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/manufacturer'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | 11 | $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $limit_start = 0; |
| 14 | 14 | $limit_end = 25; |
| 15 | 15 | $absolute_difference = 25; |
| 16 | - } else { |
|
| 16 | + } else { |
|
| 17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
| 18 | 18 | $limit_start = $limit_explode[0]; |
| 19 | 19 | $limit_end = $limit_explode[1]; |
@@ -47,7 +47,9 @@ discard block |
||
| 47 | 47 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
| 48 | 48 | $Stats = new Stats(); |
| 49 | 49 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 50 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 50 | + if (empty($all_manufacturers)) { |
|
| 51 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 52 | + } |
|
| 51 | 53 | foreach($all_manufacturers as $all_manufacturer) |
| 52 | 54 | { |
| 53 | 55 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -4,16 +4,16 @@ discard block |
||
| 4 | 4 | require_once('require/class.Stats.php'); |
| 5 | 5 | require_once('require/class.Language.php'); |
| 6 | 6 | $Spotter = new Spotter(); |
| 7 | -if (!isset($_GET['aircraft_manufacturer'])){ |
|
| 7 | +if (!isset($_GET['aircraft_manufacturer'])) { |
|
| 8 | 8 | header('Location: '.$globalURL.''); |
| 9 | 9 | } else { |
| 10 | 10 | //calculuation for the pagination |
| 11 | - if(!isset($_GET['limit'])) |
|
| 11 | + if (!isset($_GET['limit'])) |
|
| 12 | 12 | { |
| 13 | 13 | $limit_start = 0; |
| 14 | 14 | $limit_end = 25; |
| 15 | 15 | $absolute_difference = 25; |
| 16 | - } else { |
|
| 16 | + } else { |
|
| 17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
| 18 | 18 | $limit_start = $limit_explode[0]; |
| 19 | 19 | $limit_end = $limit_explode[1]; |
@@ -27,19 +27,19 @@ discard block |
||
| 27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference; |
| 28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference; |
| 29 | 29 | |
| 30 | - $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
|
| 31 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 30 | + $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'aircraft_manufacturer', FILTER_SANITIZE_STRING))); |
|
| 31 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 32 | 32 | $page_url = $globalURL.'/manufacturer/'.$manufacturer; |
| 33 | 33 | |
| 34 | 34 | if ($sort != '') { |
| 35 | - $spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,$limit_start.",".$absolute_difference, $sort); |
|
| 35 | + $spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, $limit_start.",".$absolute_difference, $sort); |
|
| 36 | 36 | } else { |
| 37 | - $spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer,$limit_start.",".$absolute_difference, ''); |
|
| 37 | + $spotter_array = $Spotter->getSpotterDataByManufacturer($manufacturer, $limit_start.",".$absolute_difference, ''); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | if (!empty($spotter_array)) |
| 41 | 41 | { |
| 42 | - $title = sprintf(_("Detailed View for %s"),$manufacturer); |
|
| 42 | + $title = sprintf(_("Detailed View for %s"), $manufacturer); |
|
| 43 | 43 | |
| 44 | 44 | require_once('header.php'); |
| 45 | 45 | print '<div class="select-item">'; |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | $Stats = new Stats(); |
| 49 | 49 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 50 | 50 | if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
| 51 | - foreach($all_manufacturers as $all_manufacturer) |
|
| 51 | + foreach ($all_manufacturers as $all_manufacturer) |
|
| 52 | 52 | { |
| 53 | - if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 53 | + if ($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
|
| 54 | 54 | { |
| 55 | 55 | print '<option value="'.strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer'])).'" selected="selected">'.$all_manufacturer['aircraft_manufacturer'].'</option>'; |
| 56 | 56 | } else { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | print '</div>'; |
| 68 | 68 | |
| 69 | 69 | print '<div class="table column">'; |
| 70 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong."),$manufacturer).'</p>'; |
|
| 70 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s</strong."), $manufacturer).'</p>'; |
|
| 71 | 71 | |
| 72 | 72 | include('manufacturer-sub-menu.php'); |
| 73 | 73 | include('table-output.php'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * Get SQL query part for filter used |
| 13 | 13 | * @param Array $filter the filter |
| 14 | - * @return Array the SQL part |
|
| 14 | + * @return string the SQL part |
|
| 15 | 15 | */ |
| 16 | 16 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 17 | 17 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
@@ -20,20 +20,27 @@ discard block |
||
| 20 | 20 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
| 21 | 21 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
| 22 | 22 | foreach($globalStatsFilters[$globalFilterName] as $source) { |
| 23 | - if (isset($source['source'])) $filter['source'][] = $source['source']; |
|
| 23 | + if (isset($source['source'])) { |
|
| 24 | + $filter['source'][] = $source['source']; |
|
| 25 | + } |
|
| 24 | 26 | } |
| 25 | 27 | } else { |
| 26 | 28 | $filter = $globalStatsFilters[$globalFilterName]; |
| 27 | 29 | } |
| 28 | 30 | } |
| 29 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 31 | + if (is_array($globalFilter)) { |
|
| 32 | + $filter = array_merge($filter,$globalFilter); |
|
| 33 | + } |
|
| 30 | 34 | $filter_query_join = ''; |
| 31 | 35 | $filter_query_where = ''; |
| 32 | 36 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 33 | 37 | $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
| 34 | 38 | } |
| 35 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
| 36 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
| 39 | + if ($filter_query_where == '' && $where) { |
|
| 40 | + $filter_query_where = ' WHERE'; |
|
| 41 | + } elseif ($filter_query_where != '' && $and) { |
|
| 42 | + $filter_query_where .= ' AND'; |
|
| 43 | + } |
|
| 37 | 44 | $filter_query = $filter_query_join.$filter_query_where; |
| 38 | 45 | return $filter_query; |
| 39 | 46 | } |
@@ -57,7 +64,9 @@ discard block |
||
| 57 | 64 | $info = str_replace('^','<br />',$info); |
| 58 | 65 | $info = str_replace('&sect;','',$info); |
| 59 | 66 | $info = str_replace('"','',$info); |
| 60 | - if ($type == '') $type = NULL; |
|
| 67 | + if ($type == '') { |
|
| 68 | + $type = NULL; |
|
| 69 | + } |
|
| 61 | 70 | $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
| 62 | 71 | $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
| 63 | 72 | try { |
@@ -10,100 +10,100 @@ |
||
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * Get SQL query part for filter used |
|
| 15 | - * @param Array $filter the filter |
|
| 16 | - * @return Array the SQL part |
|
| 17 | - */ |
|
| 18 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
| 13 | + /** |
|
| 14 | + * Get SQL query part for filter used |
|
| 15 | + * @param Array $filter the filter |
|
| 16 | + * @return Array the SQL part |
|
| 17 | + */ |
|
| 18 | + public function getFilter($filter = array(),$where = false,$and = false) { |
|
| 19 | 19 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
| 20 | 20 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
| 21 | - if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
|
| 21 | + if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
|
| 22 | 22 | foreach($globalStatsFilters[$globalFilterName] as $source) { |
| 23 | 23 | if (isset($source['source'])) $filter['source'][] = $source['source']; |
| 24 | 24 | } |
| 25 | - } else { |
|
| 25 | + } else { |
|
| 26 | 26 | $filter = $globalStatsFilters[$globalFilterName]; |
| 27 | - } |
|
| 27 | + } |
|
| 28 | 28 | } |
| 29 | 29 | if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
| 30 | 30 | $filter_query_join = ''; |
| 31 | 31 | $filter_query_where = ''; |
| 32 | 32 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 33 | - $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 33 | + $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 34 | 34 | } |
| 35 | 35 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
| 36 | 36 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
| 37 | 37 | $filter_query = $filter_query_join.$filter_query_where; |
| 38 | 38 | return $filter_query; |
| 39 | - } |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - public function getAll() { |
|
| 42 | - $filter_query = $this->getFilter(array()); |
|
| 43 | - $query = "SELECT * FROM atc".$filter_query; |
|
| 44 | - $query_values = array(); |
|
| 45 | - try { |
|
| 46 | - $sth = $this->db->prepare($query); |
|
| 47 | - $sth->execute($query_values); |
|
| 48 | - } catch(PDOException $e) { |
|
| 49 | - return "error : ".$e->getMessage(); |
|
| 50 | - } |
|
| 51 | - $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 52 | - return $all; |
|
| 53 | - } |
|
| 41 | + public function getAll() { |
|
| 42 | + $filter_query = $this->getFilter(array()); |
|
| 43 | + $query = "SELECT * FROM atc".$filter_query; |
|
| 44 | + $query_values = array(); |
|
| 45 | + try { |
|
| 46 | + $sth = $this->db->prepare($query); |
|
| 47 | + $sth->execute($query_values); |
|
| 48 | + } catch(PDOException $e) { |
|
| 49 | + return "error : ".$e->getMessage(); |
|
| 50 | + } |
|
| 51 | + $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
| 52 | + return $all; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
| 56 | - $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
| 57 | - $info = str_replace('^','<br />',$info); |
|
| 58 | - $info = str_replace('&sect;','',$info); |
|
| 59 | - $info = str_replace('"','',$info); |
|
| 60 | - if ($type == '') $type = NULL; |
|
| 61 | - $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
|
| 62 | - $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
|
| 63 | - try { |
|
| 64 | - $sth = $this->db->prepare($query); |
|
| 65 | - $sth->execute($query_values); |
|
| 66 | - } catch(PDOException $e) { |
|
| 67 | - return "error : ".$e->getMessage(); |
|
| 68 | - } |
|
| 69 | - } |
|
| 55 | + public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
| 56 | + $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
| 57 | + $info = str_replace('^','<br />',$info); |
|
| 58 | + $info = str_replace('&sect;','',$info); |
|
| 59 | + $info = str_replace('"','',$info); |
|
| 60 | + if ($type == '') $type = NULL; |
|
| 61 | + $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
|
| 62 | + $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
|
| 63 | + try { |
|
| 64 | + $sth = $this->db->prepare($query); |
|
| 65 | + $sth->execute($query_values); |
|
| 66 | + } catch(PDOException $e) { |
|
| 67 | + return "error : ".$e->getMessage(); |
|
| 68 | + } |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - public function deleteById($id) { |
|
| 72 | - $query = "DELETE FROM atc WHERE atc_id = :id"; |
|
| 73 | - $query_values = array(':id' => $id); |
|
| 74 | - try { |
|
| 75 | - $sth = $this->db->prepare($query); |
|
| 76 | - $sth->execute($query_values); |
|
| 77 | - } catch(PDOException $e) { |
|
| 78 | - return "error : ".$e->getMessage(); |
|
| 79 | - } |
|
| 80 | - } |
|
| 71 | + public function deleteById($id) { |
|
| 72 | + $query = "DELETE FROM atc WHERE atc_id = :id"; |
|
| 73 | + $query_values = array(':id' => $id); |
|
| 74 | + try { |
|
| 75 | + $sth = $this->db->prepare($query); |
|
| 76 | + $sth->execute($query_values); |
|
| 77 | + } catch(PDOException $e) { |
|
| 78 | + return "error : ".$e->getMessage(); |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - public function deleteAll() { |
|
| 83 | - $query = "DELETE FROM atc"; |
|
| 84 | - $query_values = array(); |
|
| 85 | - try { |
|
| 86 | - $sth = $this->db->prepare($query); |
|
| 87 | - $sth->execute($query_values); |
|
| 88 | - } catch(PDOException $e) { |
|
| 89 | - return "error : ".$e->getMessage(); |
|
| 90 | - } |
|
| 91 | - } |
|
| 82 | + public function deleteAll() { |
|
| 83 | + $query = "DELETE FROM atc"; |
|
| 84 | + $query_values = array(); |
|
| 85 | + try { |
|
| 86 | + $sth = $this->db->prepare($query); |
|
| 87 | + $sth->execute($query_values); |
|
| 88 | + } catch(PDOException $e) { |
|
| 89 | + return "error : ".$e->getMessage(); |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | 93 | public function deleteOldATC() { |
| 94 | - global $globalDBdriver; |
|
| 95 | - if ($globalDBdriver == 'mysql') { |
|
| 96 | - $query = "DELETE FROM atc WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= atc.atc_lastseen"; |
|
| 97 | - } else { |
|
| 98 | - $query = "DELETE FROM atc WHERE NOW() AT TIME ZONE 'UTC' - '1 HOUR'->INTERVAL >= atc.atc_lastseen"; |
|
| 99 | - } |
|
| 100 | - try { |
|
| 101 | - $sth = $this->db->prepare($query); |
|
| 102 | - $sth->execute(); |
|
| 103 | - } catch(PDOException $e) { |
|
| 104 | - return "error"; |
|
| 105 | - } |
|
| 106 | - return "success"; |
|
| 107 | - } |
|
| 94 | + global $globalDBdriver; |
|
| 95 | + if ($globalDBdriver == 'mysql') { |
|
| 96 | + $query = "DELETE FROM atc WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= atc.atc_lastseen"; |
|
| 97 | + } else { |
|
| 98 | + $query = "DELETE FROM atc WHERE NOW() AT TIME ZONE 'UTC' - '1 HOUR'->INTERVAL >= atc.atc_lastseen"; |
|
| 99 | + } |
|
| 100 | + try { |
|
| 101 | + $sth = $this->db->prepare($query); |
|
| 102 | + $sth->execute(); |
|
| 103 | + } catch(PDOException $e) { |
|
| 104 | + return "error"; |
|
| 105 | + } |
|
| 106 | + return "success"; |
|
| 107 | + } |
|
| 108 | 108 | } |
| 109 | 109 | ?> |
| 110 | 110 | \ No newline at end of file |
@@ -15,22 +15,22 @@ discard block |
||
| 15 | 15 | * @param Array $filter the filter |
| 16 | 16 | * @return Array the SQL part |
| 17 | 17 | */ |
| 18 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
| 18 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
| 19 | 19 | global $globalFilter, $globalStatsFilters, $globalFilterName; |
| 20 | 20 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
| 21 | 21 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
| 22 | - foreach($globalStatsFilters[$globalFilterName] as $source) { |
|
| 22 | + foreach ($globalStatsFilters[$globalFilterName] as $source) { |
|
| 23 | 23 | if (isset($source['source'])) $filter['source'][] = $source['source']; |
| 24 | 24 | } |
| 25 | 25 | } else { |
| 26 | 26 | $filter = $globalStatsFilters[$globalFilterName]; |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 29 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
| 30 | 30 | $filter_query_join = ''; |
| 31 | 31 | $filter_query_where = ''; |
| 32 | 32 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 33 | - $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
|
| 33 | + $filter_query_where = " WHERE format_source IN ('".implode("','", $filter['source'])."')"; |
|
| 34 | 34 | } |
| 35 | 35 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
| 36 | 36 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
@@ -45,25 +45,25 @@ discard block |
||
| 45 | 45 | try { |
| 46 | 46 | $sth = $this->db->prepare($query); |
| 47 | 47 | $sth->execute($query_values); |
| 48 | - } catch(PDOException $e) { |
|
| 48 | + } catch (PDOException $e) { |
|
| 49 | 49 | return "error : ".$e->getMessage(); |
| 50 | 50 | } |
| 51 | 51 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 52 | 52 | return $all; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function add($ident,$frequency,$latitude,$longitude,$range,$info,$date,$type = '',$ivao_id = '',$ivao_name = '',$format_source = '',$source_name = '') { |
|
| 56 | - $info = preg_replace('/[^(\x20-\x7F)]*/','',$info); |
|
| 57 | - $info = str_replace('^','<br />',$info); |
|
| 58 | - $info = str_replace('&sect;','',$info); |
|
| 59 | - $info = str_replace('"','',$info); |
|
| 55 | + public function add($ident, $frequency, $latitude, $longitude, $range, $info, $date, $type = '', $ivao_id = '', $ivao_name = '', $format_source = '', $source_name = '') { |
|
| 56 | + $info = preg_replace('/[^(\x20-\x7F)]*/', '', $info); |
|
| 57 | + $info = str_replace('^', '<br />', $info); |
|
| 58 | + $info = str_replace('&sect;', '', $info); |
|
| 59 | + $info = str_replace('"', '', $info); |
|
| 60 | 60 | if ($type == '') $type = NULL; |
| 61 | 61 | $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
| 62 | - $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
|
| 62 | + $query_values = array(':ident' => $ident, ':frequency' => $frequency, ':latitude' => $latitude, ':longitude' => $longitude, ':range' => $range, ':info' => $info, ':date' => $date, ':ivao_id' => $ivao_id, ':ivao_name' => $ivao_name, ':type' => $type, ':format_source' => $format_source, ':source_name' => $source_name); |
|
| 63 | 63 | try { |
| 64 | 64 | $sth = $this->db->prepare($query); |
| 65 | 65 | $sth->execute($query_values); |
| 66 | - } catch(PDOException $e) { |
|
| 66 | + } catch (PDOException $e) { |
|
| 67 | 67 | return "error : ".$e->getMessage(); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | try { |
| 75 | 75 | $sth = $this->db->prepare($query); |
| 76 | 76 | $sth->execute($query_values); |
| 77 | - } catch(PDOException $e) { |
|
| 77 | + } catch (PDOException $e) { |
|
| 78 | 78 | return "error : ".$e->getMessage(); |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | try { |
| 86 | 86 | $sth = $this->db->prepare($query); |
| 87 | 87 | $sth->execute($query_values); |
| 88 | - } catch(PDOException $e) { |
|
| 88 | + } catch (PDOException $e) { |
|
| 89 | 89 | return "error : ".$e->getMessage(); |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | try { |
| 101 | 101 | $sth = $this->db->prepare($query); |
| 102 | 102 | $sth->execute(); |
| 103 | - } catch(PDOException $e) { |
|
| 103 | + } catch (PDOException $e) { |
|
| 104 | 104 | return "error"; |
| 105 | 105 | } |
| 106 | 106 | return "success"; |