@@ -4,55 +4,55 @@ discard block |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | - //for the date manipulation into the query |
|
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
9 | - $start_date = $_GET['start_date'].":00"; |
|
10 | - $end_date = $_GET['end_date'].":00"; |
|
11 | - $sql_date = $start_date.",".$end_date; |
|
12 | - } else if($_GET['start_date'] != ""){ |
|
13 | - $start_date = $_GET['start_date'].":00"; |
|
14 | - $sql_date = $start_date; |
|
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
16 | - $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
17 | - $sql_date = $end_date; |
|
18 | - } else $sql_date = ''; |
|
7 | + //for the date manipulation into the query |
|
8 | + if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
9 | + $start_date = $_GET['start_date'].":00"; |
|
10 | + $end_date = $_GET['end_date'].":00"; |
|
11 | + $sql_date = $start_date.",".$end_date; |
|
12 | + } else if($_GET['start_date'] != ""){ |
|
13 | + $start_date = $_GET['start_date'].":00"; |
|
14 | + $sql_date = $start_date; |
|
15 | + } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
16 | + $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
|
17 | + $sql_date = $end_date; |
|
18 | + } else $sql_date = ''; |
|
19 | 19 | } else $sql_date = ''; |
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | - //for altitude manipulation |
|
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | - $end_altitude = $_GET['highest_altitude']; |
|
25 | - $start_altitude = $_GET['lowest_altitude']; |
|
26 | - $sql_altitude = $start_altitude.",".$end_altitude; |
|
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
28 | - $end_altitude = $_GET['highest_altitude']; |
|
29 | - $sql_altitude = $end_altitude; |
|
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | - $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
32 | - $sql_altitude = $start_altitude; |
|
33 | - } else $sql_altitude = ''; |
|
22 | + //for altitude manipulation |
|
23 | + if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
24 | + $end_altitude = $_GET['highest_altitude']; |
|
25 | + $start_altitude = $_GET['lowest_altitude']; |
|
26 | + $sql_altitude = $start_altitude.",".$end_altitude; |
|
27 | + } else if($_GET['highest_altitude'] != ""){ |
|
28 | + $end_altitude = $_GET['highest_altitude']; |
|
29 | + $sql_altitude = $end_altitude; |
|
30 | + } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
31 | + $start_altitude = $_GET['lowest_altitude'].",60000"; |
|
32 | + $sql_altitude = $start_altitude; |
|
33 | + } else $sql_altitude = ''; |
|
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | 37 | if(!isset($_GET['limit'])) |
38 | 38 | { |
39 | - if (!isset($_GET['number_results'])) |
|
40 | - { |
|
41 | - $limit_start = 0; |
|
42 | - $limit_end = 25; |
|
43 | - $absolute_difference = 25; |
|
44 | - } else { |
|
45 | - if ($_GET['number_results'] > 1000){ |
|
46 | - $_GET['number_results'] = 1000; |
|
47 | - } |
|
48 | - $limit_start = 0; |
|
49 | - $limit_end = $_GET['number_results']; |
|
50 | - $absolute_difference = $_GET['number_results']; |
|
51 | - } |
|
39 | + if (!isset($_GET['number_results'])) |
|
40 | + { |
|
41 | + $limit_start = 0; |
|
42 | + $limit_end = 25; |
|
43 | + $absolute_difference = 25; |
|
44 | + } else { |
|
45 | + if ($_GET['number_results'] > 1000){ |
|
46 | + $_GET['number_results'] = 1000; |
|
47 | + } |
|
48 | + $limit_start = 0; |
|
49 | + $limit_end = $_GET['number_results']; |
|
50 | + $absolute_difference = $_GET['number_results']; |
|
51 | + } |
|
52 | 52 | } else { |
53 | - $limit_explode = explode(",", $_GET['limit']); |
|
54 | - $limit_start = $limit_explode[0]; |
|
55 | - $limit_end = $limit_explode[1]; |
|
53 | + $limit_explode = explode(",", $_GET['limit']); |
|
54 | + $limit_start = $limit_explode[0]; |
|
55 | + $limit_end = $limit_explode[1]; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | $absolute_difference = abs($limit_start - $limit_end); |
@@ -89,56 +89,56 @@ discard block |
||
89 | 89 | |
90 | 90 | $output = '<?xml version="1.0" encoding="UTF-8" ?>'; |
91 | 91 | $output .= '<flightairmap>'; |
92 | - $output .= '<title>'.$globalName.' XML Feed</title>'; |
|
93 | - $output .= '<link>http://'.$_SERVER['HTTP_HOST'].$globalURL.'</link>'; |
|
94 | - $output .= '<aircrafts>'; |
|
92 | + $output .= '<title>'.$globalName.' XML Feed</title>'; |
|
93 | + $output .= '<link>http://'.$_SERVER['HTTP_HOST'].$globalURL.'</link>'; |
|
94 | + $output .= '<aircrafts>'; |
|
95 | 95 | |
96 | - if (!empty($spotter_array)) |
|
96 | + if (!empty($spotter_array)) |
|
97 | 97 | { |
98 | - foreach($spotter_array as $spotter_item) |
|
99 | - { |
|
98 | + foreach($spotter_array as $spotter_item) |
|
99 | + { |
|
100 | 100 | |
101 | - $output .= '<aircraft>'; |
|
102 | - $output .= '<id>'.$spotter_item['spotter_id'].'</id>'; |
|
103 | - $output .= '<ident>'.$spotter_item['ident'].'</ident>'; |
|
104 | - $output .= '<registration>'.$spotter_item['registration'].'</registration>'; |
|
105 | - $output .= '<aircraft_icao>'.$spotter_item['aircraft_type'].'</aircraft_icao>'; |
|
106 | - $output .= '<aircraft_name>'.$spotter_item['aircraft_name'].'</aircraft_name>'; |
|
107 | - $output .= '<aircraft_manufacturer>'.$spotter_item['aircraft_manufacturer'].'</aircraft_manufacturer>'; |
|
108 | - $output .= '<airline_name>'.$spotter_item['airline_name'].'</airline_name>'; |
|
109 | - $output .= '<airline_icao>'.$spotter_item['airline_icao'].'</airline_icao>'; |
|
101 | + $output .= '<aircraft>'; |
|
102 | + $output .= '<id>'.$spotter_item['spotter_id'].'</id>'; |
|
103 | + $output .= '<ident>'.$spotter_item['ident'].'</ident>'; |
|
104 | + $output .= '<registration>'.$spotter_item['registration'].'</registration>'; |
|
105 | + $output .= '<aircraft_icao>'.$spotter_item['aircraft_type'].'</aircraft_icao>'; |
|
106 | + $output .= '<aircraft_name>'.$spotter_item['aircraft_name'].'</aircraft_name>'; |
|
107 | + $output .= '<aircraft_manufacturer>'.$spotter_item['aircraft_manufacturer'].'</aircraft_manufacturer>'; |
|
108 | + $output .= '<airline_name>'.$spotter_item['airline_name'].'</airline_name>'; |
|
109 | + $output .= '<airline_icao>'.$spotter_item['airline_icao'].'</airline_icao>'; |
|
110 | 110 | if (isset($spotter_item['airline_iata'])) { |
111 | - $output .= '<airline_iata>'.$spotter_item['airline_iata'].'</airline_iata>'; |
|
112 | - } |
|
113 | - $output .= '<airline_country>'.$spotter_item['airline_country'].'</airline_country>'; |
|
114 | - if (isset($spotter_item['airline_callsign'])) { |
|
115 | - $output .= '<airline_callsign>'.$spotter_item['airline_callsign'].'</airline_callsign>'; |
|
116 | - } |
|
117 | - $output .= '<airline_type>'.$spotter_item['airline_type'].'</airline_type>'; |
|
118 | - $output .= '<departure_airport_city>'.$spotter_item['departure_airport_city'].'</departure_airport_city>'; |
|
119 | - $output .= '<departure_airport_country>'.$spotter_item['departure_airport_country'].'</departure_airport_country>'; |
|
120 | - $output .= '<departure_airport_iata>'.$spotter_item['departure_airport_iata'].'</departure_airport_iata>'; |
|
121 | - $output .= '<departure_airport_icao>'.$spotter_item['departure_airport_icao'].'</departure_airport_icao>'; |
|
122 | - $output .= '<departure_airport_latitude>'.$spotter_item['departure_airport_latitude'].'</departure_airport_latitude>'; |
|
123 | - $output .= '<departure_airport_longitude>'.$spotter_item['departure_airport_longitude'].'</departure_airport_longitude>'; |
|
124 | - $output .= '<departure_airport_altitude>'.$spotter_item['departure_airport_altitude'].'</departure_airport_altitude>'; |
|
125 | - $output .= '<arrival_airport_city>'.$spotter_item['arrival_airport_city'].'</arrival_airport_city>'; |
|
126 | - $output .= '<arrival_airport_country>'.$spotter_item['arrival_airport_country'].'</arrival_airport_country>'; |
|
127 | - $output .= '<arrival_airport_iata>'.$spotter_item['arrival_airport_iata'].'</arrival_airport_iata>'; |
|
128 | - $output .= '<arrival_airport_icao>'.$spotter_item['arrival_airport_icao'].'</arrival_airport_icao>'; |
|
129 | - $output .= '<arrival_airport_latitude>'.$spotter_item['arrival_airport_latitude'].'</arrival_airport_latitude>'; |
|
130 | - $output .= '<arrival_airport_longitude>'.$spotter_item['arrival_airport_longitude'].'</arrival_airport_longitude>'; |
|
131 | - $output .= '<arrival_airport_altitude>'.$spotter_item['arrival_airport_altitude'].'</arrival_airport_altitude>'; |
|
132 | - $output .= '<latitude>'.$spotter_item['latitude'].'</latitude>'; |
|
133 | - $output .= '<longitude>'.$spotter_item['longitude'].'</longitude>'; |
|
134 | - $output .= '<altitude>'.$spotter_item['altitude'].'</altitude>'; |
|
135 | - $output .= '<ground_speed>'.$spotter_item['ground_speed'].'</ground_speed>'; |
|
136 | - $output .= '<heading>'.$spotter_item['heading'].'</heading>'; |
|
137 | - $output .= '<heading_name>'.$spotter_item['heading_name'].'</heading_name>'; |
|
138 | - $output .= '<waypoints>'.$spotter_item['waypoints'].'</waypoints>'; |
|
139 | - $output .= '<date>'.date("c", strtotime($spotter_item['date_iso_8601'])).'</date>'; |
|
140 | - $output .= '</aircraft>'; |
|
141 | - } |
|
111 | + $output .= '<airline_iata>'.$spotter_item['airline_iata'].'</airline_iata>'; |
|
112 | + } |
|
113 | + $output .= '<airline_country>'.$spotter_item['airline_country'].'</airline_country>'; |
|
114 | + if (isset($spotter_item['airline_callsign'])) { |
|
115 | + $output .= '<airline_callsign>'.$spotter_item['airline_callsign'].'</airline_callsign>'; |
|
116 | + } |
|
117 | + $output .= '<airline_type>'.$spotter_item['airline_type'].'</airline_type>'; |
|
118 | + $output .= '<departure_airport_city>'.$spotter_item['departure_airport_city'].'</departure_airport_city>'; |
|
119 | + $output .= '<departure_airport_country>'.$spotter_item['departure_airport_country'].'</departure_airport_country>'; |
|
120 | + $output .= '<departure_airport_iata>'.$spotter_item['departure_airport_iata'].'</departure_airport_iata>'; |
|
121 | + $output .= '<departure_airport_icao>'.$spotter_item['departure_airport_icao'].'</departure_airport_icao>'; |
|
122 | + $output .= '<departure_airport_latitude>'.$spotter_item['departure_airport_latitude'].'</departure_airport_latitude>'; |
|
123 | + $output .= '<departure_airport_longitude>'.$spotter_item['departure_airport_longitude'].'</departure_airport_longitude>'; |
|
124 | + $output .= '<departure_airport_altitude>'.$spotter_item['departure_airport_altitude'].'</departure_airport_altitude>'; |
|
125 | + $output .= '<arrival_airport_city>'.$spotter_item['arrival_airport_city'].'</arrival_airport_city>'; |
|
126 | + $output .= '<arrival_airport_country>'.$spotter_item['arrival_airport_country'].'</arrival_airport_country>'; |
|
127 | + $output .= '<arrival_airport_iata>'.$spotter_item['arrival_airport_iata'].'</arrival_airport_iata>'; |
|
128 | + $output .= '<arrival_airport_icao>'.$spotter_item['arrival_airport_icao'].'</arrival_airport_icao>'; |
|
129 | + $output .= '<arrival_airport_latitude>'.$spotter_item['arrival_airport_latitude'].'</arrival_airport_latitude>'; |
|
130 | + $output .= '<arrival_airport_longitude>'.$spotter_item['arrival_airport_longitude'].'</arrival_airport_longitude>'; |
|
131 | + $output .= '<arrival_airport_altitude>'.$spotter_item['arrival_airport_altitude'].'</arrival_airport_altitude>'; |
|
132 | + $output .= '<latitude>'.$spotter_item['latitude'].'</latitude>'; |
|
133 | + $output .= '<longitude>'.$spotter_item['longitude'].'</longitude>'; |
|
134 | + $output .= '<altitude>'.$spotter_item['altitude'].'</altitude>'; |
|
135 | + $output .= '<ground_speed>'.$spotter_item['ground_speed'].'</ground_speed>'; |
|
136 | + $output .= '<heading>'.$spotter_item['heading'].'</heading>'; |
|
137 | + $output .= '<heading_name>'.$spotter_item['heading_name'].'</heading_name>'; |
|
138 | + $output .= '<waypoints>'.$spotter_item['waypoints'].'</waypoints>'; |
|
139 | + $output .= '<date>'.date("c", strtotime($spotter_item['date_iso_8601'])).'</date>'; |
|
140 | + $output .= '</aircraft>'; |
|
141 | + } |
|
142 | 142 | } |
143 | 143 | $output .= '</aircrafts>'; |
144 | 144 | $output .= '</flightairmap>'; |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | $Spotter = new Spotter(); |
6 | 6 | if (isset($_GET['start_date'])) { |
7 | 7 | //for the date manipulation into the query |
8 | - if($_GET['start_date'] != "" && $_GET['end_date'] != ""){ |
|
8 | + if ($_GET['start_date'] != "" && $_GET['end_date'] != "") { |
|
9 | 9 | $start_date = $_GET['start_date'].":00"; |
10 | 10 | $end_date = $_GET['end_date'].":00"; |
11 | 11 | $sql_date = $start_date.",".$end_date; |
12 | - } else if($_GET['start_date'] != ""){ |
|
12 | + } else if ($_GET['start_date'] != "") { |
|
13 | 13 | $start_date = $_GET['start_date'].":00"; |
14 | 14 | $sql_date = $start_date; |
15 | - } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
|
15 | + } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") { |
|
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | 18 | } else $sql_date = ''; |
@@ -20,21 +20,21 @@ discard block |
||
20 | 20 | |
21 | 21 | if (isset($_GET['highest_altitude'])) { |
22 | 22 | //for altitude manipulation |
23 | - if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){ |
|
23 | + if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") { |
|
24 | 24 | $end_altitude = $_GET['highest_altitude']; |
25 | 25 | $start_altitude = $_GET['lowest_altitude']; |
26 | 26 | $sql_altitude = $start_altitude.",".$end_altitude; |
27 | - } else if($_GET['highest_altitude'] != ""){ |
|
27 | + } else if ($_GET['highest_altitude'] != "") { |
|
28 | 28 | $end_altitude = $_GET['highest_altitude']; |
29 | 29 | $sql_altitude = $end_altitude; |
30 | - } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
|
30 | + } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") { |
|
31 | 31 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
32 | 32 | $sql_altitude = $start_altitude; |
33 | 33 | } else $sql_altitude = ''; |
34 | 34 | } else $sql_altitude = ''; |
35 | 35 | |
36 | 36 | //calculuation for the pagination |
37 | -if(!isset($_GET['limit'])) |
|
37 | +if (!isset($_GET['limit'])) |
|
38 | 38 | { |
39 | 39 | if (!isset($_GET['number_results'])) |
40 | 40 | { |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | $limit_end = 25; |
43 | 43 | $absolute_difference = 25; |
44 | 44 | } else { |
45 | - if ($_GET['number_results'] > 1000){ |
|
45 | + if ($_GET['number_results'] > 1000) { |
|
46 | 46 | $_GET['number_results'] = 1000; |
47 | 47 | } |
48 | 48 | $limit_start = 0; |
49 | 49 | $limit_end = $_GET['number_results']; |
50 | 50 | $absolute_difference = $_GET['number_results']; |
51 | 51 | } |
52 | -} else { |
|
52 | +} else { |
|
53 | 53 | $limit_explode = explode(",", $_GET['limit']); |
54 | 54 | $limit_start = $limit_explode[0]; |
55 | 55 | $limit_end = $limit_explode[1]; |
@@ -69,23 +69,23 @@ discard block |
||
69 | 69 | |
70 | 70 | if (isset($_GET['sort'])) $sort = $_GET['sort']; |
71 | 71 | else $sort = ''; |
72 | -$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
|
73 | -$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
|
74 | -$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
|
75 | -$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING); |
|
76 | -$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING); |
|
77 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
78 | -$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING); |
|
79 | -$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING); |
|
80 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
81 | -$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING); |
|
82 | -$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING); |
|
83 | -$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING); |
|
84 | -$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING); |
|
85 | -$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING); |
|
86 | -$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING); |
|
87 | -$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING); |
|
88 | -$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,''); |
|
72 | +$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING); |
|
73 | +$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING); |
|
74 | +$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING); |
|
75 | +$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING); |
|
76 | +$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING); |
|
77 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
78 | +$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING); |
|
79 | +$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING); |
|
80 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
81 | +$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING); |
|
82 | +$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING); |
|
83 | +$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING); |
|
84 | +$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING); |
|
85 | +$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING); |
|
86 | +$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING); |
|
87 | +$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING); |
|
88 | +$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, ''); |
|
89 | 89 | |
90 | 90 | $output = '{'; |
91 | 91 | $output .= '"flightairmap": {'; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | if (!empty($spotter_array)) |
97 | 97 | { |
98 | - foreach($spotter_array as $spotter_item) |
|
98 | + foreach ($spotter_array as $spotter_item) |
|
99 | 99 | { |
100 | 100 | |
101 | 101 | $output .= '{'; |
@@ -15,8 +15,12 @@ discard block |
||
15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
17 | 17 | $sql_date = $end_date; |
18 | - } else $sql_date = ''; |
|
19 | -} else $sql_date = ''; |
|
18 | + } else { |
|
19 | + $sql_date = ''; |
|
20 | + } |
|
21 | + } else { |
|
22 | + $sql_date = ''; |
|
23 | +} |
|
20 | 24 | |
21 | 25 | if (isset($_GET['highest_altitude'])) { |
22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
31 | 35 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
32 | 36 | $sql_altitude = $start_altitude; |
33 | - } else $sql_altitude = ''; |
|
34 | -} else $sql_altitude = ''; |
|
37 | + } else { |
|
38 | + $sql_altitude = ''; |
|
39 | + } |
|
40 | + } else { |
|
41 | + $sql_altitude = ''; |
|
42 | +} |
|
35 | 43 | |
36 | 44 | //calculuation for the pagination |
37 | 45 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
49 | 57 | $limit_end = $_GET['number_results']; |
50 | 58 | $absolute_difference = $_GET['number_results']; |
51 | 59 | } |
52 | -} else { |
|
60 | +} else { |
|
53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
54 | 62 | $limit_start = $limit_explode[0]; |
55 | 63 | $limit_end = $limit_explode[1]; |
@@ -67,8 +75,11 @@ discard block |
||
67 | 75 | |
68 | 76 | header("Content-type: text/yaml"); |
69 | 77 | |
70 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
71 | -else $sort = ''; |
|
78 | +if (isset($_GET['sort'])) { |
|
79 | + $sort = $_GET['sort']; |
|
80 | +} else { |
|
81 | + $sort = ''; |
|
82 | +} |
|
72 | 83 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
73 | 84 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
74 | 85 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -3,10 +3,10 @@ discard block |
||
3 | 3 | </span> |
4 | 4 | <div class="sub-menu sub-menu-container"> |
5 | 5 | <ul class="nav nav-pills"> |
6 | - <li><a href="<?php print $globalURL; ?>/aircraft/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
7 | - <li><a href="<?php print $globalURL; ?>/aircraft/statistics/registration/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-registration"){ print 'class="active"'; } ?>><?php echo _("Registration"); ?></a></li> |
|
6 | + <li><a href="<?php print $globalURL; ?>/aircraft/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-detailed") { print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
7 | + <li><a href="<?php print $globalURL; ?>/aircraft/statistics/registration/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-registration") { print 'class="active"'; } ?>><?php echo _("Registration"); ?></a></li> |
|
8 | 8 | <li class="dropdown"> |
9 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "aircraft-statistics-airline" || strtolower($current_page) == "aircraft-statistics-airline-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
9 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "aircraft-statistics-airline" || strtolower($current_page) == "aircraft-statistics-airline-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
10 | 10 | <?php echo _("Airline"); ?> <span class="caret"></span> |
11 | 11 | </a> |
12 | 12 | <ul class="dropdown-menu" role="menu"> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | </ul> |
16 | 16 | </li> |
17 | 17 | <li class="dropdown"> |
18 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "aircraft-statistics-departure-airport" || strtolower($current_page) == "aircraft-statistics-departure-airport-country" || strtolower($current_page) == "aircraft-statistics-arrival-airport" || strtolower($current_page) == "aircraft-statistics-arrival-airport-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
18 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "aircraft-statistics-departure-airport" || strtolower($current_page) == "aircraft-statistics-departure-airport-country" || strtolower($current_page) == "aircraft-statistics-arrival-airport" || strtolower($current_page) == "aircraft-statistics-arrival-airport-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
19 | 19 | <?php echo _("Airport"); ?> <span class="caret"></span> |
20 | 20 | </a> |
21 | 21 | <ul class="dropdown-menu" role="menu"> |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | <li><a href="<?php print $globalURL; ?>/aircraft/statistics/arrival-airport-country/<?php print $_GET['aircraft_type']; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
26 | 26 | </ul> |
27 | 27 | </li> |
28 | - <li><a href="<?php print $globalURL; ?>/aircraft/statistics/route/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-route"){ print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> |
|
29 | - <li><a href="<?php print $globalURL; ?>/aircraft/statistics/time/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-time"){ print 'class="active"'; } ?>><?php echo ("Time"); ?></a></li> |
|
28 | + <li><a href="<?php print $globalURL; ?>/aircraft/statistics/route/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-route") { print 'class="active"'; } ?>><?php echo _("Route"); ?></a></li> |
|
29 | + <li><a href="<?php print $globalURL; ?>/aircraft/statistics/time/<?php print $_GET['aircraft_type']; ?>" <?php if (strtolower($current_page) == "aircraft-statistics-time") { print 'class="active"'; } ?>><?php echo ("Time"); ?></a></li> |
|
30 | 30 | </ul> |
31 | 31 | </div> |
32 | 32 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
35 | 35 | function drawChart() { |
36 | 36 | var data = google.visualization.arrayToDataTable([ |
37 | 37 | ["'._("Country").'", "'._("# of times").'"], '; |
38 | - $country_data = ''; |
|
38 | + $country_data = ''; |
|
39 | 39 | foreach($airline_array as $airline_item) |
40 | 40 | { |
41 | 41 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
@@ -8,12 +8,12 @@ discard block |
||
8 | 8 | require_once('require/class.Spotter.php'); |
9 | 9 | require_once('require/class.Language.php'); |
10 | 10 | $Spotter = new Spotter(); |
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | $spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort); |
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Airlines by Country between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
16 | + $title = sprintf(_("Most Common Airlines by Country between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('route-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>'; |
|
28 | 28 | |
29 | 29 | $airline_array = $Spotter->countAllAirlineCountriesByRoute($_GET['departure_airport'], $_GET['arrival_airport']); |
30 | 30 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | var data = google.visualization.arrayToDataTable([ |
37 | 37 | ["'._("Country").'", "'._("# of times").'"], '; |
38 | 38 | $country_data = ''; |
39 | - foreach($airline_array as $airline_item) |
|
39 | + foreach ($airline_array as $airline_item) |
|
40 | 40 | { |
41 | 41 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
42 | 42 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | print '</thead>'; |
71 | 71 | print '<tbody>'; |
72 | 72 | $i = 1; |
73 | - foreach($airline_array as $airline_item) |
|
73 | + foreach ($airline_array as $airline_item) |
|
74 | 74 | { |
75 | 75 | print '<tr>'; |
76 | 76 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -1,30 +1,30 @@ |
||
1 | 1 | #!/usr/bin/php |
2 | 2 | <?php |
3 | - require_once('../require/settings.php'); |
|
4 | - if ($globalInstalled) { |
|
5 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
6 | - exit; |
|
7 | - } |
|
8 | - require('class.create_db.php'); |
|
9 | - echo "Create and import all tables..."; |
|
10 | - create_db::import_all_db('../db/'); |
|
11 | - echo "Done !\n"; |
|
3 | + require_once('../require/settings.php'); |
|
4 | + if ($globalInstalled) { |
|
5 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
6 | + exit; |
|
7 | + } |
|
8 | + require('class.create_db.php'); |
|
9 | + echo "Create and import all tables..."; |
|
10 | + create_db::import_all_db('../db/'); |
|
11 | + echo "Done !\n"; |
|
12 | 12 | |
13 | - require('class.update_db.php'); |
|
14 | - echo "Populate all tables...\n"; |
|
15 | - update_db::update_all(); |
|
16 | - echo "\nInstall waypoints...(VERY slow!)"; |
|
17 | - update_db::update_waypoints(); |
|
18 | - echo "Done !\n"; |
|
19 | - echo "Install airspace..."; |
|
20 | - update_db::update_airspace(); |
|
21 | - echo "Done !\n"; |
|
22 | - echo 'All is now installed ! Thanks'."\n"; |
|
23 | - if ($globalSBS1) { |
|
24 | - echo 'You need to run cron-sbs.php as a daemon. You can use init script in the install/init directory.'."\n"; |
|
25 | - } |
|
26 | - if ($globalACARS) { |
|
27 | - echo 'You need to run cron-acars.php as a daemon. You can use init script in the install/init directory.'."\n"; |
|
28 | - } |
|
13 | + require('class.update_db.php'); |
|
14 | + echo "Populate all tables...\n"; |
|
15 | + update_db::update_all(); |
|
16 | + echo "\nInstall waypoints...(VERY slow!)"; |
|
17 | + update_db::update_waypoints(); |
|
18 | + echo "Done !\n"; |
|
19 | + echo "Install airspace..."; |
|
20 | + update_db::update_airspace(); |
|
21 | + echo "Done !\n"; |
|
22 | + echo 'All is now installed ! Thanks'."\n"; |
|
23 | + if ($globalSBS1) { |
|
24 | + echo 'You need to run cron-sbs.php as a daemon. You can use init script in the install/init directory.'."\n"; |
|
25 | + } |
|
26 | + if ($globalACARS) { |
|
27 | + echo 'You need to run cron-acars.php as a daemon. You can use init script in the install/init directory.'."\n"; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | ?> |
31 | 31 | \ No newline at end of file |
@@ -1,23 +1,23 @@ |
||
1 | 1 | #!/usr/bin/php |
2 | 2 | <?php |
3 | - require_once('../require/settings.php'); |
|
4 | - if ($globalInstalled) { |
|
5 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
6 | - exit; |
|
7 | - } |
|
8 | - require('class.update_db.php'); |
|
9 | - if (isset($globalVATSIM) && $globalVATSIM) { |
|
3 | + require_once('../require/settings.php'); |
|
4 | + if ($globalInstalled) { |
|
5 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
6 | + exit; |
|
7 | + } |
|
8 | + require('class.update_db.php'); |
|
9 | + if (isset($globalVATSIM) && $globalVATSIM) { |
|
10 | 10 | echo "Install VATSIM airlines..."; |
11 | 11 | update_db::update_vatsim(); |
12 | 12 | echo "Done !\n"; |
13 | - } |
|
14 | - if (isset($globalIVAO) && $globalIVAO) { |
|
13 | + } |
|
14 | + if (isset($globalIVAO) && $globalIVAO) { |
|
15 | 15 | if (!file_exists('tmp/ivae_feb2013.zip')) { |
16 | 16 | echo "You have to download the file ivae_feb2013.zip from https://www.ivao.aero/softdev/mirrors.asp?software=IvAeDataUp and put it in install/tmp directory"; |
17 | 17 | } else { |
18 | - echo "Install IVAO airlines and logos..."; |
|
19 | - update_db::update_IVAO(); |
|
18 | + echo "Install IVAO airlines and logos..."; |
|
19 | + update_db::update_IVAO(); |
|
20 | 20 | echo "Done !\n"; |
21 | 21 | } |
22 | - } |
|
22 | + } |
|
23 | 23 | ?> |
24 | 24 | \ No newline at end of file |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <meta property="og:site_name" content="<?php print $globalName; ?>"/> |
40 | 40 | |
41 | 41 | <?php |
42 | - if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
42 | + if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
43 | 43 | ?> |
44 | 44 | <script language="JavaScript" type="text/javascript"> |
45 | 45 | function datasource_js() { |
@@ -120,22 +120,22 @@ discard block |
||
120 | 120 | } |
121 | 121 | </script> |
122 | 122 | <?php |
123 | - } |
|
123 | + } |
|
124 | 124 | ?> |
125 | 125 | |
126 | 126 | </head> |
127 | 127 | |
128 | 128 | <?php |
129 | - if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
129 | + if (!isset($_SESSION['install']) && !$globalInstalled) { |
|
130 | 130 | ?> |
131 | 131 | |
132 | 132 | <body class="page-<?php print strtolower($current_page); ?>" onload="datasource_js(); metarcycle_js(); create_database_js(); daemon_js(); schedule_js()"> |
133 | 133 | <?php |
134 | - } else { |
|
134 | + } else { |
|
135 | 135 | ?> |
136 | 136 | <body class="page-<?php print strtolower($current_page); ?>"> |
137 | 137 | <?php |
138 | - } |
|
138 | + } |
|
139 | 139 | ?> |
140 | 140 | <div class="navbar navbar-fixed-top" role="navigation"> |
141 | 141 | <div class="container"> |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | |
155 | 155 | <?php |
156 | 156 | if (isset($top_header)) { |
157 | - if ($top_header != "") |
|
158 | - { |
|
157 | + if ($top_header != "") |
|
158 | + { |
|
159 | 159 | print '<div class="top-header container clear" role="main">'; |
160 | 160 | print '<img src="../images/'.$top_header.'" alt="'.$title.'" title="'.$title.'" />'; |
161 | 161 | print '</div>'; |
162 | - } |
|
162 | + } |
|
163 | 163 | } |
164 | 164 | ?> |
165 | 165 |
@@ -68,27 +68,27 @@ discard block |
||
68 | 68 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') { |
69 | 69 | if (update_schema::check_version(false) == '0') { |
70 | 70 | if ($globalDBdriver == 'mysql') { |
71 | - $error .= create_db::import_all_db('../db/'); |
|
71 | + $error .= create_db::import_all_db('../db/'); |
|
72 | 72 | } elseif ($globalDBdriver == 'pgsql') { |
73 | - $error .= create_db::import_all_db('../db/pgsql/'); |
|
73 | + $error .= create_db::import_all_db('../db/pgsql/'); |
|
74 | 74 | } |
75 | 75 | if ($error != '') { |
76 | - $_SESSION['error'] = $error; |
|
76 | + $_SESSION['error'] = $error; |
|
77 | 77 | } |
78 | 78 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
79 | 79 | if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
80 | 80 | $_SESSION['install'] = 'populate'; |
81 | 81 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B'; |
82 | 82 | } else { |
83 | - $_SESSION['install'] = 'sources'; |
|
84 | - $_SESSION['next'] = 'Insert data in source table'; |
|
83 | + $_SESSION['install'] = 'sources'; |
|
84 | + $_SESSION['next'] = 'Insert data in source table'; |
|
85 | 85 | } |
86 | 86 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
87 | 87 | print json_encode($result); |
88 | 88 | } else { |
89 | 89 | $error .= update_schema::check_version(true); |
90 | 90 | if ($error != '') { |
91 | - $_SESSION['error'] = $error; |
|
91 | + $_SESSION['error'] = $error; |
|
92 | 92 | } |
93 | 93 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
94 | 94 | $_SESSION['install'] = 'sources'; |
@@ -118,25 +118,25 @@ discard block |
||
118 | 118 | $error .= update_db::update_countries(); |
119 | 119 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
120 | 120 | if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
121 | - $_SESSION['install'] = 'notam'; |
|
122 | - $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
|
123 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
124 | - print json_encode($result); |
|
121 | + $_SESSION['install'] = 'notam'; |
|
122 | + $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
|
123 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
124 | + print json_encode($result); |
|
125 | 125 | } elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
126 | - $_SESSION['install'] = 'owner'; |
|
127 | - $_SESSION['next'] = 'Populate owner table with externals data'; |
|
128 | - unset($_SESSION['owner']); |
|
129 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
130 | - print json_encode($result); |
|
126 | + $_SESSION['install'] = 'owner'; |
|
127 | + $_SESSION['next'] = 'Populate owner table with externals data'; |
|
128 | + unset($_SESSION['owner']); |
|
129 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
130 | + print json_encode($result); |
|
131 | 131 | } else { |
132 | - $_SESSION['install'] = 'sources'; |
|
133 | - $_SESSION['next'] = 'Insert data in source table'; |
|
134 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
135 | - print json_encode($result); |
|
132 | + $_SESSION['install'] = 'sources'; |
|
133 | + $_SESSION['next'] = 'Insert data in source table'; |
|
134 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
135 | + print json_encode($result); |
|
136 | 136 | } |
137 | 137 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') { |
138 | 138 | if (!is_writable('tmp')) { |
139 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
139 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
140 | 140 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
141 | 141 | print json_encode($result); |
142 | 142 | } else { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') { |
154 | 154 | if (!is_writable('tmp')) { |
155 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
155 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
156 | 156 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
157 | 157 | print json_encode($result); |
158 | 158 | } else { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') { |
187 | 187 | if (!is_writable('tmp')) { |
188 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
188 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
189 | 189 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
190 | 190 | print json_encode($result); |
191 | 191 | } else { |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') { |
202 | 202 | if (!is_writable('tmp')) { |
203 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
203 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
204 | 204 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
205 | 205 | print json_encode($result); |
206 | 206 | } else { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') { |
231 | 231 | if (!is_writable('tmp')) { |
232 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
232 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
233 | 233 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
234 | 234 | print json_encode($result); |
235 | 235 | } else { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') { |
246 | 246 | if (!is_writable('tmp')) { |
247 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
247 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
248 | 248 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
249 | 249 | print json_encode($result); |
250 | 250 | } else { |
@@ -296,17 +296,17 @@ discard block |
||
296 | 296 | */ |
297 | 297 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'sources') { |
298 | 298 | if (isset($_SESSION['sources']) && count($_SESSION['sources']) > 0) { |
299 | - $sources = $_SESSION['sources']; |
|
299 | + $sources = $_SESSION['sources']; |
|
300 | 300 | |
301 | - include_once('../require/class.Source.php'); |
|
302 | - $globalDebug = FALSE; |
|
303 | - $Source = new Source(); |
|
304 | - $Source->deleteAllLocation(); |
|
305 | - foreach ($sources as $src) { |
|
301 | + include_once('../require/class.Source.php'); |
|
302 | + $globalDebug = FALSE; |
|
303 | + $Source = new Source(); |
|
304 | + $Source->deleteAllLocation(); |
|
305 | + foreach ($sources as $src) { |
|
306 | 306 | if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
307 | - } |
|
308 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
309 | - unset($_SESSION['sources']); |
|
307 | + } |
|
308 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
309 | + unset($_SESSION['sources']); |
|
310 | 310 | } |
311 | 311 | /* |
312 | 312 | if (isset($globalIVAO) && $globalIVAO) $_SESSION['install'] = 'ivao'; |
@@ -164,15 +164,21 @@ discard block |
||
164 | 164 | |
165 | 165 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
166 | 166 | $_SESSION['install'] = 'vatsim'; |
167 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
168 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
167 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
168 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
169 | + } else { |
|
170 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
171 | + } |
|
169 | 172 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
170 | 173 | $_SESSION['install'] = 'vatsim'; |
171 | 174 | $_SESSION['next'] = 'Insert VATSIM data'; |
172 | 175 | } elseif (isset($globalIVAO) && $globalIVAO) { |
173 | 176 | $_SESSION['install'] = 'vatsim'; |
174 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
175 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
177 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
178 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
179 | + } else { |
|
180 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
181 | + } |
|
176 | 182 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
177 | 183 | $_SESSION['install'] = 'vatsim'; |
178 | 184 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -303,7 +309,9 @@ discard block |
||
303 | 309 | $Source = new Source(); |
304 | 310 | $Source->deleteAllLocation(); |
305 | 311 | foreach ($sources as $src) { |
306 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
312 | + if (isset($src['latitude']) && $src['latitude'] != '') { |
|
313 | + $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
314 | + } |
|
307 | 315 | } |
308 | 316 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
309 | 317 | unset($_SESSION['sources']); |
@@ -314,15 +322,21 @@ discard block |
||
314 | 322 | */ |
315 | 323 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
316 | 324 | $_SESSION['install'] = 'vatsim'; |
317 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
318 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
325 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
326 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
327 | + } else { |
|
328 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
329 | + } |
|
319 | 330 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
320 | 331 | $_SESSION['install'] = 'vatsim'; |
321 | 332 | $_SESSION['next'] = 'Insert VATSIM data'; |
322 | 333 | } elseif (isset($globalIVAO) && $globalIVAO) { |
323 | 334 | $_SESSION['install'] = 'vatsim'; |
324 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
325 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
335 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
336 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
337 | + } else { |
|
338 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
339 | + } |
|
326 | 340 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
327 | 341 | $_SESSION['install'] = 'vatsim'; |
328 | 342 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_create') { |
69 | 69 | $dbroot = $_SESSION['database_root']; |
70 | 70 | $dbrootpass = $_SESSION['database_rootpass']; |
71 | - $error .= create_db::create_database($dbroot,$dbrootpass,$globalDBuser,$globalDBpass,$globalDBname,$globalDBdriver,$globalDBhost); |
|
71 | + $error .= create_db::create_database($dbroot, $dbrootpass, $globalDBuser, $globalDBpass, $globalDBname, $globalDBdriver, $globalDBhost); |
|
72 | 72 | if ($error != '') { |
73 | 73 | $_SESSION['error'] = $error; |
74 | 74 | } |
75 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Create database')); |
|
75 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Create database')); |
|
76 | 76 | $_SESSION['install'] = 'database_import'; |
77 | 77 | $_SESSION['next'] = 'Create and import tables'; |
78 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
78 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
79 | 79 | print json_encode($result); |
80 | 80 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') { |
81 | 81 | if (update_schema::check_version(false) == '0') { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if ($error != '') { |
88 | 88 | $_SESSION['error'] = $error; |
89 | 89 | } |
90 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
|
90 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Create and import tables')); |
|
91 | 91 | if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
92 | 92 | $_SESSION['install'] = 'populate'; |
93 | 93 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B'; |
@@ -95,84 +95,84 @@ discard block |
||
95 | 95 | $_SESSION['install'] = 'sources'; |
96 | 96 | $_SESSION['next'] = 'Insert data in source table'; |
97 | 97 | } |
98 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
98 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
99 | 99 | print json_encode($result); |
100 | 100 | } else { |
101 | 101 | $error .= update_schema::check_version(true); |
102 | 102 | if ($error != '') { |
103 | 103 | $_SESSION['error'] = $error; |
104 | 104 | } |
105 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
|
105 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Update schema if needed')); |
|
106 | 106 | $_SESSION['install'] = 'sources'; |
107 | 107 | $_SESSION['next'] = 'Insert data in source table'; |
108 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
108 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
109 | 109 | print json_encode($result); |
110 | 110 | } |
111 | 111 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'waypoints') { |
112 | 112 | include_once('class.update_db.php'); |
113 | 113 | $error .= update_db::update_waypoints(); |
114 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate waypoints database')); |
|
114 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate waypoints database')); |
|
115 | 115 | |
116 | 116 | $_SESSION['install'] = 'airspace'; |
117 | 117 | $_SESSION['next'] = 'Populate airspace table'; |
118 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
118 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
119 | 119 | print json_encode($result); |
120 | 120 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'airspace') { |
121 | 121 | include_once('class.update_db.php'); |
122 | 122 | $error .= update_db::update_airspace(); |
123 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate airspace database')); |
|
123 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate airspace database')); |
|
124 | 124 | $_SESSION['install'] = 'countries'; |
125 | 125 | $_SESSION['next'] = 'Populate countries table'; |
126 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
126 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
127 | 127 | print json_encode($result); |
128 | 128 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'countries') { |
129 | 129 | include_once('class.update_db.php'); |
130 | 130 | $error .= update_db::update_countries(); |
131 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
|
131 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate countries database')); |
|
132 | 132 | if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
133 | 133 | $_SESSION['install'] = 'notam'; |
134 | 134 | $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
135 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
135 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
136 | 136 | print json_encode($result); |
137 | 137 | } elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
138 | 138 | $_SESSION['install'] = 'owner'; |
139 | 139 | $_SESSION['next'] = 'Populate owner table with externals data'; |
140 | 140 | unset($_SESSION['owner']); |
141 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
141 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
142 | 142 | print json_encode($result); |
143 | 143 | } else { |
144 | 144 | $_SESSION['install'] = 'sources'; |
145 | 145 | $_SESSION['next'] = 'Insert data in source table'; |
146 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
146 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
147 | 147 | print json_encode($result); |
148 | 148 | } |
149 | 149 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') { |
150 | 150 | if (!is_writable('tmp')) { |
151 | 151 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
152 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
152 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
153 | 153 | print json_encode($result); |
154 | 154 | } else { |
155 | 155 | include_once('class.update_db.php'); |
156 | 156 | $globalDebug = FALSE; |
157 | 157 | $error .= update_db::update_ModeS(); |
158 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for ADS-B')); |
|
158 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for ADS-B')); |
|
159 | 159 | |
160 | 160 | $_SESSION['install'] = 'populate_flarm'; |
161 | 161 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for FLARM'; |
162 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
162 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
163 | 163 | print json_encode($result); |
164 | 164 | } |
165 | 165 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') { |
166 | 166 | if (!is_writable('tmp')) { |
167 | 167 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
168 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
168 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
169 | 169 | print json_encode($result); |
170 | 170 | } else { |
171 | 171 | include_once('class.update_db.php'); |
172 | 172 | $globalDebug = FALSE; |
173 | 173 | $error .= update_db::update_ModeS_flarm(); |
174 | 174 | $error .= update_db::update_ModeS_ogn(); |
175 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for FLARM')); |
|
175 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for FLARM')); |
|
176 | 176 | |
177 | 177 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
178 | 178 | $_SESSION['install'] = 'vatsim'; |
@@ -192,34 +192,34 @@ discard block |
||
192 | 192 | $_SESSION['install'] = 'routes'; |
193 | 193 | $_SESSION['next'] = 'Populate routes table with externals data'; |
194 | 194 | } |
195 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
195 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
196 | 196 | print json_encode($result); |
197 | 197 | } |
198 | 198 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') { |
199 | 199 | if (!is_writable('tmp')) { |
200 | 200 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
201 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
201 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
202 | 202 | print json_encode($result); |
203 | 203 | } else { |
204 | 204 | include_once('class.update_db.php'); |
205 | 205 | $globalDebug = FALSE; |
206 | 206 | $error .= update_db::update_routes(); |
207 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate routes table with externals data')); |
|
207 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate routes table with externals data')); |
|
208 | 208 | $_SESSION['install'] = 'translation'; |
209 | 209 | $_SESSION['next'] = 'Populate translation table with externals data'; |
210 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
210 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
211 | 211 | print json_encode($result); |
212 | 212 | } |
213 | 213 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') { |
214 | 214 | if (!is_writable('tmp')) { |
215 | 215 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
216 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
216 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
217 | 217 | print json_encode($result); |
218 | 218 | } else { |
219 | 219 | include_once('class.update_db.php'); |
220 | 220 | $globalDebug = FALSE; |
221 | 221 | $error .= update_db::update_translation(); |
222 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate translation table with externals data')); |
|
222 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate translation table with externals data')); |
|
223 | 223 | |
224 | 224 | if ($_SESSION['waypoints'] == 1) { |
225 | 225 | $_SESSION['install'] = 'waypoints'; |
@@ -236,48 +236,48 @@ discard block |
||
236 | 236 | $_SESSION['install'] = 'sources'; |
237 | 237 | $_SESSION['next'] = 'Insert data in source table'; |
238 | 238 | } |
239 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
239 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
240 | 240 | print json_encode($result); |
241 | 241 | } |
242 | 242 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') { |
243 | 243 | if (!is_writable('tmp')) { |
244 | 244 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
245 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
245 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
246 | 246 | print json_encode($result); |
247 | 247 | } else { |
248 | 248 | include_once('class.update_db.php'); |
249 | 249 | $globalDebug = FALSE; |
250 | 250 | $error = update_db::update_owner(); |
251 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate owner table with externals data')); |
|
251 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate owner table with externals data')); |
|
252 | 252 | $_SESSION['install'] = 'sources'; |
253 | 253 | $_SESSION['next'] = 'Insert data in source table'; |
254 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
254 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
255 | 255 | print json_encode($result); |
256 | 256 | } |
257 | 257 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') { |
258 | 258 | if (!is_writable('tmp')) { |
259 | 259 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
260 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
260 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
261 | 261 | print json_encode($result); |
262 | 262 | } else { |
263 | 263 | include_once('class.update_db.php'); |
264 | 264 | $globalDebug = FALSE; |
265 | 265 | if (isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
266 | 266 | $error .= update_db::update_notam(); |
267 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data')); |
|
267 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data')); |
|
268 | 268 | } else { |
269 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data (no source defined)')); |
|
269 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data (no source defined)')); |
|
270 | 270 | } |
271 | 271 | if (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
272 | 272 | $_SESSION['install'] = 'owner'; |
273 | 273 | $_SESSION['next'] = 'Populate owner table'; |
274 | 274 | unset($_SESSION['owner']); |
275 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
275 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
276 | 276 | print json_encode($result); |
277 | 277 | } else { |
278 | 278 | $_SESSION['install'] = 'sources'; |
279 | 279 | $_SESSION['next'] = 'Insert data in source table'; |
280 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
280 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
281 | 281 | print json_encode($result); |
282 | 282 | } |
283 | 283 | } |
@@ -315,9 +315,9 @@ discard block |
||
315 | 315 | $Source = new Source(); |
316 | 316 | $Source->deleteAllLocation(); |
317 | 317 | foreach ($sources as $src) { |
318 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
318 | + if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'], $src['latitude'], $src['longitude'], $src['altitude'], $src['city'], $src['country'], $src['source'], 'antenna.png'); |
|
319 | 319 | } |
320 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
320 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert data in source table')); |
|
321 | 321 | unset($_SESSION['sources']); |
322 | 322 | } |
323 | 323 | /* |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $_SESSION['install'] = 'finish'; |
343 | 343 | $_SESSION['next'] = 'finish'; |
344 | 344 | } |
345 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
345 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
346 | 346 | print json_encode($result); |
347 | 347 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'vatsim') { |
348 | 348 | include_once('../install/class.create_db.php'); |
@@ -352,36 +352,36 @@ discard block |
||
352 | 352 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
353 | 353 | if (file_exists('tmp/ivae_feb2013.zip')) { |
354 | 354 | $error .= update_db::update_IVAO(); |
355 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
355 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data')); |
|
356 | 356 | } else { |
357 | 357 | $error .= update_db::update_vatsim(); |
358 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
358 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data')); |
|
359 | 359 | } |
360 | 360 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
361 | 361 | $error .= update_db::update_vatsim(); |
362 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
362 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data')); |
|
363 | 363 | } elseif (isset($globalIVAO) && $globalIVAO) { |
364 | 364 | if (file_exists('tmp/ivae_feb2013.zip')) { |
365 | 365 | $error .= update_db::update_IVAO(); |
366 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
366 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data')); |
|
367 | 367 | } else { |
368 | 368 | $error .= update_db::update_vatsim(); |
369 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data (IVAO not found)')); |
|
369 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data (IVAO not found)')); |
|
370 | 370 | } |
371 | 371 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
372 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert phpVMS data')); |
|
372 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert phpVMS data')); |
|
373 | 373 | } |
374 | 374 | //$_SESSION['install'] = 'routes'; |
375 | 375 | //$_SESSION['next'] = 'Populate routes table with externals data'; |
376 | 376 | $_SESSION['install'] = 'finish'; |
377 | 377 | $_SESSION['next'] = 'finish'; |
378 | 378 | |
379 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
379 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
380 | 380 | print json_encode($result); |
381 | 381 | } else { |
382 | 382 | //unset($_SESSION['install']); |
383 | 383 | $_SESSION['error'] = 'Unknwon task : '.$_SESSION['install']; |
384 | - $result = array('error' => 'Unknwon task : '.$_SESSION['install'],'done' => $_SESSION['done'],'next' => 'finish','install' => 'finish'); |
|
384 | + $result = array('error' => 'Unknwon task : '.$_SESSION['install'], 'done' => $_SESSION['done'], 'next' => 'finish', 'install' => 'finish'); |
|
385 | 385 | print json_encode($result); |
386 | 386 | } |
387 | 387 | ?> |
388 | 388 | \ No newline at end of file |
@@ -4,13 +4,13 @@ |
||
4 | 4 | * This Script will try to find all real arrival airports for all flights in DB |
5 | 5 | * |
6 | 6 | */ |
7 | - require_once('../require/settings.php'); |
|
8 | - if ($globalInstalled) { |
|
9 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
10 | - exit; |
|
11 | - } |
|
12 | - require('../require/class.Spotter.php'); |
|
13 | - $Spotter = new Spotter(); |
|
14 | - $Spotter->updateArrivalAirports(); |
|
7 | + require_once('../require/settings.php'); |
|
8 | + if ($globalInstalled) { |
|
9 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
10 | + exit; |
|
11 | + } |
|
12 | + require('../require/class.Spotter.php'); |
|
13 | + $Spotter = new Spotter(); |
|
14 | + $Spotter->updateArrivalAirports(); |
|
15 | 15 | |
16 | 16 | ?> |
17 | 17 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $Common = new Common(); |
13 | 13 | $settings_filename = '../require/settings.php'; |
14 | 14 | $content = file_get_contents($settings_filename); |
15 | - $fh = fopen($settings_filename,'w'); |
|
15 | + $fh = fopen($settings_filename, 'w'); |
|
16 | 16 | foreach ($settings as $settingname => $value) { |
17 | 17 | if ($value == 'TRUE' || $value == 'FALSE') { |
18 | 18 | $pattern = '/\R\$'.$settingname." = ".'(TRUE|FALSE)'."/"; |
@@ -78,21 +78,21 @@ discard block |
||
78 | 78 | $replace = "\n".'\$'.$settingname." = '".$value."'"; |
79 | 79 | } |
80 | 80 | $rep_cnt = 0; |
81 | - $content = preg_replace($pattern,$replace,$content,1,$rep_cnt); |
|
81 | + $content = preg_replace($pattern, $replace, $content, 1, $rep_cnt); |
|
82 | 82 | |
83 | 83 | /// If setting was a string and is now an array |
84 | 84 | if ($rep_cnt == 0 && is_array($value)) { |
85 | 85 | $pattern = '/\R\$'.$settingname." = '".'(.*)'."'/"; |
86 | - $content = preg_replace($pattern,$replace,$content,1,$rep_cnt); |
|
86 | + $content = preg_replace($pattern, $replace, $content, 1, $rep_cnt); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | // If setting is not in settings.php (for update) |
90 | 90 | if ($rep_cnt == 0) { |
91 | - $content = preg_replace('/\?>/',$replace.";\n?>",$content,1,$rep_cnt); |
|
91 | + $content = preg_replace('/\?>/', $replace.";\n?>", $content, 1, $rep_cnt); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | } |
95 | - fwrite($fh,$content); |
|
95 | + fwrite($fh, $content); |
|
96 | 96 | fclose($fh); |
97 | 97 | } |
98 | 98 | |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | $Common = new Common(); |
105 | 105 | $settings_filename = '../require/settings.php'; |
106 | 106 | $content = file_get_contents($settings_filename); |
107 | - $fh = fopen($settings_filename,'w'); |
|
107 | + $fh = fopen($settings_filename, 'w'); |
|
108 | 108 | foreach ($settings as $settingname) { |
109 | 109 | $pattern = '/\R\$'.$settingname." = /"; |
110 | 110 | $replace = '//$'.$settingname." = "; |
111 | - $content = preg_replace($pattern,$replace,$content); |
|
111 | + $content = preg_replace($pattern, $replace, $content); |
|
112 | 112 | } |
113 | - fwrite($fh,$content); |
|
113 | + fwrite($fh, $content); |
|
114 | 114 | fclose($fh); |
115 | 115 | } |
116 | 116 | } |
@@ -54,7 +54,9 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | if (!isset($array_value)) { |
57 | - if (!isset($arrayd_value)) $arrayd_value = ''; |
|
57 | + if (!isset($arrayd_value)) { |
|
58 | + $arrayd_value = ''; |
|
59 | + } |
|
58 | 60 | //$array_value = "'".$key."' => array(".$arrayd_value.")"; |
59 | 61 | $array_value = "array(".$arrayd_value.")"; |
60 | 62 | } elseif (isset($arrayd_value)) { |
@@ -71,7 +73,9 @@ discard block |
||
71 | 73 | } |
72 | 74 | } |
73 | 75 | } |
74 | - if (!isset($array_value)) $array_value = ''; |
|
76 | + if (!isset($array_value)) { |
|
77 | + $array_value = ''; |
|
78 | + } |
|
75 | 79 | $replace = "\n".'\$'.$settingname." = array(".$array_value.")"; |
76 | 80 | unset($array_value); |
77 | 81 | } else { |