@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $Spotter = new Spotter(); |
8 | 8 | $orderby = $Spotter->getOrderBy(); |
9 | 9 | |
10 | -$ask = filter_input(INPUT_GET,'ask',FILTER_SANITIZE_STRING); |
|
10 | +$ask = filter_input(INPUT_GET, 'ask', FILTER_SANITIZE_STRING); |
|
11 | 11 | if ($ask == 'aircraftsdetected') { |
12 | 12 | require_once('require/class.SpotterLive.php'); |
13 | 13 | $SpotterLive = new SpotterLive(); |
@@ -27,16 +27,16 @@ discard block |
||
27 | 27 | $manufacturers = $Stats->getAllManufacturers(); |
28 | 28 | if (empty($manufacturers)) $manufacturers = $Spotter->getAllManufacturers(); |
29 | 29 | $all_manufacturers = array(); |
30 | - foreach($manufacturers as $manufacturer) |
|
30 | + foreach ($manufacturers as $manufacturer) |
|
31 | 31 | { |
32 | - $all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ','-',$manufacturer['aircraft_manufacturer']))); |
|
32 | + $all_manufacturers[] = array('value' => $manufacturer['aircraft_manufacturer'], 'id' => strtolower(str_replace(' ', '-', $manufacturer['aircraft_manufacturer']))); |
|
33 | 33 | } |
34 | 34 | echo json_encode($all_manufacturers); |
35 | 35 | } elseif ($ask == 'aircrafttypes') { |
36 | 36 | $aircraft_types = $Stats->getAllAircraftTypes(); |
37 | 37 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
38 | 38 | $all_aircraft_types = array(); |
39 | - foreach($aircraft_types as $aircraft_type) |
|
39 | + foreach ($aircraft_types as $aircraft_type) |
|
40 | 40 | { |
41 | 41 | $all_aircraft_types[] = array('id' => $aircraft_type['aircraft_icao'], 'value' => $aircraft_type['aircraft_name'].' ('.$aircraft_type['aircraft_icao'].')'); |
42 | 42 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } elseif ($ask == 'airlinenames') { |
45 | 45 | $airline_names = $Stats->getAllAirlineNames(); |
46 | 46 | $all_airline_names = array(); |
47 | - foreach($airline_names as $airline_name) |
|
47 | + foreach ($airline_names as $airline_name) |
|
48 | 48 | { |
49 | 49 | $all_airline_names[] = array('id' => $airline_name['airline_icao'], 'value' => $airline_name['airline_name'].' ('.$airline_name['airline_icao'].')'); |
50 | 50 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } elseif ($ask == 'airlinecountries') { |
53 | 53 | $airline_countries = $Spotter->getAllAirlineCountries(); |
54 | 54 | $all_airline_countries = array(); |
55 | - foreach($airline_countries as $airline_country) |
|
55 | + foreach ($airline_countries as $airline_country) |
|
56 | 56 | { |
57 | 57 | $all_airline_countries[] = array('id' => $airline_country['airline_country'], 'value' => $airline_country['airline_country']); |
58 | 58 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
63 | 63 | ksort($airport_names); |
64 | 64 | $all_airport_names = array(); |
65 | - foreach($airport_names as $airport_name) |
|
65 | + foreach ($airport_names as $airport_name) |
|
66 | 66 | { |
67 | 67 | $all_airport_names[] = array('id' => $airport_name['airport_icao'], 'value' => $airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')'); |
68 | 68 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } elseif ($ask == 'airportcountries') { |
71 | 71 | $airport_countries = $Spotter->getAllAirportCountries(); |
72 | 72 | $all_airport_countries = array(); |
73 | - foreach($airport_countries as $airport_country) |
|
73 | + foreach ($airport_countries as $airport_country) |
|
74 | 74 | { |
75 | 75 | $all_airport_countries[] = array('id' => $airport_country['airport_country'], 'value' => $airport_country['airport_country']); |
76 | 76 | } |
@@ -25,7 +25,9 @@ discard block |
||
25 | 25 | echo json_encode($marinecnt); |
26 | 26 | } elseif ($ask == 'manufacturer') { |
27 | 27 | $manufacturers = $Stats->getAllManufacturers(); |
28 | - if (empty($manufacturers)) $manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + if (empty($manufacturers)) { |
|
29 | + $manufacturers = $Spotter->getAllManufacturers(); |
|
30 | + } |
|
29 | 31 | $all_manufacturers = array(); |
30 | 32 | foreach($manufacturers as $manufacturer) |
31 | 33 | { |
@@ -34,7 +36,9 @@ discard block |
||
34 | 36 | echo json_encode($all_manufacturers); |
35 | 37 | } elseif ($ask == 'aircrafttypes') { |
36 | 38 | $aircraft_types = $Stats->getAllAircraftTypes(); |
37 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
39 | + if (empty($aircraft_types)) { |
|
40 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
41 | + } |
|
38 | 42 | $all_aircraft_types = array(); |
39 | 43 | foreach($aircraft_types as $aircraft_type) |
40 | 44 | { |
@@ -59,7 +63,9 @@ discard block |
||
59 | 63 | echo json_encode($all_airline_countries); |
60 | 64 | } elseif ($ask == 'airportnames' || $ask == 'departureairportnames' || $ask == 'arrivalairportnames') { |
61 | 65 | $airport_names = $Stats->getAllAirportNames(); |
62 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
66 | + if (empty($airport_names)) { |
|
67 | + $airport_names = $Spotter->getAllAirportNames(); |
|
68 | + } |
|
63 | 69 | ksort($airport_names); |
64 | 70 | $all_airport_names = array(); |
65 | 71 | foreach($airport_names as $airport_name) |
@@ -16,24 +16,24 @@ discard block |
||
16 | 16 | $sql_date = ''; |
17 | 17 | if (isset($_GET['start_date'])) { |
18 | 18 | //for the date manipulation into the query |
19 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
19 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
20 | 20 | if (strtotime($_GET['start_date']) !== false && strtotime($_GET['end_date']) !== false) { |
21 | 21 | //$start_date = $_GET['start_date']." 00:00:00"; |
22 | - $start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00"; |
|
22 | + $start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00"; |
|
23 | 23 | //$end_date = $_GET['end_date']." 00:00:00"; |
24 | - $end_date = date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00"; |
|
24 | + $end_date = date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00"; |
|
25 | 25 | $sql_date = $start_date.",".$end_date; |
26 | 26 | } |
27 | - } else if($_GET['start_date'] != ""){ |
|
27 | + } else if ($_GET['start_date'] != "") { |
|
28 | 28 | if (strtotime($_GET['start_date']) !== false) { |
29 | 29 | //$start_date = $_GET['start_date']." 00:00:00"; |
30 | - $start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00"; |
|
30 | + $start_date = date("Y-m-d", strtotime($_GET['start_date']))." 00:00:00"; |
|
31 | 31 | $sql_date = $start_date; |
32 | 32 | } |
33 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
33 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
34 | 34 | if (strtotime($_GET['end_date']) !== false) { |
35 | 35 | //$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00"; |
36 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00"; |
|
36 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d", strtotime($_GET['end_date']))." 00:00:00"; |
|
37 | 37 | $sql_date = $end_date; |
38 | 38 | } |
39 | 39 | } else $sql_date = ''; |
@@ -41,21 +41,21 @@ discard block |
||
41 | 41 | |
42 | 42 | if (isset($_GET['highest_altitude'])) { |
43 | 43 | //for altitude manipulation |
44 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
45 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
46 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
44 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
45 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
46 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
47 | 47 | $sql_altitude = $start_altitude.",".$end_altitude; |
48 | - } else if($_GET['highest_altitude'] != ""){ |
|
49 | - $end_altitude = filter_input(INPUT_GET,'highest_altitude',FILTER_SANITIZE_NUMBER_INT); |
|
48 | + } else if ($_GET['highest_altitude'] != "") { |
|
49 | + $end_altitude = filter_input(INPUT_GET, 'highest_altitude', FILTER_SANITIZE_NUMBER_INT); |
|
50 | 50 | $sql_altitude = $end_altitude; |
51 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
52 | - $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
51 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
52 | + $start_altitude = filter_input(INPUT_GET, 'lowest_altitude', FILTER_SANITIZE_NUMBER_INT).",60000"; |
|
53 | 53 | $sql_altitude = $start_altitude; |
54 | 54 | } else $sql_altitude = ''; |
55 | 55 | } else $sql_altitude = ''; |
56 | 56 | |
57 | 57 | //calculuation for the pagination |
58 | -if(!isset($_GET['limit'])) |
|
58 | +if (!isset($_GET['limit'])) |
|
59 | 59 | { |
60 | 60 | if (!isset($_GET['number_results'])) |
61 | 61 | { |
@@ -63,45 +63,45 @@ discard block |
||
63 | 63 | $limit_end = 25; |
64 | 64 | $absolute_difference = 25; |
65 | 65 | } else { |
66 | - if ($_GET['number_results'] > 1000){ |
|
66 | + if ($_GET['number_results'] > 1000) { |
|
67 | 67 | $_GET['number_results'] = 1000; |
68 | 68 | } |
69 | 69 | $limit_start = 0; |
70 | - $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
71 | - $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
|
70 | + $limit_end = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
71 | + $absolute_difference = filter_input(INPUT_GET, 'number_results', FILTER_SANITIZE_NUMBER_INT); |
|
72 | 72 | } |
73 | -} else { |
|
73 | +} else { |
|
74 | 74 | $limit_explode = explode(",", $_GET['limit']); |
75 | - $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
|
76 | - $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
|
75 | + $limit_start = filter_var($limit_explode[0], FILTER_SANITIZE_NUMBER_INT); |
|
76 | + $limit_end = filter_var($limit_explode[1], FILTER_SANITIZE_NUMBER_INT); |
|
77 | 77 | } |
78 | 78 | $absolute_difference = abs($limit_start - $limit_end); |
79 | 79 | $limit_next = $limit_end + $absolute_difference; |
80 | 80 | $limit_previous_1 = $limit_start - $absolute_difference; |
81 | 81 | $limit_previous_2 = $limit_end - $absolute_difference; |
82 | 82 | |
83 | -if (!empty($_GET)){ |
|
84 | - $q = filter_input(INPUT_GET, 'q',FILTER_SANITIZE_STRING); |
|
85 | - $registration = filter_input(INPUT_GET, 'registration',FILTER_SANITIZE_STRING); |
|
86 | - $aircraft = filter_input(INPUT_GET, 'aircraft',FILTER_SANITIZE_STRING); |
|
87 | - $manufacturer = filter_input(INPUT_GET, 'manufacturer',FILTER_SANITIZE_STRING); |
|
88 | - $highlights = filter_input(INPUT_GET, 'highlights',FILTER_SANITIZE_STRING); |
|
89 | - $airline = filter_input(INPUT_GET, 'airline',FILTER_SANITIZE_STRING); |
|
90 | - $airline_country = filter_input(INPUT_GET, 'airline_country',FILTER_SANITIZE_STRING); |
|
91 | - $airline_type = filter_input(INPUT_GET, 'airline_type',FILTER_SANITIZE_STRING); |
|
92 | - $airport = filter_input(INPUT_GET, 'airport',FILTER_SANITIZE_STRING); |
|
93 | - $airport_country = filter_input(INPUT_GET, 'airport_country',FILTER_SANITIZE_STRING); |
|
94 | - $callsign = filter_input(INPUT_GET, 'callsign',FILTER_SANITIZE_STRING); |
|
95 | - $owner = filter_input(INPUT_GET, 'owner',FILTER_SANITIZE_STRING); |
|
96 | - $pilot_name = filter_input(INPUT_GET, 'pilot_name',FILTER_SANITIZE_STRING); |
|
97 | - $pilot_id = filter_input(INPUT_GET, 'pilot_id',FILTER_SANITIZE_STRING); |
|
98 | - $departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route',FILTER_SANITIZE_STRING); |
|
99 | - $arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
100 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
101 | - $archive = filter_input(INPUT_GET,'archive',FILTER_SANITIZE_NUMBER_INT); |
|
102 | - $origlat = filter_input(INPUT_GET,'origlat',FILTER_SANITIZE_NUMBER_FLOAT); |
|
103 | - $origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_NUMBER_FLOAT); |
|
104 | - $dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT); |
|
83 | +if (!empty($_GET)) { |
|
84 | + $q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
85 | + $registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
86 | + $aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
87 | + $manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
88 | + $highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
89 | + $airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
90 | + $airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
91 | + $airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
92 | + $airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
93 | + $airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
94 | + $callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
95 | + $owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
96 | + $pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
97 | + $pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
98 | + $departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
99 | + $arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
100 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
101 | + $archive = filter_input(INPUT_GET, 'archive', FILTER_SANITIZE_NUMBER_INT); |
|
102 | + $origlat = filter_input(INPUT_GET, 'origlat', FILTER_SANITIZE_NUMBER_FLOAT); |
|
103 | + $origlon = filter_input(INPUT_GET, 'origlon', FILTER_SANITIZE_NUMBER_FLOAT); |
|
104 | + $dist = filter_input(INPUT_GET, 'dist', FILTER_SANITIZE_NUMBER_INT); |
|
105 | 105 | if ($dist != '') { |
106 | 106 | if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934; |
107 | 107 | elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852; |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | if (!isset($sql_date)) $sql_date = ''; |
110 | 110 | if ($archive == 1) { |
111 | 111 | $SpotterArchive = new SpotterArchive(); |
112 | - $spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist); |
|
112 | + $spotter_array = $SpotterArchive->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist); |
|
113 | 113 | } else { |
114 | - $spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist); |
|
114 | + $spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '', $origlat, $origlon, $dist); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | print '<span class="sub-menu-statistic column mobile">'; |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | //remove 3D=true parameter |
145 | 145 | $no3D = str_replace("&3D=true", "", $_SERVER['QUERY_STRING']); |
146 | 146 | $kmlURL = str_replace("http://", "kml://", $globalURL); |
147 | - if (!isset($_GET['3D'])){ |
|
147 | + if (!isset($_GET['3D'])) { |
|
148 | 148 | print '<li><a href="'.$globalURL.'/search?'.$no3D.'" class="active"><i class="fa fa-table"></i> '._("Table").'</a></li>'; |
149 | 149 | } else { |
150 | 150 | print '<li><span class="notablet"><a href="'.$globalURL.'/search?'.$no3D.'"><i class="fa fa-table"></i> '._("Table").'</a></span></li>'; |
151 | 151 | } |
152 | - if (isset($_GET['3D'])){ |
|
152 | + if (isset($_GET['3D'])) { |
|
153 | 153 | print '<li><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="active"><i class="fa fa-globe"></i> '._("3D Map").'</a></li>'; |
154 | 154 | } else { |
155 | 155 | print '<li ><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="notablet nomobile"><i class="fa fa-globe"></i> '._("3D Map").'</a><a href="'.$kmlURL.'/search/kml?'.htmlentities($_SERVER['QUERY_STRING']).'" class="tablet mobile"><i class="fa fa-globe"></i> 3D Map</a></li>'; |
@@ -170,30 +170,30 @@ discard block |
||
170 | 170 | print '<div class="column">'; |
171 | 171 | print '<div class="info">'; |
172 | 172 | print '<h1>'._("Search Results for").' '; |
173 | - if (isset($_GET['q']) && $_GET['q'] != ""){ print _("Keyword:").' <span>'.$q.'</span> '; } |
|
174 | - if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; } |
|
175 | - if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; } |
|
176 | - if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; } |
|
177 | - if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; } |
|
178 | - if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; } |
|
179 | - if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; } |
|
180 | - if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; } |
|
181 | - if (isset($_GET['airport']) && $_GET['airport'] != ""){ print _("Airport:").' <span>'.$airport.'</span> '; } |
|
182 | - if (isset($_GET['airport_country']) && $_GET['airport_country'] != ""){ print _("Airport country:").' <span>'.$airport_country.'</span> '; } |
|
183 | - if (isset($_GET['callsign']) && $_GET['callsign'] != ""){ print _("Callsign:").' <span>'.$callsign.'</span> '; } |
|
184 | - if (isset($_GET['owner']) && $_GET['owner'] != ""){ print _("Owner:").' <span>'.$owner.'</span> '; } |
|
185 | - if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != ""){ print _("Pilot id:").' <span>'.$pilot_id.'</span> '; } |
|
186 | - if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != ""){ print _("Pilot name:").' <span>'.$pilot_name.'</span> '; } |
|
187 | - if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")){ print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; } |
|
188 | - if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; } |
|
189 | - if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; } |
|
190 | - if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == ""){ print _("Date starting at:").' <span>'.$start_date.'</span> '; } |
|
191 | - if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date ending at:").' <span>'.$end_date.'</span> '; } |
|
192 | - if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; } |
|
193 | - if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == ""){ print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; } |
|
194 | - if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; } |
|
195 | - if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; } |
|
196 | - if (isset($_GET['number_results']) && $_GET['number_results'] != ""){ print _("limit per page:").' <span>'.$number_results.'</span> '; } |
|
173 | + if (isset($_GET['q']) && $_GET['q'] != "") { print _("Keyword:").' <span>'.$q.'</span> '; } |
|
174 | + if (isset($_GET['aircraft']) && $_GET['aircraft'] != "") { print _("Aircraft:").' <span>'.$aircraft.'</span> '; } |
|
175 | + if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != "") { print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; } |
|
176 | + if (isset($_GET['registration']) && $_GET['registration'] != "") { print _("Registration:").' <span>'.$registration.'</span> '; } |
|
177 | + if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print _("Highlights:").' <span>'.$highlights.'</span> '; } |
|
178 | + if (isset($_GET['airline']) && $_GET['airline'] != "") { print _("Airline:").' <span>'.$airline.'</span> '; } |
|
179 | + if (isset($_GET['airline_country']) && $_GET['airline_country'] != "") { print _("Airline country:").' <span>'.$airline_country.'</span> '; } |
|
180 | + if (isset($_GET['airline_type']) && $_GET['airline_type'] != "") { print _("Airline type:").' <span>'.$airline_type.'</span> '; } |
|
181 | + if (isset($_GET['airport']) && $_GET['airport'] != "") { print _("Airport:").' <span>'.$airport.'</span> '; } |
|
182 | + if (isset($_GET['airport_country']) && $_GET['airport_country'] != "") { print _("Airport country:").' <span>'.$airport_country.'</span> '; } |
|
183 | + if (isset($_GET['callsign']) && $_GET['callsign'] != "") { print _("Callsign:").' <span>'.$callsign.'</span> '; } |
|
184 | + if (isset($_GET['owner']) && $_GET['owner'] != "") { print _("Owner:").' <span>'.$owner.'</span> '; } |
|
185 | + if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != "") { print _("Pilot id:").' <span>'.$pilot_id.'</span> '; } |
|
186 | + if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != "") { print _("Pilot name:").' <span>'.$pilot_name.'</span> '; } |
|
187 | + if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) || $_GET['arrival_airport_route'] == "")) { print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; } |
|
188 | + if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; } |
|
189 | + if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != "") { print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; } |
|
190 | + if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == "") { print _("Date starting at:").' <span>'.$start_date.'</span> '; } |
|
191 | + if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date ending at:").' <span>'.$end_date.'</span> '; } |
|
192 | + if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != "") { print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; } |
|
193 | + if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == "") { print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; } |
|
194 | + if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; } |
|
195 | + if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != "") { print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; } |
|
196 | + if (isset($_GET['number_results']) && $_GET['number_results'] != "") { print _("limit per page:").' <span>'.$number_results.'</span> '; } |
|
197 | 197 | print '</h1>'; |
198 | 198 | print '</div>'; |
199 | 199 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | </select> |
301 | 301 | </div> |
302 | 302 | </div> |
303 | - <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script> |
|
303 | + <script type="text/javascript">getSelect('manufacturer','<?php if (isset($_GET['manufacturer'])) print $manufacturer; ?>')</script> |
|
304 | 304 | <div class="form-group"> |
305 | 305 | <label class="control-label col-sm-2"><?php echo _("Type"); ?></label> |
306 | 306 | <div class="col-sm-10"> |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | </select> |
310 | 310 | </div> |
311 | 311 | </div> |
312 | - <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script> |
|
312 | + <script type="text/javascript">getSelect('aircrafttypes','<?php if (isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script> |
|
313 | 313 | <div class="form-group"> |
314 | 314 | <label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> |
315 | 315 | <div class="col-sm-10"> |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | </div> |
333 | 333 | </div> |
334 | 334 | <?php |
335 | -}else { |
|
335 | +} else { |
|
336 | 336 | ?> |
337 | 337 | <div class="form-group"> |
338 | 338 | <label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | ?> |
346 | 346 | <div class="form-group"> |
347 | 347 | <div class="col-sm-offset-2 col-sm-10"> |
348 | - <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
349 | - <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
348 | + <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
349 | + <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true") { print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
350 | 350 | </div> |
351 | 351 | </div> |
352 | 352 | </fieldset> |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | </select> |
361 | 361 | </div> |
362 | 362 | </div> |
363 | - <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script> |
|
363 | + <script type="text/javascript">getSelect('airlinenames','<?php if (isset($_GET['airline'])) print $airline; ?>');</script> |
|
364 | 364 | <div class="form-group"> |
365 | 365 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
366 | 366 | <div class="col-sm-10"> |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | </select> |
370 | 370 | </div> |
371 | 371 | </div> |
372 | - <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script> |
|
372 | + <script type="text/javascript">getSelect('airlinecountries','<?php if (isset($_GET['airline_country'])) print $airline_country; ?>');</script> |
|
373 | 373 | <div class="form-group"> |
374 | 374 | <label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> |
375 | 375 | <div class="col-sm-10"> |
@@ -378,10 +378,10 @@ discard block |
||
378 | 378 | </div> |
379 | 379 | <div class="form-group"> |
380 | 380 | <div class="col-sm-offset-2 col-sm-10"> |
381 | - <label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label> |
|
382 | - <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
383 | - <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
384 | - <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label> |
|
381 | + <label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all") { print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label> |
|
382 | + <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger") { print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
383 | + <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "cargo") { print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
384 | + <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "military") { print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label> |
|
385 | 385 | </div> |
386 | 386 | </div> |
387 | 387 | </fieldset> |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | </select> |
396 | 396 | </div> |
397 | 397 | </div> |
398 | - <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script> |
|
398 | + <script type="text/javascript">getSelect('airportnames','<?php if (isset($_GET['airport_icao'])) print $airport_icao; ?>');</script> |
|
399 | 399 | <div class="form-group"> |
400 | 400 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
401 | 401 | <div class="col-sm-10"> |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | </select> |
405 | 405 | </div> |
406 | 406 | </div> |
407 | - <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script> |
|
407 | + <script type="text/javascript">getSelect('airportcountries','<?php if (isset($_GET['airport_country'])) print $airport_country; ?>');</script> |
|
408 | 408 | </fieldset> |
409 | 409 | <fieldset> |
410 | 410 | <legend><?php echo _("Route"); ?></legend> |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | </select> |
417 | 417 | </div> |
418 | 418 | </div> |
419 | - <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script> |
|
419 | + <script type="text/javascript">getSelect('departureairportnames','<?php if (isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script> |
|
420 | 420 | <div class="form-group"> |
421 | 421 | <label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> |
422 | 422 | <div class="col-sm-10"> |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | </select> |
426 | 426 | </div> |
427 | 427 | </div> |
428 | - <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script> |
|
428 | + <script type="text/javascript">getSelect('arrivalairportnames','<?php if (isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script> |
|
429 | 429 | </fieldset> |
430 | 430 | <fieldset> |
431 | 431 | <legend><?php echo _("Date"); ?></legend> |
@@ -479,9 +479,9 @@ discard block |
||
479 | 479 | <option></option> |
480 | 480 | <?php |
481 | 481 | $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000); |
482 | -foreach($altitude_array as $altitude) |
|
482 | +foreach ($altitude_array as $altitude) |
|
483 | 483 | { |
484 | - if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude) |
|
484 | + if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude) |
|
485 | 485 | { |
486 | 486 | print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>'; |
487 | 487 | } else { |
@@ -499,9 +499,9 @@ discard block |
||
499 | 499 | <option></option> |
500 | 500 | <?php |
501 | 501 | $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000); |
502 | -foreach($altitude_array as $altitude) |
|
502 | +foreach ($altitude_array as $altitude) |
|
503 | 503 | { |
504 | - if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude) |
|
504 | + if (isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude) |
|
505 | 505 | { |
506 | 506 | print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>'; |
507 | 507 | } else { |
@@ -540,10 +540,10 @@ discard block |
||
540 | 540 | <div class="col-sm-10"> |
541 | 541 | <select class="form-control" name="number_results"> |
542 | 542 | <?php |
543 | -$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000); |
|
544 | -foreach($number_results_array as $number) |
|
543 | +$number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000); |
|
544 | +foreach ($number_results_array as $number) |
|
545 | 545 | { |
546 | - if(isset($_GET['number_results']) && $_GET['number_results'] == $number) |
|
546 | + if (isset($_GET['number_results']) && $_GET['number_results'] == $number) |
|
547 | 547 | { |
548 | 548 | print '<option value="'.$number.'" selected="selected">'.$number.'</option>'; |
549 | 549 | } else { |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | <fieldset> |
562 | 562 | <div class="form-group"> |
563 | 563 | <div class="col-sm-offset-2 col-sm-10"> |
564 | - <label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?></label> |
|
564 | + <label class="checkbox-inline"><input type="checkbox" name="archive" value="1" /><?php echo sprintf(_("Search in archive (older than %s months)"), $globalArchiveKeepMonths); ?></label> |
|
565 | 565 | </div> |
566 | 566 | </div> |
567 | 567 | </fieldset> |
@@ -36,8 +36,10 @@ discard block |
||
36 | 36 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00"; |
37 | 37 | $sql_date = $end_date; |
38 | 38 | } |
39 | - } else $sql_date = ''; |
|
40 | -} |
|
39 | + } else { |
|
40 | + $sql_date = ''; |
|
41 | + } |
|
42 | + } |
|
41 | 43 | |
42 | 44 | if (isset($_GET['highest_altitude'])) { |
43 | 45 | //for altitude manipulation |
@@ -51,8 +53,12 @@ discard block |
||
51 | 53 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
52 | 54 | $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
53 | 55 | $sql_altitude = $start_altitude; |
54 | - } else $sql_altitude = ''; |
|
55 | -} else $sql_altitude = ''; |
|
56 | + } else { |
|
57 | + $sql_altitude = ''; |
|
58 | + } |
|
59 | + } else { |
|
60 | + $sql_altitude = ''; |
|
61 | +} |
|
56 | 62 | |
57 | 63 | //calculuation for the pagination |
58 | 64 | if(!isset($_GET['limit'])) |
@@ -70,7 +76,7 @@ discard block |
||
70 | 76 | $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
71 | 77 | $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
72 | 78 | } |
73 | -} else { |
|
79 | +} else { |
|
74 | 80 | $limit_explode = explode(",", $_GET['limit']); |
75 | 81 | $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
76 | 82 | $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
@@ -103,10 +109,15 @@ discard block |
||
103 | 109 | $origlon = filter_input(INPUT_GET,'origlon',FILTER_SANITIZE_NUMBER_FLOAT); |
104 | 110 | $dist = filter_input(INPUT_GET,'dist',FILTER_SANITIZE_NUMBER_INT); |
105 | 111 | if ($dist != '') { |
106 | - if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934; |
|
107 | - elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852; |
|
112 | + if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') { |
|
113 | + $dist = $dist*1.60934; |
|
114 | + } elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') { |
|
115 | + $dist = $dist*1.852; |
|
116 | + } |
|
117 | + } |
|
118 | + if (!isset($sql_date)) { |
|
119 | + $sql_date = ''; |
|
108 | 120 | } |
109 | - if (!isset($sql_date)) $sql_date = ''; |
|
110 | 121 | if ($archive == 1) { |
111 | 122 | $SpotterArchive = new SpotterArchive(); |
112 | 123 | $spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist); |
@@ -174,7 +185,10 @@ discard block |
||
174 | 185 | if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; } |
175 | 186 | if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; } |
176 | 187 | if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; } |
177 | - if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; } |
|
188 | + if (isset($_GET['highlights'])) { |
|
189 | + if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; |
|
190 | + } |
|
191 | + } |
|
178 | 192 | if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; } |
179 | 193 | if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; } |
180 | 194 | if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; } |
@@ -285,7 +299,10 @@ discard block |
||
285 | 299 | <div class="form-group"> |
286 | 300 | <label class="control-label col-sm-2"><?php echo _("Keywords"); ?></label> |
287 | 301 | <div class="col-sm-10"> |
288 | - <input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) print $q; ?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
302 | + <input type="text" class="form-control" id="q" name="q" value="<?php if (isset($_GET['q'])) { |
|
303 | + print $q; |
|
304 | +} |
|
305 | +?>" size="10" placeholder="<?php echo _("Keywords"); ?>" /> |
|
289 | 306 | </div> |
290 | 307 | </div> |
291 | 308 | </fieldset> |
@@ -300,7 +317,10 @@ discard block |
||
300 | 317 | </select> |
301 | 318 | </div> |
302 | 319 | </div> |
303 | - <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) print $manufacturer; ?>')</script> |
|
320 | + <script type="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer'])) { |
|
321 | + print $manufacturer; |
|
322 | +} |
|
323 | +?>')</script> |
|
304 | 324 | <div class="form-group"> |
305 | 325 | <label class="control-label col-sm-2"><?php echo _("Type"); ?></label> |
306 | 326 | <div class="col-sm-10"> |
@@ -309,11 +329,17 @@ discard block |
||
309 | 329 | </select> |
310 | 330 | </div> |
311 | 331 | </div> |
312 | - <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) print $aircraft_icao; ?>');</script> |
|
332 | + <script type="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao'])) { |
|
333 | + print $aircraft_icao; |
|
334 | +} |
|
335 | +?>');</script> |
|
313 | 336 | <div class="form-group"> |
314 | 337 | <label class="control-label col-sm-2"><?php echo _("Registration"); ?></label> |
315 | 338 | <div class="col-sm-10"> |
316 | - <input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) print $registration; ?>" size="8" placeholder="<?php echo _("Registration"); ?>" /> |
|
339 | + <input type="text" class="form-control" name="registration" value="<?php if (isset($_GET['registration'])) { |
|
340 | + print $registration; |
|
341 | +} |
|
342 | +?>" size="8" placeholder="<?php echo _("Registration"); ?>" /> |
|
317 | 343 | </div> |
318 | 344 | </div> |
319 | 345 | <?php |
@@ -322,22 +348,31 @@ discard block |
||
322 | 348 | <div class="form-group"> |
323 | 349 | <label class="control-label col-sm-2"><?php echo _("Pilot id"); ?></label> |
324 | 350 | <div class="col-sm-10"> |
325 | - <input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) print $pilot_id; ?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" /> |
|
351 | + <input type="text" class="form-control" name="pilot_id" value="<?php if (isset($_GET['pilot_id'])) { |
|
352 | + print $pilot_id; |
|
353 | +} |
|
354 | +?>" size="15" placeholder="<?php echo _("Pilot id"); ?>" /> |
|
326 | 355 | </div> |
327 | 356 | </div> |
328 | 357 | <div class="form-group"> |
329 | 358 | <label class="control-label col-sm-2"><?php echo _("Pilot name"); ?></label> |
330 | 359 | <div class="col-sm-10"> |
331 | - <input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) print $pilot_name; ?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" /> |
|
360 | + <input type="text" class="form-control" name="pilot_name" value="<?php if (isset($_GET['pilot_name'])) { |
|
361 | + print $pilot_name; |
|
362 | +} |
|
363 | +?>" size="15" placeholder="<?php echo _("Pilot name"); ?>" /> |
|
332 | 364 | </div> |
333 | 365 | </div> |
334 | 366 | <?php |
335 | -}else { |
|
367 | +} else { |
|
336 | 368 | ?> |
337 | 369 | <div class="form-group"> |
338 | 370 | <label class="control-label col-sm-2"><?php echo _("Owner name"); ?></label> |
339 | 371 | <div class="col-sm-10"> |
340 | - <input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) print $owner; ?>" size="15" placeholder="<?php echo _("Owner name"); ?>" /> |
|
372 | + <input type="text" class="form-control" name="owner" value="<?php if (isset($_GET['owner'])) { |
|
373 | + print $owner; |
|
374 | +} |
|
375 | +?>" size="15" placeholder="<?php echo _("Owner name"); ?>" /> |
|
341 | 376 | </div> |
342 | 377 | </div> |
343 | 378 | <?php |
@@ -345,8 +380,14 @@ discard block |
||
345 | 380 | ?> |
346 | 381 | <div class="form-group"> |
347 | 382 | <div class="col-sm-offset-2 col-sm-10"> |
348 | - <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
349 | - <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
383 | + <!--<div><input type="checkbox" class="form-control" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) { |
|
384 | + if ($_GET['highlights'] == "true"){ print 'checked="checked"'; |
|
385 | +} |
|
386 | +} ?>> <label for="highlights"><?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label></div>--> |
|
387 | + <label class="checkbox-inline"><input type="checkbox" name="highlights" value="true" id="highlights" <?php if (isset($_GET['highlights'])) { |
|
388 | + if ($_GET['highlights'] == "true"){ print 'checked="checked"'; |
|
389 | +} |
|
390 | +} ?>> <?php echo _("Include only aircrafts with special highlights (unique liveries, destinations etc.)"); ?></label> |
|
350 | 391 | </div> |
351 | 392 | </div> |
352 | 393 | </fieldset> |
@@ -360,7 +401,10 @@ discard block |
||
360 | 401 | </select> |
361 | 402 | </div> |
362 | 403 | </div> |
363 | - <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) print $airline; ?>');</script> |
|
404 | + <script type="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline'])) { |
|
405 | + print $airline; |
|
406 | +} |
|
407 | +?>');</script> |
|
364 | 408 | <div class="form-group"> |
365 | 409 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
366 | 410 | <div class="col-sm-10"> |
@@ -369,19 +413,34 @@ discard block |
||
369 | 413 | </select> |
370 | 414 | </div> |
371 | 415 | </div> |
372 | - <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) print $airline_country; ?>');</script> |
|
416 | + <script type="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country'])) { |
|
417 | + print $airline_country; |
|
418 | +} |
|
419 | +?>');</script> |
|
373 | 420 | <div class="form-group"> |
374 | 421 | <label class="control-label col-sm-2"><?php echo _("Callsign"); ?></label> |
375 | 422 | <div class="col-sm-10"> |
376 | - <input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size="8" placeholder="<?php echo _("Callsign"); ?>" /> |
|
423 | + <input type="text" name="callsign" class="form-control" value="<?php if (isset($_GET['callsign'])) { |
|
424 | + print $callsign; |
|
425 | +} |
|
426 | +?>" size="8" placeholder="<?php echo _("Callsign"); ?>" /> |
|
377 | 427 | </div> |
378 | 428 | </div> |
379 | 429 | <div class="form-group"> |
380 | 430 | <div class="col-sm-offset-2 col-sm-10"> |
381 | 431 | <label class="radio-inline"><input type="radio" name="airline_type" value="all" id="airline_type_all" <?php if (!isset($_GET['airline_type']) || $_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?>> <?php echo _("All airlines types"); ?></label> |
382 | - <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
383 | - <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
384 | - <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?>> <?php echo _("Only Military airlines"); ?></label> |
|
432 | + <label class="radio-inline"><input type="radio" name="airline_type" value="passenger" id="airline_type_passenger" <?php if (isset($_GET['airline_type'])) { |
|
433 | + if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; |
|
434 | +} |
|
435 | +} ?>> <?php echo _("Only Passenger airlines"); ?></label> |
|
436 | + <label class="radio-inline"><input type="radio" name="airline_type" value="cargo" id="airline_type_cargo" <?php if (isset($_GET['airline_type'])) { |
|
437 | + if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; |
|
438 | +} |
|
439 | +} ?>> <?php echo _("Only Cargo airlines"); ?></label> |
|
440 | + <label class="radio-inline"><input type="radio" name="airline_type" value="military" id="airline_type_military" <?php if (isset($_GET['airline_type'])) { |
|
441 | + if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; |
|
442 | +} |
|
443 | +} ?>> <?php echo _("Only Military airlines"); ?></label> |
|
385 | 444 | </div> |
386 | 445 | </div> |
387 | 446 | </fieldset> |
@@ -395,7 +454,10 @@ discard block |
||
395 | 454 | </select> |
396 | 455 | </div> |
397 | 456 | </div> |
398 | - <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) print $airport_icao; ?>');</script> |
|
457 | + <script type="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao'])) { |
|
458 | + print $airport_icao; |
|
459 | +} |
|
460 | +?>');</script> |
|
399 | 461 | <div class="form-group"> |
400 | 462 | <label class="control-label col-sm-2"><?php echo _("Country"); ?></label> |
401 | 463 | <div class="col-sm-10"> |
@@ -404,7 +466,10 @@ discard block |
||
404 | 466 | </select> |
405 | 467 | </div> |
406 | 468 | </div> |
407 | - <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) print $airport_country; ?>');</script> |
|
469 | + <script type="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country'])) { |
|
470 | + print $airport_country; |
|
471 | +} |
|
472 | +?>');</script> |
|
408 | 473 | </fieldset> |
409 | 474 | <fieldset> |
410 | 475 | <legend><?php echo _("Route"); ?></legend> |
@@ -416,7 +481,10 @@ discard block |
||
416 | 481 | </select> |
417 | 482 | </div> |
418 | 483 | </div> |
419 | - <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) print $departure_airport_route; ?>');</script> |
|
484 | + <script type="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route'])) { |
|
485 | + print $departure_airport_route; |
|
486 | +} |
|
487 | +?>');</script> |
|
420 | 488 | <div class="form-group"> |
421 | 489 | <label class="control-label col-sm-2"><?php echo _("Arrival Airport"); ?></label> |
422 | 490 | <div class="col-sm-10"> |
@@ -425,7 +493,10 @@ discard block |
||
425 | 493 | </select> |
426 | 494 | </div> |
427 | 495 | </div> |
428 | - <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) print $arrival_airport_route; ?>');</script> |
|
496 | + <script type="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route'])) { |
|
497 | + print $arrival_airport_route; |
|
498 | +} |
|
499 | +?>');</script> |
|
429 | 500 | </fieldset> |
430 | 501 | <fieldset> |
431 | 502 | <legend><?php echo _("Date"); ?></legend> |
@@ -433,7 +504,10 @@ discard block |
||
433 | 504 | <label class="control-label col-sm-2"><?php echo _("Start Date"); ?></label> |
434 | 505 | <div class="col-sm-10"> |
435 | 506 | <div class='input-group date' id='datetimepicker1'> |
436 | - <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) print $start_date; ?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
507 | + <input type='text' name="start_date" class="form-control" value="<?php if (isset($_GET['start_date'])) { |
|
508 | + print $start_date; |
|
509 | +} |
|
510 | +?>" placeholder="<?php echo _("Start Date/Time"); ?>" /> |
|
437 | 511 | <span class="input-group-addon"> |
438 | 512 | <span class="glyphicon glyphicon-calendar"></span> |
439 | 513 | </span> |
@@ -444,7 +518,10 @@ discard block |
||
444 | 518 | <label class="control-label col-sm-2"><?php echo _("End Date"); ?></label> |
445 | 519 | <div class="col-sm-10"> |
446 | 520 | <div class='input-group date' id='datetimepicker2'> |
447 | - <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) print $end_date; ?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
521 | + <input type='text' name="end_date" class="form-control" value="<?php if (isset($_GET['end_date'])) { |
|
522 | + print $end_date; |
|
523 | +} |
|
524 | +?>" placeholder="<?php echo _("End Date/Time"); ?>" /> |
|
448 | 525 | <span class="input-group-addon"> |
449 | 526 | <span class="glyphicon glyphicon-calendar"></span> |
450 | 527 | </span> |
@@ -517,19 +594,33 @@ discard block |
||
517 | 594 | <div class="form-group"> |
518 | 595 | <label class="control-label col-sm-2"><?php echo _("Latitude"); ?></label> |
519 | 596 | <div class="col-sm-10"> |
520 | - <input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) print $origlat; ?>" /> |
|
597 | + <input type="text" name="origlat" class="form-control" placeholder="<?php echo _("Center point latitude"); ?>" value="<?php if (isset($_GET['origlat'])) { |
|
598 | + print $origlat; |
|
599 | +} |
|
600 | +?>" /> |
|
521 | 601 | </div> |
522 | 602 | </div> |
523 | 603 | <div class="form-group"> |
524 | 604 | <label class="control-label col-sm-2"><?php echo _("Longitude"); ?></label> |
525 | 605 | <div class="col-sm-10"> |
526 | - <input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) print $origlon; ?>" /> |
|
606 | + <input type="text" name="origlon" class="form-control" placeholder="<?php echo _("Center point longitude"); ?>" value="<?php if (isset($_GET['origlon'])) { |
|
607 | + print $origlon; |
|
608 | +} |
|
609 | +?>" /> |
|
527 | 610 | </div> |
528 | 611 | </div> |
529 | 612 | <div class="form-group"> |
530 | - <label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?></label> |
|
613 | + <label class="control-label col-sm-2"><?php echo _("Distance").' ('; if (isset($globalDistanceUnit)) { |
|
614 | + print $globalDistanceUnit; |
|
615 | +} else { |
|
616 | + print 'km'; |
|
617 | +} |
|
618 | +print ')'; ?></label> |
|
531 | 619 | <div class="col-sm-10"> |
532 | - <input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) print $distance; ?>" /> |
|
620 | + <input type="text" name="dist" class="form-control" placeholder="<?php echo _("Distance from center point"); ?>" value="<?php if (isset($_GET['distance'])) { |
|
621 | + print $distance; |
|
622 | +} |
|
623 | +?>" /> |
|
533 | 624 | </div> |
534 | 625 | </div> |
535 | 626 | </fieldset> |
@@ -7,35 +7,35 @@ discard block |
||
7 | 7 | public $latest_schema = 46; |
8 | 8 | |
9 | 9 | public function __construct($dbc = null,$dbname = null,$user = null,$pass = null) { |
10 | - global $globalNoDB; |
|
11 | - if (isset($globalNoDB) && $globalNoDB === TRUE) { |
|
10 | + global $globalNoDB; |
|
11 | + if (isset($globalNoDB) && $globalNoDB === TRUE) { |
|
12 | 12 | $this->db = null; |
13 | - } else { |
|
13 | + } else { |
|
14 | 14 | if ($dbc === null) { |
15 | - if ($this->db === null && $dbname === null) { |
|
15 | + if ($this->db === null && $dbname === null) { |
|
16 | 16 | if ($user === null && $pass === null) { |
17 | - $this->createDBConnection(); |
|
17 | + $this->createDBConnection(); |
|
18 | 18 | } else { |
19 | - $this->createDBConnection(null,$user,$pass); |
|
19 | + $this->createDBConnection(null,$user,$pass); |
|
20 | 20 | } |
21 | - } else { |
|
21 | + } else { |
|
22 | 22 | $this->createDBConnection($dbname); |
23 | - } |
|
23 | + } |
|
24 | 24 | } elseif ($dbname === null || $dbname === 'default') { |
25 | - $this->db = $dbc; |
|
26 | - if ($this->connectionExists() === false) { |
|
25 | + $this->db = $dbc; |
|
26 | + if ($this->connectionExists() === false) { |
|
27 | 27 | /* |
28 | 28 | echo 'Restart Connection !!!'."\n"; |
29 | 29 | $e = new \Exception; |
30 | 30 | var_dump($e->getTraceAsString()); |
31 | 31 | */ |
32 | 32 | $this->createDBConnection(); |
33 | - } |
|
33 | + } |
|
34 | 34 | } else { |
35 | - //$this->connectionExists(); |
|
36 | - $this->dbs[$dbname] = $dbc; |
|
35 | + //$this->connectionExists(); |
|
36 | + $this->dbs[$dbname] = $dbc; |
|
37 | + } |
|
37 | 38 | } |
38 | - } |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function db() { |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * Creates the database connection |
|
60 | - * |
|
61 | - * @return Boolean of the database connection |
|
62 | - * |
|
63 | - */ |
|
59 | + * Creates the database connection |
|
60 | + * |
|
61 | + * @return Boolean of the database connection |
|
62 | + * |
|
63 | + */ |
|
64 | 64 | |
65 | 65 | public function createDBConnection($DBname = null, $user = null, $pass = null) |
66 | 66 | { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | if($results->rowCount()>0) { |
161 | - return true; |
|
161 | + return true; |
|
162 | 162 | } |
163 | 163 | else return false; |
164 | 164 | } |
@@ -176,14 +176,14 @@ discard block |
||
176 | 176 | $sum = $sum->fetchColumn(0); |
177 | 177 | } else $sum = 0; |
178 | 178 | if (intval($sum) !== 2) { |
179 | - return false; |
|
179 | + return false; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | } catch(PDOException $e) { |
183 | 183 | if($e->getCode() != 'HY000' || !stristr($e->getMessage(), 'server has gone away')) { |
184 | - throw $e; |
|
185 | - } |
|
186 | - //echo 'error ! '.$e->getMessage(); |
|
184 | + throw $e; |
|
185 | + } |
|
186 | + //echo 'error ! '.$e->getMessage(); |
|
187 | 187 | return false; |
188 | 188 | } |
189 | 189 | return true; |
@@ -287,8 +287,8 @@ discard block |
||
287 | 287 | $version = 0; |
288 | 288 | if ($this->tableExists('aircraft')) { |
289 | 289 | if (!$this->tableExists('config')) { |
290 | - $version = '1'; |
|
291 | - return $version; |
|
290 | + $version = '1'; |
|
291 | + return $version; |
|
292 | 292 | } else { |
293 | 293 | $query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1"; |
294 | 294 | try { |
@@ -309,10 +309,10 @@ discard block |
||
309 | 309 | * @return Boolean if latest version or not |
310 | 310 | */ |
311 | 311 | public function latest() { |
312 | - global $globalNoDB; |
|
313 | - if (isset($globalNoDB) && $globalNoDB === TRUE) return true; |
|
314 | - if ($this->check_schema_version() == $this->latest_schema) return true; |
|
315 | - else return false; |
|
312 | + global $globalNoDB; |
|
313 | + if (isset($globalNoDB) && $globalNoDB === TRUE) return true; |
|
314 | + if ($this->check_schema_version() == $this->latest_schema) return true; |
|
315 | + else return false; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | } |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | require_once(dirname(__FILE__).'/settings.php'); |
3 | 3 | |
4 | -class Connection{ |
|
4 | +class Connection { |
|
5 | 5 | public $db = null; |
6 | 6 | public $dbs = array(); |
7 | 7 | public $latest_schema = 46; |
8 | 8 | |
9 | - public function __construct($dbc = null,$dbname = null,$user = null,$pass = null) { |
|
9 | + public function __construct($dbc = null, $dbname = null, $user = null, $pass = null) { |
|
10 | 10 | global $globalNoDB; |
11 | 11 | if (isset($globalNoDB) && $globalNoDB === TRUE) { |
12 | 12 | $this->db = null; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | if ($user === null && $pass === null) { |
17 | 17 | $this->createDBConnection(); |
18 | 18 | } else { |
19 | - $this->createDBConnection(null,$user,$pass); |
|
19 | + $this->createDBConnection(null, $user, $pass); |
|
20 | 20 | } |
21 | 21 | } else { |
22 | 22 | $this->createDBConnection($dbname); |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | while (true) { |
101 | 101 | try { |
102 | 102 | if ($globalDBSdriver == 'mysql') { |
103 | - $this->dbs[$DBname] = new PDO("$globalDBSdriver:host=$globalDBShost;port=$globalDBSport;dbname=$globalDBSname;charset=utf8", $globalDBSuser, $globalDBSpass); |
|
103 | + $this->dbs[$DBname] = new PDO("$globalDBSdriver:host=$globalDBShost;port=$globalDBSport;dbname=$globalDBSname;charset=utf8", $globalDBSuser, $globalDBSpass); |
|
104 | 104 | $this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); |
105 | 105 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
106 | - $this->dbs[$DBname]->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER); |
|
107 | - if (!isset($globalDBTimeOut)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,500); |
|
108 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
109 | - if (!isset($globalDBPersistent)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
110 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
106 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); |
|
107 | + if (!isset($globalDBTimeOut)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT, 500); |
|
108 | + else $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT, $globalDBTimeOut); |
|
109 | + if (!isset($globalDBPersistent)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT, true); |
|
110 | + else $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT, $globalDBPersistent); |
|
111 | 111 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); |
112 | 112 | $this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); |
113 | 113 | // Workaround against "ONLY_FULL_GROUP_BY" mode |
@@ -117,19 +117,19 @@ discard block |
||
117 | 117 | $this->dbs[$DBname]->exec('SET SESSION time_zone = "+00:00"'); |
118 | 118 | //$this->dbs[$DBname]->exec('SET @@session.time_zone = "+00:00"'); |
119 | 119 | } else { |
120 | - $this->dbs[$DBname] = new PDO("$globalDBSdriver:host=$globalDBShost;port=$globalDBSport;dbname=$globalDBSname;options='--client_encoding=utf8'", $globalDBSuser, $globalDBSpass); |
|
120 | + $this->dbs[$DBname] = new PDO("$globalDBSdriver:host=$globalDBShost;port=$globalDBSport;dbname=$globalDBSname;options='--client_encoding=utf8'", $globalDBSuser, $globalDBSpass); |
|
121 | 121 | //$this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); |
122 | 122 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
123 | - $this->dbs[$DBname]->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER); |
|
124 | - if (!isset($globalDBTimeOut)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,200); |
|
125 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
126 | - if (!isset($globalDBPersistent)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
127 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
123 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); |
|
124 | + if (!isset($globalDBTimeOut)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT, 200); |
|
125 | + else $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT, $globalDBTimeOut); |
|
126 | + if (!isset($globalDBPersistent)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT, true); |
|
127 | + else $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT, $globalDBPersistent); |
|
128 | 128 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); |
129 | 129 | $this->dbs[$DBname]->exec('SET timezone="UTC"'); |
130 | 130 | } |
131 | 131 | break; |
132 | - } catch(PDOException $e) { |
|
132 | + } catch (PDOException $e) { |
|
133 | 133 | $i++; |
134 | 134 | if (isset($globalDebug) && $globalDebug) echo 'Error connecting to DB: '.$globalDBSname.' - Error: '.$e->getMessage()."\n"; |
135 | 135 | //exit; |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | try { |
155 | 155 | //$Connection = new Connection(); |
156 | 156 | $results = $this->db->query($query); |
157 | - } catch(PDOException $e) { |
|
157 | + } catch (PDOException $e) { |
|
158 | 158 | return false; |
159 | 159 | } |
160 | - if($results->rowCount()>0) { |
|
160 | + if ($results->rowCount() > 0) { |
|
161 | 161 | return true; |
162 | 162 | } |
163 | 163 | else return false; |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | return false; |
180 | 180 | } |
181 | 181 | |
182 | - } catch(PDOException $e) { |
|
183 | - if($e->getCode() != 'HY000' || !stristr($e->getMessage(), 'server has gone away')) { |
|
182 | + } catch (PDOException $e) { |
|
183 | + if ($e->getCode() != 'HY000' || !stristr($e->getMessage(), 'server has gone away')) { |
|
184 | 184 | throw $e; |
185 | 185 | } |
186 | 186 | //echo 'error ! '.$e->getMessage(); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | /* |
193 | 193 | * Check if index exist |
194 | 194 | */ |
195 | - public function indexExists($table,$index) |
|
195 | + public function indexExists($table, $index) |
|
196 | 196 | { |
197 | 197 | global $globalDBdriver, $globalDBname; |
198 | 198 | if ($globalDBdriver == 'mysql') { |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | try { |
204 | 204 | //$Connection = new Connection(); |
205 | 205 | $results = $this->db->query($query); |
206 | - } catch(PDOException $e) { |
|
206 | + } catch (PDOException $e) { |
|
207 | 207 | return false; |
208 | 208 | } |
209 | 209 | $nb = $results->fetchAll(PDO::FETCH_ASSOC); |
210 | - if($nb[0]['nb'] > 0) { |
|
210 | + if ($nb[0]['nb'] > 0) { |
|
211 | 211 | return true; |
212 | 212 | } |
213 | 213 | else return false; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $query = "SELECT * FROM ".$table." LIMIT 0"; |
223 | 223 | try { |
224 | 224 | $results = $this->db->query($query); |
225 | - } catch(PDOException $e) { |
|
225 | + } catch (PDOException $e) { |
|
226 | 226 | return "error : ".$e->getMessage()."\n"; |
227 | 227 | } |
228 | 228 | $columns = array(); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | return $columns; |
235 | 235 | } |
236 | 236 | |
237 | - public function getColumnType($table,$column) { |
|
237 | + public function getColumnType($table, $column) { |
|
238 | 238 | $select = $this->db->query('SELECT '.$column.' FROM '.$table); |
239 | 239 | $tomet = $select->getColumnMeta(0); |
240 | 240 | return $tomet['native_type']; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * Check if a column name exist in a table |
245 | 245 | * @return Boolean column exist or not |
246 | 246 | */ |
247 | - public function checkColumnName($table,$name) |
|
247 | + public function checkColumnName($table, $name) |
|
248 | 248 | { |
249 | 249 | global $globalDBdriver, $globalDBname; |
250 | 250 | if ($globalDBdriver == 'mysql') { |
@@ -254,8 +254,8 @@ discard block |
||
254 | 254 | } |
255 | 255 | try { |
256 | 256 | $sth = $this->db()->prepare($query); |
257 | - $sth->execute(array(':database' => $globalDBname,':table' => $table,':name' => $name)); |
|
258 | - } catch(PDOException $e) { |
|
257 | + $sth->execute(array(':database' => $globalDBname, ':table' => $table, ':name' => $name)); |
|
258 | + } catch (PDOException $e) { |
|
259 | 259 | echo "error : ".$e->getMessage()."\n"; |
260 | 260 | } |
261 | 261 | $result = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | try { |
295 | 295 | $sth = $this->db->prepare($query); |
296 | 296 | $sth->execute(); |
297 | - } catch(PDOException $e) { |
|
297 | + } catch (PDOException $e) { |
|
298 | 298 | return "error : ".$e->getMessage()."\n"; |
299 | 299 | } |
300 | 300 | $result = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -6,6 +6,9 @@ discard block |
||
6 | 6 | public $dbs = array(); |
7 | 7 | public $latest_schema = 46; |
8 | 8 | |
9 | + /** |
|
10 | + * @param string $dbname |
|
11 | + */ |
|
9 | 12 | public function __construct($dbc = null,$dbname = null,$user = null,$pass = null) { |
10 | 13 | global $globalNoDB; |
11 | 14 | if (isset($globalNoDB) && $globalNoDB === TRUE) { |
@@ -142,6 +145,9 @@ discard block |
||
142 | 145 | return true; |
143 | 146 | } |
144 | 147 | |
148 | + /** |
|
149 | + * @param string $table |
|
150 | + */ |
|
145 | 151 | public function tableExists($table) |
146 | 152 | { |
147 | 153 | global $globalDBdriver, $globalDBname; |
@@ -192,6 +198,11 @@ discard block |
||
192 | 198 | /* |
193 | 199 | * Check if index exist |
194 | 200 | */ |
201 | + |
|
202 | + /** |
|
203 | + * @param string $table |
|
204 | + * @param string $index |
|
205 | + */ |
|
195 | 206 | public function indexExists($table,$index) |
196 | 207 | { |
197 | 208 | global $globalDBdriver, $globalDBname; |
@@ -234,6 +245,10 @@ discard block |
||
234 | 245 | return $columns; |
235 | 246 | } |
236 | 247 | |
248 | + /** |
|
249 | + * @param string $table |
|
250 | + * @param string $column |
|
251 | + */ |
|
237 | 252 | public function getColumnType($table,$column) { |
238 | 253 | $select = $this->db->query('SELECT '.$column.' FROM '.$table); |
239 | 254 | $tomet = $select->getColumnMeta(0); |
@@ -244,6 +259,11 @@ discard block |
||
244 | 259 | * Check if a column name exist in a table |
245 | 260 | * @return Boolean column exist or not |
246 | 261 | */ |
262 | + |
|
263 | + /** |
|
264 | + * @param string $table |
|
265 | + * @param string $name |
|
266 | + */ |
|
247 | 267 | public function checkColumnName($table,$name) |
248 | 268 | { |
249 | 269 | global $globalDBdriver, $globalDBname; |
@@ -73,8 +73,11 @@ discard block |
||
73 | 73 | $globalDBSname = $globalDBname; |
74 | 74 | $globalDBSuser = $globalDBuser; |
75 | 75 | $globalDBSpass = $globalDBpass; |
76 | - if (!isset($globalDBport) || $globalDBport === NULL || $globalDBport == '') $globalDBSport = 3306; |
|
77 | - else $globalDBSport = $globalDBport; |
|
76 | + if (!isset($globalDBport) || $globalDBport === NULL || $globalDBport == '') { |
|
77 | + $globalDBSport = 3306; |
|
78 | + } else { |
|
79 | + $globalDBSport = $globalDBport; |
|
80 | + } |
|
78 | 81 | } else { |
79 | 82 | $DBname = 'default'; |
80 | 83 | $globalDBSdriver = $globalDBdriver; |
@@ -82,8 +85,11 @@ discard block |
||
82 | 85 | $globalDBSname = $globalDBname; |
83 | 86 | $globalDBSuser = $user; |
84 | 87 | $globalDBSpass = $pass; |
85 | - if (!isset($globalDBport) || $globalDBport === NULL || $globalDBport == '') $globalDBSport = 3306; |
|
86 | - else $globalDBSport = $globalDBport; |
|
88 | + if (!isset($globalDBport) || $globalDBport === NULL || $globalDBport == '') { |
|
89 | + $globalDBSport = 3306; |
|
90 | + } else { |
|
91 | + $globalDBSport = $globalDBport; |
|
92 | + } |
|
87 | 93 | } |
88 | 94 | } else { |
89 | 95 | $globalDBSdriver = $globalDB[$DBname]['driver']; |
@@ -91,12 +97,19 @@ discard block |
||
91 | 97 | $globalDBSname = $globalDB[$DBname]['name']; |
92 | 98 | $globalDBSuser = $globalDB[$DBname]['user']; |
93 | 99 | $globalDBSpass = $globalDB[$DBname]['pass']; |
94 | - if (isset($globalDB[$DBname]['port'])) $globalDBSport = $globalDB[$DBname]['port']; |
|
95 | - else $globalDBSport = 3306; |
|
100 | + if (isset($globalDB[$DBname]['port'])) { |
|
101 | + $globalDBSport = $globalDB[$DBname]['port']; |
|
102 | + } else { |
|
103 | + $globalDBSport = 3306; |
|
104 | + } |
|
105 | + } |
|
106 | + if ($globalDBSname == '' || $globalDBSuser == '') { |
|
107 | + return false; |
|
96 | 108 | } |
97 | - if ($globalDBSname == '' || $globalDBSuser == '') return false; |
|
98 | 109 | // Set number of try to connect to DB |
99 | - if (!isset($globalDBretry) || $globalDBretry == '' || $globalDBretry === NULL) $globalDBretry = 5; |
|
110 | + if (!isset($globalDBretry) || $globalDBretry == '' || $globalDBretry === NULL) { |
|
111 | + $globalDBretry = 5; |
|
112 | + } |
|
100 | 113 | $i = 0; |
101 | 114 | while (true) { |
102 | 115 | try { |
@@ -105,10 +118,16 @@ discard block |
||
105 | 118 | $this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); |
106 | 119 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
107 | 120 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER); |
108 | - if (!isset($globalDBTimeOut)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,500); |
|
109 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
110 | - if (!isset($globalDBPersistent)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
111 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
121 | + if (!isset($globalDBTimeOut)) { |
|
122 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,500); |
|
123 | + } else { |
|
124 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
125 | + } |
|
126 | + if (!isset($globalDBPersistent)) { |
|
127 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
128 | + } else { |
|
129 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
130 | + } |
|
112 | 131 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); |
113 | 132 | $this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); |
114 | 133 | // Workaround against "ONLY_FULL_GROUP_BY" mode |
@@ -122,24 +141,36 @@ discard block |
||
122 | 141 | //$this->dbs[$DBname]->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, "SET NAMES 'utf8'"); |
123 | 142 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
124 | 143 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER); |
125 | - if (!isset($globalDBTimeOut)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,200); |
|
126 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
127 | - if (!isset($globalDBPersistent)) $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
128 | - else $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
144 | + if (!isset($globalDBTimeOut)) { |
|
145 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,200); |
|
146 | + } else { |
|
147 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_TIMEOUT,$globalDBTimeOut); |
|
148 | + } |
|
149 | + if (!isset($globalDBPersistent)) { |
|
150 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,true); |
|
151 | + } else { |
|
152 | + $this->dbs[$DBname]->setAttribute(PDO::ATTR_PERSISTENT,$globalDBPersistent); |
|
153 | + } |
|
129 | 154 | $this->dbs[$DBname]->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); |
130 | 155 | $this->dbs[$DBname]->exec('SET timezone="UTC"'); |
131 | 156 | } |
132 | 157 | break; |
133 | 158 | } catch(PDOException $e) { |
134 | 159 | $i++; |
135 | - if (isset($globalDebug) && $globalDebug) echo 'Error connecting to DB: '.$globalDBSname.' - Error: '.$e->getMessage()."\n"; |
|
160 | + if (isset($globalDebug) && $globalDebug) { |
|
161 | + echo 'Error connecting to DB: '.$globalDBSname.' - Error: '.$e->getMessage()."\n"; |
|
162 | + } |
|
136 | 163 | //exit; |
137 | - if ($i > $globalDBretry) return false; |
|
164 | + if ($i > $globalDBretry) { |
|
165 | + return false; |
|
166 | + } |
|
138 | 167 | //return false; |
139 | 168 | } |
140 | 169 | sleep(2); |
141 | 170 | } |
142 | - if ($DBname === 'default') $this->db = $this->dbs['default']; |
|
171 | + if ($DBname === 'default') { |
|
172 | + $this->db = $this->dbs['default']; |
|
173 | + } |
|
143 | 174 | return true; |
144 | 175 | } |
145 | 176 | |
@@ -151,7 +182,9 @@ discard block |
||
151 | 182 | } else { |
152 | 183 | $query = "SELECT * FROM pg_catalog.pg_tables WHERE tablename = '".$table."'"; |
153 | 184 | } |
154 | - if ($this->db == NULL) return false; |
|
185 | + if ($this->db == NULL) { |
|
186 | + return false; |
|
187 | + } |
|
155 | 188 | try { |
156 | 189 | //$Connection = new Connection(); |
157 | 190 | $results = $this->db->query($query); |
@@ -160,22 +193,31 @@ discard block |
||
160 | 193 | } |
161 | 194 | if($results->rowCount()>0) { |
162 | 195 | return true; |
196 | + } else { |
|
197 | + return false; |
|
163 | 198 | } |
164 | - else return false; |
|
165 | 199 | } |
166 | 200 | |
167 | 201 | public function connectionExists() |
168 | 202 | { |
169 | 203 | global $globalDBdriver, $globalDBCheckConnection, $globalNoDB; |
170 | - if (isset($globalDBCheckConnection) && $globalDBCheckConnection === FALSE) return true; |
|
171 | - if (isset($globalNoDB) && $globalNoDB === TRUE) return true; |
|
204 | + if (isset($globalDBCheckConnection) && $globalDBCheckConnection === FALSE) { |
|
205 | + return true; |
|
206 | + } |
|
207 | + if (isset($globalNoDB) && $globalNoDB === TRUE) { |
|
208 | + return true; |
|
209 | + } |
|
172 | 210 | $query = "SELECT 1 + 1"; |
173 | - if ($this->db === null) return false; |
|
211 | + if ($this->db === null) { |
|
212 | + return false; |
|
213 | + } |
|
174 | 214 | try { |
175 | 215 | $sum = @$this->db->query($query); |
176 | 216 | if ($sum instanceof \PDOStatement) { |
177 | 217 | $sum = $sum->fetchColumn(0); |
178 | - } else $sum = 0; |
|
218 | + } else { |
|
219 | + $sum = 0; |
|
220 | + } |
|
179 | 221 | if (intval($sum) !== 2) { |
180 | 222 | return false; |
181 | 223 | } |
@@ -210,8 +252,9 @@ discard block |
||
210 | 252 | $nb = $results->fetchAll(PDO::FETCH_ASSOC); |
211 | 253 | if($nb[0]['nb'] > 0) { |
212 | 254 | return true; |
255 | + } else { |
|
256 | + return false; |
|
213 | 257 | } |
214 | - else return false; |
|
215 | 258 | } |
216 | 259 | |
217 | 260 | /* |
@@ -261,9 +304,12 @@ discard block |
||
261 | 304 | } |
262 | 305 | $result = $sth->fetch(PDO::FETCH_ASSOC); |
263 | 306 | $sth->closeCursor(); |
264 | - if ($result['nb'] > 0) return true; |
|
265 | - else return false; |
|
266 | -/* } else { |
|
307 | + if ($result['nb'] > 0) { |
|
308 | + return true; |
|
309 | + } else { |
|
310 | + return false; |
|
311 | + } |
|
312 | + /* } else { |
|
267 | 313 | $query = "SELECT * FROM ".$table." LIMIT 0"; |
268 | 314 | try { |
269 | 315 | $results = $this->db->query($query); |
@@ -302,7 +348,9 @@ discard block |
||
302 | 348 | $sth->closeCursor(); |
303 | 349 | return $result['value']; |
304 | 350 | } |
305 | - } else return $version; |
|
351 | + } else { |
|
352 | + return $version; |
|
353 | + } |
|
306 | 354 | } |
307 | 355 | |
308 | 356 | /* |
@@ -311,9 +359,14 @@ discard block |
||
311 | 359 | */ |
312 | 360 | public function latest() { |
313 | 361 | global $globalNoDB; |
314 | - if (isset($globalNoDB) && $globalNoDB === TRUE) return true; |
|
315 | - if ($this->check_schema_version() == $this->latest_schema) return true; |
|
316 | - else return false; |
|
362 | + if (isset($globalNoDB) && $globalNoDB === TRUE) { |
|
363 | + return true; |
|
364 | + } |
|
365 | + if ($this->check_schema_version() == $this->latest_schema) { |
|
366 | + return true; |
|
367 | + } else { |
|
368 | + return false; |
|
369 | + } |
|
317 | 370 | } |
318 | 371 | |
319 | 372 | } |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
127 | - * Gets all launch site |
|
128 | - * |
|
129 | - * @return Array the launch site list |
|
130 | - * |
|
131 | - */ |
|
127 | + * Gets all launch site |
|
128 | + * |
|
129 | + * @return Array the launch site list |
|
130 | + * |
|
131 | + */ |
|
132 | 132 | public function countAllLaunchSite($limit = true, $filters = array()) |
133 | 133 | { |
134 | 134 | global $globalDBdriver; |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
156 | - * Gets all owners |
|
157 | - * |
|
158 | - * @return Array the owners list |
|
159 | - * |
|
160 | - */ |
|
156 | + * Gets all owners |
|
157 | + * |
|
158 | + * @return Array the owners list |
|
159 | + * |
|
160 | + */ |
|
161 | 161 | public function countAllOwners($limit = true, $filters = array()) |
162 | 162 | { |
163 | 163 | global $globalDBdriver; |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
185 | - * Gets all countries owners |
|
186 | - * |
|
187 | - * @return Array the countries list |
|
188 | - * |
|
189 | - */ |
|
185 | + * Gets all countries owners |
|
186 | + * |
|
187 | + * @return Array the countries list |
|
188 | + * |
|
189 | + */ |
|
190 | 190 | public function countAllCountriesOwners($limit = true, $filters = array()) |
191 | 191 | { |
192 | 192 | global $globalDBdriver; |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
214 | - * Counts all launch dates during the last year |
|
215 | - * |
|
216 | - * @return Array the launch date list |
|
217 | - * |
|
218 | - */ |
|
214 | + * Counts all launch dates during the last year |
|
215 | + * |
|
216 | + * @return Array the launch date list |
|
217 | + * |
|
218 | + */ |
|
219 | 219 | public function countAllMonthsLastYear($filters = array(), $sincedate = '') |
220 | 220 | { |
221 | 221 | global $globalTimezone, $globalDBdriver; |
@@ -256,11 +256,11 @@ discard block |
||
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
259 | - * Counts all dates during the last 10 years |
|
260 | - * |
|
261 | - * @return Array the date list |
|
262 | - * |
|
263 | - */ |
|
259 | + * Counts all dates during the last 10 years |
|
260 | + * |
|
261 | + * @return Array the date list |
|
262 | + * |
|
263 | + */ |
|
264 | 264 | public function countAllYears($filters = array(), $sincedate = '') |
265 | 265 | { |
266 | 266 | global $globalTimezone, $globalDBdriver; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | try { |
20 | 20 | $sth = $this->db->prepare($query); |
21 | 21 | $sth->execute(array(':name' => $name)); |
22 | - } catch(PDOException $e) { |
|
22 | + } catch (PDOException $e) { |
|
23 | 23 | echo $e->getMessage(); |
24 | 24 | } |
25 | 25 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | try { |
32 | 32 | $sth = $this->db->prepare($query); |
33 | 33 | $sth->execute(); |
34 | - } catch(PDOException $e) { |
|
34 | + } catch (PDOException $e) { |
|
35 | 35 | echo $e->getMessage(); |
36 | 36 | } |
37 | 37 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | try { |
44 | 44 | $sth = $this->db->prepare($query); |
45 | 45 | $sth->execute(); |
46 | - } catch(PDOException $e) { |
|
46 | + } catch (PDOException $e) { |
|
47 | 47 | echo $e->getMessage(); |
48 | 48 | } |
49 | 49 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | try { |
56 | 56 | $sth = $this->db->prepare($query); |
57 | 57 | $sth->execute(array(':type' => $type)); |
58 | - } catch(PDOException $e) { |
|
58 | + } catch (PDOException $e) { |
|
59 | 59 | echo $e->getMessage(); |
60 | 60 | } |
61 | 61 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -63,48 +63,48 @@ discard block |
||
63 | 63 | else return array(); |
64 | 64 | } |
65 | 65 | |
66 | - public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
66 | + public function position_all($timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
67 | 67 | $all_sat = $this->get_tle_names(); |
68 | 68 | $result = array(); |
69 | 69 | foreach ($all_sat as $sat) { |
70 | - $position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second); |
|
71 | - $result = array_merge($position,$result); |
|
70 | + $position = $this->position($sat['tle_name'], $timestamp_begin, $timestamp_end, $second); |
|
71 | + $result = array_merge($position, $result); |
|
72 | 72 | } |
73 | 73 | return $result; |
74 | 74 | } |
75 | 75 | |
76 | - public function position_all_type($type,$timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
76 | + public function position_all_type($type, $timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
77 | 77 | $all_sat = $this->get_tle_names_type($type); |
78 | 78 | $result = array(); |
79 | 79 | foreach ($all_sat as $sat) { |
80 | - $position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second); |
|
81 | - $result = array_merge($position,$result); |
|
80 | + $position = $this->position($sat['tle_name'], $timestamp_begin, $timestamp_end, $second); |
|
81 | + $result = array_merge($position, $result); |
|
82 | 82 | } |
83 | 83 | return $result; |
84 | 84 | } |
85 | 85 | |
86 | - public function position($name,$timestamp_begin = '',$timestamp_end = '',$second = 10) { |
|
86 | + public function position($name, $timestamp_begin = '', $timestamp_end = '', $second = 10) { |
|
87 | 87 | $qth = new Predict_QTH(); |
88 | 88 | $qth->lat = floatval(37.790252); |
89 | 89 | $qth->lon = floatval(-122.419968); |
90 | 90 | |
91 | 91 | $tle_file = $this->get_tle($name); |
92 | 92 | $type = $tle_file['tle_type']; |
93 | - $tle = new Predict_TLE($tle_file['tle_name'],$tle_file['tle_tle1'],$tle_file['tle_tle2']); |
|
93 | + $tle = new Predict_TLE($tle_file['tle_name'], $tle_file['tle_tle1'], $tle_file['tle_tle2']); |
|
94 | 94 | $sat = new Predict_Sat($tle); |
95 | 95 | $predict = new Predict(); |
96 | 96 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
97 | 97 | if ($timestamp_begin == '') $timestamp_begin = time(); |
98 | 98 | if ($timestamp_end == '') { |
99 | 99 | $now = Predict_Time::unix2daynum($timestamp_begin); |
100 | - $predict->predict_calc($sat,$qth,$now); |
|
101 | - return array('name' => $name, 'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp_begin,'type' => $type); |
|
100 | + $predict->predict_calc($sat, $qth, $now); |
|
101 | + return array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp_begin, 'type' => $type); |
|
102 | 102 | } else { |
103 | 103 | $result = array(); |
104 | - for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp=$timestamp+$second) { |
|
104 | + for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp = $timestamp + $second) { |
|
105 | 105 | $now = Predict_Time::unix2daynum($timestamp); |
106 | - $predict->predict_calc($sat,$qth,$now); |
|
107 | - $result[] = array('name' => $name,'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp,'type' => $type); |
|
106 | + $predict->predict_calc($sat, $qth, $now); |
|
107 | + $result[] = array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp, 'type' => $type); |
|
108 | 108 | } |
109 | 109 | return $result; |
110 | 110 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | try { |
116 | 116 | $sth = $this->db->prepare($query); |
117 | 117 | $sth->execute(array(':name' => $name.'%')); |
118 | - } catch(PDOException $e) { |
|
118 | + } catch (PDOException $e) { |
|
119 | 119 | echo $e->getMessage(); |
120 | 120 | } |
121 | 121 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $sth->execute($query_values); |
144 | 144 | $launch_site_array = array(); |
145 | 145 | $temp_array = array(); |
146 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
146 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
147 | 147 | { |
148 | 148 | $temp_array['launch_site'] = $row['launch_site']; |
149 | 149 | $temp_array['launch_site_count'] = $row['launch_site_count']; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $sth->execute($query_values); |
173 | 173 | $owner_array = array(); |
174 | 174 | $temp_array = array(); |
175 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
175 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
176 | 176 | { |
177 | 177 | $temp_array['owner_name'] = $row['owner_name']; |
178 | 178 | $temp_array['owner_count'] = $row['owner_count']; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $sth->execute($query_values); |
202 | 202 | $owner_array = array(); |
203 | 203 | $temp_array = array(); |
204 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
204 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
205 | 205 | { |
206 | 206 | $temp_array['country_name'] = $row['country_name']; |
207 | 207 | $temp_array['country_count'] = $row['country_count']; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $sth->execute($query_data); |
246 | 246 | $date_array = array(); |
247 | 247 | $temp_array = array(); |
248 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
248 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
249 | 249 | { |
250 | 250 | $temp_array['year_name'] = $row['year_name']; |
251 | 251 | $temp_array['month_name'] = $row['month_name']; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $sth->execute($query_data); |
291 | 291 | $date_array = array(); |
292 | 292 | $temp_array = array(); |
293 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
293 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
294 | 294 | { |
295 | 295 | $temp_array['year_name'] = $row['year_name']; |
296 | 296 | $temp_array['date_count'] = $row['date_count']; |
@@ -12,7 +12,9 @@ discard block |
||
12 | 12 | public function __construct($dbc = null) { |
13 | 13 | $Connection = new Connection($dbc); |
14 | 14 | $this->db = $Connection->db(); |
15 | - if ($this->db === null) die('Error: No DB connection.'); |
|
15 | + if ($this->db === null) { |
|
16 | + die('Error: No DB connection.'); |
|
17 | + } |
|
16 | 18 | } |
17 | 19 | |
18 | 20 | public function get_tle($name) { |
@@ -24,8 +26,11 @@ discard block |
||
24 | 26 | echo $e->getMessage(); |
25 | 27 | } |
26 | 28 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
27 | - if (isset($result[0])) return $result[0]; |
|
28 | - else return array(); |
|
29 | + if (isset($result[0])) { |
|
30 | + return $result[0]; |
|
31 | + } else { |
|
32 | + return array(); |
|
33 | + } |
|
29 | 34 | } |
30 | 35 | public function get_tle_types() { |
31 | 36 | $query = 'SELECT DISTINCT tle_type FROM tle ORDER BY tle_type'; |
@@ -36,8 +41,11 @@ discard block |
||
36 | 41 | echo $e->getMessage(); |
37 | 42 | } |
38 | 43 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
39 | - if (isset($result[0])) return $result; |
|
40 | - else return array(); |
|
44 | + if (isset($result[0])) { |
|
45 | + return $result; |
|
46 | + } else { |
|
47 | + return array(); |
|
48 | + } |
|
41 | 49 | } |
42 | 50 | public function get_tle_names() { |
43 | 51 | $query = 'SELECT DISTINCT tle_name, tle_type FROM tle'; |
@@ -48,8 +56,11 @@ discard block |
||
48 | 56 | echo $e->getMessage(); |
49 | 57 | } |
50 | 58 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
51 | - if (isset($result[0])) return $result; |
|
52 | - else return array(); |
|
59 | + if (isset($result[0])) { |
|
60 | + return $result; |
|
61 | + } else { |
|
62 | + return array(); |
|
63 | + } |
|
53 | 64 | } |
54 | 65 | public function get_tle_names_type($type) { |
55 | 66 | $query = 'SELECT tle_name, tle_type FROM tle WHERE tle_type = :type ORDER BY tle_name'; |
@@ -60,8 +71,11 @@ discard block |
||
60 | 71 | echo $e->getMessage(); |
61 | 72 | } |
62 | 73 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
63 | - if (isset($result[0])) return $result; |
|
64 | - else return array(); |
|
74 | + if (isset($result[0])) { |
|
75 | + return $result; |
|
76 | + } else { |
|
77 | + return array(); |
|
78 | + } |
|
65 | 79 | } |
66 | 80 | |
67 | 81 | public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
@@ -95,7 +109,9 @@ discard block |
||
95 | 109 | $sat = new Predict_Sat($tle); |
96 | 110 | $predict = new Predict(); |
97 | 111 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
98 | - if ($timestamp_begin == '') $timestamp_begin = time(); |
|
112 | + if ($timestamp_begin == '') { |
|
113 | + $timestamp_begin = time(); |
|
114 | + } |
|
99 | 115 | if ($timestamp_end == '') { |
100 | 116 | $now = Predict_Time::unix2daynum($timestamp_begin); |
101 | 117 | $predict->predict_calc($sat,$qth,$now); |
@@ -120,8 +136,11 @@ discard block |
||
120 | 136 | echo $e->getMessage(); |
121 | 137 | } |
122 | 138 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
123 | - if (isset($result[0])) return $result[0]; |
|
124 | - else return array(); |
|
139 | + if (isset($result[0])) { |
|
140 | + return $result[0]; |
|
141 | + } else { |
|
142 | + return array(); |
|
143 | + } |
|
125 | 144 | } |
126 | 145 | |
127 | 146 | /** |
@@ -139,7 +158,9 @@ discard block |
||
139 | 158 | FROM satellite".$filter_query." satellite.launch_site <> '' AND satellite.launch_site IS NOT NULL"; |
140 | 159 | $query_values = array(); |
141 | 160 | $query .= " GROUP BY satellite.launch_site ORDER BY launch_site_count DESC"; |
142 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
161 | + if ($limit) { |
|
162 | + $query .= " LIMIT 10 OFFSET 0"; |
|
163 | + } |
|
143 | 164 | $sth = $this->db->prepare($query); |
144 | 165 | $sth->execute($query_values); |
145 | 166 | $launch_site_array = array(); |
@@ -168,7 +189,9 @@ discard block |
||
168 | 189 | FROM satellite".$filter_query." satellite.owner <> '' AND satellite.owner IS NOT NULL"; |
169 | 190 | $query_values = array(); |
170 | 191 | $query .= " GROUP BY satellite.owner ORDER BY owner_count DESC"; |
171 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
192 | + if ($limit) { |
|
193 | + $query .= " LIMIT 10 OFFSET 0"; |
|
194 | + } |
|
172 | 195 | $sth = $this->db->prepare($query); |
173 | 196 | $sth->execute($query_values); |
174 | 197 | $owner_array = array(); |
@@ -197,7 +220,9 @@ discard block |
||
197 | 220 | FROM satellite".$filter_query." satellite.country_owner <> '' AND satellite.country_owner IS NOT NULL"; |
198 | 221 | $query_values = array(); |
199 | 222 | $query .= " GROUP BY satellite.country_owner ORDER BY country_count DESC"; |
200 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
223 | + if ($limit) { |
|
224 | + $query .= " LIMIT 10 OFFSET 0"; |
|
225 | + } |
|
201 | 226 | $sth = $this->db->prepare($query); |
202 | 227 | $sth->execute($query_values); |
203 | 228 | $owner_array = array(); |
@@ -224,20 +249,26 @@ discard block |
||
224 | 249 | date_default_timezone_set($globalTimezone); |
225 | 250 | $datetime = new DateTime(); |
226 | 251 | $offset = $datetime->format('P'); |
227 | - } else $offset = '+00:00'; |
|
252 | + } else { |
|
253 | + $offset = '+00:00'; |
|
254 | + } |
|
228 | 255 | //$filter_query = $this->getFilter($filters,true,true); |
229 | 256 | $filter_query = ' WHERE'; |
230 | 257 | if ($globalDBdriver == 'mysql') { |
231 | 258 | $query = "SELECT MONTH(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
232 | 259 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR)"; |
233 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
260 | + if ($sincedate != '') { |
|
261 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
262 | + } |
|
234 | 263 | $query .= " GROUP BY year_name, month_name |
235 | 264 | ORDER BY year_name, month_name ASC"; |
236 | 265 | $query_data = array(':offset' => $offset); |
237 | 266 | } else { |
238 | 267 | $query = "SELECT EXTRACT(MONTH FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS month_name, EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
239 | 268 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 YEARS'"; |
240 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
269 | + if ($sincedate != '') { |
|
270 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
271 | + } |
|
241 | 272 | $query .= " GROUP BY year_name, month_name |
242 | 273 | ORDER BY year_name, month_name ASC"; |
243 | 274 | $query_data = array(':offset' => $offset); |
@@ -269,20 +300,26 @@ discard block |
||
269 | 300 | date_default_timezone_set($globalTimezone); |
270 | 301 | $datetime = new DateTime(); |
271 | 302 | $offset = $datetime->format('P'); |
272 | - } else $offset = '+00:00'; |
|
303 | + } else { |
|
304 | + $offset = '+00:00'; |
|
305 | + } |
|
273 | 306 | //$filter_query = $this->getFilter($filters,true,true); |
274 | 307 | $filter_query = ' WHERE'; |
275 | 308 | if ($globalDBdriver == 'mysql') { |
276 | 309 | $query = "SELECT YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
277 | 310 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 YEAR)"; |
278 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
311 | + if ($sincedate != '') { |
|
312 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
313 | + } |
|
279 | 314 | $query .= " GROUP BY year_name |
280 | 315 | ORDER BY year_name ASC"; |
281 | 316 | $query_data = array(':offset' => $offset); |
282 | 317 | } else { |
283 | 318 | $query = "SELECT EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
284 | 319 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '10 YEARS'"; |
285 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
320 | + if ($sincedate != '') { |
|
321 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
322 | + } |
|
286 | 323 | $query .= " GROUP BY year_name |
287 | 324 | ORDER BY year_name ASC"; |
288 | 325 | $query_data = array(':offset' => $offset); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | <button type="button" class="close">×</button> |
10 | 10 | <?php |
11 | 11 | |
12 | -$sat = filter_input(INPUT_GET,'sat',FILTER_SANITIZE_STRING); |
|
12 | +$sat = filter_input(INPUT_GET, 'sat', FILTER_SANITIZE_STRING); |
|
13 | 13 | $sat = urldecode($sat); |
14 | 14 | //$info = $Satellite->get_info(str_replace(' ','-',$sat)); |
15 | 15 | //print_r($info); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $aircraft_name = 'INTEGRAL'; |
49 | 49 | // $ground_speed = 14970; |
50 | 50 | $launch_date = '17 October 2002'; |
51 | -} elseif (strpos($sat,'IRIDIUM') !== false) { |
|
51 | +} elseif (strpos($sat, 'IRIDIUM') !== false) { |
|
52 | 52 | $image = 'https://upload.wikimedia.org/wikipedia/commons/b/b6/Iridium_Satellite.jpg'; |
53 | 53 | $image_copyright = 'Cliff'; |
54 | 54 | $ident = 'Iridium satellite constellation'; |
@@ -56,23 +56,23 @@ discard block |
||
56 | 56 | $aircraft_name = $sat; |
57 | 57 | // $ground_speed = 14970; |
58 | 58 | // $launch_date = '29 september 2011'; |
59 | -} elseif (strpos($sat,'ORBCOMM') !== false) { |
|
59 | +} elseif (strpos($sat, 'ORBCOMM') !== false) { |
|
60 | 60 | $ident = 'Orbcomm'; |
61 | 61 | $aircraft_wiki = 'https://en.wikipedia.org/wiki/Orbcomm_(satellite)'; |
62 | 62 | $aircraft_name = $sat; |
63 | -} elseif (strpos($sat,'GLOBALSTAR') !== false) { |
|
63 | +} elseif (strpos($sat, 'GLOBALSTAR') !== false) { |
|
64 | 64 | $ident = 'Globalstar'; |
65 | 65 | $aircraft_wiki = 'https://en.wikipedia.org/wiki/Globalstar'; |
66 | 66 | $aircraft_name = $sat; |
67 | - $satname = str_replace(array('[+]','[-]'),'',$sat); |
|
68 | -} elseif (strpos($sat,'OSCAR 7') !== false) { |
|
67 | + $satname = str_replace(array('[+]', '[-]'), '', $sat); |
|
68 | +} elseif (strpos($sat, 'OSCAR 7') !== false) { |
|
69 | 69 | $image = 'https://upload.wikimedia.org/wikipedia/en/a/ad/AMSAT-OSCAR_7.jpg'; |
70 | 70 | $image_copyright = 'Amsat.org'; |
71 | 71 | $ident = 'AMSAT-OSCAR 7'; |
72 | 72 | $aircraft_wiki = 'https://en.wikipedia.org/wiki/AMSAT-OSCAR_7'; |
73 | 73 | $aircraft_name = $sat; |
74 | 74 | $launch_date = '15 November 1974'; |
75 | -} elseif (strpos($sat,'santaclaus') !== false) { |
|
75 | +} elseif (strpos($sat, 'santaclaus') !== false) { |
|
76 | 76 | $image = 'https://upload.wikimedia.org/wikipedia/commons/4/49/Jonathan_G_Meath_portrays_Santa_Claus.jpg'; |
77 | 77 | $image_copyright = 'Jonathan G Meath'; |
78 | 78 | $ident = 'Santa Claus'; |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | // $launch_date = '15 November 1974'; |
82 | 82 | } else { |
83 | 83 | $ident = $sat; |
84 | - if (strpos($sat,'(')) $satname = $sat; |
|
85 | - else $satname = str_replace(array(' '),'-',$sat); |
|
84 | + if (strpos($sat, '(')) $satname = $sat; |
|
85 | + else $satname = str_replace(array(' '), '-', $sat); |
|
86 | 86 | } |
87 | 87 | if (!isset($satname)) $satname = $sat; |
88 | 88 | $info = $Satellite->get_info(strtolower(trim($satname))); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | print '<div><span>'._("Orbit").'</span>'.$info['orbit'].'</div>'; |
146 | 146 | } |
147 | 147 | if ($info['launch_date'] != '') { |
148 | - print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d',strtotime($info['launch_date'])).'</div>'; |
|
148 | + print '<div><span>'._("Launch Date").'</span>'.date('Y-m-d', strtotime($info['launch_date'])).'</div>'; |
|
149 | 149 | } |
150 | 150 | if ($info['launch_site'] != '') { |
151 | 151 | print '<div><span>'._("Launch Site").'</span>'.$info['launch_site'].'</div>'; |
@@ -81,10 +81,15 @@ |
||
81 | 81 | // $launch_date = '15 November 1974'; |
82 | 82 | } else { |
83 | 83 | $ident = $sat; |
84 | - if (strpos($sat,'(')) $satname = $sat; |
|
85 | - else $satname = str_replace(array(' '),'-',$sat); |
|
84 | + if (strpos($sat,'(')) { |
|
85 | + $satname = $sat; |
|
86 | + } else { |
|
87 | + $satname = str_replace(array(' '),'-',$sat); |
|
88 | + } |
|
89 | + } |
|
90 | +if (!isset($satname)) { |
|
91 | + $satname = $sat; |
|
86 | 92 | } |
87 | -if (!isset($satname)) $satname = $sat; |
|
88 | 93 | $info = $Satellite->get_info(strtolower(trim($satname))); |
89 | 94 | $position = $Satellite->position($sat); |
90 | 95 | $ground_speed = $position['speed']; |
@@ -52,7 +52,12 @@ |
||
52 | 52 | } else { |
53 | 53 | for (var i = 0; i < viewer.dataSources.get(dsn).entities.values.length; i++) { |
54 | 54 | var entity = viewer.dataSources.get(dsn).entities.values[i]; |
55 | - if (parseInt(entity.lastupdatesat) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
55 | + if (parseInt(entity.lastupdatesat) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
56 | + print $globalMapRefresh*2000; |
|
57 | +} else { |
|
58 | + print '60000'; |
|
59 | +} |
|
60 | +?>)) { |
|
56 | 61 | viewer.dataSources.get(dsn).entities.remove(entity); |
57 | 62 | } |
58 | 63 | } |
@@ -20,17 +20,17 @@ discard block |
||
20 | 20 | |
21 | 21 | $spotter_array = array(); |
22 | 22 | if (isset($_COOKIE['sattypes']) && $_COOKIE['sattypes'] != '') { |
23 | - $sattypes = explode(',',$_COOKIE['sattypes']); |
|
23 | + $sattypes = explode(',', $_COOKIE['sattypes']); |
|
24 | 24 | foreach ($sattypes as $sattype) { |
25 | - $spotter_array = array_merge($Satellite->position_all_type($sattype,$timeb-$globalLiveInterval,$timeb),$spotter_array); |
|
25 | + $spotter_array = array_merge($Satellite->position_all_type($sattype, $timeb - $globalLiveInterval, $timeb), $spotter_array); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss']) { |
29 | - $spotter_array = array_merge($Satellite->position('ISS (ZARYA)',time()-$globalLiveInterval,time()),$spotter_array); |
|
30 | - $spotter_array = array_merge($Satellite->position('TIANGONG 1',time()-$globalLiveInterval,time()),$spotter_array); |
|
31 | - $spotter_array = array_merge($Satellite->position('TIANGONG-2',time()-$globalLiveInterval,time()),$spotter_array); |
|
29 | + $spotter_array = array_merge($Satellite->position('ISS (ZARYA)', time() - $globalLiveInterval, time()), $spotter_array); |
|
30 | + $spotter_array = array_merge($Satellite->position('TIANGONG 1', time() - $globalLiveInterval, time()), $spotter_array); |
|
31 | + $spotter_array = array_merge($Satellite->position('TIANGONG-2', time() - $globalLiveInterval, time()), $spotter_array); |
|
32 | 32 | } |
33 | -$spotter_array = array_unique($spotter_array,SORT_REGULAR); |
|
33 | +$spotter_array = array_unique($spotter_array, SORT_REGULAR); |
|
34 | 34 | /* |
35 | 35 | $modelsdb = array(); |
36 | 36 | if (file_exists('models/space/space_modelsdb')) { |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
55 | 55 | |
56 | 56 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
57 | -$output .= ',"clock": {"currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
|
57 | +$output .= ',"clock": {"currentTime" : "'.date("c", time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
|
58 | 58 | //$output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
59 | 59 | |
60 | 60 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
61 | 61 | $output .= '},'; |
62 | 62 | if (!empty($spotter_array) && is_array($spotter_array)) |
63 | 63 | { |
64 | - foreach($spotter_array as $spotter_item) |
|
64 | + foreach ($spotter_array as $spotter_item) |
|
65 | 65 | { |
66 | 66 | $j++; |
67 | 67 | date_default_timezone_set('UTC'); |
@@ -115,23 +115,23 @@ discard block |
||
115 | 115 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/cubiesat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
116 | 116 | } elseif ($spotter_item['name'] == 'TERRA') { |
117 | 117 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/terra.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
118 | - } elseif (strpos($spotter_item['name'],'O3B') !== false) { |
|
118 | + } elseif (strpos($spotter_item['name'], 'O3B') !== false) { |
|
119 | 119 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/o3b.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
120 | - } elseif (strpos($spotter_item['name'],'GLOBALSTAR') !== false) { |
|
120 | + } elseif (strpos($spotter_item['name'], 'GLOBALSTAR') !== false) { |
|
121 | 121 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/globalstar.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
122 | - } elseif (strpos($spotter_item['name'],'GPS') !== false) { |
|
122 | + } elseif (strpos($spotter_item['name'], 'GPS') !== false) { |
|
123 | 123 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/gps.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
124 | - } elseif (strpos($spotter_item['name'],'GENESIS') !== false) { |
|
124 | + } elseif (strpos($spotter_item['name'], 'GENESIS') !== false) { |
|
125 | 125 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/genesis.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
126 | - } elseif (strpos($spotter_item['name'],'OSCAR 7') !== false) { |
|
126 | + } elseif (strpos($spotter_item['name'], 'OSCAR 7') !== false) { |
|
127 | 127 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/oscar7.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
128 | - } elseif (strpos($spotter_item['name'],'FLOCK') !== false) { |
|
128 | + } elseif (strpos($spotter_item['name'], 'FLOCK') !== false) { |
|
129 | 129 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/cubesat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
130 | - } elseif (strpos($spotter_item['name'],'PLEIADES') !== false) { |
|
130 | + } elseif (strpos($spotter_item['name'], 'PLEIADES') !== false) { |
|
131 | 131 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/pleiades.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
132 | - } elseif (strpos($spotter_item['name'],'DUCHIFAT') !== false) { |
|
132 | + } elseif (strpos($spotter_item['name'], 'DUCHIFAT') !== false) { |
|
133 | 133 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/duchifat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
134 | - } elseif (strpos($spotter_item['name'],'FORMOSAT-2') !== false) { |
|
134 | + } elseif (strpos($spotter_item['name'], 'FORMOSAT-2') !== false) { |
|
135 | 135 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/formosat2.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
136 | 136 | } elseif ($spotter_item['type'] == 'iridium') { |
137 | 137 | $output .= '"model": {"gltf" : "'.$globalURL.'/models/space/iridium.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },'; |
@@ -153,14 +153,14 @@ discard block |
||
153 | 153 | // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", '; |
154 | 154 | $output .= '"interpolationAlgorithm":"HERMITE","interpolationDegree":3,'; |
155 | 155 | $output .= '"cartographicDegrees": ['; |
156 | - $output .= '"'.date("c",$spotter_item['timestamp']).'", '; |
|
156 | + $output .= '"'.date("c", $spotter_item['timestamp']).'", '; |
|
157 | 157 | $output .= $spotter_item['longitude'].', '; |
158 | 158 | $output .= $spotter_item['latitude'].', '; |
159 | 159 | $output .= $spotter_item['altitude']*1000; |
160 | 160 | $orientation = '"orientation" : { '; |
161 | 161 | $orientation .= '"unitQuaternion": ['; |
162 | 162 | } else { |
163 | - $output .= ',"'.date("c",$spotter_item['timestamp']).'", '; |
|
163 | + $output .= ',"'.date("c", $spotter_item['timestamp']).'", '; |
|
164 | 164 | $output .= $spotter_item['longitude'].', '; |
165 | 165 | $output .= $spotter_item['latitude'].', '; |
166 | 166 | $output .= $spotter_item['altitude']*1000; |
@@ -131,45 +131,72 @@ discard block |
||
131 | 131 | </div> |
132 | 132 | <p> |
133 | 133 | <label for="dbhost">Database hostname</label> |
134 | - <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) print $globalDBhost; ?>" /> |
|
134 | + <input type="text" name="dbhost" id="dbhost" value="<?php if (isset($globalDBhost)) { |
|
135 | + print $globalDBhost; |
|
136 | +} |
|
137 | +?>" /> |
|
135 | 138 | </p> |
136 | 139 | <p> |
137 | 140 | <label for="dbport">Database port</label> |
138 | - <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) print $globalDBport; ?>" /> |
|
141 | + <input type="text" name="dbport" id="dbport" value="<?php if (isset($globalDBport)) { |
|
142 | + print $globalDBport; |
|
143 | +} |
|
144 | +?>" /> |
|
139 | 145 | <p class="help-block">Default is 3306 for MariaDB/MySQL, 5432 for PostgreSQL</p> |
140 | 146 | </p> |
141 | 147 | <p> |
142 | 148 | <label for="dbname">Database name</label> |
143 | - <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) print $globalDBname; ?>" /> |
|
149 | + <input type="text" name="dbname" id="dbname" value="<?php if (isset($globalDBname)) { |
|
150 | + print $globalDBname; |
|
151 | +} |
|
152 | +?>" /> |
|
144 | 153 | </p> |
145 | 154 | <p> |
146 | 155 | <label for="dbuser">Database user</label> |
147 | - <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) print $globalDBuser; ?>" /> |
|
156 | + <input type="text" name="dbuser" id="dbuser" value="<?php if (isset($globalDBuser)) { |
|
157 | + print $globalDBuser; |
|
158 | +} |
|
159 | +?>" /> |
|
148 | 160 | </p> |
149 | 161 | <p> |
150 | 162 | <label for="dbuserpass">Database user password</label> |
151 | - <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) print $globalDBpass; ?>" /> |
|
163 | + <input type="password" name="dbuserpass" id="dbuserpass" value="<?php if (isset($globalDBpass)) { |
|
164 | + print $globalDBpass; |
|
165 | +} |
|
166 | +?>" /> |
|
152 | 167 | </p> |
153 | 168 | </fieldset> |
154 | 169 | <fieldset id="site"> |
155 | 170 | <legend>Site configuration</legend> |
156 | 171 | <p> |
157 | 172 | <label for="sitename">Site name</label> |
158 | - <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) print $globalName; ?>" /> |
|
173 | + <input type="text" name="sitename" id="sitename" value="<?php if (isset($globalName)) { |
|
174 | + print $globalName; |
|
175 | +} |
|
176 | +?>" /> |
|
159 | 177 | </p> |
160 | 178 | <p> |
161 | 179 | <label for="siteurl">Site directory</label> |
162 | - <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) print $globalURL; ?>" /> |
|
180 | + <input type="text" name="siteurl" id="siteurl" value="<?php if (isset($globalURL)) { |
|
181 | + print $globalURL; |
|
182 | +} |
|
183 | +?>" /> |
|
163 | 184 | <p class="help-block">Can be null. ex : <i>flightairmap</i> if complete URL is <i>http://toto.com/flightairmap</i></p> |
164 | 185 | </p> |
165 | 186 | <p> |
166 | 187 | <label for="timezone">Timezone</label> |
167 | - <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) print $globalTimezone; ?>" /> |
|
188 | + <input type="text" name="timezone" id="timezone" value="<?php if (isset($globalTimezone)) { |
|
189 | + print $globalTimezone; |
|
190 | +} |
|
191 | +?>" /> |
|
168 | 192 | <p class="help-block">ex : UTC, Europe/Paris,...</p> |
169 | 193 | </p> |
170 | 194 | <p> |
171 | 195 | <label for="language">Language</label> |
172 | - <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) print $globalLanguage; ?>" /> |
|
196 | + <input type="text" name="language" id="language" value="<?php if (isset($globalLanguage)) { |
|
197 | + print $globalLanguage; |
|
198 | +} |
|
199 | +?>" /> |
|
173 | 200 | <p class="help-block">Used only when link to wikipedia for now. Can be EN,DE,FR,...</p> |
174 | 201 | </p> |
175 | 202 | </fieldset> |
@@ -190,11 +217,17 @@ discard block |
||
190 | 217 | <div id="mapbox_data"> |
191 | 218 | <p> |
192 | 219 | <label for="mapboxid">Mapbox id</label> |
193 | - <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) print $globalMapboxId; ?>" /> |
|
220 | + <input type="text" name="mapboxid" id="mapboxid" value="<?php if (isset($globalMapboxId)) { |
|
221 | + print $globalMapboxId; |
|
222 | +} |
|
223 | +?>" /> |
|
194 | 224 | </p> |
195 | 225 | <p> |
196 | 226 | <label for="mapboxtoken">Mapbox token</label> |
197 | - <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) print $globalMapboxToken; ?>" /> |
|
227 | + <input type="text" name="mapboxtoken" id="mapboxtoken" value="<?php if (isset($globalMapboxToken)) { |
|
228 | + print $globalMapboxToken; |
|
229 | +} |
|
230 | +?>" /> |
|
198 | 231 | </p> |
199 | 232 | <p class="help-block">Get a key <a href="https://www.mapbox.com/developers/">here</a></p> |
200 | 233 | </div> |
@@ -202,7 +235,10 @@ discard block |
||
202 | 235 | <div id="google_data"> |
203 | 236 | <p> |
204 | 237 | <label for="googlekey">Google API key</label> |
205 | - <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) print $globalGoogleAPIKey; ?>" /> |
|
238 | + <input type="text" name="googlekey" id="googlekey" value="<?php if (isset($globalGoogleAPIKey)) { |
|
239 | + print $globalGoogleAPIKey; |
|
240 | +} |
|
241 | +?>" /> |
|
206 | 242 | <p class="help-block">Get a key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key">here</a></p> |
207 | 243 | </p> |
208 | 244 | </div> |
@@ -210,7 +246,10 @@ discard block |
||
210 | 246 | <div id="bing_data"> |
211 | 247 | <p> |
212 | 248 | <label for="bingkey">Bing Map key</label> |
213 | - <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) print $globalBingMapKey; ?>" /> |
|
249 | + <input type="text" name="bingkey" id="bingkey" value="<?php if (isset($globalBingMapKey)) { |
|
250 | + print $globalBingMapKey; |
|
251 | +} |
|
252 | +?>" /> |
|
214 | 253 | <p class="help-block">Get a key <a href="https://www.bingmapsportal.com/">here</a></p> |
215 | 254 | </p> |
216 | 255 | </div> |
@@ -218,7 +257,10 @@ discard block |
||
218 | 257 | <div id="mapquest_data"> |
219 | 258 | <p> |
220 | 259 | <label for="mapquestkey">MapQuest key</label> |
221 | - <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) print $globalMapQuestKey; ?>" /> |
|
260 | + <input type="text" name="mapquestkey" id="mapquestkey" value="<?php if (isset($globalMapQuestKey)) { |
|
261 | + print $globalMapQuestKey; |
|
262 | +} |
|
263 | +?>" /> |
|
222 | 264 | <p class="help-block">Get a key <a href="https://developer.mapquest.com/user/me/apps">here</a></p> |
223 | 265 | </p> |
224 | 266 | </div> |
@@ -226,11 +268,17 @@ discard block |
||
226 | 268 | <div id="here_data"> |
227 | 269 | <p> |
228 | 270 | <label for="hereappid">Here App_Id</label> |
229 | - <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) print $globalHereappId; ?>" /> |
|
271 | + <input type="text" name="hereappid" id="hereappid" value="<?php if (isset($globalHereappId)) { |
|
272 | + print $globalHereappId; |
|
273 | +} |
|
274 | +?>" /> |
|
230 | 275 | </p> |
231 | 276 | <p> |
232 | 277 | <label for="hereappcode">Here App_Code</label> |
233 | - <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) print $globalHereappCode; ?>" /> |
|
278 | + <input type="text" name="hereappcode" id="hereappcode" value="<?php if (isset($globalHereappCode)) { |
|
279 | + print $globalHereappCode; |
|
280 | +} |
|
281 | +?>" /> |
|
234 | 282 | </p> |
235 | 283 | <p class="help-block">Get a key <a href="https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/quick-start.html">here</a></p> |
236 | 284 | </div> |
@@ -238,7 +286,10 @@ discard block |
||
238 | 286 | <div id="openweathermap_data"> |
239 | 287 | <p> |
240 | 288 | <label for="openweathermapkey">OpenWeatherMap key (weather layer)</label> |
241 | - <input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) print $globalOpenWeatherMapKey; ?>" /> |
|
289 | + <input type="text" name="openweathermapkey" id="openweathermapkey" value="<?php if (isset($globalOpenWeatherMapKey)) { |
|
290 | + print $globalOpenWeatherMapKey; |
|
291 | +} |
|
292 | +?>" /> |
|
242 | 293 | <p class="help-block">Get a key <a href="https://openweathermap.org/">here</a></p> |
243 | 294 | </p> |
244 | 295 | </div> |
@@ -248,42 +299,86 @@ discard block |
||
248 | 299 | <legend>Coverage area</legend> |
249 | 300 | <p> |
250 | 301 | <label for="latitudemax">The maximum latitude (north)</label> |
251 | - <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) print $globalLatitudeMax; ?>" /> |
|
302 | + <input type="text" name="latitudemax" id="latitudemax" value="<?php if (isset($globalLatitudeMax)) { |
|
303 | + print $globalLatitudeMax; |
|
304 | +} |
|
305 | +?>" /> |
|
252 | 306 | </p> |
253 | 307 | <p> |
254 | 308 | <label for="latitudemin">The minimum latitude (south)</label> |
255 | - <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) print $globalLatitudeMin; ?>" /> |
|
309 | + <input type="text" name="latitudemin" id="latitudemin" value="<?php if (isset($globalLatitudeMin)) { |
|
310 | + print $globalLatitudeMin; |
|
311 | +} |
|
312 | +?>" /> |
|
256 | 313 | </p> |
257 | 314 | <p> |
258 | 315 | <label for="longitudemax">The maximum longitude (west)</label> |
259 | - <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) print $globalLongitudeMax; ?>" /> |
|
316 | + <input type="text" name="longitudemax" id="longitudemax" value="<?php if (isset($globalLongitudeMax)) { |
|
317 | + print $globalLongitudeMax; |
|
318 | +} |
|
319 | +?>" /> |
|
260 | 320 | </p> |
261 | 321 | <p> |
262 | 322 | <label for="longitudemin">The minimum longitude (east)</label> |
263 | - <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) print $globalLongitudeMin; ?>" /> |
|
323 | + <input type="text" name="longitudemin" id="longitudemin" value="<?php if (isset($globalLongitudeMin)) { |
|
324 | + print $globalLongitudeMin; |
|
325 | +} |
|
326 | +?>" /> |
|
264 | 327 | </p> |
265 | 328 | <p> |
266 | 329 | <label for="latitudecenter">The latitude center</label> |
267 | - <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) print $globalCenterLatitude; ?>" /> |
|
330 | + <input type="text" name="latitudecenter" id="latitudecenter" value="<?php if (isset($globalCenterLatitude)) { |
|
331 | + print $globalCenterLatitude; |
|
332 | +} |
|
333 | +?>" /> |
|
268 | 334 | </p> |
269 | 335 | <p> |
270 | 336 | <label for="longitudecenter">The longitude center</label> |
271 | - <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) print $globalCenterLongitude; ?>" /> |
|
337 | + <input type="text" name="longitudecenter" id="longitudecenter" value="<?php if (isset($globalCenterLongitude)) { |
|
338 | + print $globalCenterLongitude; |
|
339 | +} |
|
340 | +?>" /> |
|
272 | 341 | </p> |
273 | 342 | <p> |
274 | 343 | <label for="livezoom">Default Zoom on live map</label> |
275 | - <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>" /> |
|
344 | + <input type="number" name="livezoom" id="livezoom" value="<?php if (isset($globalLiveZoom)) { |
|
345 | + print $globalLiveZoom; |
|
346 | +} else { |
|
347 | + print '9'; |
|
348 | +} |
|
349 | +?>" /> |
|
276 | 350 | </p> |
277 | 351 | <p> |
278 | 352 | <label for="squawk_country">Country for squawk usage</label> |
279 | 353 | <select name="squawk_country" id="squawk_country"> |
280 | - <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') print ' selected '; ?>>UK</option> |
|
281 | - <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') print ' selected '; ?>>NZ</option> |
|
282 | - <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') print ' selected '; ?>>US</option> |
|
283 | - <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') print ' selected '; ?>>AU</option> |
|
284 | - <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') print ' selected '; ?>>NL</option> |
|
285 | - <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') print ' selected '; ?>>FR</option> |
|
286 | - <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') print ' selected '; ?>>TR</option> |
|
354 | + <option value="UK"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'UK') { |
|
355 | + print ' selected '; |
|
356 | +} |
|
357 | +?>>UK</option> |
|
358 | + <option value="NZ"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NZ') { |
|
359 | + print ' selected '; |
|
360 | +} |
|
361 | +?>>NZ</option> |
|
362 | + <option value="US"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'US') { |
|
363 | + print ' selected '; |
|
364 | +} |
|
365 | +?>>US</option> |
|
366 | + <option value="AU"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'AU') { |
|
367 | + print ' selected '; |
|
368 | +} |
|
369 | +?>>AU</option> |
|
370 | + <option value="NL"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'NL') { |
|
371 | + print ' selected '; |
|
372 | +} |
|
373 | +?>>NL</option> |
|
374 | + <option value="FR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'FR') { |
|
375 | + print ' selected '; |
|
376 | +} |
|
377 | +?>>FR</option> |
|
378 | + <option value="TR"<?php if (isset($globalSquawkCountry) && $globalSquawkCountry == 'TR') { |
|
379 | + print ' selected '; |
|
380 | +} |
|
381 | +?>>TR</option> |
|
287 | 382 | </select> |
288 | 383 | </p> |
289 | 384 | </fieldset> |
@@ -292,15 +387,24 @@ discard block |
||
292 | 387 | <p><i>Only put in DB flights that are inside a circle</i></p> |
293 | 388 | <p> |
294 | 389 | <label for="latitude">Center latitude</label> |
295 | - <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) echo $globalDistanceIgnore['latitude']; ?>" /> |
|
390 | + <input type="text" name="zoilatitude" id="latitude" value="<?php if (isset($globalDistanceIgnore['latitude'])) { |
|
391 | + echo $globalDistanceIgnore['latitude']; |
|
392 | +} |
|
393 | +?>" /> |
|
296 | 394 | </p> |
297 | 395 | <p> |
298 | 396 | <label for="longitude">Center longitude</label> |
299 | - <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) echo $globalDistanceIgnore['longitude']; ?>" /> |
|
397 | + <input type="text" name="zoilongitude" id="longitude" value="<?php if (isset($globalDistanceIgnore['longitude'])) { |
|
398 | + echo $globalDistanceIgnore['longitude']; |
|
399 | +} |
|
400 | +?>" /> |
|
300 | 401 | </p> |
301 | 402 | <p> |
302 | 403 | <label for="Distance">Distance (in km)</label> |
303 | - <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) echo $globalDistanceIgnore['distance']; ?>" /> |
|
404 | + <input type="text" name="zoidistance" id="distance" value="<?php if (isset($globalDistanceIgnore['distance'])) { |
|
405 | + echo $globalDistanceIgnore['distance']; |
|
406 | +} |
|
407 | +?>" /> |
|
304 | 408 | </p> |
305 | 409 | </fieldset> |
306 | 410 | <fieldset id="sourceloc"> |
@@ -411,11 +515,17 @@ discard block |
||
411 | 515 | <div id="flightaware_data"> |
412 | 516 | <p> |
413 | 517 | <label for="flightawareusername">FlightAware username</label> |
414 | - <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) print $globalFlightAwareUsername; ?>" /> |
|
518 | + <input type="text" name="flightawareusername" id="flightawareusername" value="<?php if (isset($globalFlightAwareUsername)) { |
|
519 | + print $globalFlightAwareUsername; |
|
520 | +} |
|
521 | +?>" /> |
|
415 | 522 | </p> |
416 | 523 | <p> |
417 | 524 | <label for="flightawarepassword">FlightAware password/API key</label> |
418 | - <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) print $globalFlightAwarePassword; ?>" /> |
|
525 | + <input type="text" name="flightawarepassword" id="flightawarepassword" value="<?php if (isset($globalFlightAwarePassword)) { |
|
526 | + print $globalFlightAwarePassword; |
|
527 | +} |
|
528 | +?>" /> |
|
419 | 529 | </p> |
420 | 530 | </div> |
421 | 531 | --> |
@@ -457,7 +567,10 @@ discard block |
||
457 | 567 | if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
458 | 568 | ?> |
459 | 569 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
460 | - <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
|
570 | + <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) { |
|
571 | + print $source['port']; |
|
572 | +} |
|
573 | +?>" /></td> |
|
461 | 574 | <?php |
462 | 575 | } else { |
463 | 576 | $hostport = explode(':',$source['host']); |
@@ -476,33 +589,102 @@ discard block |
||
476 | 589 | ?> |
477 | 590 | <td> |
478 | 591 | <select name="format[]" id="format"> |
479 | - <option value="auto" <?php if (!isset($source['format'])) print 'selected'; ?>>Auto</option> |
|
480 | - <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') print 'selected'; ?>>SBS</option> |
|
481 | - <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') print 'selected'; ?>>TSV</option> |
|
482 | - <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') print 'selected'; ?>>Raw</option> |
|
483 | - <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') print 'selected'; ?>>APRS</option> |
|
484 | - <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') print 'selected'; ?>>Radarcape deltadb.txt</option> |
|
485 | - <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') print 'selected'; ?>>Vatsim</option> |
|
486 | - <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') print 'selected'; ?>>Virtual Radar Server AircraftList.json</option> |
|
487 | - <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') print 'selected'; ?>>Virtual Radar Server TCP</option> |
|
488 | - <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') print 'selected'; ?>>phpVMS</option> |
|
489 | - <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') print 'selected'; ?>>Virtual Airlines Manager</option> |
|
490 | - <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') print 'selected'; ?>>IVAO</option> |
|
491 | - <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') print 'selected'; ?>>FlightGear Multiplayer</option> |
|
492 | - <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') print 'selected'; ?>>FlightGear Singleplayer</option> |
|
493 | - <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') print 'selected'; ?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
494 | - <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') print 'selected'; ?>>ACARS SBS-3 over TCP</option> |
|
495 | - <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') print 'selected'; ?>>NMEA AIS over TCP</option> |
|
496 | - <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') print 'selected'; ?>>AirWhere website</option> |
|
497 | - <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') print 'selected'; ?>>HidnSeek Callback</option> |
|
498 | - <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') print 'selected'; ?>>Blitzortung</option> |
|
592 | + <option value="auto" <?php if (!isset($source['format'])) { |
|
593 | + print 'selected'; |
|
594 | +} |
|
595 | +?>>Auto</option> |
|
596 | + <option value="sbs" <?php if (isset($source['format']) && $source['format'] == 'sbs') { |
|
597 | + print 'selected'; |
|
598 | +} |
|
599 | +?>>SBS</option> |
|
600 | + <option value="tsv" <?php if (isset($source['format']) && $source['format'] == 'tsv') { |
|
601 | + print 'selected'; |
|
602 | +} |
|
603 | +?>>TSV</option> |
|
604 | + <option value="raw" <?php if (isset($source['format']) && $source['format'] == 'raw') { |
|
605 | + print 'selected'; |
|
606 | +} |
|
607 | +?>>Raw</option> |
|
608 | + <option value="aprs" <?php if (isset($source['format']) && $source['format'] == 'aprs') { |
|
609 | + print 'selected'; |
|
610 | +} |
|
611 | +?>>APRS</option> |
|
612 | + <option value="deltadbtxt" <?php if (isset($source['format']) && $source['format'] == 'deltadbtxt') { |
|
613 | + print 'selected'; |
|
614 | +} |
|
615 | +?>>Radarcape deltadb.txt</option> |
|
616 | + <option value="vatsimtxt" <?php if (isset($source['format']) && $source['format'] == 'vatsimtxt') { |
|
617 | + print 'selected'; |
|
618 | +} |
|
619 | +?>>Vatsim</option> |
|
620 | + <option value="aircraftlistjson" <?php if (isset($source['format']) && $source['format'] == 'aircraftlistjson') { |
|
621 | + print 'selected'; |
|
622 | +} |
|
623 | +?>>Virtual Radar Server AircraftList.json</option> |
|
624 | + <option value="vrstcp" <?php if (isset($source['format']) && $source['format'] == 'vrstcp') { |
|
625 | + print 'selected'; |
|
626 | +} |
|
627 | +?>>Virtual Radar Server TCP</option> |
|
628 | + <option value="phpvmacars" <?php if (isset($source['format']) && $source['format'] == 'phpvmacars') { |
|
629 | + print 'selected'; |
|
630 | +} |
|
631 | +?>>phpVMS</option> |
|
632 | + <option value="vam" <?php if (isset($source['format']) && $source['format'] == 'vam') { |
|
633 | + print 'selected'; |
|
634 | +} |
|
635 | +?>>Virtual Airlines Manager</option> |
|
636 | + <option value="whazzup" <?php if (isset($source['format']) && $source['format'] == 'whazzup') { |
|
637 | + print 'selected'; |
|
638 | +} |
|
639 | +?>>IVAO</option> |
|
640 | + <option value="flightgearmp" <?php if (isset($source['format']) && $source['format'] == 'flightgearmp') { |
|
641 | + print 'selected'; |
|
642 | +} |
|
643 | +?>>FlightGear Multiplayer</option> |
|
644 | + <option value="flightgearsp" <?php if (isset($source['format']) && $source['format'] == 'flightgearsp') { |
|
645 | + print 'selected'; |
|
646 | +} |
|
647 | +?>>FlightGear Singleplayer</option> |
|
648 | + <option value="acars" <?php if (isset($source['format']) && $source['format'] == 'acars') { |
|
649 | + print 'selected'; |
|
650 | +} |
|
651 | +?>>ACARS from acarsdec/acarsdeco2 over UDP</option> |
|
652 | + <option value="acarssbs3" <?php if (isset($source['format']) && $source['format'] == 'acarssbs3') { |
|
653 | + print 'selected'; |
|
654 | +} |
|
655 | +?>>ACARS SBS-3 over TCP</option> |
|
656 | + <option value="ais" <?php if (isset($source['format']) && $source['format'] == 'ais') { |
|
657 | + print 'selected'; |
|
658 | +} |
|
659 | +?>>NMEA AIS over TCP</option> |
|
660 | + <option value="airwhere" <?php if (isset($source['format']) && $source['format'] == 'airwhere') { |
|
661 | + print 'selected'; |
|
662 | +} |
|
663 | +?>>AirWhere website</option> |
|
664 | + <option value="hidnseek_callback" <?php if (isset($source['format']) && $source['format'] == 'hidnseek_callback') { |
|
665 | + print 'selected'; |
|
666 | +} |
|
667 | +?>>HidnSeek Callback</option> |
|
668 | + <option value="blitzortung" <?php if (isset($source['format']) && $source['format'] == 'blitzortung') { |
|
669 | + print 'selected'; |
|
670 | +} |
|
671 | +?>>Blitzortung</option> |
|
499 | 672 | </select> |
500 | 673 | </td> |
501 | 674 | <td> |
502 | - <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) print $source['name']; ?>" /> |
|
675 | + <input type="text" name="name[]" id="name" value="<?php if (isset($source['name'])) { |
|
676 | + print $source['name']; |
|
677 | +} |
|
678 | +?>" /> |
|
503 | 679 | </td> |
504 | - <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) print 'checked'; ?> /></td> |
|
505 | - <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) print 'checked'; ?> /></td> |
|
680 | + <td><input type="checkbox" name="sourcestats[]" id="sourcestats" title="Create statistics for the source like number of messages, distance,..." value="1" <?php if (isset($source['sourcestats']) && $source['sourcestats']) { |
|
681 | + print 'checked'; |
|
682 | +} |
|
683 | +?> /></td> |
|
684 | + <td><input type="checkbox" name="noarchive[]" id="noarchive" title="Don't archive this source" value="1" <?php if (isset($source['noarchive']) && $source['noarchive']) { |
|
685 | + print 'checked'; |
|
686 | +} |
|
687 | +?> /></td> |
|
506 | 688 | <td> |
507 | 689 | <select name="timezones[]" id="timezones"> |
508 | 690 | <?php |
@@ -512,7 +694,9 @@ discard block |
||
512 | 694 | print '<option selected>'.$timezones.'</option>'; |
513 | 695 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
514 | 696 | print '<option selected>'.$timezones.'</option>'; |
515 | - } else print '<option>'.$timezones.'</option>'; |
|
697 | + } else { |
|
698 | + print '<option>'.$timezones.'</option>'; |
|
699 | + } |
|
516 | 700 | } |
517 | 701 | ?> |
518 | 702 | </select> |
@@ -562,7 +746,9 @@ discard block |
||
562 | 746 | foreach($timezonelist as $timezones){ |
563 | 747 | if ($timezones == 'UTC') { |
564 | 748 | print '<option selected>'.$timezones.'</option>'; |
565 | - } else print '<option>'.$timezones.'</option>'; |
|
749 | + } else { |
|
750 | + print '<option>'.$timezones.'</option>'; |
|
751 | + } |
|
566 | 752 | } |
567 | 753 | ?> |
568 | 754 | </select> |
@@ -585,11 +771,17 @@ discard block |
||
585 | 771 | <p>Listen UDP server for acarsdec/acarsdeco2/... with <i>daemon-acars.php</i> script</p> |
586 | 772 | <p> |
587 | 773 | <label for="acarshost">ACARS UDP host</label> |
588 | - <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) print $globalACARSHost; ?>" /> |
|
774 | + <input type="text" name="acarshost" id="acarshost" value="<?php if (isset($globalACARSHost)) { |
|
775 | + print $globalACARSHost; |
|
776 | +} |
|
777 | +?>" /> |
|
589 | 778 | </p> |
590 | 779 | <p> |
591 | 780 | <label for="acarsport">ACARS UDP port</label> |
592 | - <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) print $globalACARSPort; ?>" /> |
|
781 | + <input type="number" name="acarsport" id="acarsport" value="<?php if (isset($globalACARSPort)) { |
|
782 | + print $globalACARSPort; |
|
783 | +} |
|
784 | +?>" /> |
|
593 | 785 | </p> |
594 | 786 | </fieldset> |
595 | 787 | </div> |
@@ -671,13 +863,19 @@ discard block |
||
671 | 863 | <div id="schedules_options"> |
672 | 864 | <p> |
673 | 865 | <label for="britishairways">British Airways API Key</label> |
674 | - <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) print $globalBritishAirwaysKey; ?>" /> |
|
866 | + <input type="text" name="britishairways" id="britishairways" value="<?php if (isset($globalBritishAirwaysKey)) { |
|
867 | + print $globalBritishAirwaysKey; |
|
868 | +} |
|
869 | +?>" /> |
|
675 | 870 | <p class="help-block">Register an account on <a href="https://developer.ba.com/">https://developer.ba.com/</a></p> |
676 | 871 | </p> |
677 | 872 | <!-- |
678 | 873 | <p> |
679 | 874 | <label for="transavia">Transavia Test API Consumer Key</label> |
680 | - <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) print $globalTransaviaKey; ?>" /> |
|
875 | + <input type="text" name="transavia" id="transavia" value="<?php if (isset($globalTransaviaKey)) { |
|
876 | + print $globalTransaviaKey; |
|
877 | +} |
|
878 | +?>" /> |
|
681 | 879 | <p class="help-block">Register an account on <a href="https://developer.transavia.com">https://developer.transavia.com</a></p> |
682 | 880 | </p> |
683 | 881 | --> |
@@ -686,10 +884,16 @@ discard block |
||
686 | 884 | <b>Lufthansa API Key</b> |
687 | 885 | <p> |
688 | 886 | <label for="lufthansakey">Key</label> |
689 | - <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) print $globalLufthansaKey['key']; ?>" /> |
|
887 | + <input type="text" name="lufthansakey" id="lufthansakey" value="<?php if (isset($globalLufthansaKey['key'])) { |
|
888 | + print $globalLufthansaKey['key']; |
|
889 | +} |
|
890 | +?>" /> |
|
690 | 891 | </p><p> |
691 | 892 | <label for="lufthansasecret">Secret</label> |
692 | - <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) print $globalLufthansaKey['secret']; ?>" /> |
|
893 | + <input type="text" name="lufthansasecret" id="lufthansasecret" value="<?php if (isset($globalLufthansaKey['secret'])) { |
|
894 | + print $globalLufthansaKey['secret']; |
|
895 | +} |
|
896 | +?>" /> |
|
693 | 897 | </p> |
694 | 898 | </div> |
695 | 899 | <p class="help-block">Register an account on <a href="https://developer.lufthansa.com/page">https://developer.lufthansa.com/page</a></p> |
@@ -709,7 +913,10 @@ discard block |
||
709 | 913 | </p> |
710 | 914 | <p> |
711 | 915 | <label for="notamsource">URL of your feed from notaminfo.com</label> |
712 | - <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) print $globalNOTAMSource; ?>" /> |
|
916 | + <input type="text" name="notamsource" id="notamsource" value="<?php if (isset($globalNOTAMSource)) { |
|
917 | + print $globalNOTAMSource; |
|
918 | +} |
|
919 | +?>" /> |
|
713 | 920 | <p class="help-block">If you want to use world NOTAM from FlightAirMap website, leave it blank</p> |
714 | 921 | </p> |
715 | 922 | <br /> |
@@ -725,14 +932,20 @@ discard block |
||
725 | 932 | <div id="metarsrc"> |
726 | 933 | <p> |
727 | 934 | <label for="metarsource">URL of your METAR source</label> |
728 | - <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) print $globalMETARurl; ?>" /> |
|
935 | + <input type="text" name="metarsource" id="metarsource" value="<?php if (isset($globalMETARurl)) { |
|
936 | + print $globalMETARurl; |
|
937 | +} |
|
938 | +?>" /> |
|
729 | 939 | <p class="help-block">Use {icao} to specify where we replace by airport icao. ex : http://metar.vatsim.net/metar.php?id={icao}</p> |
730 | 940 | </p> |
731 | 941 | </div> |
732 | 942 | <br /> |
733 | 943 | <p> |
734 | 944 | <label for="bitly">Bit.ly access token api (used in search page)</label> |
735 | - <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) print $globalBitlyAccessToken; ?>" /> |
|
945 | + <input type="text" name="bitly" id="bitly" value="<?php if (isset($globalBitlyAccessToken)) { |
|
946 | + print $globalBitlyAccessToken; |
|
947 | +} |
|
948 | +?>" /> |
|
736 | 949 | </p> |
737 | 950 | <br /> |
738 | 951 | <p> |
@@ -748,11 +961,26 @@ discard block |
||
748 | 961 | <p> |
749 | 962 | <label for="geoid_source">Geoid Source</label> |
750 | 963 | <select name="geoid_source" id="geoid_source"> |
751 | - <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') print ' selected="selected"'; ?>>EGM96 15' (2.1MB)</option> |
|
752 | - <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') print ' selected="selected"'; ?>>EGM96 5' (19MB)</option> |
|
753 | - <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') print ' selected="selected"'; ?>>EGM2008 5' (19MB)</option> |
|
754 | - <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') print ' selected="selected"'; ?>>EGM2008 2.5' (75MB)</option> |
|
755 | - <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') print ' selected="selected"'; ?>>EGM2008 1' (470MB)</option> |
|
964 | + <option value="egm96-15"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-15') { |
|
965 | + print ' selected="selected"'; |
|
966 | +} |
|
967 | +?>>EGM96 15' (2.1MB)</option> |
|
968 | + <option value="egm96-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm96-5') { |
|
969 | + print ' selected="selected"'; |
|
970 | +} |
|
971 | +?>>EGM96 5' (19MB)</option> |
|
972 | + <option value="egm2008-5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-5') { |
|
973 | + print ' selected="selected"'; |
|
974 | +} |
|
975 | +?>>EGM2008 5' (19MB)</option> |
|
976 | + <option value="egm2008-2_5"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-2_5') { |
|
977 | + print ' selected="selected"'; |
|
978 | +} |
|
979 | +?>>EGM2008 2.5' (75MB)</option> |
|
980 | + <option value="egm2008-1"<?php if (isset($globalGeoidSource) && $globalGeoidSource == 'egm2008-1') { |
|
981 | + print ' selected="selected"'; |
|
982 | +} |
|
983 | +?>>EGM2008 1' (470MB)</option> |
|
756 | 984 | </select> |
757 | 985 | <p class="help-block">The geoid is approximated by an "earth gravity model" (EGM).</p> |
758 | 986 | </p> |
@@ -770,7 +998,12 @@ discard block |
||
770 | 998 | </p> |
771 | 999 | <p> |
772 | 1000 | <label for="archivemonths">Generate statistics, delete or put in archive flights older than xx months</label> |
773 | - <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) print $globalArchiveMonths; else echo '1'; ?>" /> |
|
1001 | + <input type="number" name="archivemonths" id="archivemonths" value="<?php if (isset($globalArchiveMonths)) { |
|
1002 | + print $globalArchiveMonths; |
|
1003 | +} else { |
|
1004 | + echo '1'; |
|
1005 | +} |
|
1006 | +?>" /> |
|
774 | 1007 | <p class="help-block">0 to disable, delete old flight if <i>Archive all flights data</i> is disabled</p> |
775 | 1008 | </p> |
776 | 1009 | <p> |
@@ -780,12 +1013,22 @@ discard block |
||
780 | 1013 | </p> |
781 | 1014 | <p> |
782 | 1015 | <label for="archivekeepmonths">Keep flights data for xx months in archive</label> |
783 | - <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) print $globalArchiveKeepMonths; else echo '1'; ?>" /> |
|
1016 | + <input type="number" name="archivekeepmonths" id="archivekeepmonths" value="<?php if (isset($globalArchiveKeepMonths)) { |
|
1017 | + print $globalArchiveKeepMonths; |
|
1018 | +} else { |
|
1019 | + echo '1'; |
|
1020 | +} |
|
1021 | +?>" /> |
|
784 | 1022 | <p class="help-block">0 to disable</p> |
785 | 1023 | </p> |
786 | 1024 | <p> |
787 | 1025 | <label for="archivekeeptrackmonths">Keep flights track data for xx months in archive</label> |
788 | - <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) print $globalArchiveKeepTrackMonths; else echo '1'; ?>" /> |
|
1026 | + <input type="number" name="archivekeeptrackmonths" id="archivekeeptrackmonths" value="<?php if (isset($globalArchiveKeepTrackMonths)) { |
|
1027 | + print $globalArchiveKeepTrackMonths; |
|
1028 | +} else { |
|
1029 | + echo '1'; |
|
1030 | +} |
|
1031 | +?>" /> |
|
789 | 1032 | <p class="help-block">0 to disable, should be less or egal to <i>Keep flights data</i> value</p> |
790 | 1033 | </p> |
791 | 1034 | <br /> |
@@ -795,7 +1038,12 @@ discard block |
||
795 | 1038 | <p class="help-block">Uncheck if the script is running as cron job</p> |
796 | 1039 | <div id="cronends"> |
797 | 1040 | <label for="cronend">Run script for xx seconds</label> |
798 | - <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) print $globalCronEnd; else print '0'; ?>" /> |
|
1041 | + <input type="number" name="cronend" id="cronend" value="<?php if (isset($globalCronEnd)) { |
|
1042 | + print $globalCronEnd; |
|
1043 | +} else { |
|
1044 | + print '0'; |
|
1045 | +} |
|
1046 | +?>" /> |
|
799 | 1047 | <p class="help-block">Set to 0 to disable. Should be disabled if source is URL.</p> |
800 | 1048 | </div> |
801 | 1049 | </p> |
@@ -848,15 +1096,30 @@ discard block |
||
848 | 1096 | <br /> |
849 | 1097 | <p> |
850 | 1098 | <label for="refresh">Show flights detected since xxx seconds</label> |
851 | - <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) echo $globalLiveInterval; else echo '200'; ?>" /> |
|
1099 | + <input type="number" name="refresh" id="refresh" value="<?php if (isset($globalLiveInterval)) { |
|
1100 | + echo $globalLiveInterval; |
|
1101 | +} else { |
|
1102 | + echo '200'; |
|
1103 | +} |
|
1104 | +?>" /> |
|
852 | 1105 | </p> |
853 | 1106 | <p> |
854 | 1107 | <label for="maprefresh">Live map refresh (in seconds)</label> |
855 | - <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) echo $globalMapRefresh; else echo '30'; ?>" /> |
|
1108 | + <input type="number" name="maprefresh" id="maprefresh" value="<?php if (isset($globalMapRefresh)) { |
|
1109 | + echo $globalMapRefresh; |
|
1110 | +} else { |
|
1111 | + echo '30'; |
|
1112 | +} |
|
1113 | +?>" /> |
|
856 | 1114 | </p> |
857 | 1115 | <p> |
858 | 1116 | <label for="mapidle">Map idle timeout (in minutes)</label> |
859 | - <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) echo $globalMapIdleTimeout; else echo '30'; ?>" /> |
|
1117 | + <input type="number" name="mapidle" id="mapidle" value="<?php if (isset($globalMapIdleTimeout)) { |
|
1118 | + echo $globalMapIdleTimeout; |
|
1119 | +} else { |
|
1120 | + echo '30'; |
|
1121 | +} |
|
1122 | +?>" /> |
|
860 | 1123 | <p class="help-block">0 to disable</p> |
861 | 1124 | </p> |
862 | 1125 | <p> |
@@ -871,12 +1134,20 @@ discard block |
||
871 | 1134 | <br /> |
872 | 1135 | <p> |
873 | 1136 | <label for="closestmindist">Distance to airport set as arrival (in km)</label> |
874 | - <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) echo $globalClosestMinDist; else echo '50'; ?>" /> |
|
1137 | + <input type="number" name="closestmindist" id="closestmindist" value="<?php if (isset($globalClosestMinDist)) { |
|
1138 | + echo $globalClosestMinDist; |
|
1139 | +} else { |
|
1140 | + echo '50'; |
|
1141 | +} |
|
1142 | +?>" /> |
|
875 | 1143 | </p> |
876 | 1144 | <br /> |
877 | 1145 | <p> |
878 | 1146 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
879 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
1147 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) { |
|
1148 | + echo $globalAircraftSize; |
|
1149 | +} |
|
1150 | +?>" /> |
|
880 | 1151 | </p> |
881 | 1152 | <br /> |
882 | 1153 | <p> |
@@ -889,7 +1160,12 @@ discard block |
||
889 | 1160 | if (extension_loaded('gd') && function_exists('gd_info')) { |
890 | 1161 | ?> |
891 | 1162 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
892 | - <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
|
1163 | + <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) { |
|
1164 | + echo $globalAircraftIconColor; |
|
1165 | +} else { |
|
1166 | + echo '1a3151'; |
|
1167 | +} |
|
1168 | +?>" /> |
|
893 | 1169 | <?php |
894 | 1170 | if (!is_writable('../cache')) { |
895 | 1171 | ?> |
@@ -907,14 +1183,27 @@ discard block |
||
907 | 1183 | <p> |
908 | 1184 | <label for="airportzoom">Zoom level minimum to see airports icons</label> |
909 | 1185 | <div class="range"> |
910 | - <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?>" /> |
|
911 | - <output id="range"><?php if (isset($globalAirportZoom)) echo $globalAirportZoom; else echo '7'; ?></output> |
|
1186 | + <input type="range" name="airportzoom" id="airportzoom" value="<?php if (isset($globalAirportZoom)) { |
|
1187 | + echo $globalAirportZoom; |
|
1188 | +} else { |
|
1189 | + echo '7'; |
|
1190 | +} |
|
1191 | +?>" /> |
|
1192 | + <output id="range"><?php if (isset($globalAirportZoom)) { |
|
1193 | + echo $globalAirportZoom; |
|
1194 | +} else { |
|
1195 | + echo '7'; |
|
1196 | +} |
|
1197 | +?></output> |
|
912 | 1198 | </div> |
913 | 1199 | </p> |
914 | 1200 | <br /> |
915 | 1201 | <p> |
916 | 1202 | <label for="customcss">Custom CSS web path</label> |
917 | - <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) echo $globalCustomCSS; ?>" /> |
|
1203 | + <input type="text" name="customcss" id="customcss" value="<?php if (isset($globalCustomCSS)) { |
|
1204 | + echo $globalCustomCSS; |
|
1205 | +} |
|
1206 | +?>" /> |
|
918 | 1207 | </p> |
919 | 1208 | </fieldset> |
920 | 1209 | <input type="submit" name="submit" value="Create/Update database & write setup" /> |
@@ -941,8 +1230,12 @@ discard block |
||
941 | 1230 | $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
942 | 1231 | $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
943 | 1232 | |
944 | - if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
|
945 | - if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1233 | + if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) { |
|
1234 | + $error .= 'Mysql driver for PDO must be loaded'; |
|
1235 | + } |
|
1236 | + if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) { |
|
1237 | + $error .= 'PosgreSQL driver for PDO must be loaded'; |
|
1238 | + } |
|
946 | 1239 | |
947 | 1240 | $_SESSION['database_root'] = $dbroot; |
948 | 1241 | $_SESSION['database_rootpass'] = $dbrootpass; |
@@ -1010,15 +1303,23 @@ discard block |
||
1010 | 1303 | $source_city = $_POST['source_city']; |
1011 | 1304 | $source_country = $_POST['source_country']; |
1012 | 1305 | $source_ref = $_POST['source_ref']; |
1013 | - if (isset($source_id)) $source_id = $_POST['source_id']; |
|
1014 | - else $source_id = array(); |
|
1306 | + if (isset($source_id)) { |
|
1307 | + $source_id = $_POST['source_id']; |
|
1308 | + } else { |
|
1309 | + $source_id = array(); |
|
1310 | + } |
|
1015 | 1311 | |
1016 | 1312 | $sources = array(); |
1017 | 1313 | foreach ($source_name as $keys => $name) { |
1018 | - if (isset($source_id[$keys])) $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1019 | - else $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1314 | + if (isset($source_id[$keys])) { |
|
1315 | + $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'id' => $source_id[$keys],'source' => $source_ref[$keys]); |
|
1316 | + } else { |
|
1317 | + $sources[] = array('name' => $name,'latitude' => $source_latitude[$keys],'longitude' => $source_longitude[$keys],'altitude' => $source_altitude[$keys],'city' => $source_city[$keys],'country' => $source_country[$keys],'source' => $source_ref[$keys]); |
|
1318 | + } |
|
1319 | + } |
|
1320 | + if (count($sources) > 0) { |
|
1321 | + $_SESSION['sources'] = $sources; |
|
1020 | 1322 | } |
1021 | - if (count($sources) > 0) $_SESSION['sources'] = $sources; |
|
1022 | 1323 | |
1023 | 1324 | //$sbshost = filter_input(INPUT_POST,'sbshost',FILTER_SANITIZE_STRING); |
1024 | 1325 | //$sbsport = filter_input(INPUT_POST,'sbsport',FILTER_SANITIZE_NUMBER_INT); |
@@ -1039,17 +1340,29 @@ discard block |
||
1039 | 1340 | $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
1040 | 1341 | |
1041 | 1342 | $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
1042 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1043 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1343 | + if ($globalaircraft == 'aircraft') { |
|
1344 | + $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1345 | + } else { |
|
1346 | + $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1347 | + } |
|
1044 | 1348 | $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
1045 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1046 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1349 | + if ($globaltracker == 'tracker') { |
|
1350 | + $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1351 | + } else { |
|
1352 | + $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1353 | + } |
|
1047 | 1354 | $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
1048 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1049 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1355 | + if ($globalmarine == 'marine') { |
|
1356 | + $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1357 | + } else { |
|
1358 | + $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1359 | + } |
|
1050 | 1360 | $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING); |
1051 | - if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
1052 | - else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
1361 | + if ($globalsatellite == 'satellite') { |
|
1362 | + $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
1363 | + } else { |
|
1364 | + $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
1365 | + } |
|
1053 | 1366 | |
1054 | 1367 | /* |
1055 | 1368 | $globalSBS1Hosts = array(); |
@@ -1071,23 +1384,37 @@ discard block |
||
1071 | 1384 | $name = $_POST['name']; |
1072 | 1385 | $format = $_POST['format']; |
1073 | 1386 | $timezones = $_POST['timezones']; |
1074 | - if (isset($_POST['sourcestats'])) $sourcestats = $_POST['sourcestats']; |
|
1075 | - else $sourcestats = array(); |
|
1076 | - if (isset($_POST['noarchive'])) $noarchive = $_POST['noarchive']; |
|
1077 | - else $noarchive = array(); |
|
1387 | + if (isset($_POST['sourcestats'])) { |
|
1388 | + $sourcestats = $_POST['sourcestats']; |
|
1389 | + } else { |
|
1390 | + $sourcestats = array(); |
|
1391 | + } |
|
1392 | + if (isset($_POST['noarchive'])) { |
|
1393 | + $noarchive = $_POST['noarchive']; |
|
1394 | + } else { |
|
1395 | + $noarchive = array(); |
|
1396 | + } |
|
1078 | 1397 | $gSources = array(); |
1079 | 1398 | $forcepilots = false; |
1080 | 1399 | foreach ($host as $key => $h) { |
1081 | - if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) $cov = 'TRUE'; |
|
1082 | - else $cov = 'FALSE'; |
|
1083 | - if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
|
1084 | - else $arch = 'FALSE'; |
|
1400 | + if (isset($sourcestats[$key]) && $sourcestats[$key] == 1) { |
|
1401 | + $cov = 'TRUE'; |
|
1402 | + } else { |
|
1403 | + $cov = 'FALSE'; |
|
1404 | + } |
|
1405 | + if (isset($noarchive[$key]) && $noarchive[$key] == 1) { |
|
1406 | + $arch = 'TRUE'; |
|
1407 | + } else { |
|
1408 | + $arch = 'FALSE'; |
|
1409 | + } |
|
1085 | 1410 | if (strpos($format[$key],'_callback')) { |
1086 | 1411 | $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
1087 | 1412 | } elseif ($h != '' || $name[$key] != '') { |
1088 | 1413 | $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
1089 | 1414 | } |
1090 | - if ($format[$key] == 'airwhere') $forcepilots = true; |
|
1415 | + if ($format[$key] == 'airwhere') { |
|
1416 | + $forcepilots = true; |
|
1417 | + } |
|
1091 | 1418 | } |
1092 | 1419 | $settings = array_merge($settings,array('globalSources' => $gSources)); |
1093 | 1420 | |
@@ -1115,7 +1442,9 @@ discard block |
||
1115 | 1442 | $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
1116 | 1443 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1117 | 1444 | $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
1118 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1445 | + } else { |
|
1446 | + $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1447 | + } |
|
1119 | 1448 | |
1120 | 1449 | $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
1121 | 1450 | $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
@@ -1154,7 +1483,9 @@ discard block |
||
1154 | 1483 | |
1155 | 1484 | // Create in settings.php keys not yet configurable if not already here |
1156 | 1485 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1157 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1486 | + if (!isset($globalDebug)) { |
|
1487 | + $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1488 | + } |
|
1158 | 1489 | |
1159 | 1490 | $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
1160 | 1491 | if ($resetyearstats == 'resetyearstats') { |
@@ -1191,37 +1522,56 @@ discard block |
||
1191 | 1522 | } |
1192 | 1523 | */ |
1193 | 1524 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
1194 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1195 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1196 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1197 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1525 | + if ($globalsbs == 'sbs') { |
|
1526 | + $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1527 | + } else { |
|
1528 | + $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1529 | + } |
|
1530 | + if ($globalaprs == 'aprs') { |
|
1531 | + $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1532 | + } else { |
|
1533 | + $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1534 | + } |
|
1198 | 1535 | $va = false; |
1199 | 1536 | if ($globalivao == 'ivao') { |
1200 | 1537 | $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
1201 | 1538 | $va = true; |
1202 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1539 | + } else { |
|
1540 | + $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1541 | + } |
|
1203 | 1542 | if ($globalvatsim == 'vatsim') { |
1204 | 1543 | $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
1205 | 1544 | $va = true; |
1206 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1545 | + } else { |
|
1546 | + $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1547 | + } |
|
1207 | 1548 | if ($globalphpvms == 'phpvms') { |
1208 | 1549 | $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
1209 | 1550 | $va = true; |
1210 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1551 | + } else { |
|
1552 | + $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1553 | + } |
|
1211 | 1554 | if ($globalvam == 'vam') { |
1212 | 1555 | $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
1213 | 1556 | $va = true; |
1214 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1557 | + } else { |
|
1558 | + $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1559 | + } |
|
1215 | 1560 | if ($va) { |
1216 | 1561 | $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
1217 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1562 | + } else { |
|
1563 | + $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1564 | + } |
|
1218 | 1565 | if ($globalva == 'va' || $va) { |
1219 | 1566 | $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
1220 | 1567 | $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
1221 | 1568 | } else { |
1222 | 1569 | $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
1223 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1224 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1570 | + if ($forcepilots) { |
|
1571 | + $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1572 | + } else { |
|
1573 | + $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1574 | + } |
|
1225 | 1575 | } |
1226 | 1576 | |
1227 | 1577 | |
@@ -1397,7 +1747,9 @@ discard block |
||
1397 | 1747 | $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
1398 | 1748 | } |
1399 | 1749 | |
1400 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1750 | + if (!isset($globalTransaction)) { |
|
1751 | + $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1752 | + } |
|
1401 | 1753 | |
1402 | 1754 | // Set some defaults values... |
1403 | 1755 | if (!isset($globalAircraftImageSources)) { |
@@ -1412,15 +1764,23 @@ discard block |
||
1412 | 1764 | |
1413 | 1765 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1414 | 1766 | |
1415 | - if ($error == '') settings::modify_settings($settings); |
|
1416 | - if ($error == '') settings::comment_settings($settings_comment); |
|
1767 | + if ($error == '') { |
|
1768 | + settings::modify_settings($settings); |
|
1769 | + } |
|
1770 | + if ($error == '') { |
|
1771 | + settings::comment_settings($settings_comment); |
|
1772 | + } |
|
1417 | 1773 | if ($error != '') { |
1418 | 1774 | print '<div class="info column">'.$error.'</div>'; |
1419 | 1775 | require('../footer.php'); |
1420 | 1776 | exit; |
1421 | 1777 | } else { |
1422 | - if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') $_SESSION['waypoints'] = 1; |
|
1423 | - if (isset($_POST['owner']) && $_POST['owner'] == 'owner') $_SESSION['owner'] = 1; |
|
1778 | + if (isset($_POST['waypoints']) && $_POST['waypoints'] == 'waypoints') { |
|
1779 | + $_SESSION['waypoints'] = 1; |
|
1780 | + } |
|
1781 | + if (isset($_POST['owner']) && $_POST['owner'] == 'owner') { |
|
1782 | + $_SESSION['owner'] = 1; |
|
1783 | + } |
|
1424 | 1784 | if (isset($_POST['createdb'])) { |
1425 | 1785 | $_SESSION['install'] = 'database_create'; |
1426 | 1786 | } else { |
@@ -1456,10 +1816,18 @@ discard block |
||
1456 | 1816 | $popw = false; |
1457 | 1817 | foreach ($_SESSION['done'] as $done) { |
1458 | 1818 | print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
1459 | - if ($done == 'Create database') $pop = true; |
|
1460 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1461 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1462 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1819 | + if ($done == 'Create database') { |
|
1820 | + $pop = true; |
|
1821 | + } |
|
1822 | + if ($_SESSION['install'] == 'database_create') { |
|
1823 | + $pop = true; |
|
1824 | + } |
|
1825 | + if ($_SESSION['install'] == 'database_import') { |
|
1826 | + $popi = true; |
|
1827 | + } |
|
1828 | + if ($_SESSION['install'] == 'waypoints') { |
|
1829 | + $popw = true; |
|
1830 | + } |
|
1463 | 1831 | } |
1464 | 1832 | if ($pop) { |
1465 | 1833 | sleep(5); |
@@ -1470,7 +1838,9 @@ discard block |
||
1470 | 1838 | } else if ($popw) { |
1471 | 1839 | sleep(5); |
1472 | 1840 | print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
1473 | - } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1841 | + } else { |
|
1842 | + print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
|
1843 | + } |
|
1474 | 1844 | print '</div></ul>'; |
1475 | 1845 | print '<div id="error"></div>'; |
1476 | 1846 | /* foreach ($_SESSION['done'] as $done) { |
@@ -322,14 +322,14 @@ discard block |
||
322 | 322 | </tr> |
323 | 323 | <!-- |
324 | 324 | <?php |
325 | - if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') { |
|
326 | - require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
327 | - $Connection = new Connection(); |
|
325 | + if (isset($globalDBuser) && isset($globalDBpass) && $globalDBuser != '' && $globalDBpass != '') { |
|
326 | + require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
|
327 | + $Connection = new Connection(); |
|
328 | 328 | ?> |
329 | 329 | --> |
330 | 330 | <?php |
331 | 331 | if ($Connection->db != NULL) { |
332 | - if ($Connection->tableExists('source_location')) { |
|
332 | + if ($Connection->tableExists('source_location')) { |
|
333 | 333 | require_once(dirname(__FILE__).'/../require/class.Source.php'); |
334 | 334 | $Source = new Source(); |
335 | 335 | //$alllocations = $Source->getAllLocationInfo(); |
@@ -349,9 +349,9 @@ discard block |
||
349 | 349 | |
350 | 350 | <?php |
351 | 351 | } |
352 | - } |
|
352 | + } |
|
353 | + } |
|
353 | 354 | } |
354 | - } |
|
355 | 355 | ?> |
356 | 356 | |
357 | 357 | <tr> |
@@ -461,12 +461,12 @@ discard block |
||
461 | 461 | ?> |
462 | 462 | <tr> |
463 | 463 | <?php |
464 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
464 | + if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
465 | 465 | ?> |
466 | 466 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
467 | 467 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
468 | 468 | <?php |
469 | - } else { |
|
469 | + } else { |
|
470 | 470 | $hostport = explode(':',$source['host']); |
471 | 471 | if (isset($hostport[1])) { |
472 | 472 | $host = $hostport[0]; |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | <td><input type="text" name="host[]" id="host" value="<?php print $host; ?>" /></td> |
480 | 480 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php print $port; ?>" /></td> |
481 | 481 | <?php |
482 | - } |
|
482 | + } |
|
483 | 483 | ?> |
484 | 484 | <td> |
485 | 485 | <select name="format[]" id="format"> |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | <br /> |
894 | 894 | <p> |
895 | 895 | <?php |
896 | - if (extension_loaded('gd') && function_exists('gd_info')) { |
|
896 | + if (extension_loaded('gd') && function_exists('gd_info')) { |
|
897 | 897 | ?> |
898 | 898 | <label for="aircrafticoncolor">Color of aircraft icon on map</label> |
899 | 899 | <input type="color" name="aircrafticoncolor" id="aircrafticoncolor" value="#<?php if (isset($globalAircraftIconColor)) echo $globalAircraftIconColor; else echo '1a3151'; ?>" /> |
@@ -903,11 +903,11 @@ discard block |
||
903 | 903 | <b>The directory cache is not writable, aircraft icon will not be cached</b> |
904 | 904 | <?php |
905 | 905 | } |
906 | - } else { |
|
906 | + } else { |
|
907 | 907 | ?> |
908 | 908 | <b>PHP GD is not installed, you can't change color of aircraft icon on map</b> |
909 | 909 | <?php |
910 | - } |
|
910 | + } |
|
911 | 911 | ?> |
912 | 912 | </p> |
913 | 913 | <br /> |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | </p> |
932 | 932 | <?php |
933 | 933 | require('../footer.php'); |
934 | - exit; |
|
934 | + exit; |
|
935 | 935 | } |
936 | 936 | // ' |
937 | 937 | $settings = array(); |
@@ -1022,8 +1022,8 @@ discard block |
||
1022 | 1022 | |
1023 | 1023 | $sources = array(); |
1024 | 1024 | foreach ($source_name as $keys => $name) { |
1025 | - 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]); |
|
1026 | - 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]); |
|
1025 | + 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]); |
|
1026 | + 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]); |
|
1027 | 1027 | } |
1028 | 1028 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
1029 | 1029 | |
@@ -1408,14 +1408,14 @@ discard block |
||
1408 | 1408 | |
1409 | 1409 | // Set some defaults values... |
1410 | 1410 | if (!isset($globalAircraftImageSources)) { |
1411 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1412 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1411 | + $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1412 | + $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1413 | 1413 | } |
1414 | 1414 | |
1415 | 1415 | if (!isset($globalSchedulesSources)) { |
1416 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1417 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1418 | - } |
|
1416 | + $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1417 | + $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1418 | + } |
|
1419 | 1419 | |
1420 | 1420 | $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
1421 | 1421 | |
@@ -1462,21 +1462,21 @@ discard block |
||
1462 | 1462 | $popi = false; |
1463 | 1463 | $popw = false; |
1464 | 1464 | foreach ($_SESSION['done'] as $done) { |
1465 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1466 | - if ($done == 'Create database') $pop = true; |
|
1467 | - if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1468 | - if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1469 | - if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1465 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1466 | + if ($done == 'Create database') $pop = true; |
|
1467 | + if ($_SESSION['install'] == 'database_create') $pop = true; |
|
1468 | + if ($_SESSION['install'] == 'database_import') $popi = true; |
|
1469 | + if ($_SESSION['install'] == 'waypoints') $popw = true; |
|
1470 | 1470 | } |
1471 | 1471 | if ($pop) { |
1472 | - sleep(5); |
|
1473 | - print '<li>Create database....<img src="../images/loading.gif" /></li>'; |
|
1472 | + sleep(5); |
|
1473 | + print '<li>Create database....<img src="../images/loading.gif" /></li>'; |
|
1474 | 1474 | } else if ($popi) { |
1475 | - sleep(5); |
|
1476 | - print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
1475 | + sleep(5); |
|
1476 | + print '<li>Create and import tables....<img src="../images/loading.gif" /></li>'; |
|
1477 | 1477 | } else if ($popw) { |
1478 | - sleep(5); |
|
1479 | - print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
|
1478 | + sleep(5); |
|
1479 | + print '<li>Populate waypoints database....<img src="../images/loading.gif" /></li>'; |
|
1480 | 1480 | } else print '<li>Update schema if needed....<img src="../images/loading.gif" /></li>'; |
1481 | 1481 | print '</div></ul>'; |
1482 | 1482 | print '<div id="error"></div>'; |
@@ -1539,7 +1539,7 @@ discard block |
||
1539 | 1539 | unset($_COOKIE['install']); |
1540 | 1540 | print '<div class="info column"><ul>'; |
1541 | 1541 | foreach ($_SESSION['done'] as $done) { |
1542 | - print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1542 | + print '<li>'.$done.'....<strong>SUCCESS</strong></li>'; |
|
1543 | 1543 | } |
1544 | 1544 | print '<li>Reloading page to check all is now ok....<strong>SUCCESS</strong></li>'; |
1545 | 1545 | 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 | |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | if (!extension_loaded('curl')) { |
74 | 74 | $error[] = "Curl is not loaded."; |
75 | 75 | } |
76 | - if(function_exists('apache_get_modules') ){ |
|
77 | - if(!in_array('mod_rewrite',apache_get_modules())) { |
|
76 | + if (function_exists('apache_get_modules')) { |
|
77 | + if (!in_array('mod_rewrite', apache_get_modules())) { |
|
78 | 78 | $error[] = "mod_rewrite is not available."; |
79 | 79 | } |
80 | 80 | /* |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | 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>'; |
91 | 91 | if (isset($_SERVER['REQUEST_SCHEME']) && isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']) && isset($_SERVER['REQUEST_URI'])) { |
92 | 92 | if (function_exists('get_headers')) { |
93 | - $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/','search',str_replace('index.php',$_SERVER["REQUEST_URI"]))); |
|
94 | - if (isset($check_header[0]) && !stripos($check_header[0],"200 OK")) { |
|
93 | + $check_header = @get_headers($_SERVER['REQUEST_SCHEME'].'://'.$_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].str_replace('install/', 'search', str_replace('index.php', $_SERVER["REQUEST_URI"]))); |
|
94 | + if (isset($check_header[0]) && !stripos($check_header[0], "200 OK")) { |
|
95 | 95 | print '<div class="info column"><p><strong>Check your configuration, rewrite don\'t seems to work.</strong></p></div>'; |
96 | 96 | } |
97 | 97 | } |
@@ -461,13 +461,13 @@ discard block |
||
461 | 461 | ?> |
462 | 462 | <tr> |
463 | 463 | <?php |
464 | - if (filter_var($source['host'],FILTER_VALIDATE_URL)) { |
|
464 | + if (filter_var($source['host'], FILTER_VALIDATE_URL)) { |
|
465 | 465 | ?> |
466 | 466 | <td><input type="text" name="host[]" id="host" value="<?php print $source['host']; ?>" /></td> |
467 | 467 | <td><input type="text" name="port[]" class="col-xs-2" id="port" value="<?php if (isset($source['port'])) print $source['port']; ?>" /></td> |
468 | 468 | <?php |
469 | 469 | } else { |
470 | - $hostport = explode(':',$source['host']); |
|
470 | + $hostport = explode(':', $source['host']); |
|
471 | 471 | if (isset($hostport[1])) { |
472 | 472 | $host = $hostport[0]; |
473 | 473 | $port = $hostport[1]; |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | <select name="timezones[]" id="timezones"> |
515 | 515 | <?php |
516 | 516 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
517 | - foreach($timezonelist as $timezones){ |
|
517 | + foreach ($timezonelist as $timezones) { |
|
518 | 518 | if (isset($source['timezone']) && $source['timezone'] == $timezones) { |
519 | 519 | print '<option selected>'.$timezones.'</option>'; |
520 | 520 | } elseif (!isset($source['timezone']) && $timezones == 'UTC') { |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | <select name="timezones[]" id="timezones"> |
567 | 567 | <?php |
568 | 568 | $timezonelist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); |
569 | - foreach($timezonelist as $timezones){ |
|
569 | + foreach ($timezonelist as $timezones) { |
|
570 | 570 | if ($timezones == 'UTC') { |
571 | 571 | print '<option selected>'.$timezones.'</option>'; |
572 | 572 | } else print '<option>'.$timezones.'</option>'; |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | <br /> |
884 | 884 | <p> |
885 | 885 | <label for="aircraftsize">Size of aircraft icon on map (default to 30px if zoom > 7 else 15px), empty to default</label> |
886 | - <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize;?>" /> |
|
886 | + <input type="number" name="aircraftsize" id="aircraftsize" value="<?php if (isset($globalAircraftSize)) echo $globalAircraftSize; ?>" /> |
|
887 | 887 | </p> |
888 | 888 | <br /> |
889 | 889 | <p> |
@@ -939,14 +939,14 @@ discard block |
||
939 | 939 | $error = ''; |
940 | 940 | |
941 | 941 | if (isset($_POST['dbtype'])) { |
942 | - $dbtype = filter_input(INPUT_POST,'dbtype',FILTER_SANITIZE_STRING); |
|
943 | - $dbroot = filter_input(INPUT_POST,'dbroot',FILTER_SANITIZE_STRING); |
|
944 | - $dbrootpass = filter_input(INPUT_POST,'dbrootpass',FILTER_SANITIZE_STRING); |
|
945 | - $dbname = filter_input(INPUT_POST,'dbname',FILTER_SANITIZE_STRING); |
|
946 | - $dbuser = filter_input(INPUT_POST,'dbuser',FILTER_SANITIZE_STRING); |
|
947 | - $dbuserpass = filter_input(INPUT_POST,'dbuserpass',FILTER_SANITIZE_STRING); |
|
948 | - $dbhost = filter_input(INPUT_POST,'dbhost',FILTER_SANITIZE_STRING); |
|
949 | - $dbport = filter_input(INPUT_POST,'dbport',FILTER_SANITIZE_STRING); |
|
942 | + $dbtype = filter_input(INPUT_POST, 'dbtype', FILTER_SANITIZE_STRING); |
|
943 | + $dbroot = filter_input(INPUT_POST, 'dbroot', FILTER_SANITIZE_STRING); |
|
944 | + $dbrootpass = filter_input(INPUT_POST, 'dbrootpass', FILTER_SANITIZE_STRING); |
|
945 | + $dbname = filter_input(INPUT_POST, 'dbname', FILTER_SANITIZE_STRING); |
|
946 | + $dbuser = filter_input(INPUT_POST, 'dbuser', FILTER_SANITIZE_STRING); |
|
947 | + $dbuserpass = filter_input(INPUT_POST, 'dbuserpass', FILTER_SANITIZE_STRING); |
|
948 | + $dbhost = filter_input(INPUT_POST, 'dbhost', FILTER_SANITIZE_STRING); |
|
949 | + $dbport = filter_input(INPUT_POST, 'dbport', FILTER_SANITIZE_STRING); |
|
950 | 950 | |
951 | 951 | if ($dbtype == 'mysql' && !extension_loaded('pdo_mysql')) $error .= 'Mysql driver for PDO must be loaded'; |
952 | 952 | if ($dbtype == 'pgsql' && !extension_loaded('pdo_pgsql')) $error .= 'PosgreSQL driver for PDO must be loaded'; |
@@ -966,49 +966,49 @@ discard block |
||
966 | 966 | } else $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
967 | 967 | */ |
968 | 968 | |
969 | - $settings = array_merge($settings,array('globalDBdriver' => $dbtype,'globalDBhost' => $dbhost,'globalDBuser' => $dbuser,'globalDBport' => $dbport,'globalDBpass' => $dbuserpass,'globalDBname' => $dbname)); |
|
969 | + $settings = array_merge($settings, array('globalDBdriver' => $dbtype, 'globalDBhost' => $dbhost, 'globalDBuser' => $dbuser, 'globalDBport' => $dbport, 'globalDBpass' => $dbuserpass, 'globalDBname' => $dbname)); |
|
970 | 970 | |
971 | - $sitename = filter_input(INPUT_POST,'sitename',FILTER_SANITIZE_STRING); |
|
972 | - $siteurl = filter_input(INPUT_POST,'siteurl',FILTER_SANITIZE_STRING); |
|
973 | - $timezone = filter_input(INPUT_POST,'timezone',FILTER_SANITIZE_STRING); |
|
974 | - $language = filter_input(INPUT_POST,'language',FILTER_SANITIZE_STRING); |
|
975 | - $settings = array_merge($settings,array('globalName' => $sitename,'globalURL' => $siteurl, 'globalTimezone' => $timezone,'globalLanguage' => $language)); |
|
971 | + $sitename = filter_input(INPUT_POST, 'sitename', FILTER_SANITIZE_STRING); |
|
972 | + $siteurl = filter_input(INPUT_POST, 'siteurl', FILTER_SANITIZE_STRING); |
|
973 | + $timezone = filter_input(INPUT_POST, 'timezone', FILTER_SANITIZE_STRING); |
|
974 | + $language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
975 | + $settings = array_merge($settings, array('globalName' => $sitename, 'globalURL' => $siteurl, 'globalTimezone' => $timezone, 'globalLanguage' => $language)); |
|
976 | 976 | |
977 | - $mapprovider = filter_input(INPUT_POST,'mapprovider',FILTER_SANITIZE_STRING); |
|
978 | - $mapboxid = filter_input(INPUT_POST,'mapboxid',FILTER_SANITIZE_STRING); |
|
979 | - $mapboxtoken = filter_input(INPUT_POST,'mapboxtoken',FILTER_SANITIZE_STRING); |
|
980 | - $googlekey = filter_input(INPUT_POST,'googlekey',FILTER_SANITIZE_STRING); |
|
981 | - $bingkey = filter_input(INPUT_POST,'bingkey',FILTER_SANITIZE_STRING); |
|
982 | - $openweathermapkey = filter_input(INPUT_POST,'openweathermapkey',FILTER_SANITIZE_STRING); |
|
983 | - $mapquestkey = filter_input(INPUT_POST,'mapquestkey',FILTER_SANITIZE_STRING); |
|
984 | - $hereappid = filter_input(INPUT_POST,'hereappid',FILTER_SANITIZE_STRING); |
|
985 | - $hereappcode = filter_input(INPUT_POST,'hereappcode',FILTER_SANITIZE_STRING); |
|
986 | - $settings = array_merge($settings,array('globalMapProvider' => $mapprovider,'globalMapboxId' => $mapboxid,'globalMapboxToken' => $mapboxtoken,'globalGoogleAPIKey' => $googlekey,'globalBingMapKey' => $bingkey,'globalHereappID' => $hereappid,'globalHereappCode' => $hereappcode,'globalMapQuestKey' => $mapquestkey,'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
977 | + $mapprovider = filter_input(INPUT_POST, 'mapprovider', FILTER_SANITIZE_STRING); |
|
978 | + $mapboxid = filter_input(INPUT_POST, 'mapboxid', FILTER_SANITIZE_STRING); |
|
979 | + $mapboxtoken = filter_input(INPUT_POST, 'mapboxtoken', FILTER_SANITIZE_STRING); |
|
980 | + $googlekey = filter_input(INPUT_POST, 'googlekey', FILTER_SANITIZE_STRING); |
|
981 | + $bingkey = filter_input(INPUT_POST, 'bingkey', FILTER_SANITIZE_STRING); |
|
982 | + $openweathermapkey = filter_input(INPUT_POST, 'openweathermapkey', FILTER_SANITIZE_STRING); |
|
983 | + $mapquestkey = filter_input(INPUT_POST, 'mapquestkey', FILTER_SANITIZE_STRING); |
|
984 | + $hereappid = filter_input(INPUT_POST, 'hereappid', FILTER_SANITIZE_STRING); |
|
985 | + $hereappcode = filter_input(INPUT_POST, 'hereappcode', FILTER_SANITIZE_STRING); |
|
986 | + $settings = array_merge($settings, array('globalMapProvider' => $mapprovider, 'globalMapboxId' => $mapboxid, 'globalMapboxToken' => $mapboxtoken, 'globalGoogleAPIKey' => $googlekey, 'globalBingMapKey' => $bingkey, 'globalHereappID' => $hereappid, 'globalHereappCode' => $hereappcode, 'globalMapQuestKey' => $mapquestkey, 'globalOpenWeatherMapKey' => $openweathermapkey)); |
|
987 | 987 | |
988 | - $latitudemax = filter_input(INPUT_POST,'latitudemax',FILTER_SANITIZE_STRING); |
|
989 | - $latitudemin = filter_input(INPUT_POST,'latitudemin',FILTER_SANITIZE_STRING); |
|
990 | - $longitudemax = filter_input(INPUT_POST,'longitudemax',FILTER_SANITIZE_STRING); |
|
991 | - $longitudemin = filter_input(INPUT_POST,'longitudemin',FILTER_SANITIZE_STRING); |
|
992 | - $livezoom = filter_input(INPUT_POST,'livezoom',FILTER_SANITIZE_NUMBER_INT); |
|
993 | - $settings = array_merge($settings,array('globalLatitudeMax' => $latitudemax,'globalLatitudeMin' => $latitudemin,'globalLongitudeMax' => $longitudemax,'globalLongitudeMin' => $longitudemin,'globalLiveZoom' => $livezoom)); |
|
988 | + $latitudemax = filter_input(INPUT_POST, 'latitudemax', FILTER_SANITIZE_STRING); |
|
989 | + $latitudemin = filter_input(INPUT_POST, 'latitudemin', FILTER_SANITIZE_STRING); |
|
990 | + $longitudemax = filter_input(INPUT_POST, 'longitudemax', FILTER_SANITIZE_STRING); |
|
991 | + $longitudemin = filter_input(INPUT_POST, 'longitudemin', FILTER_SANITIZE_STRING); |
|
992 | + $livezoom = filter_input(INPUT_POST, 'livezoom', FILTER_SANITIZE_NUMBER_INT); |
|
993 | + $settings = array_merge($settings, array('globalLatitudeMax' => $latitudemax, 'globalLatitudeMin' => $latitudemin, 'globalLongitudeMax' => $longitudemax, 'globalLongitudeMin' => $longitudemin, 'globalLiveZoom' => $livezoom)); |
|
994 | 994 | |
995 | - $squawk_country = filter_input(INPUT_POST,'squawk_country',FILTER_SANITIZE_STRING); |
|
996 | - $settings = array_merge($settings,array('globalSquawkCountry' => $squawk_country)); |
|
995 | + $squawk_country = filter_input(INPUT_POST, 'squawk_country', FILTER_SANITIZE_STRING); |
|
996 | + $settings = array_merge($settings, array('globalSquawkCountry' => $squawk_country)); |
|
997 | 997 | |
998 | - $latitudecenter = filter_input(INPUT_POST,'latitudecenter',FILTER_SANITIZE_STRING); |
|
999 | - $longitudecenter = filter_input(INPUT_POST,'longitudecenter',FILTER_SANITIZE_STRING); |
|
1000 | - $settings = array_merge($settings,array('globalCenterLatitude' => $latitudecenter,'globalCenterLongitude' => $longitudecenter)); |
|
998 | + $latitudecenter = filter_input(INPUT_POST, 'latitudecenter', FILTER_SANITIZE_STRING); |
|
999 | + $longitudecenter = filter_input(INPUT_POST, 'longitudecenter', FILTER_SANITIZE_STRING); |
|
1000 | + $settings = array_merge($settings, array('globalCenterLatitude' => $latitudecenter, 'globalCenterLongitude' => $longitudecenter)); |
|
1001 | 1001 | |
1002 | - $acars = filter_input(INPUT_POST,'acars',FILTER_SANITIZE_STRING); |
|
1002 | + $acars = filter_input(INPUT_POST, 'acars', FILTER_SANITIZE_STRING); |
|
1003 | 1003 | if ($acars == 'acars') { |
1004 | - $settings = array_merge($settings,array('globalACARS' => 'TRUE')); |
|
1004 | + $settings = array_merge($settings, array('globalACARS' => 'TRUE')); |
|
1005 | 1005 | } else { |
1006 | - $settings = array_merge($settings,array('globalACARS' => 'FALSE')); |
|
1006 | + $settings = array_merge($settings, array('globalACARS' => 'FALSE')); |
|
1007 | 1007 | } |
1008 | 1008 | |
1009 | - $flightawareusername = filter_input(INPUT_POST,'flightawareusername',FILTER_SANITIZE_STRING); |
|
1010 | - $flightawarepassword = filter_input(INPUT_POST,'flightawarepassword',FILTER_SANITIZE_STRING); |
|
1011 | - $settings = array_merge($settings,array('globalFlightAwareUsername' => $flightawareusername,'globalFlightAwarePassword' => $flightawarepassword)); |
|
1009 | + $flightawareusername = filter_input(INPUT_POST, 'flightawareusername', FILTER_SANITIZE_STRING); |
|
1010 | + $flightawarepassword = filter_input(INPUT_POST, 'flightawarepassword', FILTER_SANITIZE_STRING); |
|
1011 | + $settings = array_merge($settings, array('globalFlightAwareUsername' => $flightawareusername, 'globalFlightAwarePassword' => $flightawarepassword)); |
|
1012 | 1012 | |
1013 | 1013 | $source_name = $_POST['source_name']; |
1014 | 1014 | $source_latitude = $_POST['source_latitude']; |
@@ -1022,8 +1022,8 @@ discard block |
||
1022 | 1022 | |
1023 | 1023 | $sources = array(); |
1024 | 1024 | foreach ($source_name as $keys => $name) { |
1025 | - 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]); |
|
1026 | - 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]); |
|
1025 | + 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]); |
|
1026 | + 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]); |
|
1027 | 1027 | } |
1028 | 1028 | if (count($sources) > 0) $_SESSION['sources'] = $sources; |
1029 | 1029 | |
@@ -1036,27 +1036,27 @@ discard block |
||
1036 | 1036 | $sbsurl = $_POST['sbsurl']; |
1037 | 1037 | */ |
1038 | 1038 | |
1039 | - $globalvatsim = filter_input(INPUT_POST,'globalvatsim',FILTER_SANITIZE_STRING); |
|
1040 | - $globalva = filter_input(INPUT_POST,'globalva',FILTER_SANITIZE_STRING); |
|
1041 | - $globalivao = filter_input(INPUT_POST,'globalivao',FILTER_SANITIZE_STRING); |
|
1042 | - $globalphpvms = filter_input(INPUT_POST,'globalphpvms',FILTER_SANITIZE_STRING); |
|
1043 | - $globalvam = filter_input(INPUT_POST,'globalvam',FILTER_SANITIZE_STRING); |
|
1044 | - $globalsbs = filter_input(INPUT_POST,'globalsbs',FILTER_SANITIZE_STRING); |
|
1045 | - $globalaprs = filter_input(INPUT_POST,'globalaprs',FILTER_SANITIZE_STRING); |
|
1046 | - $datasource = filter_input(INPUT_POST,'datasource',FILTER_SANITIZE_STRING); |
|
1039 | + $globalvatsim = filter_input(INPUT_POST, 'globalvatsim', FILTER_SANITIZE_STRING); |
|
1040 | + $globalva = filter_input(INPUT_POST, 'globalva', FILTER_SANITIZE_STRING); |
|
1041 | + $globalivao = filter_input(INPUT_POST, 'globalivao', FILTER_SANITIZE_STRING); |
|
1042 | + $globalphpvms = filter_input(INPUT_POST, 'globalphpvms', FILTER_SANITIZE_STRING); |
|
1043 | + $globalvam = filter_input(INPUT_POST, 'globalvam', FILTER_SANITIZE_STRING); |
|
1044 | + $globalsbs = filter_input(INPUT_POST, 'globalsbs', FILTER_SANITIZE_STRING); |
|
1045 | + $globalaprs = filter_input(INPUT_POST, 'globalaprs', FILTER_SANITIZE_STRING); |
|
1046 | + $datasource = filter_input(INPUT_POST, 'datasource', FILTER_SANITIZE_STRING); |
|
1047 | 1047 | |
1048 | - $globalaircraft = filter_input(INPUT_POST,'globalaircraft',FILTER_SANITIZE_STRING); |
|
1049 | - if ($globalaircraft == 'aircraft') $settings = array_merge($settings,array('globalAircraft' => 'TRUE')); |
|
1050 | - else $settings = array_merge($settings,array('globalAircraft' => 'FALSE')); |
|
1051 | - $globaltracker = filter_input(INPUT_POST,'globaltracker',FILTER_SANITIZE_STRING); |
|
1052 | - if ($globaltracker == 'tracker') $settings = array_merge($settings,array('globalTracker' => 'TRUE')); |
|
1053 | - else $settings = array_merge($settings,array('globalTracker' => 'FALSE')); |
|
1054 | - $globalmarine = filter_input(INPUT_POST,'globalmarine',FILTER_SANITIZE_STRING); |
|
1055 | - if ($globalmarine == 'marine') $settings = array_merge($settings,array('globalMarine' => 'TRUE')); |
|
1056 | - else $settings = array_merge($settings,array('globalMarine' => 'FALSE')); |
|
1057 | - $globalsatellite = filter_input(INPUT_POST,'globalsatellite',FILTER_SANITIZE_STRING); |
|
1058 | - if ($globalsatellite == 'satellite') $settings = array_merge($settings,array('globalSatellite' => 'TRUE')); |
|
1059 | - else $settings = array_merge($settings,array('globalSatellite' => 'FALSE')); |
|
1048 | + $globalaircraft = filter_input(INPUT_POST, 'globalaircraft', FILTER_SANITIZE_STRING); |
|
1049 | + if ($globalaircraft == 'aircraft') $settings = array_merge($settings, array('globalAircraft' => 'TRUE')); |
|
1050 | + else $settings = array_merge($settings, array('globalAircraft' => 'FALSE')); |
|
1051 | + $globaltracker = filter_input(INPUT_POST, 'globaltracker', FILTER_SANITIZE_STRING); |
|
1052 | + if ($globaltracker == 'tracker') $settings = array_merge($settings, array('globalTracker' => 'TRUE')); |
|
1053 | + else $settings = array_merge($settings, array('globalTracker' => 'FALSE')); |
|
1054 | + $globalmarine = filter_input(INPUT_POST, 'globalmarine', FILTER_SANITIZE_STRING); |
|
1055 | + if ($globalmarine == 'marine') $settings = array_merge($settings, array('globalMarine' => 'TRUE')); |
|
1056 | + else $settings = array_merge($settings, array('globalMarine' => 'FALSE')); |
|
1057 | + $globalsatellite = filter_input(INPUT_POST, 'globalsatellite', FILTER_SANITIZE_STRING); |
|
1058 | + if ($globalsatellite == 'satellite') $settings = array_merge($settings, array('globalSatellite' => 'TRUE')); |
|
1059 | + else $settings = array_merge($settings, array('globalSatellite' => 'FALSE')); |
|
1060 | 1060 | |
1061 | 1061 | /* |
1062 | 1062 | $globalSBS1Hosts = array(); |
@@ -1072,7 +1072,7 @@ discard block |
||
1072 | 1072 | } |
1073 | 1073 | $settings = array_merge($settings,array('globalSBS1Hosts' => $globalSBS1Hosts)); |
1074 | 1074 | */ |
1075 | - $settings_comment = array_merge($settings_comment,array('globalSBS1Hosts')); |
|
1075 | + $settings_comment = array_merge($settings_comment, array('globalSBS1Hosts')); |
|
1076 | 1076 | $host = $_POST['host']; |
1077 | 1077 | $port = $_POST['port']; |
1078 | 1078 | $name = $_POST['name']; |
@@ -1089,104 +1089,104 @@ discard block |
||
1089 | 1089 | else $cov = 'FALSE'; |
1090 | 1090 | if (isset($noarchive[$key]) && $noarchive[$key] == 1) $arch = 'TRUE'; |
1091 | 1091 | else $arch = 'FALSE'; |
1092 | - if (strpos($format[$key],'_callback')) { |
|
1093 | - $gSources[] = array('host' => $h, 'pass' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'TRUE'); |
|
1092 | + if (strpos($format[$key], '_callback')) { |
|
1093 | + $gSources[] = array('host' => $h, 'pass' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'TRUE'); |
|
1094 | 1094 | } elseif ($h != '' || $name[$key] != '') { |
1095 | - $gSources[] = array('host' => $h, 'port' => $port[$key],'name' => $name[$key],'format' => $format[$key],'sourcestats' => $cov,'noarchive' => $arch,'timezone' => $timezones[$key],'callback' => 'FALSE'); |
|
1095 | + $gSources[] = array('host' => $h, 'port' => $port[$key], 'name' => $name[$key], 'format' => $format[$key], 'sourcestats' => $cov, 'noarchive' => $arch, 'timezone' => $timezones[$key], 'callback' => 'FALSE'); |
|
1096 | 1096 | } |
1097 | 1097 | if ($format[$key] == 'airwhere') $forcepilots = true; |
1098 | 1098 | } |
1099 | - $settings = array_merge($settings,array('globalSources' => $gSources)); |
|
1099 | + $settings = array_merge($settings, array('globalSources' => $gSources)); |
|
1100 | 1100 | |
1101 | 1101 | /* |
1102 | 1102 | $sbstimeout = filter_input(INPUT_POST,'sbstimeout',FILTER_SANITIZE_NUMBER_INT); |
1103 | 1103 | $settings = array_merge($settings,array('globalSourcesTimeOut' => $sbstimeout)); |
1104 | 1104 | */ |
1105 | - $acarshost = filter_input(INPUT_POST,'acarshost',FILTER_SANITIZE_STRING); |
|
1106 | - $acarsport = filter_input(INPUT_POST,'acarsport',FILTER_SANITIZE_NUMBER_INT); |
|
1107 | - $settings = array_merge($settings,array('globalACARSHost' => $acarshost,'globalACARSPort' => $acarsport)); |
|
1105 | + $acarshost = filter_input(INPUT_POST, 'acarshost', FILTER_SANITIZE_STRING); |
|
1106 | + $acarsport = filter_input(INPUT_POST, 'acarsport', FILTER_SANITIZE_NUMBER_INT); |
|
1107 | + $settings = array_merge($settings, array('globalACARSHost' => $acarshost, 'globalACARSPort' => $acarsport)); |
|
1108 | 1108 | |
1109 | - $bitly = filter_input(INPUT_POST,'bitly',FILTER_SANITIZE_STRING); |
|
1110 | - $settings = array_merge($settings,array('globalBitlyAccessToken' => $bitly)); |
|
1109 | + $bitly = filter_input(INPUT_POST, 'bitly', FILTER_SANITIZE_STRING); |
|
1110 | + $settings = array_merge($settings, array('globalBitlyAccessToken' => $bitly)); |
|
1111 | 1111 | |
1112 | - $customcss = filter_input(INPUT_POST,'customcss',FILTER_SANITIZE_STRING); |
|
1113 | - $settings = array_merge($settings,array('globalCustomCSS' => $customcss)); |
|
1112 | + $customcss = filter_input(INPUT_POST, 'customcss', FILTER_SANITIZE_STRING); |
|
1113 | + $settings = array_merge($settings, array('globalCustomCSS' => $customcss)); |
|
1114 | 1114 | |
1115 | - $notamsource = filter_input(INPUT_POST,'notamsource',FILTER_SANITIZE_STRING); |
|
1116 | - $settings = array_merge($settings,array('globalNOTAMSource' => $notamsource)); |
|
1117 | - $metarsource = filter_input(INPUT_POST,'metarsource',FILTER_SANITIZE_STRING); |
|
1118 | - $settings = array_merge($settings,array('globalMETARurl' => $metarsource)); |
|
1115 | + $notamsource = filter_input(INPUT_POST, 'notamsource', FILTER_SANITIZE_STRING); |
|
1116 | + $settings = array_merge($settings, array('globalNOTAMSource' => $notamsource)); |
|
1117 | + $metarsource = filter_input(INPUT_POST, 'metarsource', FILTER_SANITIZE_STRING); |
|
1118 | + $settings = array_merge($settings, array('globalMETARurl' => $metarsource)); |
|
1119 | 1119 | |
1120 | - $zoilatitude = filter_input(INPUT_POST,'zoilatitude',FILTER_SANITIZE_STRING); |
|
1121 | - $zoilongitude = filter_input(INPUT_POST,'zoilongitude',FILTER_SANITIZE_STRING); |
|
1122 | - $zoidistance = filter_input(INPUT_POST,'zoidistance',FILTER_SANITIZE_NUMBER_INT); |
|
1120 | + $zoilatitude = filter_input(INPUT_POST, 'zoilatitude', FILTER_SANITIZE_STRING); |
|
1121 | + $zoilongitude = filter_input(INPUT_POST, 'zoilongitude', FILTER_SANITIZE_STRING); |
|
1122 | + $zoidistance = filter_input(INPUT_POST, 'zoidistance', FILTER_SANITIZE_NUMBER_INT); |
|
1123 | 1123 | if ($zoilatitude != '' && $zoilongitude != '' && $zoidistance != '') { |
1124 | - $settings = array_merge($settings,array('globalDistanceIgnore' => array('latitude' => $zoilatitude,'longitude' => $zoilongitude,'distance' => $zoidistance))); |
|
1125 | - } else $settings = array_merge($settings,array('globalDistanceIgnore' => array())); |
|
1124 | + $settings = array_merge($settings, array('globalDistanceIgnore' => array('latitude' => $zoilatitude, 'longitude' => $zoilongitude, 'distance' => $zoidistance))); |
|
1125 | + } else $settings = array_merge($settings, array('globalDistanceIgnore' => array())); |
|
1126 | 1126 | |
1127 | - $refresh = filter_input(INPUT_POST,'refresh',FILTER_SANITIZE_NUMBER_INT); |
|
1128 | - $settings = array_merge($settings,array('globalLiveInterval' => $refresh)); |
|
1129 | - $maprefresh = filter_input(INPUT_POST,'maprefresh',FILTER_SANITIZE_NUMBER_INT); |
|
1130 | - $settings = array_merge($settings,array('globalMapRefresh' => $maprefresh)); |
|
1131 | - $mapidle = filter_input(INPUT_POST,'mapidle',FILTER_SANITIZE_NUMBER_INT); |
|
1132 | - $settings = array_merge($settings,array('globalMapIdleTimeout' => $mapidle)); |
|
1133 | - $closestmindist = filter_input(INPUT_POST,'closestmindist',FILTER_SANITIZE_NUMBER_INT); |
|
1134 | - $settings = array_merge($settings,array('globalClosestMinDist' => $closestmindist)); |
|
1127 | + $refresh = filter_input(INPUT_POST, 'refresh', FILTER_SANITIZE_NUMBER_INT); |
|
1128 | + $settings = array_merge($settings, array('globalLiveInterval' => $refresh)); |
|
1129 | + $maprefresh = filter_input(INPUT_POST, 'maprefresh', FILTER_SANITIZE_NUMBER_INT); |
|
1130 | + $settings = array_merge($settings, array('globalMapRefresh' => $maprefresh)); |
|
1131 | + $mapidle = filter_input(INPUT_POST, 'mapidle', FILTER_SANITIZE_NUMBER_INT); |
|
1132 | + $settings = array_merge($settings, array('globalMapIdleTimeout' => $mapidle)); |
|
1133 | + $closestmindist = filter_input(INPUT_POST, 'closestmindist', FILTER_SANITIZE_NUMBER_INT); |
|
1134 | + $settings = array_merge($settings, array('globalClosestMinDist' => $closestmindist)); |
|
1135 | 1135 | |
1136 | - $aircraftsize = filter_input(INPUT_POST,'aircraftsize',FILTER_SANITIZE_NUMBER_INT); |
|
1137 | - $settings = array_merge($settings,array('globalAircraftSize' => $aircraftsize)); |
|
1136 | + $aircraftsize = filter_input(INPUT_POST, 'aircraftsize', FILTER_SANITIZE_NUMBER_INT); |
|
1137 | + $settings = array_merge($settings, array('globalAircraftSize' => $aircraftsize)); |
|
1138 | 1138 | |
1139 | - $archivemonths = filter_input(INPUT_POST,'archivemonths',FILTER_SANITIZE_NUMBER_INT); |
|
1140 | - $settings = array_merge($settings,array('globalArchiveMonths' => $archivemonths)); |
|
1139 | + $archivemonths = filter_input(INPUT_POST, 'archivemonths', FILTER_SANITIZE_NUMBER_INT); |
|
1140 | + $settings = array_merge($settings, array('globalArchiveMonths' => $archivemonths)); |
|
1141 | 1141 | |
1142 | - $archiveyear = filter_input(INPUT_POST,'archiveyear',FILTER_SANITIZE_STRING); |
|
1142 | + $archiveyear = filter_input(INPUT_POST, 'archiveyear', FILTER_SANITIZE_STRING); |
|
1143 | 1143 | if ($archiveyear == "archiveyear") { |
1144 | - $settings = array_merge($settings,array('globalArchiveYear' => 'TRUE')); |
|
1144 | + $settings = array_merge($settings, array('globalArchiveYear' => 'TRUE')); |
|
1145 | 1145 | } else { |
1146 | - $settings = array_merge($settings,array('globalArchiveYear' => 'FALSE')); |
|
1146 | + $settings = array_merge($settings, array('globalArchiveYear' => 'FALSE')); |
|
1147 | 1147 | } |
1148 | - $archivekeepmonths = filter_input(INPUT_POST,'archivekeepmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1149 | - $settings = array_merge($settings,array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1150 | - $archivekeeptrackmonths = filter_input(INPUT_POST,'archivekeeptrackmonths',FILTER_SANITIZE_NUMBER_INT); |
|
1151 | - $settings = array_merge($settings,array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1148 | + $archivekeepmonths = filter_input(INPUT_POST, 'archivekeepmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1149 | + $settings = array_merge($settings, array('globalArchiveKeepMonths' => $archivekeepmonths)); |
|
1150 | + $archivekeeptrackmonths = filter_input(INPUT_POST, 'archivekeeptrackmonths', FILTER_SANITIZE_NUMBER_INT); |
|
1151 | + $settings = array_merge($settings, array('globalArchiveKeepTrackMonths' => $archivekeeptrackmonths)); |
|
1152 | 1152 | |
1153 | - $britishairways = filter_input(INPUT_POST,'britishairways',FILTER_SANITIZE_STRING); |
|
1154 | - $settings = array_merge($settings,array('globalBritishAirwaysKey' => $britishairways)); |
|
1155 | - $transavia = filter_input(INPUT_POST,'transavia',FILTER_SANITIZE_STRING); |
|
1156 | - $settings = array_merge($settings,array('globalTransaviaKey' => $transavia)); |
|
1153 | + $britishairways = filter_input(INPUT_POST, 'britishairways', FILTER_SANITIZE_STRING); |
|
1154 | + $settings = array_merge($settings, array('globalBritishAirwaysKey' => $britishairways)); |
|
1155 | + $transavia = filter_input(INPUT_POST, 'transavia', FILTER_SANITIZE_STRING); |
|
1156 | + $settings = array_merge($settings, array('globalTransaviaKey' => $transavia)); |
|
1157 | 1157 | |
1158 | - $lufthansakey = filter_input(INPUT_POST,'lufthansakey',FILTER_SANITIZE_STRING); |
|
1159 | - $lufthansasecret = filter_input(INPUT_POST,'lufthansasecret',FILTER_SANITIZE_STRING); |
|
1160 | - $settings = array_merge($settings,array('globalLufthansaKey' => array('key' => $lufthansakey,'secret' => $lufthansasecret))); |
|
1158 | + $lufthansakey = filter_input(INPUT_POST, 'lufthansakey', FILTER_SANITIZE_STRING); |
|
1159 | + $lufthansasecret = filter_input(INPUT_POST, 'lufthansasecret', FILTER_SANITIZE_STRING); |
|
1160 | + $settings = array_merge($settings, array('globalLufthansaKey' => array('key' => $lufthansakey, 'secret' => $lufthansasecret))); |
|
1161 | 1161 | |
1162 | 1162 | // Create in settings.php keys not yet configurable if not already here |
1163 | 1163 | //if (!isset($globalImageBingKey)) $settings = array_merge($settings,array('globalImageBingKey' => '')); |
1164 | - if (!isset($globalDebug)) $settings = array_merge($settings,array('globalDebug' => 'TRUE')); |
|
1164 | + if (!isset($globalDebug)) $settings = array_merge($settings, array('globalDebug' => 'TRUE')); |
|
1165 | 1165 | |
1166 | - $resetyearstats = filter_input(INPUT_POST,'resetyearstats',FILTER_SANITIZE_STRING); |
|
1166 | + $resetyearstats = filter_input(INPUT_POST, 'resetyearstats', FILTER_SANITIZE_STRING); |
|
1167 | 1167 | if ($resetyearstats == 'resetyearstats') { |
1168 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'TRUE')); |
|
1168 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'TRUE')); |
|
1169 | 1169 | } else { |
1170 | - $settings = array_merge($settings,array('globalDeleteLastYearStats' => 'FALSE')); |
|
1170 | + $settings = array_merge($settings, array('globalDeleteLastYearStats' => 'FALSE')); |
|
1171 | 1171 | } |
1172 | 1172 | |
1173 | - $archive = filter_input(INPUT_POST,'archive',FILTER_SANITIZE_STRING); |
|
1173 | + $archive = filter_input(INPUT_POST, 'archive', FILTER_SANITIZE_STRING); |
|
1174 | 1174 | if ($archive == 'archive') { |
1175 | - $settings = array_merge($settings,array('globalArchive' => 'TRUE')); |
|
1175 | + $settings = array_merge($settings, array('globalArchive' => 'TRUE')); |
|
1176 | 1176 | } else { |
1177 | - $settings = array_merge($settings,array('globalArchive' => 'FALSE')); |
|
1177 | + $settings = array_merge($settings, array('globalArchive' => 'FALSE')); |
|
1178 | 1178 | } |
1179 | - $daemon = filter_input(INPUT_POST,'daemon',FILTER_SANITIZE_STRING); |
|
1179 | + $daemon = filter_input(INPUT_POST, 'daemon', FILTER_SANITIZE_STRING); |
|
1180 | 1180 | if ($daemon == 'daemon') { |
1181 | - $settings = array_merge($settings,array('globalDaemon' => 'TRUE')); |
|
1181 | + $settings = array_merge($settings, array('globalDaemon' => 'TRUE')); |
|
1182 | 1182 | } else { |
1183 | - $settings = array_merge($settings,array('globalDaemon' => 'FALSE')); |
|
1183 | + $settings = array_merge($settings, array('globalDaemon' => 'FALSE')); |
|
1184 | 1184 | } |
1185 | - $schedules = filter_input(INPUT_POST,'schedules',FILTER_SANITIZE_STRING); |
|
1185 | + $schedules = filter_input(INPUT_POST, 'schedules', FILTER_SANITIZE_STRING); |
|
1186 | 1186 | if ($schedules == 'schedules') { |
1187 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE')); |
|
1187 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE')); |
|
1188 | 1188 | } else { |
1189 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE')); |
|
1189 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE')); |
|
1190 | 1190 | } |
1191 | 1191 | |
1192 | 1192 | /* |
@@ -1197,227 +1197,227 @@ discard block |
||
1197 | 1197 | $settings = array_merge($settings,array('globalFlightAware' => 'FALSE','globalSBS1' => 'TRUE')); |
1198 | 1198 | } |
1199 | 1199 | */ |
1200 | - $settings = array_merge($settings,array('globalFlightAware' => 'FALSE')); |
|
1201 | - if ($globalsbs == 'sbs') $settings = array_merge($settings,array('globalSBS1' => 'TRUE')); |
|
1202 | - else $settings = array_merge($settings,array('globalSBS1' => 'FALSE')); |
|
1203 | - if ($globalaprs == 'aprs') $settings = array_merge($settings,array('globalAPRS' => 'TRUE')); |
|
1204 | - else $settings = array_merge($settings,array('globalAPRS' => 'FALSE')); |
|
1200 | + $settings = array_merge($settings, array('globalFlightAware' => 'FALSE')); |
|
1201 | + if ($globalsbs == 'sbs') $settings = array_merge($settings, array('globalSBS1' => 'TRUE')); |
|
1202 | + else $settings = array_merge($settings, array('globalSBS1' => 'FALSE')); |
|
1203 | + if ($globalaprs == 'aprs') $settings = array_merge($settings, array('globalAPRS' => 'TRUE')); |
|
1204 | + else $settings = array_merge($settings, array('globalAPRS' => 'FALSE')); |
|
1205 | 1205 | $va = false; |
1206 | 1206 | if ($globalivao == 'ivao') { |
1207 | - $settings = array_merge($settings,array('globalIVAO' => 'TRUE')); |
|
1207 | + $settings = array_merge($settings, array('globalIVAO' => 'TRUE')); |
|
1208 | 1208 | $va = true; |
1209 | - } else $settings = array_merge($settings,array('globalIVAO' => 'FALSE')); |
|
1209 | + } else $settings = array_merge($settings, array('globalIVAO' => 'FALSE')); |
|
1210 | 1210 | if ($globalvatsim == 'vatsim') { |
1211 | - $settings = array_merge($settings,array('globalVATSIM' => 'TRUE')); |
|
1211 | + $settings = array_merge($settings, array('globalVATSIM' => 'TRUE')); |
|
1212 | 1212 | $va = true; |
1213 | - } else $settings = array_merge($settings,array('globalVATSIM' => 'FALSE')); |
|
1213 | + } else $settings = array_merge($settings, array('globalVATSIM' => 'FALSE')); |
|
1214 | 1214 | if ($globalphpvms == 'phpvms') { |
1215 | - $settings = array_merge($settings,array('globalphpVMS' => 'TRUE')); |
|
1215 | + $settings = array_merge($settings, array('globalphpVMS' => 'TRUE')); |
|
1216 | 1216 | $va = true; |
1217 | - } else $settings = array_merge($settings,array('globalphpVMS' => 'FALSE')); |
|
1217 | + } else $settings = array_merge($settings, array('globalphpVMS' => 'FALSE')); |
|
1218 | 1218 | if ($globalvam == 'vam') { |
1219 | - $settings = array_merge($settings,array('globalVAM' => 'TRUE')); |
|
1219 | + $settings = array_merge($settings, array('globalVAM' => 'TRUE')); |
|
1220 | 1220 | $va = true; |
1221 | - } else $settings = array_merge($settings,array('globalVAM' => 'FALSE')); |
|
1221 | + } else $settings = array_merge($settings, array('globalVAM' => 'FALSE')); |
|
1222 | 1222 | if ($va) { |
1223 | - $settings = array_merge($settings,array('globalSchedulesFetch' => 'FALSE','globalTranslationFetch' => 'FALSE')); |
|
1224 | - } else $settings = array_merge($settings,array('globalSchedulesFetch' => 'TRUE','globalTranslationFetch' => 'TRUE')); |
|
1223 | + $settings = array_merge($settings, array('globalSchedulesFetch' => 'FALSE', 'globalTranslationFetch' => 'FALSE')); |
|
1224 | + } else $settings = array_merge($settings, array('globalSchedulesFetch' => 'TRUE', 'globalTranslationFetch' => 'TRUE')); |
|
1225 | 1225 | if ($globalva == 'va' || $va) { |
1226 | - $settings = array_merge($settings,array('globalVA' => 'TRUE')); |
|
1227 | - $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1226 | + $settings = array_merge($settings, array('globalVA' => 'TRUE')); |
|
1227 | + $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
1228 | 1228 | } else { |
1229 | - $settings = array_merge($settings,array('globalVA' => 'FALSE')); |
|
1230 | - if ($forcepilots) $settings = array_merge($settings,array('globalUsePilot' => 'TRUE','globalUseOwner' => 'FALSE')); |
|
1231 | - else $settings = array_merge($settings,array('globalUsePilot' => 'FALSE','globalUseOwner' => 'TRUE')); |
|
1229 | + $settings = array_merge($settings, array('globalVA' => 'FALSE')); |
|
1230 | + if ($forcepilots) $settings = array_merge($settings, array('globalUsePilot' => 'TRUE', 'globalUseOwner' => 'FALSE')); |
|
1231 | + else $settings = array_merge($settings, array('globalUsePilot' => 'FALSE', 'globalUseOwner' => 'TRUE')); |
|
1232 | 1232 | } |
1233 | 1233 | |
1234 | 1234 | |
1235 | 1235 | |
1236 | - $notam = filter_input(INPUT_POST,'notam',FILTER_SANITIZE_STRING); |
|
1236 | + $notam = filter_input(INPUT_POST, 'notam', FILTER_SANITIZE_STRING); |
|
1237 | 1237 | if ($notam == 'notam') { |
1238 | - $settings = array_merge($settings,array('globalNOTAM' => 'TRUE')); |
|
1238 | + $settings = array_merge($settings, array('globalNOTAM' => 'TRUE')); |
|
1239 | 1239 | } else { |
1240 | - $settings = array_merge($settings,array('globalNOTAM' => 'FALSE')); |
|
1240 | + $settings = array_merge($settings, array('globalNOTAM' => 'FALSE')); |
|
1241 | 1241 | } |
1242 | - $owner = filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING); |
|
1242 | + $owner = filter_input(INPUT_POST, 'owner', FILTER_SANITIZE_STRING); |
|
1243 | 1243 | if ($owner == 'owner') { |
1244 | - $settings = array_merge($settings,array('globalOwner' => 'TRUE')); |
|
1244 | + $settings = array_merge($settings, array('globalOwner' => 'TRUE')); |
|
1245 | 1245 | } else { |
1246 | - $settings = array_merge($settings,array('globalOwner' => 'FALSE')); |
|
1246 | + $settings = array_merge($settings, array('globalOwner' => 'FALSE')); |
|
1247 | 1247 | } |
1248 | - $map3d = filter_input(INPUT_POST,'map3d',FILTER_SANITIZE_STRING); |
|
1248 | + $map3d = filter_input(INPUT_POST, 'map3d', FILTER_SANITIZE_STRING); |
|
1249 | 1249 | if ($map3d == 'map3d') { |
1250 | - $settings = array_merge($settings,array('globalMap3D' => 'TRUE')); |
|
1250 | + $settings = array_merge($settings, array('globalMap3D' => 'TRUE')); |
|
1251 | 1251 | } else { |
1252 | - $settings = array_merge($settings,array('globalMap3D' => 'FALSE')); |
|
1252 | + $settings = array_merge($settings, array('globalMap3D' => 'FALSE')); |
|
1253 | 1253 | } |
1254 | - $crash = filter_input(INPUT_POST,'crash',FILTER_SANITIZE_STRING); |
|
1254 | + $crash = filter_input(INPUT_POST, 'crash', FILTER_SANITIZE_STRING); |
|
1255 | 1255 | if ($crash == 'crash') { |
1256 | - $settings = array_merge($settings,array('globalAccidents' => 'TRUE')); |
|
1256 | + $settings = array_merge($settings, array('globalAccidents' => 'TRUE')); |
|
1257 | 1257 | } else { |
1258 | - $settings = array_merge($settings,array('globalAccidents' => 'FALSE')); |
|
1258 | + $settings = array_merge($settings, array('globalAccidents' => 'FALSE')); |
|
1259 | 1259 | } |
1260 | - $mapsatellites = filter_input(INPUT_POST,'mapsatellites',FILTER_SANITIZE_STRING); |
|
1260 | + $mapsatellites = filter_input(INPUT_POST, 'mapsatellites', FILTER_SANITIZE_STRING); |
|
1261 | 1261 | if ($mapsatellites == 'mapsatellites') { |
1262 | - $settings = array_merge($settings,array('globalMapSatellites' => 'TRUE')); |
|
1262 | + $settings = array_merge($settings, array('globalMapSatellites' => 'TRUE')); |
|
1263 | 1263 | } else { |
1264 | - $settings = array_merge($settings,array('globalMapSatellites' => 'FALSE')); |
|
1264 | + $settings = array_merge($settings, array('globalMapSatellites' => 'FALSE')); |
|
1265 | 1265 | } |
1266 | - $map3ddefault = filter_input(INPUT_POST,'map3ddefault',FILTER_SANITIZE_STRING); |
|
1266 | + $map3ddefault = filter_input(INPUT_POST, 'map3ddefault', FILTER_SANITIZE_STRING); |
|
1267 | 1267 | if ($map3ddefault == 'map3ddefault') { |
1268 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'TRUE')); |
|
1268 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'TRUE')); |
|
1269 | 1269 | } else { |
1270 | - $settings = array_merge($settings,array('globalMap3Ddefault' => 'FALSE')); |
|
1270 | + $settings = array_merge($settings, array('globalMap3Ddefault' => 'FALSE')); |
|
1271 | 1271 | } |
1272 | - $translate = filter_input(INPUT_POST,'translate',FILTER_SANITIZE_STRING); |
|
1272 | + $translate = filter_input(INPUT_POST, 'translate', FILTER_SANITIZE_STRING); |
|
1273 | 1273 | if ($translate == 'translate') { |
1274 | - $settings = array_merge($settings,array('globalTranslate' => 'TRUE')); |
|
1274 | + $settings = array_merge($settings, array('globalTranslate' => 'TRUE')); |
|
1275 | 1275 | } else { |
1276 | - $settings = array_merge($settings,array('globalTranslate' => 'FALSE')); |
|
1276 | + $settings = array_merge($settings, array('globalTranslate' => 'FALSE')); |
|
1277 | 1277 | } |
1278 | - $realairlines = filter_input(INPUT_POST,'realairlines',FILTER_SANITIZE_STRING); |
|
1278 | + $realairlines = filter_input(INPUT_POST, 'realairlines', FILTER_SANITIZE_STRING); |
|
1279 | 1279 | if ($realairlines == 'realairlines') { |
1280 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'TRUE')); |
|
1280 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'TRUE')); |
|
1281 | 1281 | } else { |
1282 | - $settings = array_merge($settings,array('globalUseRealAirlines' => 'FALSE')); |
|
1282 | + $settings = array_merge($settings, array('globalUseRealAirlines' => 'FALSE')); |
|
1283 | 1283 | } |
1284 | - $estimation = filter_input(INPUT_POST,'estimation',FILTER_SANITIZE_STRING); |
|
1284 | + $estimation = filter_input(INPUT_POST, 'estimation', FILTER_SANITIZE_STRING); |
|
1285 | 1285 | if ($estimation == 'estimation') { |
1286 | - $settings = array_merge($settings,array('globalMapEstimation' => 'TRUE')); |
|
1286 | + $settings = array_merge($settings, array('globalMapEstimation' => 'TRUE')); |
|
1287 | 1287 | } else { |
1288 | - $settings = array_merge($settings,array('globalMapEstimation' => 'FALSE')); |
|
1288 | + $settings = array_merge($settings, array('globalMapEstimation' => 'FALSE')); |
|
1289 | 1289 | } |
1290 | - $metar = filter_input(INPUT_POST,'metar',FILTER_SANITIZE_STRING); |
|
1290 | + $metar = filter_input(INPUT_POST, 'metar', FILTER_SANITIZE_STRING); |
|
1291 | 1291 | if ($metar == 'metar') { |
1292 | - $settings = array_merge($settings,array('globalMETAR' => 'TRUE')); |
|
1292 | + $settings = array_merge($settings, array('globalMETAR' => 'TRUE')); |
|
1293 | 1293 | } else { |
1294 | - $settings = array_merge($settings,array('globalMETAR' => 'FALSE')); |
|
1294 | + $settings = array_merge($settings, array('globalMETAR' => 'FALSE')); |
|
1295 | 1295 | } |
1296 | - $metarcycle = filter_input(INPUT_POST,'metarcycle',FILTER_SANITIZE_STRING); |
|
1296 | + $metarcycle = filter_input(INPUT_POST, 'metarcycle', FILTER_SANITIZE_STRING); |
|
1297 | 1297 | if ($metarcycle == 'metarcycle') { |
1298 | - $settings = array_merge($settings,array('globalMETARcycle' => 'TRUE')); |
|
1298 | + $settings = array_merge($settings, array('globalMETARcycle' => 'TRUE')); |
|
1299 | 1299 | } else { |
1300 | - $settings = array_merge($settings,array('globalMETARcycle' => 'FALSE')); |
|
1300 | + $settings = array_merge($settings, array('globalMETARcycle' => 'FALSE')); |
|
1301 | 1301 | } |
1302 | - $fork = filter_input(INPUT_POST,'fork',FILTER_SANITIZE_STRING); |
|
1302 | + $fork = filter_input(INPUT_POST, 'fork', FILTER_SANITIZE_STRING); |
|
1303 | 1303 | if ($fork == 'fork') { |
1304 | - $settings = array_merge($settings,array('globalFork' => 'TRUE')); |
|
1304 | + $settings = array_merge($settings, array('globalFork' => 'TRUE')); |
|
1305 | 1305 | } else { |
1306 | - $settings = array_merge($settings,array('globalFork' => 'FALSE')); |
|
1306 | + $settings = array_merge($settings, array('globalFork' => 'FALSE')); |
|
1307 | 1307 | } |
1308 | 1308 | |
1309 | - $colormap = filter_input(INPUT_POST,'colormap',FILTER_SANITIZE_STRING); |
|
1309 | + $colormap = filter_input(INPUT_POST, 'colormap', FILTER_SANITIZE_STRING); |
|
1310 | 1310 | if ($colormap == 'colormap') { |
1311 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'TRUE')); |
|
1311 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'TRUE')); |
|
1312 | 1312 | } else { |
1313 | - $settings = array_merge($settings,array('globalMapAltitudeColor' => 'FALSE')); |
|
1313 | + $settings = array_merge($settings, array('globalMapAltitudeColor' => 'FALSE')); |
|
1314 | 1314 | } |
1315 | 1315 | |
1316 | 1316 | if (isset($_POST['aircrafticoncolor'])) { |
1317 | - $aircrafticoncolor = filter_input(INPUT_POST,'aircrafticoncolor',FILTER_SANITIZE_STRING); |
|
1318 | - $settings = array_merge($settings,array('globalAircraftIconColor' => substr($aircrafticoncolor,1))); |
|
1317 | + $aircrafticoncolor = filter_input(INPUT_POST, 'aircrafticoncolor', FILTER_SANITIZE_STRING); |
|
1318 | + $settings = array_merge($settings, array('globalAircraftIconColor' => substr($aircrafticoncolor, 1))); |
|
1319 | 1319 | } |
1320 | 1320 | |
1321 | - $airportzoom = filter_input(INPUT_POST,'airportzoom',FILTER_SANITIZE_NUMBER_INT); |
|
1322 | - $settings = array_merge($settings,array('globalAirportZoom' => $airportzoom)); |
|
1321 | + $airportzoom = filter_input(INPUT_POST, 'airportzoom', FILTER_SANITIZE_NUMBER_INT); |
|
1322 | + $settings = array_merge($settings, array('globalAirportZoom' => $airportzoom)); |
|
1323 | 1323 | |
1324 | - $unitdistance = filter_input(INPUT_POST,'unitdistance',FILTER_SANITIZE_STRING); |
|
1325 | - $settings = array_merge($settings,array('globalUnitDistance' => $unitdistance)); |
|
1326 | - $unitaltitude = filter_input(INPUT_POST,'unitaltitude',FILTER_SANITIZE_STRING); |
|
1327 | - $settings = array_merge($settings,array('globalUnitAltitude' => $unitaltitude)); |
|
1328 | - $unitspeed = filter_input(INPUT_POST,'unitspeed',FILTER_SANITIZE_STRING); |
|
1329 | - $settings = array_merge($settings,array('globalUnitSpeed' => $unitspeed)); |
|
1324 | + $unitdistance = filter_input(INPUT_POST, 'unitdistance', FILTER_SANITIZE_STRING); |
|
1325 | + $settings = array_merge($settings, array('globalUnitDistance' => $unitdistance)); |
|
1326 | + $unitaltitude = filter_input(INPUT_POST, 'unitaltitude', FILTER_SANITIZE_STRING); |
|
1327 | + $settings = array_merge($settings, array('globalUnitAltitude' => $unitaltitude)); |
|
1328 | + $unitspeed = filter_input(INPUT_POST, 'unitspeed', FILTER_SANITIZE_STRING); |
|
1329 | + $settings = array_merge($settings, array('globalUnitSpeed' => $unitspeed)); |
|
1330 | 1330 | |
1331 | - $mappopup = filter_input(INPUT_POST,'mappopup',FILTER_SANITIZE_STRING); |
|
1331 | + $mappopup = filter_input(INPUT_POST, 'mappopup', FILTER_SANITIZE_STRING); |
|
1332 | 1332 | if ($mappopup == 'mappopup') { |
1333 | - $settings = array_merge($settings,array('globalMapPopup' => 'TRUE')); |
|
1333 | + $settings = array_merge($settings, array('globalMapPopup' => 'TRUE')); |
|
1334 | 1334 | } else { |
1335 | - $settings = array_merge($settings,array('globalMapPopup' => 'FALSE')); |
|
1335 | + $settings = array_merge($settings, array('globalMapPopup' => 'FALSE')); |
|
1336 | 1336 | } |
1337 | - $airportpopup = filter_input(INPUT_POST,'airportpopup',FILTER_SANITIZE_STRING); |
|
1337 | + $airportpopup = filter_input(INPUT_POST, 'airportpopup', FILTER_SANITIZE_STRING); |
|
1338 | 1338 | if ($airportpopup == 'airportpopup') { |
1339 | - $settings = array_merge($settings,array('globalAirportPopup' => 'TRUE')); |
|
1339 | + $settings = array_merge($settings, array('globalAirportPopup' => 'TRUE')); |
|
1340 | 1340 | } else { |
1341 | - $settings = array_merge($settings,array('globalAirportPopup' => 'FALSE')); |
|
1341 | + $settings = array_merge($settings, array('globalAirportPopup' => 'FALSE')); |
|
1342 | 1342 | } |
1343 | - $maphistory = filter_input(INPUT_POST,'maphistory',FILTER_SANITIZE_STRING); |
|
1343 | + $maphistory = filter_input(INPUT_POST, 'maphistory', FILTER_SANITIZE_STRING); |
|
1344 | 1344 | if ($maphistory == 'maphistory') { |
1345 | - $settings = array_merge($settings,array('globalMapHistory' => 'TRUE')); |
|
1345 | + $settings = array_merge($settings, array('globalMapHistory' => 'TRUE')); |
|
1346 | 1346 | } else { |
1347 | - $settings = array_merge($settings,array('globalMapHistory' => 'FALSE')); |
|
1347 | + $settings = array_merge($settings, array('globalMapHistory' => 'FALSE')); |
|
1348 | 1348 | } |
1349 | - $maptooltip = filter_input(INPUT_POST,'maptooltip',FILTER_SANITIZE_STRING); |
|
1349 | + $maptooltip = filter_input(INPUT_POST, 'maptooltip', FILTER_SANITIZE_STRING); |
|
1350 | 1350 | if ($maptooltip == 'maptooltip') { |
1351 | - $settings = array_merge($settings,array('globalMapTooltip' => 'TRUE')); |
|
1351 | + $settings = array_merge($settings, array('globalMapTooltip' => 'TRUE')); |
|
1352 | 1352 | } else { |
1353 | - $settings = array_merge($settings,array('globalMapTooltip' => 'FALSE')); |
|
1353 | + $settings = array_merge($settings, array('globalMapTooltip' => 'FALSE')); |
|
1354 | 1354 | } |
1355 | - $flightroute = filter_input(INPUT_POST,'flightroute',FILTER_SANITIZE_STRING); |
|
1355 | + $flightroute = filter_input(INPUT_POST, 'flightroute', FILTER_SANITIZE_STRING); |
|
1356 | 1356 | if ($flightroute == 'flightroute') { |
1357 | - $settings = array_merge($settings,array('globalMapRoute' => 'TRUE')); |
|
1357 | + $settings = array_merge($settings, array('globalMapRoute' => 'TRUE')); |
|
1358 | 1358 | } else { |
1359 | - $settings = array_merge($settings,array('globalMapRoute' => 'FALSE')); |
|
1359 | + $settings = array_merge($settings, array('globalMapRoute' => 'FALSE')); |
|
1360 | 1360 | } |
1361 | - $flightremainingroute = filter_input(INPUT_POST,'flightremainingroute',FILTER_SANITIZE_STRING); |
|
1361 | + $flightremainingroute = filter_input(INPUT_POST, 'flightremainingroute', FILTER_SANITIZE_STRING); |
|
1362 | 1362 | if ($flightremainingroute == 'flightremainingroute') { |
1363 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'TRUE')); |
|
1363 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'TRUE')); |
|
1364 | 1364 | } else { |
1365 | - $settings = array_merge($settings,array('globalMapRemainingRoute' => 'FALSE')); |
|
1365 | + $settings = array_merge($settings, array('globalMapRemainingRoute' => 'FALSE')); |
|
1366 | 1366 | } |
1367 | - $allflights = filter_input(INPUT_POST,'allflights',FILTER_SANITIZE_STRING); |
|
1367 | + $allflights = filter_input(INPUT_POST, 'allflights', FILTER_SANITIZE_STRING); |
|
1368 | 1368 | if ($allflights == 'allflights') { |
1369 | - $settings = array_merge($settings,array('globalAllFlights' => 'TRUE')); |
|
1369 | + $settings = array_merge($settings, array('globalAllFlights' => 'TRUE')); |
|
1370 | 1370 | } else { |
1371 | - $settings = array_merge($settings,array('globalAllFlights' => 'FALSE')); |
|
1371 | + $settings = array_merge($settings, array('globalAllFlights' => 'FALSE')); |
|
1372 | 1372 | } |
1373 | - $bbox = filter_input(INPUT_POST,'bbox',FILTER_SANITIZE_STRING); |
|
1373 | + $bbox = filter_input(INPUT_POST, 'bbox', FILTER_SANITIZE_STRING); |
|
1374 | 1374 | if ($bbox == 'bbox') { |
1375 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'TRUE')); |
|
1375 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'TRUE')); |
|
1376 | 1376 | } else { |
1377 | - $settings = array_merge($settings,array('globalMapUseBbox' => 'FALSE')); |
|
1377 | + $settings = array_merge($settings, array('globalMapUseBbox' => 'FALSE')); |
|
1378 | 1378 | } |
1379 | - $groundaltitude = filter_input(INPUT_POST,'groundaltitude',FILTER_SANITIZE_STRING); |
|
1379 | + $groundaltitude = filter_input(INPUT_POST, 'groundaltitude', FILTER_SANITIZE_STRING); |
|
1380 | 1380 | if ($groundaltitude == 'groundaltitude') { |
1381 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'TRUE')); |
|
1381 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'TRUE')); |
|
1382 | 1382 | } else { |
1383 | - $settings = array_merge($settings,array('globalGroundAltitude' => 'FALSE')); |
|
1383 | + $settings = array_merge($settings, array('globalGroundAltitude' => 'FALSE')); |
|
1384 | 1384 | } |
1385 | - $waypoints = filter_input(INPUT_POST,'waypoints',FILTER_SANITIZE_STRING); |
|
1385 | + $waypoints = filter_input(INPUT_POST, 'waypoints', FILTER_SANITIZE_STRING); |
|
1386 | 1386 | if ($waypoints == 'waypoints') { |
1387 | - $settings = array_merge($settings,array('globalWaypoints' => 'TRUE')); |
|
1387 | + $settings = array_merge($settings, array('globalWaypoints' => 'TRUE')); |
|
1388 | 1388 | } else { |
1389 | - $settings = array_merge($settings,array('globalWaypoints' => 'FALSE')); |
|
1389 | + $settings = array_merge($settings, array('globalWaypoints' => 'FALSE')); |
|
1390 | 1390 | } |
1391 | - $geoid = filter_input(INPUT_POST,'geoid',FILTER_SANITIZE_STRING); |
|
1391 | + $geoid = filter_input(INPUT_POST, 'geoid', FILTER_SANITIZE_STRING); |
|
1392 | 1392 | if ($geoid == 'geoid') { |
1393 | - $settings = array_merge($settings,array('globalGeoid' => 'TRUE')); |
|
1393 | + $settings = array_merge($settings, array('globalGeoid' => 'TRUE')); |
|
1394 | 1394 | } else { |
1395 | - $settings = array_merge($settings,array('globalGeoid' => 'FALSE')); |
|
1395 | + $settings = array_merge($settings, array('globalGeoid' => 'FALSE')); |
|
1396 | 1396 | } |
1397 | - $geoid_source = filter_input(INPUT_POST,'geoid_source',FILTER_SANITIZE_STRING); |
|
1398 | - $settings = array_merge($settings,array('globalGeoidSource' => $geoid_source)); |
|
1397 | + $geoid_source = filter_input(INPUT_POST, 'geoid_source', FILTER_SANITIZE_STRING); |
|
1398 | + $settings = array_merge($settings, array('globalGeoidSource' => $geoid_source)); |
|
1399 | 1399 | |
1400 | - $noairlines = filter_input(INPUT_POST,'noairlines',FILTER_SANITIZE_STRING); |
|
1400 | + $noairlines = filter_input(INPUT_POST, 'noairlines', FILTER_SANITIZE_STRING); |
|
1401 | 1401 | if ($noairlines == 'noairlines') { |
1402 | - $settings = array_merge($settings,array('globalNoAirlines' => 'TRUE')); |
|
1402 | + $settings = array_merge($settings, array('globalNoAirlines' => 'TRUE')); |
|
1403 | 1403 | } else { |
1404 | - $settings = array_merge($settings,array('globalNoAirlines' => 'FALSE')); |
|
1404 | + $settings = array_merge($settings, array('globalNoAirlines' => 'FALSE')); |
|
1405 | 1405 | } |
1406 | 1406 | |
1407 | - if (!isset($globalTransaction)) $settings = array_merge($settings,array('globalTransaction' => 'TRUE')); |
|
1407 | + if (!isset($globalTransaction)) $settings = array_merge($settings, array('globalTransaction' => 'TRUE')); |
|
1408 | 1408 | |
1409 | 1409 | // Set some defaults values... |
1410 | 1410 | if (!isset($globalAircraftImageSources)) { |
1411 | - $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters'); |
|
1412 | - $settings = array_merge($settings,array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1411 | + $globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'airportdata', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters'); |
|
1412 | + $settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources)); |
|
1413 | 1413 | } |
1414 | 1414 | |
1415 | 1415 | if (!isset($globalSchedulesSources)) { |
1416 | - $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware'); |
|
1417 | - $settings = array_merge($settings,array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1416 | + $globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware'); |
|
1417 | + $settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources)); |
|
1418 | 1418 | } |
1419 | 1419 | |
1420 | - $settings = array_merge($settings,array('globalInstalled' => 'TRUE')); |
|
1420 | + $settings = array_merge($settings, array('globalInstalled' => 'TRUE')); |
|
1421 | 1421 | |
1422 | 1422 | if ($error == '') settings::modify_settings($settings); |
1423 | 1423 | if ($error == '') settings::comment_settings($settings_comment); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { |
10 | 10 | exec("ps ux", $output, $result); |
11 | 11 | $j = 0; |
12 | - foreach ($output as $line) if(strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ")) $j++; |
|
12 | + foreach ($output as $line) if (strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ")) $j++; |
|
13 | 13 | if ($j > 1) { |
14 | 14 | echo "Script is already runnning..."; |
15 | 15 | die(); |
@@ -9,7 +9,9 @@ discard block |
||
9 | 9 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { |
10 | 10 | exec("ps ux", $output, $result); |
11 | 11 | $j = 0; |
12 | - foreach ($output as $line) if(strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ")) $j++; |
|
12 | + foreach ($output as $line) { |
|
13 | + if(strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ")) $j++; |
|
14 | + } |
|
13 | 15 | if ($j > 1) { |
14 | 16 | echo "Script is already runnning..."; |
15 | 17 | die(); |
@@ -29,14 +31,18 @@ discard block |
||
29 | 31 | $update_db->update_notam(); |
30 | 32 | } |
31 | 33 | $update_db->insert_last_notam_update(); |
32 | - } elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) echo "NOTAM are only updated once a day.\n"; |
|
34 | + } elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) { |
|
35 | + echo "NOTAM are only updated once a day.\n"; |
|
36 | + } |
|
33 | 37 | if ($update_db->check_last_update() && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
34 | 38 | $update_db->update_all(); |
35 | 39 | // require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
36 | 40 | // $Spotter = new Spotter(); |
37 | 41 | // $Spotter->updateFieldsFromOtherTables(); |
38 | 42 | $update_db->insert_last_update(); |
39 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n"; |
|
43 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) { |
|
44 | + echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n"; |
|
45 | + } |
|
40 | 46 | if (isset($globalWaypoints) && $globalWaypoints && $update_db->check_last_airspace_update()) { |
41 | 47 | echo "Check if new airspace version exist..."; |
42 | 48 | echo $update_db->update_airspace_fam(); |
@@ -45,8 +51,11 @@ discard block |
||
45 | 51 | if (isset($globalGeoid) && $globalGeoid && $update_db->check_last_geoid_update()) { |
46 | 52 | echo "Check if new geoid version exist..."; |
47 | 53 | $error = $update_db->update_geoid_fam(); |
48 | - if ($error == '') $update_db->insert_last_geoid_update(); |
|
49 | - else echo $error; |
|
54 | + if ($error == '') { |
|
55 | + $update_db->insert_last_geoid_update(); |
|
56 | + } else { |
|
57 | + echo $error; |
|
58 | + } |
|
50 | 59 | } |
51 | 60 | if (isset($globalMarine) && $globalMarine && $update_db->check_last_marine_identity_update()) { |
52 | 61 | echo "Check if new marine identity version exist..."; |
@@ -64,7 +73,9 @@ discard block |
||
64 | 73 | //echo "Done"; |
65 | 74 | } |
66 | 75 | $update_db->insert_last_owner_update(); |
67 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Owner are only updated every 15 days.\n"; |
|
76 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
77 | + echo "Owner are only updated every 15 days.\n"; |
|
78 | + } |
|
68 | 79 | |
69 | 80 | if (isset($globalAccidents) && $globalAccidents && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
70 | 81 | require_once(dirname(__FILE__).'/../require/class.Accident.php'); |
@@ -73,7 +84,9 @@ discard block |
||
73 | 84 | if ($Accident->check_last_accidents_update()) { |
74 | 85 | $Accident->download_update(); |
75 | 86 | $Accident->insert_last_accidents_update(); |
76 | - } else echo "Accidents are updated once a day.\n"; |
|
87 | + } else { |
|
88 | + echo "Accidents are updated once a day.\n"; |
|
89 | + } |
|
77 | 90 | } |
78 | 91 | |
79 | 92 | } |
@@ -86,15 +99,19 @@ discard block |
||
86 | 99 | if ($METAR->check_last_update()) { |
87 | 100 | $METAR->addMETARCycle(); |
88 | 101 | $METAR->insert_last_update(); |
89 | - } else echo "METAR are only updated every 30 minutes.\n"; |
|
90 | -} |
|
102 | + } else { |
|
103 | + echo "METAR are only updated every 30 minutes.\n"; |
|
104 | + } |
|
105 | + } |
|
91 | 106 | |
92 | 107 | if (isset($globalSchedules) && $globalSchedules && $update_db->check_last_schedules_update() && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
93 | 108 | echo "Updating schedules..."; |
94 | 109 | //$update_db->update_oneworld(); |
95 | 110 | $update_db->update_skyteam(); |
96 | 111 | $update_db->insert_last_schedules_update(); |
97 | -} elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Schedules are only updated every 15 days.\n"; |
|
112 | +} elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
113 | + echo "Schedules are only updated every 15 days.\n"; |
|
114 | +} |
|
98 | 115 | |
99 | 116 | if (isset($globalArchiveMonths) && $globalArchiveMonths > 0) { |
100 | 117 | echo "Updating statistics and archive old data..."; |