@@ -12,221 +12,221 @@ |
||
12 | 12 | */ |
13 | 13 | class Predict_TLE |
14 | 14 | { |
15 | - public $header; /* Header line of TLE file */ |
|
16 | - public $line1; /* Line 1 of TLE */ |
|
17 | - public $line2; /* Line 2 of TLE */ |
|
18 | - public $epoch; /*!< Epoch Time in NORAD TLE format YYDDD.FFFFFFFF */ |
|
19 | - public $epoch_year; /*!< Epoch: year */ |
|
20 | - public $epoch_day; /*!< Epoch: day of year */ |
|
21 | - public $epoch_fod; /*!< Epoch: Fraction of day. */ |
|
22 | - public $xndt2o; /*!< 1. time derivative of mean motion */ |
|
23 | - public $xndd6o; /*!< 2. time derivative of mean motion */ |
|
24 | - public $bstar; /*!< Bstar drag coefficient. */ |
|
25 | - public $xincl; /*!< Inclination */ |
|
26 | - public $xnodeo; /*!< R.A.A.N. */ |
|
27 | - public $eo; /*!< Eccentricity */ |
|
28 | - public $omegao; /*!< argument of perigee */ |
|
29 | - public $xmo; /*!< mean anomaly */ |
|
30 | - public $xno; /*!< mean motion */ |
|
31 | - |
|
32 | - public $catnr; /*!< Catalogue Number. */ |
|
33 | - public $elset; /*!< Element Set number. */ |
|
34 | - public $revnum; /*!< Revolution Number at epoch. */ |
|
35 | - |
|
36 | - public $sat_name; /*!< Satellite name string. */ |
|
37 | - public $idesg; /*!< International Designator. */ |
|
38 | - public $status; /*!< Operational status. */ |
|
39 | - |
|
40 | - /* values needed for squint calculations */ |
|
41 | - public $xincl1; |
|
42 | - public $xnodeo1; |
|
43 | - public $omegao1; |
|
44 | - |
|
45 | - |
|
46 | - /* Converts the strings in a raw two-line element set */ |
|
47 | - /* to their intended numerical values. No processing */ |
|
48 | - /* of these values is done, e.g. from deg to rads etc. */ |
|
49 | - /* This is done in the select_ephemeris() function. */ |
|
50 | - public function __construct($header, $line1, $line2) |
|
51 | - { |
|
52 | - if (!$this->Good_Elements($line1, $line2)) { |
|
53 | - throw new Predict_Exception('Invalid TLE contents'); |
|
54 | - } |
|
55 | - |
|
56 | - $this->header = $header; |
|
57 | - $this->line1 = $line1; |
|
58 | - $this->line2 = $line2; |
|
59 | - |
|
60 | - /** Decode Card 1 **/ |
|
61 | - /* Satellite's catalogue number */ |
|
62 | - $this->catnr = (int) substr($line1, 2, 5); |
|
63 | - |
|
64 | - /* International Designator for satellite */ |
|
65 | - $this->idesg = substr($line1, 9, 8); |
|
66 | - |
|
67 | - /* Epoch time; this is the complete, unconverted epoch. */ |
|
68 | - /* Replace spaces with 0 before casting, as leading spaces are allowed */ |
|
69 | - $this->epoch = (float) str_replace(' ', '0', substr($line1, 18, 14)); |
|
70 | - |
|
71 | - /* Now, convert the epoch time into year, day |
|
15 | + public $header; /* Header line of TLE file */ |
|
16 | + public $line1; /* Line 1 of TLE */ |
|
17 | + public $line2; /* Line 2 of TLE */ |
|
18 | + public $epoch; /*!< Epoch Time in NORAD TLE format YYDDD.FFFFFFFF */ |
|
19 | + public $epoch_year; /*!< Epoch: year */ |
|
20 | + public $epoch_day; /*!< Epoch: day of year */ |
|
21 | + public $epoch_fod; /*!< Epoch: Fraction of day. */ |
|
22 | + public $xndt2o; /*!< 1. time derivative of mean motion */ |
|
23 | + public $xndd6o; /*!< 2. time derivative of mean motion */ |
|
24 | + public $bstar; /*!< Bstar drag coefficient. */ |
|
25 | + public $xincl; /*!< Inclination */ |
|
26 | + public $xnodeo; /*!< R.A.A.N. */ |
|
27 | + public $eo; /*!< Eccentricity */ |
|
28 | + public $omegao; /*!< argument of perigee */ |
|
29 | + public $xmo; /*!< mean anomaly */ |
|
30 | + public $xno; /*!< mean motion */ |
|
31 | + |
|
32 | + public $catnr; /*!< Catalogue Number. */ |
|
33 | + public $elset; /*!< Element Set number. */ |
|
34 | + public $revnum; /*!< Revolution Number at epoch. */ |
|
35 | + |
|
36 | + public $sat_name; /*!< Satellite name string. */ |
|
37 | + public $idesg; /*!< International Designator. */ |
|
38 | + public $status; /*!< Operational status. */ |
|
39 | + |
|
40 | + /* values needed for squint calculations */ |
|
41 | + public $xincl1; |
|
42 | + public $xnodeo1; |
|
43 | + public $omegao1; |
|
44 | + |
|
45 | + |
|
46 | + /* Converts the strings in a raw two-line element set */ |
|
47 | + /* to their intended numerical values. No processing */ |
|
48 | + /* of these values is done, e.g. from deg to rads etc. */ |
|
49 | + /* This is done in the select_ephemeris() function. */ |
|
50 | + public function __construct($header, $line1, $line2) |
|
51 | + { |
|
52 | + if (!$this->Good_Elements($line1, $line2)) { |
|
53 | + throw new Predict_Exception('Invalid TLE contents'); |
|
54 | + } |
|
55 | + |
|
56 | + $this->header = $header; |
|
57 | + $this->line1 = $line1; |
|
58 | + $this->line2 = $line2; |
|
59 | + |
|
60 | + /** Decode Card 1 **/ |
|
61 | + /* Satellite's catalogue number */ |
|
62 | + $this->catnr = (int) substr($line1, 2, 5); |
|
63 | + |
|
64 | + /* International Designator for satellite */ |
|
65 | + $this->idesg = substr($line1, 9, 8); |
|
66 | + |
|
67 | + /* Epoch time; this is the complete, unconverted epoch. */ |
|
68 | + /* Replace spaces with 0 before casting, as leading spaces are allowed */ |
|
69 | + $this->epoch = (float) str_replace(' ', '0', substr($line1, 18, 14)); |
|
70 | + |
|
71 | + /* Now, convert the epoch time into year, day |
|
72 | 72 | and fraction of day, according to: |
73 | 73 | |
74 | 74 | YYDDD.FFFFFFFF |
75 | 75 | */ |
76 | 76 | |
77 | - // Adjust for 2 digit year through 2056 |
|
78 | - $this->epoch_year = (int) substr($line1, 18, 2); |
|
79 | - if ($this->epoch_year > 56) { |
|
80 | - $this->epoch_year = $this->epoch_year + 1900; |
|
81 | - } else { |
|
82 | - $this->epoch_year = $this->epoch_year + 2000; |
|
83 | - } |
|
77 | + // Adjust for 2 digit year through 2056 |
|
78 | + $this->epoch_year = (int) substr($line1, 18, 2); |
|
79 | + if ($this->epoch_year > 56) { |
|
80 | + $this->epoch_year = $this->epoch_year + 1900; |
|
81 | + } else { |
|
82 | + $this->epoch_year = $this->epoch_year + 2000; |
|
83 | + } |
|
84 | 84 | |
85 | - /* Epoch day */ |
|
86 | - $this->epoch_day = (int) substr($line1, 20, 3); |
|
85 | + /* Epoch day */ |
|
86 | + $this->epoch_day = (int) substr($line1, 20, 3); |
|
87 | 87 | |
88 | - /* Epoch fraction of day */ |
|
89 | - $this->epoch_fod = (float) substr($line1, 23, 9); |
|
88 | + /* Epoch fraction of day */ |
|
89 | + $this->epoch_fod = (float) substr($line1, 23, 9); |
|
90 | 90 | |
91 | 91 | |
92 | - /* Satellite's First Time Derivative */ |
|
93 | - $this->xndt2o = (float) substr($line1, 33, 10); |
|
92 | + /* Satellite's First Time Derivative */ |
|
93 | + $this->xndt2o = (float) substr($line1, 33, 10); |
|
94 | 94 | |
95 | - /* Satellite's Second Time Derivative */ |
|
96 | - $this->xndd6o = (float) (substr($line1, 44, 1) . '.' . substr($line1, 45, 5) . 'E' . substr($line1, 50, 2)); |
|
95 | + /* Satellite's Second Time Derivative */ |
|
96 | + $this->xndd6o = (float) (substr($line1, 44, 1) . '.' . substr($line1, 45, 5) . 'E' . substr($line1, 50, 2)); |
|
97 | 97 | |
98 | - /* Satellite's bstar drag term |
|
98 | + /* Satellite's bstar drag term |
|
99 | 99 | FIXME: How about buff[0] ???? |
100 | 100 | */ |
101 | - $this->bstar = (float) (substr($line1, 53, 1) . '.' . substr($line1, 54, 5) . 'E' . substr($line1, 59, 2)); |
|
101 | + $this->bstar = (float) (substr($line1, 53, 1) . '.' . substr($line1, 54, 5) . 'E' . substr($line1, 59, 2)); |
|
102 | 102 | |
103 | - /* Element Number */ |
|
104 | - $this->elset = (int) substr($line1, 64, 4); |
|
103 | + /* Element Number */ |
|
104 | + $this->elset = (int) substr($line1, 64, 4); |
|
105 | 105 | |
106 | - /** Decode Card 2 **/ |
|
107 | - /* Satellite's Orbital Inclination (degrees) */ |
|
108 | - $this->xincl = (float) substr($line2, 8, 8); |
|
106 | + /** Decode Card 2 **/ |
|
107 | + /* Satellite's Orbital Inclination (degrees) */ |
|
108 | + $this->xincl = (float) substr($line2, 8, 8); |
|
109 | 109 | |
110 | - /* Satellite's RAAN (degrees) */ |
|
111 | - $this->xnodeo = (float) substr($line2, 17, 8); |
|
110 | + /* Satellite's RAAN (degrees) */ |
|
111 | + $this->xnodeo = (float) substr($line2, 17, 8); |
|
112 | 112 | |
113 | - /* Satellite's Orbital Eccentricity */ |
|
114 | - $this->eo = (float) ('.' . substr($line2, 26, 7)); |
|
113 | + /* Satellite's Orbital Eccentricity */ |
|
114 | + $this->eo = (float) ('.' . substr($line2, 26, 7)); |
|
115 | 115 | |
116 | - /* Satellite's Argument of Perigee (degrees) */ |
|
117 | - $this->omegao = (float) substr($line2, 34, 8); |
|
116 | + /* Satellite's Argument of Perigee (degrees) */ |
|
117 | + $this->omegao = (float) substr($line2, 34, 8); |
|
118 | 118 | |
119 | - /* Satellite's Mean Anomaly of Orbit (degrees) */ |
|
120 | - $this->xmo = (float) substr($line2, 43, 8); |
|
119 | + /* Satellite's Mean Anomaly of Orbit (degrees) */ |
|
120 | + $this->xmo = (float) substr($line2, 43, 8); |
|
121 | 121 | |
122 | - /* Satellite's Mean Motion (rev/day) */ |
|
123 | - $this->xno = (float) substr($line2, 52, 11); |
|
122 | + /* Satellite's Mean Motion (rev/day) */ |
|
123 | + $this->xno = (float) substr($line2, 52, 11); |
|
124 | 124 | |
125 | - /* Satellite's Revolution number at epoch */ |
|
126 | - $this->revnum = (float) substr($line2, 63, 5); |
|
127 | - } |
|
125 | + /* Satellite's Revolution number at epoch */ |
|
126 | + $this->revnum = (float) substr($line2, 63, 5); |
|
127 | + } |
|
128 | 128 | |
129 | - /* Calculates the checksum mod 10 of a line from a TLE set and */ |
|
130 | - /* returns true if it compares with checksum in column 68, else false.*/ |
|
131 | - /* tle_set is a character string holding the two lines read */ |
|
132 | - /* from a text file containing NASA format Keplerian elements. */ |
|
133 | - /* NOTE!!! The stuff about two lines is not quite true. |
|
129 | + /* Calculates the checksum mod 10 of a line from a TLE set and */ |
|
130 | + /* returns true if it compares with checksum in column 68, else false.*/ |
|
131 | + /* tle_set is a character string holding the two lines read */ |
|
132 | + /* from a text file containing NASA format Keplerian elements. */ |
|
133 | + /* NOTE!!! The stuff about two lines is not quite true. |
|
134 | 134 | The function assumes that tle_set[0] is the begining |
135 | 135 | of the line and that there are 68 elements - see the consumer |
136 | 136 | */ |
137 | - public function Checksum_Good($tle_set) |
|
138 | - { |
|
139 | - if (strlen($tle_set) < 69) { |
|
140 | - return false; |
|
141 | - } |
|
142 | - |
|
143 | - $checksum = 0; |
|
144 | - |
|
145 | - for ($i = 0; $i < 68; $i++) { |
|
146 | - if (($tle_set[$i] >= '0') && ($tle_set[$i] <= '9')) { |
|
147 | - $value = $tle_set[$i] - '0'; |
|
148 | - } else if ($tle_set[$i] == '-' ) { |
|
149 | - $value = 1; |
|
150 | - } else { |
|
151 | - $value = 0; |
|
152 | - } |
|
153 | - |
|
154 | - $checksum += $value; |
|
155 | - } |
|
156 | - |
|
157 | - $checksum %= 10; |
|
158 | - $check_digit = $tle_set[68] - '0'; |
|
159 | - |
|
160 | - return $checksum == $check_digit; |
|
161 | - } |
|
162 | - |
|
163 | - /* Carries out various checks on a TLE set to verify its validity */ |
|
164 | - /* $line1 is the first line of the TLE, $line2 is the second line */ |
|
165 | - /* from a text file containing NASA format Keplerian elements. */ |
|
166 | - public function Good_Elements($line1, $line2) |
|
167 | - { |
|
168 | - /* Verify checksum of both lines of a TLE set */ |
|
169 | - if (!$this->Checksum_Good($line1) || !$this->Checksum_Good($line2)) { |
|
170 | - return false; |
|
171 | - } |
|
172 | - |
|
173 | - /* Check the line number of each line */ |
|
174 | - if (($line1[0] != '1') || ($line2[0] != '2')) { |
|
175 | - return false; |
|
176 | - } |
|
177 | - |
|
178 | - /* Verify that Satellite Number is same in both lines */ |
|
179 | - if (strncmp($line1[2], $line2[2], 5) != 0) { |
|
180 | - return false; |
|
181 | - } |
|
182 | - |
|
183 | - /* Check that various elements are in the right place */ |
|
184 | - if (($line1[23] != '.') || |
|
185 | - ($line1[34] != '.') || |
|
186 | - ($line2[11] != '.') || |
|
187 | - ($line2[20] != '.') || |
|
188 | - ($line2[37] != '.') || |
|
189 | - ($line2[46] != '.') || |
|
190 | - ($line2[54] != '.') || |
|
191 | - (strncmp(substr($line1, 61), ' 0 ', 3) != 0)) { |
|
192 | - |
|
193 | - return false; |
|
194 | - } |
|
195 | - |
|
196 | - return true; |
|
197 | - } |
|
198 | - |
|
199 | - /** |
|
200 | - * A function to allow checksum creation of a line. This is driven by |
|
201 | - * the fact that some TLEs from SpaceTrack are missing checksum numbers. |
|
202 | - * You can use this to create a checksum for a line, but you should |
|
203 | - * probably have confidence that the TLE data itself is good. YMMV. |
|
204 | - * |
|
205 | - * @throws Predict_Exception if the line is not exactly 68 chars |
|
206 | - * @return string |
|
207 | - */ |
|
208 | - static public function createChecksum($line) |
|
209 | - { |
|
210 | - if (strlen($line) != 68) { |
|
211 | - throw Predict_Exception('Invalid line, needs to e 68 chars'); |
|
212 | - } |
|
213 | - |
|
214 | - $checksum = 0; |
|
215 | - |
|
216 | - for ($i = 0; $i < 68; $i++) { |
|
217 | - if (($line[$i] >= '0') && ($line[$i] <= '9')) { |
|
218 | - $value = (int) $line[$i]; |
|
219 | - } else if ($line[$i] == '-' ) { |
|
220 | - $value = 1; |
|
221 | - } else { |
|
222 | - $value = 0; |
|
223 | - } |
|
224 | - |
|
225 | - $checksum += $value; |
|
226 | - } |
|
227 | - |
|
228 | - $checksum %= 10; |
|
229 | - |
|
230 | - return $checksum; |
|
231 | - } |
|
137 | + public function Checksum_Good($tle_set) |
|
138 | + { |
|
139 | + if (strlen($tle_set) < 69) { |
|
140 | + return false; |
|
141 | + } |
|
142 | + |
|
143 | + $checksum = 0; |
|
144 | + |
|
145 | + for ($i = 0; $i < 68; $i++) { |
|
146 | + if (($tle_set[$i] >= '0') && ($tle_set[$i] <= '9')) { |
|
147 | + $value = $tle_set[$i] - '0'; |
|
148 | + } else if ($tle_set[$i] == '-' ) { |
|
149 | + $value = 1; |
|
150 | + } else { |
|
151 | + $value = 0; |
|
152 | + } |
|
153 | + |
|
154 | + $checksum += $value; |
|
155 | + } |
|
156 | + |
|
157 | + $checksum %= 10; |
|
158 | + $check_digit = $tle_set[68] - '0'; |
|
159 | + |
|
160 | + return $checksum == $check_digit; |
|
161 | + } |
|
162 | + |
|
163 | + /* Carries out various checks on a TLE set to verify its validity */ |
|
164 | + /* $line1 is the first line of the TLE, $line2 is the second line */ |
|
165 | + /* from a text file containing NASA format Keplerian elements. */ |
|
166 | + public function Good_Elements($line1, $line2) |
|
167 | + { |
|
168 | + /* Verify checksum of both lines of a TLE set */ |
|
169 | + if (!$this->Checksum_Good($line1) || !$this->Checksum_Good($line2)) { |
|
170 | + return false; |
|
171 | + } |
|
172 | + |
|
173 | + /* Check the line number of each line */ |
|
174 | + if (($line1[0] != '1') || ($line2[0] != '2')) { |
|
175 | + return false; |
|
176 | + } |
|
177 | + |
|
178 | + /* Verify that Satellite Number is same in both lines */ |
|
179 | + if (strncmp($line1[2], $line2[2], 5) != 0) { |
|
180 | + return false; |
|
181 | + } |
|
182 | + |
|
183 | + /* Check that various elements are in the right place */ |
|
184 | + if (($line1[23] != '.') || |
|
185 | + ($line1[34] != '.') || |
|
186 | + ($line2[11] != '.') || |
|
187 | + ($line2[20] != '.') || |
|
188 | + ($line2[37] != '.') || |
|
189 | + ($line2[46] != '.') || |
|
190 | + ($line2[54] != '.') || |
|
191 | + (strncmp(substr($line1, 61), ' 0 ', 3) != 0)) { |
|
192 | + |
|
193 | + return false; |
|
194 | + } |
|
195 | + |
|
196 | + return true; |
|
197 | + } |
|
198 | + |
|
199 | + /** |
|
200 | + * A function to allow checksum creation of a line. This is driven by |
|
201 | + * the fact that some TLEs from SpaceTrack are missing checksum numbers. |
|
202 | + * You can use this to create a checksum for a line, but you should |
|
203 | + * probably have confidence that the TLE data itself is good. YMMV. |
|
204 | + * |
|
205 | + * @throws Predict_Exception if the line is not exactly 68 chars |
|
206 | + * @return string |
|
207 | + */ |
|
208 | + static public function createChecksum($line) |
|
209 | + { |
|
210 | + if (strlen($line) != 68) { |
|
211 | + throw Predict_Exception('Invalid line, needs to e 68 chars'); |
|
212 | + } |
|
213 | + |
|
214 | + $checksum = 0; |
|
215 | + |
|
216 | + for ($i = 0; $i < 68; $i++) { |
|
217 | + if (($line[$i] >= '0') && ($line[$i] <= '9')) { |
|
218 | + $value = (int) $line[$i]; |
|
219 | + } else if ($line[$i] == '-' ) { |
|
220 | + $value = 1; |
|
221 | + } else { |
|
222 | + $value = 0; |
|
223 | + } |
|
224 | + |
|
225 | + $checksum += $value; |
|
226 | + } |
|
227 | + |
|
228 | + $checksum %= 10; |
|
229 | + |
|
230 | + return $checksum; |
|
231 | + } |
|
232 | 232 | } |
@@ -12,30 +12,30 @@ discard block |
||
12 | 12 | */ |
13 | 13 | class Predict_TLE |
14 | 14 | { |
15 | - public $header; /* Header line of TLE file */ |
|
16 | - public $line1; /* Line 1 of TLE */ |
|
17 | - public $line2; /* Line 2 of TLE */ |
|
18 | - public $epoch; /*!< Epoch Time in NORAD TLE format YYDDD.FFFFFFFF */ |
|
15 | + public $header; /* Header line of TLE file */ |
|
16 | + public $line1; /* Line 1 of TLE */ |
|
17 | + public $line2; /* Line 2 of TLE */ |
|
18 | + public $epoch; /*!< Epoch Time in NORAD TLE format YYDDD.FFFFFFFF */ |
|
19 | 19 | public $epoch_year; /*!< Epoch: year */ |
20 | - public $epoch_day; /*!< Epoch: day of year */ |
|
21 | - public $epoch_fod; /*!< Epoch: Fraction of day. */ |
|
22 | - public $xndt2o; /*!< 1. time derivative of mean motion */ |
|
23 | - public $xndd6o; /*!< 2. time derivative of mean motion */ |
|
24 | - public $bstar; /*!< Bstar drag coefficient. */ |
|
25 | - public $xincl; /*!< Inclination */ |
|
26 | - public $xnodeo; /*!< R.A.A.N. */ |
|
27 | - public $eo; /*!< Eccentricity */ |
|
28 | - public $omegao; /*!< argument of perigee */ |
|
29 | - public $xmo; /*!< mean anomaly */ |
|
30 | - public $xno; /*!< mean motion */ |
|
31 | - |
|
32 | - public $catnr; /*!< Catalogue Number. */ |
|
33 | - public $elset; /*!< Element Set number. */ |
|
34 | - public $revnum; /*!< Revolution Number at epoch. */ |
|
35 | - |
|
36 | - public $sat_name; /*!< Satellite name string. */ |
|
37 | - public $idesg; /*!< International Designator. */ |
|
38 | - public $status; /*!< Operational status. */ |
|
20 | + public $epoch_day; /*!< Epoch: day of year */ |
|
21 | + public $epoch_fod; /*!< Epoch: Fraction of day. */ |
|
22 | + public $xndt2o; /*!< 1. time derivative of mean motion */ |
|
23 | + public $xndd6o; /*!< 2. time derivative of mean motion */ |
|
24 | + public $bstar; /*!< Bstar drag coefficient. */ |
|
25 | + public $xincl; /*!< Inclination */ |
|
26 | + public $xnodeo; /*!< R.A.A.N. */ |
|
27 | + public $eo; /*!< Eccentricity */ |
|
28 | + public $omegao; /*!< argument of perigee */ |
|
29 | + public $xmo; /*!< mean anomaly */ |
|
30 | + public $xno; /*!< mean motion */ |
|
31 | + |
|
32 | + public $catnr; /*!< Catalogue Number. */ |
|
33 | + public $elset; /*!< Element Set number. */ |
|
34 | + public $revnum; /*!< Revolution Number at epoch. */ |
|
35 | + |
|
36 | + public $sat_name; /*!< Satellite name string. */ |
|
37 | + public $idesg; /*!< International Designator. */ |
|
38 | + public $status; /*!< Operational status. */ |
|
39 | 39 | |
40 | 40 | /* values needed for squint calculations */ |
41 | 41 | public $xincl1; |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | $this->xndt2o = (float) substr($line1, 33, 10); |
94 | 94 | |
95 | 95 | /* Satellite's Second Time Derivative */ |
96 | - $this->xndd6o = (float) (substr($line1, 44, 1) . '.' . substr($line1, 45, 5) . 'E' . substr($line1, 50, 2)); |
|
96 | + $this->xndd6o = (float) (substr($line1, 44, 1).'.'.substr($line1, 45, 5).'E'.substr($line1, 50, 2)); |
|
97 | 97 | |
98 | 98 | /* Satellite's bstar drag term |
99 | 99 | FIXME: How about buff[0] ???? |
100 | 100 | */ |
101 | - $this->bstar = (float) (substr($line1, 53, 1) . '.' . substr($line1, 54, 5) . 'E' . substr($line1, 59, 2)); |
|
101 | + $this->bstar = (float) (substr($line1, 53, 1).'.'.substr($line1, 54, 5).'E'.substr($line1, 59, 2)); |
|
102 | 102 | |
103 | 103 | /* Element Number */ |
104 | 104 | $this->elset = (int) substr($line1, 64, 4); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $this->xnodeo = (float) substr($line2, 17, 8); |
112 | 112 | |
113 | 113 | /* Satellite's Orbital Eccentricity */ |
114 | - $this->eo = (float) ('.' . substr($line2, 26, 7)); |
|
114 | + $this->eo = (float) ('.'.substr($line2, 26, 7)); |
|
115 | 115 | |
116 | 116 | /* Satellite's Argument of Perigee (degrees) */ |
117 | 117 | $this->omegao = (float) substr($line2, 34, 8); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | for ($i = 0; $i < 68; $i++) { |
146 | 146 | if (($tle_set[$i] >= '0') && ($tle_set[$i] <= '9')) { |
147 | 147 | $value = $tle_set[$i] - '0'; |
148 | - } else if ($tle_set[$i] == '-' ) { |
|
148 | + } else if ($tle_set[$i] == '-') { |
|
149 | 149 | $value = 1; |
150 | 150 | } else { |
151 | 151 | $value = 0; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | for ($i = 0; $i < 68; $i++) { |
217 | 217 | if (($line[$i] >= '0') && ($line[$i] <= '9')) { |
218 | 218 | $value = (int) $line[$i]; |
219 | - } else if ($line[$i] == '-' ) { |
|
219 | + } else if ($line[$i] == '-') { |
|
220 | 220 | $value = 1; |
221 | 221 | } else { |
222 | 222 | $value = 0; |
@@ -6,8 +6,8 @@ |
||
6 | 6 | */ |
7 | 7 | class Predict_Geodetic |
8 | 8 | { |
9 | - public $lat; /*!< Lattitude [rad] */ |
|
10 | - public $lon; /*!< Longitude [rad] */ |
|
11 | - public $alt; /*!< Altitude [km] */ |
|
12 | - public $theta; |
|
9 | + public $lat; /*!< Lattitude [rad] */ |
|
10 | + public $lon; /*!< Longitude [rad] */ |
|
11 | + public $alt; /*!< Altitude [km] */ |
|
12 | + public $theta; |
|
13 | 13 | } |
@@ -8,32 +8,32 @@ |
||
8 | 8 | */ |
9 | 9 | class Predict_SGSDPStatic |
10 | 10 | { |
11 | - public $aodp; |
|
12 | - public $aycof; |
|
13 | - public $c1; |
|
14 | - public $c4; |
|
15 | - public $c5; |
|
16 | - public $cosio; |
|
17 | - public $d2; |
|
18 | - public $d3; |
|
19 | - public $d4; |
|
20 | - public $delmo; |
|
21 | - public $omgcof; |
|
22 | - public $eta; |
|
23 | - public $omgdot; |
|
24 | - public $sinio; |
|
25 | - public $xnodp; |
|
26 | - public $sinmo; |
|
27 | - public $t2cof; |
|
28 | - public $t3cof; |
|
29 | - public $t4cof; |
|
30 | - public $t5cof; |
|
31 | - public $x1mth2; |
|
32 | - public $x3thm1; |
|
33 | - public $x7thm1; |
|
34 | - public $xmcof; |
|
35 | - public $xmdot; |
|
36 | - public $xnodcf; |
|
37 | - public $xnodot; |
|
38 | - public $xlcof; |
|
11 | + public $aodp; |
|
12 | + public $aycof; |
|
13 | + public $c1; |
|
14 | + public $c4; |
|
15 | + public $c5; |
|
16 | + public $cosio; |
|
17 | + public $d2; |
|
18 | + public $d3; |
|
19 | + public $d4; |
|
20 | + public $delmo; |
|
21 | + public $omgcof; |
|
22 | + public $eta; |
|
23 | + public $omgdot; |
|
24 | + public $sinio; |
|
25 | + public $xnodp; |
|
26 | + public $sinmo; |
|
27 | + public $t2cof; |
|
28 | + public $t3cof; |
|
29 | + public $t4cof; |
|
30 | + public $t5cof; |
|
31 | + public $x1mth2; |
|
32 | + public $x3thm1; |
|
33 | + public $x7thm1; |
|
34 | + public $xmcof; |
|
35 | + public $xmdot; |
|
36 | + public $xnodcf; |
|
37 | + public $xnodot; |
|
38 | + public $xlcof; |
|
39 | 39 | } |
@@ -7,14 +7,14 @@ |
||
7 | 7 | */ |
8 | 8 | class Predict_QTH |
9 | 9 | { |
10 | - public $name; /*!< Name, eg. callsign. */ |
|
11 | - public $loc; /*!< Location, eg City, Country. */ |
|
12 | - public $desc; /*!< Short description. */ |
|
13 | - public $lat; /*!< Latitude in dec. deg. North. */ |
|
14 | - public $lon; /*!< Longitude in dec. deg. East. */ |
|
15 | - public $alt; /*!< Altitude above sea level in meters. */ |
|
16 | - public $qra; /*!< QRA locator */ |
|
17 | - public $wx; /*!< Weather station code (4 chars). */ |
|
10 | + public $name; /*!< Name, eg. callsign. */ |
|
11 | + public $loc; /*!< Location, eg City, Country. */ |
|
12 | + public $desc; /*!< Short description. */ |
|
13 | + public $lat; /*!< Latitude in dec. deg. North. */ |
|
14 | + public $lon; /*!< Longitude in dec. deg. East. */ |
|
15 | + public $alt; /*!< Altitude above sea level in meters. */ |
|
16 | + public $qra; /*!< QRA locator */ |
|
17 | + public $wx; /*!< Weather station code (4 chars). */ |
|
18 | 18 | |
19 | - public $data; /*!< Raw data from cfg file. */ |
|
19 | + public $data; /*!< Raw data from cfg file. */ |
|
20 | 20 | } |
@@ -7,14 +7,14 @@ |
||
7 | 7 | */ |
8 | 8 | class Predict_QTH |
9 | 9 | { |
10 | - public $name; /*!< Name, eg. callsign. */ |
|
11 | - public $loc; /*!< Location, eg City, Country. */ |
|
12 | - public $desc; /*!< Short description. */ |
|
13 | - public $lat; /*!< Latitude in dec. deg. North. */ |
|
14 | - public $lon; /*!< Longitude in dec. deg. East. */ |
|
15 | - public $alt; /*!< Altitude above sea level in meters. */ |
|
16 | - public $qra; /*!< QRA locator */ |
|
17 | - public $wx; /*!< Weather station code (4 chars). */ |
|
10 | + public $name; /*!< Name, eg. callsign. */ |
|
11 | + public $loc; /*!< Location, eg City, Country. */ |
|
12 | + public $desc; /*!< Short description. */ |
|
13 | + public $lat; /*!< Latitude in dec. deg. North. */ |
|
14 | + public $lon; /*!< Longitude in dec. deg. East. */ |
|
15 | + public $alt; /*!< Altitude above sea level in meters. */ |
|
16 | + public $qra; /*!< QRA locator */ |
|
17 | + public $wx; /*!< Weather station code (4 chars). */ |
|
18 | 18 | |
19 | - public $data; /*!< Raw data from cfg file. */ |
|
19 | + public $data; /*!< Raw data from cfg file. */ |
|
20 | 20 | } |
@@ -6,8 +6,8 @@ |
||
6 | 6 | */ |
7 | 7 | class Predict_Vector |
8 | 8 | { |
9 | - public $x = 0; |
|
10 | - public $y = 0; |
|
11 | - public $z = 0; |
|
12 | - public $w = 0; |
|
9 | + public $x = 0; |
|
10 | + public $y = 0; |
|
11 | + public $z = 0; |
|
12 | + public $w = 0; |
|
13 | 13 | } |
@@ -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,27 +63,27 @@ 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 = 37.790252; |
89 | 89 | $qth->lon = -122.419968; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $tle_file = $this->get_tle($name); |
92 | 92 | //print_r($tle_file); |
93 | 93 | $type = $tle_file['tle_type']; |
94 | - $tle = new Predict_TLE($tle_file['tle_name'],$tle_file['tle_tle1'],$tle_file['tle_tle2']); |
|
94 | + $tle = new Predict_TLE($tle_file['tle_name'], $tle_file['tle_tle1'], $tle_file['tle_tle2']); |
|
95 | 95 | $sat = new Predict_Sat($tle); |
96 | 96 | $predict = new Predict(); |
97 | 97 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | if ($timestamp_end == '') { |
100 | 100 | $now = Predict_Time::unix2daynum($timestamp_begin); |
101 | 101 | //echo $now; |
102 | - $predict->predict_calc($sat,$qth,$now); |
|
103 | - return array('name' => $name, 'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp_begin,'type' => $type); |
|
102 | + $predict->predict_calc($sat, $qth, $now); |
|
103 | + return array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp_begin, 'type' => $type); |
|
104 | 104 | } else { |
105 | - for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp=$timestamp+$second) { |
|
105 | + for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp = $timestamp + $second) { |
|
106 | 106 | //echo $timestamp."\n"; |
107 | 107 | $now = Predict_Time::unix2daynum($timestamp); |
108 | 108 | //echo $now; |
109 | - $predict->predict_calc($sat,$qth,$now); |
|
110 | - $result[] = array('name' => $name,'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp,'type' => $type); |
|
109 | + $predict->predict_calc($sat, $qth, $now); |
|
110 | + $result[] = array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp, 'type' => $type); |
|
111 | 111 | } |
112 | 112 | return $result; |
113 | 113 | } |
@@ -23,8 +23,11 @@ discard block |
||
23 | 23 | echo $e->getMessage(); |
24 | 24 | } |
25 | 25 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
26 | - if (isset($result[0])) return $result[0]; |
|
27 | - else return array(); |
|
26 | + if (isset($result[0])) { |
|
27 | + return $result[0]; |
|
28 | + } else { |
|
29 | + return array(); |
|
30 | + } |
|
28 | 31 | } |
29 | 32 | public function get_tle_types() { |
30 | 33 | $query = 'SELECT DISTINCT tle_type FROM tle ORDER BY tle_type'; |
@@ -35,8 +38,11 @@ discard block |
||
35 | 38 | echo $e->getMessage(); |
36 | 39 | } |
37 | 40 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
38 | - if (isset($result[0])) return $result; |
|
39 | - else return array(); |
|
41 | + if (isset($result[0])) { |
|
42 | + return $result; |
|
43 | + } else { |
|
44 | + return array(); |
|
45 | + } |
|
40 | 46 | } |
41 | 47 | public function get_tle_names() { |
42 | 48 | $query = 'SELECT DISTINCT tle_name, tle_type FROM tle'; |
@@ -47,8 +53,11 @@ discard block |
||
47 | 53 | echo $e->getMessage(); |
48 | 54 | } |
49 | 55 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
50 | - if (isset($result[0])) return $result; |
|
51 | - else return array(); |
|
56 | + if (isset($result[0])) { |
|
57 | + return $result; |
|
58 | + } else { |
|
59 | + return array(); |
|
60 | + } |
|
52 | 61 | } |
53 | 62 | public function get_tle_names_type($type) { |
54 | 63 | $query = 'SELECT tle_name, tle_type FROM tle WHERE tle_type = :type ORDER BY tle_name'; |
@@ -59,8 +68,11 @@ discard block |
||
59 | 68 | echo $e->getMessage(); |
60 | 69 | } |
61 | 70 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
62 | - if (isset($result[0])) return $result; |
|
63 | - else return array(); |
|
71 | + if (isset($result[0])) { |
|
72 | + return $result; |
|
73 | + } else { |
|
74 | + return array(); |
|
75 | + } |
|
64 | 76 | } |
65 | 77 | |
66 | 78 | public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
@@ -95,7 +107,9 @@ discard block |
||
95 | 107 | $sat = new Predict_Sat($tle); |
96 | 108 | $predict = new Predict(); |
97 | 109 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
98 | - if ($timestamp_begin == '') $timestamp_begin = time(); |
|
110 | + if ($timestamp_begin == '') { |
|
111 | + $timestamp_begin = time(); |
|
112 | + } |
|
99 | 113 | if ($timestamp_end == '') { |
100 | 114 | $now = Predict_Time::unix2daynum($timestamp_begin); |
101 | 115 | //echo $now; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | <button type="button" class="close">×</button> |
8 | 8 | <?php |
9 | 9 | |
10 | -$sat = filter_input(INPUT_GET,'sat',FILTER_SANITIZE_STRING); |
|
10 | +$sat = filter_input(INPUT_GET, 'sat', FILTER_SANITIZE_STRING); |
|
11 | 11 | $sat = urldecode($sat); |
12 | 12 | |
13 | 13 | if ($sat == 'ISS (ZARYA)') { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $aircraft_name = 'INTEGRAL'; |
43 | 43 | // $ground_speed = 14970; |
44 | 44 | $launch_date = '17 October 2002'; |
45 | -} elseif (strpos($sat,'IRIDIUM') !== false) { |
|
45 | +} elseif (strpos($sat, 'IRIDIUM') !== false) { |
|
46 | 46 | $image = 'https://upload.wikimedia.org/wikipedia/commons/b/b6/Iridium_Satellite.jpg'; |
47 | 47 | $image_copyright = 'Cliff'; |
48 | 48 | $ident = 'Iridium satellite constellation'; |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | $aircraft_name = $sat; |
51 | 51 | // $ground_speed = 14970; |
52 | 52 | // $launch_date = '29 september 2011'; |
53 | -} elseif (strpos($sat,'ORBCOMM') !== false) { |
|
53 | +} elseif (strpos($sat, 'ORBCOMM') !== false) { |
|
54 | 54 | $ident = 'Orbcomm'; |
55 | 55 | $aircraft_wiki = 'https://en.wikipedia.org/wiki/Orbcomm_(satellite)'; |
56 | 56 | $aircraft_name = $sat; |
57 | -} elseif (strpos($sat,'GLOBALSTAR') !== false) { |
|
57 | +} elseif (strpos($sat, 'GLOBALSTAR') !== false) { |
|
58 | 58 | $ident = 'Globalstar'; |
59 | 59 | $aircraft_wiki = 'https://en.wikipedia.org/wiki/Globalstar'; |
60 | 60 | $aircraft_name = $sat; |
61 | -} elseif (strpos($sat,'OSCAR 7') !== false) { |
|
61 | +} elseif (strpos($sat, 'OSCAR 7') !== false) { |
|
62 | 62 | $image = 'https://upload.wikimedia.org/wikipedia/en/a/ad/AMSAT-OSCAR_7.jpg'; |
63 | 63 | $image_copyright = 'Amsat.org'; |
64 | 64 | $ident = 'AMSAT-OSCAR 7'; |
@@ -1,48 +1,48 @@ |
||
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 | - echo "Populate all tables...\n"; |
|
10 | - update_db::update_all(); |
|
11 | - echo "\nInstall waypoints...(VERY slow!)"; |
|
12 | - update_db::update_waypoints(); |
|
13 | - echo "Done !\n"; |
|
14 | - echo "Install airspace..."; |
|
15 | - update_db::update_airspace(); |
|
16 | - echo "Done !\n"; |
|
17 | - echo "Install countries..."; |
|
18 | - update_db::update_countries(); |
|
19 | - echo "Done !\n"; |
|
20 | - if (isset($globalOwner) && $globalOwner) { |
|
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 | + echo "Populate all tables...\n"; |
|
10 | + update_db::update_all(); |
|
11 | + echo "\nInstall waypoints...(VERY slow!)"; |
|
12 | + update_db::update_waypoints(); |
|
13 | + echo "Done !\n"; |
|
14 | + echo "Install airspace..."; |
|
15 | + update_db::update_airspace(); |
|
16 | + echo "Done !\n"; |
|
17 | + echo "Install countries..."; |
|
18 | + update_db::update_countries(); |
|
19 | + echo "Done !\n"; |
|
20 | + if (isset($globalOwner) && $globalOwner) { |
|
21 | 21 | echo "Install private owners..."; |
22 | 22 | update_db::update_owner(); |
23 | - echo "Done !\n"; |
|
24 | - } |
|
25 | - /* |
|
23 | + echo "Done !\n"; |
|
24 | + } |
|
25 | + /* |
|
26 | 26 | if (isset($globalIVAO) && $globalIVAO) { |
27 | 27 | echo "Install IVAO airlines and logos..."; |
28 | 28 | update_db::update_IVAO(); |
29 | 29 | echo "Done !\n"; |
30 | 30 | } |
31 | 31 | */ |
32 | - if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
|
32 | + if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
|
33 | 33 | echo "Install NOTAM from notaminfo.com..."; |
34 | - update_db:update_notam(); |
|
35 | - echo "Done !\n"; |
|
36 | - } |
|
37 | - if (isset($globalMap3D) && $globalMap3D) { |
|
34 | + update_db:update_notam(); |
|
35 | + echo "Done !\n"; |
|
36 | + } |
|
37 | + if (isset($globalMap3D) && $globalMap3D) { |
|
38 | 38 | echo "Install 3D models..."; |
39 | 39 | update_db::update_models(); |
40 | 40 | echo "Done !\n"; |
41 | 41 | if (isset($globalMapSatellites) && $globalMapSatellites) { |
42 | - echo "Install Space 3D models..."; |
|
43 | - update_db::update_space_models(); |
|
44 | - echo "Done !\n"; |
|
45 | - } |
|
46 | - } |
|
42 | + echo "Install Space 3D models..."; |
|
43 | + update_db::update_space_models(); |
|
44 | + echo "Done !\n"; |
|
45 | + } |
|
46 | + } |
|
47 | 47 | |
48 | 48 | ?> |
49 | 49 | \ No newline at end of file |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
6 | 6 | $current_page = $file_path['filename']; |
7 | 7 | date_default_timezone_set($globalTimezone); |
8 | -if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
|
9 | -else $MapType = $globalMapProvider; |
|
8 | +if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') { |
|
9 | + $MapType = $_COOKIE['MapType']; |
|
10 | +} else { |
|
11 | + $MapType = $globalMapProvider; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | <!DOCTYPE html> |
12 | 15 | <html> |
@@ -181,7 +184,13 @@ discard block |
||
181 | 184 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
182 | 185 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
183 | 186 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
184 | -<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
187 | +<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
188 | + print '&latitude='.$latitude; |
|
189 | +} |
|
190 | +?><?php if(isset($longitude)) { |
|
191 | + print '&longitude='.$longitude; |
|
192 | +} |
|
193 | +?>&<?php print time(); ?>"></script> |
|
185 | 194 | <?php |
186 | 195 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
187 | 196 | ?> |
@@ -235,7 +244,13 @@ discard block |
||
235 | 244 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
236 | 245 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
237 | 246 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
238 | -<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
247 | +<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
248 | + print '&latitude='.$latitude; |
|
249 | +} |
|
250 | +?><?php if(isset($longitude)) { |
|
251 | + print '&longitude='.$longitude; |
|
252 | +} |
|
253 | +?>&<?php print time(); ?>"></script> |
|
239 | 254 | <?php |
240 | 255 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
241 | 256 | ?> |
@@ -308,7 +323,12 @@ discard block |
||
308 | 323 | <span class="icon-bar"></span> |
309 | 324 | </button> |
310 | 325 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a> |
311 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
326 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
327 | + print '/'; |
|
328 | +} else { |
|
329 | + print $globalURL; |
|
330 | +} |
|
331 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
312 | 332 | </div> |
313 | 333 | <div class="collapse navbar-collapse"> |
314 | 334 | <ul class="nav navbar-nav"> |
@@ -386,7 +406,9 @@ discard block |
||
386 | 406 | $alllang = $Language->getLanguages(); |
387 | 407 | foreach ($alllang as $key => $lang) { |
388 | 408 | print '<option value="'.$key.'"'; |
389 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
409 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
410 | + print ' selected '; |
|
411 | + } |
|
390 | 412 | print '>'.$lang[0].'</option>'; |
391 | 413 | } |
392 | 414 | ?> |
@@ -533,4 +555,7 @@ discard block |
||
533 | 555 | |
534 | 556 | ?> |
535 | 557 | |
536 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
558 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
559 | + print 'index '; |
|
560 | +} |
|
561 | +?>clear"> |
@@ -8,31 +8,31 @@ discard block |
||
8 | 8 | if (isset($_COOKIE['MapType']) && $_COOKIE['MapType'] != '') $MapType = $_COOKIE['MapType']; |
9 | 9 | else $MapType = $globalMapProvider; |
10 | 10 | if (isset($_GET['3d'])) { |
11 | - setcookie('MapFormat','3d'); |
|
11 | + setcookie('MapFormat', '3d'); |
|
12 | 12 | } else if (isset($_GET['2d'])) { |
13 | - setcookie('MapFormat','2d'); |
|
13 | + setcookie('MapFormat', '2d'); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | if (isset($_POST['archive'])) { |
17 | - setcookie('archive','true'); |
|
18 | - setcookie('archive_begin',strtotime($_POST['start_date'])); |
|
19 | - setcookie('archive_end',strtotime($_POST['end_date'])); |
|
20 | - setcookie('archive_speed',$_POST['archivespeed']); |
|
17 | + setcookie('archive', 'true'); |
|
18 | + setcookie('archive_begin', strtotime($_POST['start_date'])); |
|
19 | + setcookie('archive_end', strtotime($_POST['end_date'])); |
|
20 | + setcookie('archive_speed', $_POST['archivespeed']); |
|
21 | 21 | } |
22 | 22 | if (isset($_POST['noarchive'])) { |
23 | - setcookie('archive','false',-1); |
|
24 | - setcookie('archive_begin','',-1); |
|
25 | - setcookie('archive_end','',-1); |
|
26 | - setcookie('archive_speed','',-1); |
|
23 | + setcookie('archive', 'false', -1); |
|
24 | + setcookie('archive_begin', '', -1); |
|
25 | + setcookie('archive_end', '', -1); |
|
26 | + setcookie('archive_speed', '', -1); |
|
27 | 27 | } |
28 | 28 | // When button "Remove all filters" is clicked |
29 | 29 | if (isset($_POST['removefilters'])) { |
30 | - $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
|
31 | - return strpos($key,'filter_') === 0; |
|
30 | + $allfilters = array_filter(array_keys($_COOKIE), function($key) { |
|
31 | + return strpos($key, 'filter_') === 0; |
|
32 | 32 | }); |
33 | 33 | foreach ($allfilters as $filt) { |
34 | 34 | unset($_COOKIE[$filt]); |
35 | - setcookie($filt,null,-1); |
|
35 | + setcookie($filt, null, -1); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
217 | 217 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
218 | 218 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
219 | -<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
219 | +<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
220 | 220 | <?php |
221 | 221 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
222 | 222 | ?> |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
271 | 271 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
272 | 272 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
273 | -<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
273 | +<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if (isset($latitude)) print '&latitude='.$latitude; ?><?php if (isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
274 | 274 | <?php |
275 | 275 | if (isset($globalGoogleAPIKey) && $globalGoogleAPIKey != '' && ($MapType == 'Google-Roadmap' || $MapType == 'Google-Satellite' || $MapType == 'Google-Hybrid' || $MapType == 'Google-Terrain')) { |
276 | 276 | ?> |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | ?> |
434 | 434 | <div class="search"> |
435 | 435 | <form action="<?php print $globalURL; ?>/search" method="get"> |
436 | - <input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != ""){ print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button> |
|
436 | + <input type="text" name="q" value="<?php if (isset($GET['q'])) { if ($_GET['q'] != "") { print $_GET['q']; } else { print _("Search"); } } else { print _("Search"); } ?>" onfocus="if (this.value=='search'){this.value='';}" /><button type="submit"><i class="fa fa-search"></i></button> |
|
437 | 437 | </form> |
438 | 438 | </div> |
439 | 439 | <div class="social"> |
@@ -451,14 +451,14 @@ discard block |
||
451 | 451 | print '</div>'; |
452 | 452 | } |
453 | 453 | |
454 | -if (strtolower($current_page) =='ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
454 | +if (strtolower($current_page) == 'ident-detailed' || strtolower($current_page) == 'flightid-overview') { |
|
455 | 455 | ?> |
456 | 456 | <div class="top-header clear" role="main"> |
457 | 457 | <div id="archive-map"></div> |
458 | 458 | </div> |
459 | 459 | <?php |
460 | 460 | } |
461 | -if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
|
461 | +if ((strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) || (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false)) |
|
462 | 462 | { |
463 | 463 | ?> |
464 | 464 | <div class="top-header clear" role="main"> |
@@ -471,15 +471,15 @@ discard block |
||
471 | 471 | var zoom = 13; |
472 | 472 | //create the map |
473 | 473 | <?php |
474 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
474 | + if (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
475 | 475 | ?> |
476 | 476 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
477 | 477 | <?php |
478 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
478 | + } elseif (strpos(strtolower($current_page), 'airport-') !== false && strpos(strtolower($current_page), 'statistics-') === false) { |
|
479 | 479 | ?> |
480 | 480 | map = L.map('map', { zoomControl:true }); |
481 | 481 | <?php |
482 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
482 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
483 | 483 | ?> |
484 | 484 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
485 | 485 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
488 | 488 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
489 | 489 | <?php |
490 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
490 | + } elseif (strpos(strtolower($current_page), 'route-') !== false && strpos(strtolower($current_page), 'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
491 | 491 | ?> |
492 | 492 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
493 | 493 | <?php |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | // When button "Remove all filters" is clicked |
29 | 29 | if (isset($_POST['removefilters'])) { |
30 | 30 | $allfilters = array_filter(array_keys($_COOKIE),function($key) { |
31 | - return strpos($key,'filter_') === 0; |
|
31 | + return strpos($key,'filter_') === 0; |
|
32 | 32 | }); |
33 | 33 | foreach ($allfilters as $filt) { |
34 | 34 | unset($_COOKIE[$filt]); |
@@ -167,16 +167,16 @@ discard block |
||
167 | 167 | } |
168 | 168 | ?> |
169 | 169 | <?php |
170 | - if (isset($_POST['archive'])) { |
|
170 | + if (isset($_POST['archive'])) { |
|
171 | 171 | ?> |
172 | 172 | <?php |
173 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
173 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
174 | 174 | ?> |
175 | 175 | |
176 | 176 | <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>&archive&begindate=<?php print strtotime($_POST['start_date']); ?>&enddate=<?php print strtotime($_POST['end_date']); ?>&archivespeed=<?php print $_POST['archivespeed']; ?>"></script> |
177 | 177 | <?php |
178 | - } |
|
179 | - } else { |
|
178 | + } |
|
179 | + } else { |
|
180 | 180 | ?> |
181 | 181 | <?php |
182 | 182 | /* if (isset($globalBeta) && $globalBeta) { |
@@ -188,18 +188,18 @@ discard block |
||
188 | 188 | */ |
189 | 189 | ?> |
190 | 190 | <?php |
191 | - if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
191 | + if ((!isset($_COOKIE['MapFormat']) && (!isset($globalMap3Ddefault) || !$globalMap3Ddefault)) || (isset($_COOKIE['MapFormat']) && $_COOKIE['MapFormat'] != '3d')) { |
|
192 | 192 | ?> |
193 | 193 | <script src="<?php print $globalURL; ?>/js/leaflet-playback.js"></script> |
194 | 194 | <script src="<?php print $globalURL; ?>/js/map.js.php?<?php print time(); ?>"></script> |
195 | 195 | <?php |
196 | - } |
|
196 | + } |
|
197 | 197 | ?> |
198 | 198 | <?php |
199 | 199 | // } |
200 | 200 | ?> |
201 | 201 | <?php |
202 | - } |
|
202 | + } |
|
203 | 203 | } |
204 | 204 | ?> |
205 | 205 | <?php |
@@ -359,23 +359,23 @@ discard block |
||
359 | 359 | <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li> |
360 | 360 | <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li> |
361 | 361 | <?php |
362 | - if ($globalACARS) { |
|
363 | - if (isset($globalDemo) && $globalDemo) { |
|
364 | - ?> |
|
362 | + if ($globalACARS) { |
|
363 | + if (isset($globalDemo) && $globalDemo) { |
|
364 | + ?> |
|
365 | 365 | <li><hr /></li> |
366 | 366 | <li><i><?php echo _('ACARS data not available publicly'); ?></i></li> |
367 | 367 | <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li> |
368 | 368 | <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li> |
369 | 369 | <?php |
370 | - } else { |
|
371 | - ?> |
|
370 | + } else { |
|
371 | + ?> |
|
372 | 372 | <li><hr /></li> |
373 | 373 | <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li> |
374 | 374 | <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li> |
375 | 375 | <?php |
376 | - } |
|
377 | - } |
|
378 | - ?> |
|
376 | + } |
|
377 | + } |
|
378 | + ?> |
|
379 | 379 | <li><hr /></li> |
380 | 380 | <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li> |
381 | 381 | <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li> |
@@ -417,14 +417,14 @@ discard block |
||
417 | 417 | <form> |
418 | 418 | <select class="selectpicker" data-width="120px" onchange="language(this);"> |
419 | 419 | <?php |
420 | - $Language = new Language(); |
|
421 | - $alllang = $Language->getLanguages(); |
|
422 | - foreach ($alllang as $key => $lang) { |
|
423 | - print '<option value="'.$key.'"'; |
|
424 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
425 | - print '>'.$lang[0].'</option>'; |
|
426 | - } |
|
427 | - ?> |
|
420 | + $Language = new Language(); |
|
421 | + $alllang = $Language->getLanguages(); |
|
422 | + foreach ($alllang as $key => $lang) { |
|
423 | + print '<option value="'.$key.'"'; |
|
424 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
425 | + print '>'.$lang[0].'</option>'; |
|
426 | + } |
|
427 | + ?> |
|
428 | 428 | </select> |
429 | 429 | </form> |
430 | 430 | </div> |
@@ -455,18 +455,18 @@ discard block |
||
455 | 455 | ?> |
456 | 456 | <div class="top-header clear" role="main"> |
457 | 457 | <?php |
458 | - if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
458 | + if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) { |
|
459 | 459 | ?> |
460 | 460 | <div id="archive-map"></div> |
461 | 461 | <?php |
462 | - } |
|
462 | + } |
|
463 | 463 | ?> |
464 | 464 | </div> |
465 | 465 | <?php |
466 | 466 | } |
467 | 467 | if ((strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) || (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false)) |
468 | 468 | { |
469 | - ?> |
|
469 | + ?> |
|
470 | 470 | <div class="top-header clear" role="main"> |
471 | 471 | <div id="map"></div> |
472 | 472 | <link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" /> |
@@ -477,15 +477,15 @@ discard block |
||
477 | 477 | var zoom = 13; |
478 | 478 | //create the map |
479 | 479 | <?php |
480 | - if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
480 | + if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) { |
|
481 | 481 | ?> |
482 | 482 | map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom); |
483 | 483 | <?php |
484 | - } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
484 | + } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) { |
|
485 | 485 | ?> |
486 | 486 | map = L.map('map', { zoomControl:true }); |
487 | 487 | <?php |
488 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
488 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) { |
|
489 | 489 | ?> |
490 | 490 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]); |
491 | 491 | var line = L.polyline([[<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>],[<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>]]).addTo(map); |
@@ -493,22 +493,22 @@ discard block |
||
493 | 493 | var departure_airport = L.marker([<?php print $spotter_array[0]['departure_airport_latitude']; ?>, <?php print $spotter_array[0]['departure_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/departure_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
494 | 494 | var arrival_airport = L.marker([<?php print $spotter_array[0]['arrival_airport_latitude']; ?>, <?php print $spotter_array[0]['arrival_airport_longitude']; ?>], {icon: L.icon({iconUrl: '<?php print $globalURL; ?>/images/arrival_airport.png',iconSize: [16,18],iconAnchor: [8,16]})}).addTo(map); |
495 | 495 | <?php |
496 | - } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
496 | + } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude'])) { |
|
497 | 497 | ?> |
498 | 498 | map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]); |
499 | 499 | <?php |
500 | - } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
500 | + } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) { |
|
501 | 501 | ?> |
502 | 502 | map = L.map('map', { zoomControl:true }); |
503 | 503 | <?php |
504 | - } |
|
504 | + } |
|
505 | 505 | ?> |
506 | 506 | //initialize the layer group for the aircrft markers |
507 | 507 | var layer_data = L.layerGroup(); |
508 | 508 | |
509 | 509 | //a few title layers |
510 | 510 | <?php |
511 | - if ($globalMapProvider == 'Mapbox') { |
|
511 | + if ($globalMapProvider == 'Mapbox') { |
|
512 | 512 | ?> |
513 | 513 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
514 | 514 | maxZoom: 18, |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | token : '<?php print $globalMapboxToken; ?>' |
520 | 520 | }).addTo(map); |
521 | 521 | <?php |
522 | - } elseif ($globalMapProvider == 'OpenStreetMap') { |
|
522 | + } elseif ($globalMapProvider == 'OpenStreetMap') { |
|
523 | 523 | ?> |
524 | 524 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
525 | 525 | maxZoom: 18, |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | '<a href="http://www.openstreetmap.org/copyright">Open Database Licence</a>' |
528 | 528 | }).addTo(map); |
529 | 529 | <?php |
530 | - } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
530 | + } elseif ($globalMapProvider == 'MapQuest-OSM') { |
|
531 | 531 | ?> |
532 | 532 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', { |
533 | 533 | maxZoom: 18, |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>' |
537 | 537 | }).addTo(map); |
538 | 538 | <?php |
539 | - } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
539 | + } elseif ($globalMapProvider == 'MapQuest-Aerial') { |
|
540 | 540 | ?> |
541 | 541 | L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', { |
542 | 542 | maxZoom: 18, |
@@ -545,27 +545,27 @@ discard block |
||
545 | 545 | 'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>, Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"' |
546 | 546 | }).addTo(map); |
547 | 547 | <?php |
548 | - } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
548 | + } elseif ($globalMapProvider == 'Google-Roadmap') { |
|
549 | 549 | ?> |
550 | 550 | var googleLayer = new L.Google('ROADMAP'); |
551 | 551 | map.addLayer(googleLayer); |
552 | 552 | <?php |
553 | - } elseif ($globalMapProvider == 'Google-Satellite') { |
|
553 | + } elseif ($globalMapProvider == 'Google-Satellite') { |
|
554 | 554 | ?> |
555 | 555 | var googleLayer = new L.Google('SATELLITE'); |
556 | 556 | map.addLayer(googleLayer); |
557 | 557 | <?php |
558 | - } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
558 | + } elseif ($globalMapProvider == 'Google-Hybrid') { |
|
559 | 559 | ?> |
560 | 560 | var googleLayer = new L.Google('HYBRID'); |
561 | 561 | map.addLayer(googleLayer); |
562 | 562 | <?php |
563 | - } elseif ($globalMapProvider == 'Google-Terrain') { |
|
563 | + } elseif ($globalMapProvider == 'Google-Terrain') { |
|
564 | 564 | ?> |
565 | 565 | var googleLayer = new L.Google('Terrain'); |
566 | 566 | map.addLayer(googleLayer); |
567 | 567 | <?php |
568 | - } |
|
568 | + } |
|
569 | 569 | ?> |
570 | 570 | </script> |
571 | 571 | </div> |