Completed
Push — master ( 2c5525...528bd8 )
by Yannick
32:59
created
live-geojson.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -14,23 +14,23 @@  discard block
 block discarded – undo
14 14
 $usecoord = false;
15 15
 if (isset($_GET['test'])) exit();
16 16
 if (isset($_GET['tracker'])) {
17
-    $tracker = true;
17
+	$tracker = true;
18 18
 }
19 19
 if (isset($_GET['marine'])) {
20
-    $marine = true;
20
+	$marine = true;
21 21
 }
22 22
 if ($tracker) {
23
-    require_once('require/class.Tracker.php');
24
-    require_once('require/class.TrackerLive.php');
25
-    require_once('require/class.TrackerArchive.php');
23
+	require_once('require/class.Tracker.php');
24
+	require_once('require/class.TrackerLive.php');
25
+	require_once('require/class.TrackerArchive.php');
26 26
 } elseif ($marine) {
27
-    require_once('require/class.Marine.php');
28
-    require_once('require/class.MarineLive.php');
29
-    require_once('require/class.MarineArchive.php');
27
+	require_once('require/class.Marine.php');
28
+	require_once('require/class.MarineLive.php');
29
+	require_once('require/class.MarineArchive.php');
30 30
 } else {
31
-    require_once('require/class.Spotter.php');
32
-    require_once('require/class.SpotterLive.php');
33
-    require_once('require/class.SpotterArchive.php');
31
+	require_once('require/class.Spotter.php');
32
+	require_once('require/class.SpotterLive.php');
33
+	require_once('require/class.SpotterArchive.php');
34 34
 }
35 35
 
36 36
 $begintime = microtime(true);
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 $Common = new Common();
51 51
 
52 52
 if (isset($_GET['download'])) {
53
-    if ($_GET['download'] == "true")
54
-    {
53
+	if ($_GET['download'] == "true")
54
+	{
55 55
 	header('Content-disposition: attachment; filename="flightairmap.json"');
56
-    }
56
+	}
57 57
 }
58 58
 header('Content-Type: text/javascript');
59 59
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	$usecoord = true;
132 132
 	$coord = explode(',',$_GET['coord']);
133 133
 	if (filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
134
-	    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) {
134
+		&& $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0) {
135 135
 		if ($tracker) {
136 136
 			$spotter_array = $TrackerLive->getMinLiveTrackerDatabyCoord($coord,$filter);
137 137
 		} elseif ($marine) {
@@ -635,17 +635,17 @@  discard block
 block discarded – undo
635 635
 				if ($history == '' && isset($_COOKIE['history'])) $history = $_COOKIE['history'];
636 636
 				
637 637
 				if (
638
-				    (isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
639
-				    || ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
638
+					(isset($_COOKIE['flightpath']) && $_COOKIE['flightpath'] == 'true') 
639
+					|| ((isset($globalMapHistory) && $globalMapHistory) || $allhistory)
640 640
 				//    || (isset($history) && $history != '' && $history != 'NA' && ($history == $spotter_item['ident'] || $history == $spotter_item['flightaware_id']))
641 641
 				//    || (isset($history) && $history != '' && $history != 'NA' && $history == $spotter_item['ident'])
642
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
643
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
644
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
645
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
646
-				    || (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
647
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
648
-				    ) {
642
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
643
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id'])
644
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['fammarine_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['fammarine_id']))
645
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['fammarine_id']) && $_GET['fammarine_id'] == $spotter_item['fammarine_id'])
646
+					|| (isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['famtrackid']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['famtrackid']))
647
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['famtrackid']) && $_GET['famtrackid'] == $spotter_item['famtrackid'])
648
+					) {
649 649
 					if ($tracker) {
650 650
 						if ($from_archive || $globalArchive) {
651 651
 							$spotter_history_array = $TrackerArchive->getAllArchiveTrackerDataById($spotter_item['famtrackid']);
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
 							$spotter_history_array = $TrackerLive->getAllLiveTrackerDataById($spotter_item['famtrackid']);
654 654
 						}
655 655
 						if (((isset($_COOKIE['mapmatching']) && $_COOKIE['mapmatching'] == 'true') ||
656
-						    (!isset($_COOKIE['mapmatching']) && $globalMapMatching === TRUE)) && 
657
-						    isset($_GET['zoom']) && $_GET['zoom'] > 12 && 
658
-						    isset($spotter_item['type']) && (
656
+							(!isset($_COOKIE['mapmatching']) && $globalMapMatching === TRUE)) && 
657
+							isset($_GET['zoom']) && $_GET['zoom'] > 12 && 
658
+							isset($spotter_item['type']) && (
659 659
 							$spotter_item['type'] == 'Firetruck' ||
660 660
 							$spotter_item['type'] == 'Ambulance' ||
661 661
 							$spotter_item['type'] == 'Truck (18 Wheeler)' ||
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 							$spotter_item['type'] == 'Jeep' ||
668 668
 							$spotter_item['type'] == 'Motorcycle' ||
669 669
 							$spotter_item['type'] == 'Car'
670
-						    )
670
+							)
671 671
 						) {
672 672
 							require(dirname(__FILE__).'/require/class.MapMatching.php');
673 673
 							$MapMatching = new MapMatching();
@@ -770,75 +770,75 @@  discard block
 block discarded – undo
770 770
 				}
771 771
 				
772 772
 				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
773
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
774
-				     && (isset($spotter_item['departure_airport']) 
775
-				        && $spotter_item['departure_airport'] != 'NA' 
776
-				        && isset($spotter_item['arrival_airport']) 
777
-				        && $spotter_item['arrival_airport'] != 'NA' 
778
-				        && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
779
-				    	    || (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
780
-				    if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
781
-				    else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
782
-				    if (isset($spotter_item['departure_airport_latitude'])) {
773
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
774
+					 && (isset($spotter_item['departure_airport']) 
775
+						&& $spotter_item['departure_airport'] != 'NA' 
776
+						&& isset($spotter_item['arrival_airport']) 
777
+						&& $spotter_item['arrival_airport'] != 'NA' 
778
+						&& ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") 
779
+							|| (!isset($_COOKIE['MapRoute']) && isset($globalMapRoute) && $globalMapRoute)))) {
780
+					if ($compress) $output_air = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "route"},"geometry": {"type": "LineString","coordinates": [';
781
+					else $output_air = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "route"},"geometry": {"type": "LineString","coordinates": [';
782
+					if (isset($spotter_item['departure_airport_latitude'])) {
783 783
 					$output_air .= '['.$spotter_item['departure_airport_longitude'].','.$spotter_item['departure_airport_latitude'].'],';
784
-				    } elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
784
+					} elseif (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA') {
785 785
 					$dairport = $Spotter->getAllAirportInfo($spotter_item['departure_airport']);
786 786
 					if (isset($dairport[0]['latitude'])) {
787
-					    $output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';
787
+						$output_air .= '['.$dairport[0]['longitude'].','.$dairport[0]['latitude'].'],';
788 788
 					}
789
-				    }
790
-				    if (isset($spotter_item['arrival_airport_latitude'])) {
789
+					}
790
+					if (isset($spotter_item['arrival_airport_latitude'])) {
791 791
 					$output_air .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].'],';
792
-				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
792
+					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
793 793
 					$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
794 794
 					if (isset($aairport[0]['latitude'])) {
795
-					    $output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';
795
+						$output_air .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].'],';
796 796
 					}
797
-				    }
798
-				    $output_air  = substr($output_air, 0, -1);
799
-				    $output_air .= ']}},';
800
-				    $output .= $output_air;
801
-				    unset($output_air);
797
+					}
798
+					$output_air  = substr($output_air, 0, -1);
799
+					$output_air .= ']}},';
800
+					$output .= $output_air;
801
+					unset($output_air);
802 802
 				}
803 803
 
804 804
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != 'NA' && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
805 805
 				//if (isset($history) && $history != '' && $history == $spotter_item['ident'] && isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA' && ((isset($_COOKIE['MapRoute']) && $_COOKIE['MapRoute'] == "true") || (!isset($_COOKIE['MapRoute']) && (!isset($globalMapRoute) || (isset($globalMapRoute) && $globalMapRoute))))) {
806 806
 				if (((isset($history) && $history != '' && $history != 'NA' && isset($spotter_item['flightaware_id']) && str_replace('-','',$history) == str_replace('-','',$spotter_item['flightaware_id']))
807
-				    || (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
808
-				     && (isset($spotter_item['arrival_airport']) 
809
-				        && $spotter_item['arrival_airport'] != 'NA' 
810
-				        && ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") 
811
-				    	    || (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) 
812
-				    	    || (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
813
-				    $havedata = false;
814
-				    if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
815
-				    else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
807
+					|| (isset($history) && $history == '' && isset($spotter_item['flightaware_id']) && isset($_GET['flightaware_id']) && $_GET['flightaware_id'] == $spotter_item['flightaware_id']))
808
+					 && (isset($spotter_item['arrival_airport']) 
809
+						&& $spotter_item['arrival_airport'] != 'NA' 
810
+						&& ((isset($_COOKIE['MapRemainingRoute']) && $_COOKIE['MapRemainingRoute'] == "true") 
811
+							|| (!isset($_COOKIE['MapRemainingRoute']) && (!isset($globalMapRemainingRoute) 
812
+							|| (isset($globalMapRemainingRoute) && $globalMapRemainingRoute)))))) {
813
+					$havedata = false;
814
+					if ($compress) $output_dest = '{"type": "Feature","properties": {"c": "'.$spotter_item['ident'].'","t": "routedest"},"geometry": {"type": "LineString","coordinates": [';
815
+					else $output_dest = '{"type": "Feature","properties": {"callsign": "'.$spotter_item['ident'].'","type": "routedest"},"geometry": {"type": "LineString","coordinates": [';
816 816
 				    
817
-				    //$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
818
-				    if (isset($spotter_item['arrival_airport_latitude'])) {
817
+					//$output_dest .= '['.$spotter_item['longitude'].','.$spotter_item['latitude'].'],';
818
+					if (isset($spotter_item['arrival_airport_latitude'])) {
819 819
 					//$output_dest .= '['.$spotter_item['arrival_airport_longitude'].','.$spotter_item['arrival_airport_latitude'].']';
820 820
 					$end_lon = $spotter_item['arrival_airport_longitude'];
821 821
 					$end_lat = $spotter_item['arrival_airport_latitude'];
822 822
 					$havedata = true;
823
-				    } elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
823
+					} elseif (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') {
824 824
 					$aairport = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']);
825 825
 					if (isset($aairport[0]['latitude'])) {
826
-					    //$output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';
827
-					    $end_lon = $aairport[0]['longitude'];
828
-					    $end_lat = $aairport[0]['latitude'];
829
-					    $havedata = true;
826
+						//$output_dest .= '['.$aairport[0]['longitude'].','.$aairport[0]['latitude'].']';
827
+						$end_lon = $aairport[0]['longitude'];
828
+						$end_lat = $aairport[0]['latitude'];
829
+						$havedata = true;
830 830
 					}
831
-				    }
832
-				    if ($havedata) {
831
+					}
832
+					if ($havedata) {
833 833
 					$line = $Common->greatCircle($spotter_item['latitude'],$spotter_item['longitude'],$end_lat,$end_lon);
834 834
 					foreach ($line[0] as $coord) {
835 835
 						$output_dest .= '['.$coord[0].','.$coord[1].'],';
836 836
 					}
837 837
 					$output_dest  = substr($output_dest, 0, -1);
838
-				    }
839
-				    $output_dest .= ']}},';
840
-				    if ($havedata) $output .= $output_dest;
841
-				    unset($output_dest);
838
+					}
839
+					$output_dest .= ']}},';
840
+					if ($havedata) $output .= $output_dest;
841
+					unset($output_dest);
842 842
 				}
843 843
 			}
844 844
 			$output  = substr($output, 0, -1);
Please login to merge, or discard this patch.
require/class.Common.php 1 patch
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
 	//protected $cookies = array();
8 8
 	
9 9
 	/**
10
-	* Get data from form result
11
-	* @param String $url form URL
12
-	* @param String $type type of submit form method (get or post)
13
-	* @param String|Array $data values form post method
14
-	* @param Array $headers header to submit with the form
15
-	* @return String the result
16
-	*/
10
+	 * Get data from form result
11
+	 * @param String $url form URL
12
+	 * @param String $type type of submit form method (get or post)
13
+	 * @param String|Array $data values form post method
14
+	 * @param Array $headers header to submit with the form
15
+	 * @return String the result
16
+	 */
17 17
 	public function getData($url, $type = 'get', $data = '', $headers = '',$cookie = '',$referer = '',$timeout = '',$useragent = '', $sizelimit = false, $async = false) {
18 18
 		global $globalProxy, $globalForceIPv4;
19 19
 		$ch = curl_init();
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 	}
167 167
 
168 168
 	/**
169
-	* Convert a HTML table to an array
170
-	* @param String $data HTML page
171
-	* @return Array array of the tables in HTML page
172
-	*/
169
+	 * Convert a HTML table to an array
170
+	 * @param String $data HTML page
171
+	 * @return Array array of the tables in HTML page
172
+	 */
173 173
 	public function table2array($data) {
174 174
 		if (!is_string($data)) return array();
175 175
 		if ($data == '') return array();
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 	}
204 204
 	
205 205
 	/**
206
-	* Convert <p> part of a HTML page to an array
207
-	* @param String $data HTML page
208
-	* @return Array array of the <p> in HTML page
209
-	*/
206
+	 * Convert <p> part of a HTML page to an array
207
+	 * @param String $data HTML page
208
+	 * @return Array array of the <p> in HTML page
209
+	 */
210 210
 	public function text2array($data) {
211 211
 		$html = str_get_html($data);
212 212
 		if ($html === false) return array();
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
 	}
222 222
 
223 223
 	/**
224
-	* Give distance between 2 coordonnates
225
-	* @param Float $lat latitude of first point
226
-	* @param Float $lon longitude of first point
227
-	* @param Float $latc latitude of second point
228
-	* @param Float $lonc longitude of second point
229
-	* @param String $unit km else no unit used
230
-	* @return Float Distance in $unit
231
-	*/
224
+	 * Give distance between 2 coordonnates
225
+	 * @param Float $lat latitude of first point
226
+	 * @param Float $lon longitude of first point
227
+	 * @param Float $latc latitude of second point
228
+	 * @param Float $lonc longitude of second point
229
+	 * @param String $unit km else no unit used
230
+	 * @return Float Distance in $unit
231
+	 */
232 232
 	public function distance($lat, $lon, $latc, $lonc, $unit = 'km') {
233 233
 		if ($lat == $latc && $lon == $lonc) return 0;
234 234
 		$dist = rad2deg(acos(sin(deg2rad(floatval($lat)))*sin(deg2rad(floatval($latc)))+ cos(deg2rad(floatval($lat)))*cos(deg2rad(floatval($latc)))*cos(deg2rad(floatval($lon)-floatval($lonc)))))*60*1.1515;
@@ -246,12 +246,12 @@  discard block
 block discarded – undo
246 246
 	}
247 247
 
248 248
 	/**
249
-	* Give plunge between 2 altitudes and distance
250
-	* @param Float $initial_altitude altitude of first point in m
251
-	* @param Float $final_altitude altitude of second point in m
252
-	* @param String $distance distance between two points in m
253
-	* @return Float plunge
254
-	*/
249
+	 * Give plunge between 2 altitudes and distance
250
+	 * @param Float $initial_altitude altitude of first point in m
251
+	 * @param Float $final_altitude altitude of second point in m
252
+	 * @param String $distance distance between two points in m
253
+	 * @return Float plunge
254
+	 */
255 255
 	public function plunge($initial_altitude,$final_altitude,$distance) {
256 256
 		$plunge = rad2deg(asin(($final_altitude-$initial_altitude)/$distance));
257 257
 		/*
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
 	}
266 266
 
267 267
 	/**
268
-	* Give azimuth between 2 coordonnates
269
-	* @param Float $lat latitude of first point
270
-	* @param Float $lon longitude of first point
271
-	* @param Float $latc latitude of second point
272
-	* @param Float $lonc longitude of second point
273
-	* @return Float Azimuth
274
-	*/
268
+	 * Give azimuth between 2 coordonnates
269
+	 * @param Float $lat latitude of first point
270
+	 * @param Float $lon longitude of first point
271
+	 * @param Float $latc latitude of second point
272
+	 * @param Float $lonc longitude of second point
273
+	 * @return Float Azimuth
274
+	 */
275 275
 	public function azimuth($lat, $lon, $latc, $lonc) {
276 276
 		$dX = $latc - $lat;
277 277
 		$dY = $lonc - $lon;
@@ -282,11 +282,11 @@  discard block
 block discarded – undo
282 282
 	
283 283
 	
284 284
 	/**
285
-	* Check is distance realistic
286
-	* @param int $timeDifference the time between the reception of both messages
287
-	* @param float $distance distance covered
288
-	* @return whether distance is realistic
289
-	*/
285
+	 * Check is distance realistic
286
+	 * @param int $timeDifference the time between the reception of both messages
287
+	 * @param float $distance distance covered
288
+	 * @return whether distance is realistic
289
+	 */
290 290
 	public function withinThreshold ($timeDifference, $distance) {
291 291
 		$x = abs($timeDifference);
292 292
 		$d = abs($distance);
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
 	}
337 337
 	
338 338
 	/**
339
-	* Copy folder contents
340
-	* @param       string   $source    Source path
341
-	* @param       string   $dest      Destination path
342
-	* @return      bool     Returns true on success, false on failure
343
-	*/
339
+	 * Copy folder contents
340
+	 * @param       string   $source    Source path
341
+	 * @param       string   $dest      Destination path
342
+	 * @return      bool     Returns true on success, false on failure
343
+	 */
344 344
 	public function xcopy($source, $dest)
345 345
 	{
346 346
 		$files = glob($source.'*.*');
@@ -352,20 +352,20 @@  discard block
 block discarded – undo
352 352
 	}
353 353
 	
354 354
 	/**
355
-	* Check if an url exist
356
-	* @param	String $url url to check
357
-	* @return	bool Return true on succes false on failure
358
-	*/
355
+	 * Check if an url exist
356
+	 * @param	String $url url to check
357
+	 * @return	bool Return true on succes false on failure
358
+	 */
359 359
 	public function urlexist($url){
360 360
 		$headers=get_headers($url);
361 361
 		return stripos($headers[0],"200 OK")?true:false;
362 362
 	}
363 363
 	
364 364
 	/**
365
-	* Convert hexa to string
366
-	* @param	String $hex data in hexa
367
-	* @return	String Return result
368
-	*/
365
+	 * Convert hexa to string
366
+	 * @param	String $hex data in hexa
367
+	 * @return	String Return result
368
+	 */
369 369
 	public function hex2str($hex) {
370 370
 		$str = '';
371 371
 		$hexln = strlen($hex);
@@ -374,10 +374,10 @@  discard block
 block discarded – undo
374 374
 	}
375 375
 	
376 376
 	/**
377
-	* Convert hexa color to rgb
378
-	* @param	String $hex data in hexa
379
-	* @return	String Return result
380
-	*/
377
+	 * Convert hexa color to rgb
378
+	 * @param	String $hex data in hexa
379
+	 * @return	String Return result
380
+	 */
381 381
 	public function hex2rgb($hex) {
382 382
 		$hex = str_replace('#','',$hex);
383 383
 		return sscanf($hex, "%02x%02x%02x"); 
@@ -455,9 +455,9 @@  discard block
 block discarded – undo
455 455
 	}
456 456
 	
457 457
 	/**
458
-	* Returns list of available locales
459
-	*
460
-	* @return array
458
+	 * Returns list of available locales
459
+	 *
460
+	 * @return array
461 461
 	 */
462 462
 	public function listLocaleDir()
463 463
 	{
@@ -556,100 +556,100 @@  discard block
 block discarded – undo
556 556
 	public function remove_accents($string) {
557 557
 		if ( !preg_match('/[\x80-\xff]/', $string) ) return $string;
558 558
 		$chars = array(
559
-		    // Decompositions for Latin-1 Supplement
560
-		    chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
561
-		    chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
562
-		    chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
563
-		    chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
564
-		    chr(195).chr(137) => 'E', chr(195).chr(138) => 'E',
565
-		    chr(195).chr(139) => 'E', chr(195).chr(140) => 'I',
566
-		    chr(195).chr(141) => 'I', chr(195).chr(142) => 'I',
567
-		    chr(195).chr(143) => 'I', chr(195).chr(145) => 'N',
568
-		    chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
569
-		    chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
570
-		    chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
571
-		    chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
572
-		    chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
573
-		    chr(195).chr(159) => 's', chr(195).chr(160) => 'a',
574
-		    chr(195).chr(161) => 'a', chr(195).chr(162) => 'a',
575
-		    chr(195).chr(163) => 'a', chr(195).chr(164) => 'a',
576
-		    chr(195).chr(165) => 'a', chr(195).chr(167) => 'c',
577
-		    chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
578
-		    chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
579
-		    chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
580
-		    chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
581
-		    chr(195).chr(177) => 'n', chr(195).chr(178) => 'o',
582
-		    chr(195).chr(179) => 'o', chr(195).chr(180) => 'o',
583
-		    chr(195).chr(181) => 'o', chr(195).chr(182) => 'o',
584
-		    chr(195).chr(182) => 'o', chr(195).chr(185) => 'u',
585
-		    chr(195).chr(186) => 'u', chr(195).chr(187) => 'u',
586
-		    chr(195).chr(188) => 'u', chr(195).chr(189) => 'y',
587
-		    chr(195).chr(191) => 'y',
588
-		    // Decompositions for Latin Extended-A
589
-		    chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
590
-		    chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',
591
-		    chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',
592
-		    chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',
593
-		    chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',
594
-		    chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',
595
-		    chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',
596
-		    chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',
597
-		    chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',
598
-		    chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',
599
-		    chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',
600
-		    chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',
601
-		    chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',
602
-		    chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',
603
-		    chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',
604
-		    chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',
605
-		    chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',
606
-		    chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',
607
-		    chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',
608
-		    chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',
609
-		    chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',
610
-		    chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',
611
-		    chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
612
-		    chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
613
-		    chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
614
-		    chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
615
-		    chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
616
-		    chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
617
-		    chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
618
-		    chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',
619
-		    chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',
620
-		    chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',
621
-		    chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',
622
-		    chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',
623
-		    chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',
624
-		    chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',
625
-		    chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',
626
-		    chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',
627
-		    chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
628
-		    chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
629
-		    chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
630
-		    chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
631
-		    chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
632
-		    chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
633
-		    chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
634
-		    chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
635
-		    chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
636
-		    chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
637
-		    chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
638
-		    chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
639
-		    chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
640
-		    chr(197).chr(166) => 'T', chr(197).chr(167) => 't',
641
-		    chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',
642
-		    chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',
643
-		    chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',
644
-		    chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',
645
-		    chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',
646
-		    chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',
647
-		    chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',
648
-		    chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',
649
-		    chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',
650
-		    chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
651
-		    chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
652
-		    chr(197).chr(190) => 'z', chr(197).chr(191) => 's'
559
+			// Decompositions for Latin-1 Supplement
560
+			chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
561
+			chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
562
+			chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
563
+			chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
564
+			chr(195).chr(137) => 'E', chr(195).chr(138) => 'E',
565
+			chr(195).chr(139) => 'E', chr(195).chr(140) => 'I',
566
+			chr(195).chr(141) => 'I', chr(195).chr(142) => 'I',
567
+			chr(195).chr(143) => 'I', chr(195).chr(145) => 'N',
568
+			chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
569
+			chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
570
+			chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
571
+			chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
572
+			chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
573
+			chr(195).chr(159) => 's', chr(195).chr(160) => 'a',
574
+			chr(195).chr(161) => 'a', chr(195).chr(162) => 'a',
575
+			chr(195).chr(163) => 'a', chr(195).chr(164) => 'a',
576
+			chr(195).chr(165) => 'a', chr(195).chr(167) => 'c',
577
+			chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
578
+			chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
579
+			chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
580
+			chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
581
+			chr(195).chr(177) => 'n', chr(195).chr(178) => 'o',
582
+			chr(195).chr(179) => 'o', chr(195).chr(180) => 'o',
583
+			chr(195).chr(181) => 'o', chr(195).chr(182) => 'o',
584
+			chr(195).chr(182) => 'o', chr(195).chr(185) => 'u',
585
+			chr(195).chr(186) => 'u', chr(195).chr(187) => 'u',
586
+			chr(195).chr(188) => 'u', chr(195).chr(189) => 'y',
587
+			chr(195).chr(191) => 'y',
588
+			// Decompositions for Latin Extended-A
589
+			chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
590
+			chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',
591
+			chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',
592
+			chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',
593
+			chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',
594
+			chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',
595
+			chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',
596
+			chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',
597
+			chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',
598
+			chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',
599
+			chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',
600
+			chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',
601
+			chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',
602
+			chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',
603
+			chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',
604
+			chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',
605
+			chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',
606
+			chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',
607
+			chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',
608
+			chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',
609
+			chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',
610
+			chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',
611
+			chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
612
+			chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
613
+			chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
614
+			chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
615
+			chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
616
+			chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
617
+			chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
618
+			chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',
619
+			chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',
620
+			chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',
621
+			chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',
622
+			chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',
623
+			chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',
624
+			chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',
625
+			chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',
626
+			chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',
627
+			chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
628
+			chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
629
+			chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
630
+			chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
631
+			chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
632
+			chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
633
+			chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
634
+			chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
635
+			chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
636
+			chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
637
+			chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
638
+			chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
639
+			chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
640
+			chr(197).chr(166) => 'T', chr(197).chr(167) => 't',
641
+			chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',
642
+			chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',
643
+			chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',
644
+			chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',
645
+			chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',
646
+			chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',
647
+			chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',
648
+			chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',
649
+			chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',
650
+			chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
651
+			chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
652
+			chr(197).chr(190) => 'z', chr(197).chr(191) => 's'
653 653
 		);
654 654
 		$string = strtr($string, $chars);
655 655
 		return $string;
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 			$dfX = $first_pass[$j][0];
791 791
 			$dfDiffLong = abs($dfX - $dfPrevX);
792 792
 			if ($dfDiffLong > $dfDiffSpace &&
793
-			    (($dfX > $dfLeftBorderX && $dfPrevX < $dfRightBorderX) || ($dfPrevX > $dfLeftBorderX && $dfX < $dfRightBorderX))) 
793
+				(($dfX > $dfLeftBorderX && $dfPrevX < $dfRightBorderX) || ($dfPrevX > $dfLeftBorderX && $dfX < $dfRightBorderX))) 
794 794
 			{
795 795
 				$bHasBigDiff = true;
796 796
 			} else if ($dfDiffLong > $dfMaxSmallDiffLong) {
@@ -810,8 +810,8 @@  discard block
 block discarded – undo
810 810
 					$dfX2 = floatval($first_pass[$k][0]);
811 811
 					$dfY2 = floatval($first_pass[$k][1]);
812 812
 					if ($dfX1 > -180 && $dfX1 < $dfRightBorderX && $dfX2 == 180 &&
813
-					    $k+1 < count($first_pass) &&
814
-					    $first_pass[$k-1][0] > -180 && $first_pass[$k-1][0] < $dfRightBorderX)
813
+						$k+1 < count($first_pass) &&
814
+						$first_pass[$k-1][0] > -180 && $first_pass[$k-1][0] < $dfRightBorderX)
815 815
 					{
816 816
 						$poNewLS[] = array(-180, $first_pass[$k][1]);
817 817
 						$k++;
@@ -819,8 +819,8 @@  discard block
 block discarded – undo
819 819
 						$poNewLS[] = array($first_pass[$k][0], $first_pass[$k][1]);
820 820
 						continue;
821 821
 					} else if ($dfX1 > $dfLeftBorderX && $dfX1 < 180 && $dfX2 == -180 &&
822
-					    $k+1 < $first_pass_ln &&
823
-					    $first_pass[$k-1][0] > $dfLeftBorderX && $first_pass[$k-1][0] < 180)
822
+						$k+1 < $first_pass_ln &&
823
+						$first_pass[$k-1][0] > $dfLeftBorderX && $first_pass[$k-1][0] < 180)
824 824
 					{
825 825
 						$poNewLS[] = array(180, $first_pass[$k][1]);
826 826
 						$k++;
Please login to merge, or discard this patch.
require/class.SpotterLive.php 1 patch
Indentation   +205 added lines, -205 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 
14 14
 
15 15
 	/**
16
-	* Get SQL query part for filter used
17
-	* @param Array $filter the filter
18
-	* @return Array the SQL part
19
-	*/
16
+	 * Get SQL query part for filter used
17
+	 * @param Array $filter the filter
18
+	 * @return Array the SQL part
19
+	 */
20 20
 	public function getFilter($filter = array(),$where = false,$and = false) {
21 21
 		global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver;
22 22
 		$filters = array();
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
 	}
137 137
 
138 138
 	/**
139
-	* Gets all the spotter information based on the latest data entry
140
-	*
141
-	* @return Array the spotter information
142
-	*
143
-	*/
139
+	 * Gets all the spotter information based on the latest data entry
140
+	 *
141
+	 * @return Array the spotter information
142
+	 *
143
+	 */
144 144
 	public function getLiveSpotterData($limit = '', $sort = '', $filter = array())
145 145
 	{
146 146
 		global $globalDBdriver, $globalLiveInterval;
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
 	}
184 184
 
185 185
 	/**
186
-	* Gets Minimal Live Spotter data
187
-	*
188
-	* @return Array the spotter information
189
-	*
190
-	*/
186
+	 * Gets Minimal Live Spotter data
187
+	 *
188
+	 * @return Array the spotter information
189
+	 *
190
+	 */
191 191
 	public function getMinLiveSpotterData($filter = array())
192 192
 	{
193 193
 		global $globalDBdriver, $globalLiveInterval, $globalArchive;
@@ -224,11 +224,11 @@  discard block
 block discarded – undo
224 224
 	}
225 225
 
226 226
 	/**
227
-	* Gets Minimal Live Spotter data since xx seconds
228
-	*
229
-	* @return Array the spotter information
230
-	*
231
-	*/
227
+	 * Gets Minimal Live Spotter data since xx seconds
228
+	 *
229
+	 * @return Array the spotter information
230
+	 *
231
+	 */
232 232
 	public function getMinLastLiveSpotterData($coord = array(),$filter = array(), $limit = false, $id = '')
233 233
 	{
234 234
 		global $globalDBdriver, $globalLiveInterval, $globalArchive, $globalMap3DAircraftsLimit;
@@ -320,11 +320,11 @@  discard block
 block discarded – undo
320 320
 	}
321 321
 
322 322
 	/**
323
-	* Gets number of latest data entry
324
-	*
325
-	* @return String number of entry
326
-	*
327
-	*/
323
+	 * Gets number of latest data entry
324
+	 *
325
+	 * @return String number of entry
326
+	 *
327
+	 */
328 328
 	public function getLiveSpotterCount($filter = array())
329 329
 	{
330 330
 		global $globalDBdriver, $globalLiveInterval;
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
 	}
352 352
 
353 353
 	/**
354
-	* Gets all the spotter information based on the latest data entry and coord
355
-	*
356
-	* @return Array the spotter information
357
-	*
358
-	*/
354
+	 * Gets all the spotter information based on the latest data entry and coord
355
+	 *
356
+	 * @return Array the spotter information
357
+	 *
358
+	 */
359 359
 	public function getLiveSpotterDatabyCoord($coord, $filter = array())
360 360
 	{
361 361
 		global $globalDBdriver, $globalLiveInterval;
@@ -380,11 +380,11 @@  discard block
 block discarded – undo
380 380
 	}
381 381
 
382 382
 	/**
383
-	* Gets all the spotter information based on the latest data entry and coord
384
-	*
385
-	* @return Array the spotter information
386
-	*
387
-	*/
383
+	 * Gets all the spotter information based on the latest data entry and coord
384
+	 *
385
+	 * @return Array the spotter information
386
+	 *
387
+	 */
388 388
 	public function getMinLiveSpotterDatabyCoord($coord, $filter = array())
389 389
 	{
390 390
 		global $globalDBdriver, $globalLiveInterval, $globalArchive;
@@ -449,11 +449,11 @@  discard block
 block discarded – undo
449 449
 	}
450 450
 
451 451
 	/**
452
-	* Gets all the spotter information based on a user's latitude and longitude
453
-	*
454
-	* @return Array the spotter information
455
-	*
456
-	*/
452
+	 * Gets all the spotter information based on a user's latitude and longitude
453
+	 *
454
+	 * @return Array the spotter information
455
+	 *
456
+	 */
457 457
 	public function getLatestSpotterForLayar($lat, $lng, $radius, $interval)
458 458
 	{
459 459
 		$Spotter = new Spotter($this->db);
@@ -463,98 +463,98 @@  discard block
 block discarded – undo
463 463
 				return false;
464 464
 			}
465 465
 		}
466
-        if ($lng != '')
467
-                {
468
-                        if (!is_numeric($lng))
469
-                        {
470
-                                return false;
471
-                        }
472
-                }
473
-
474
-                if ($radius != '')
475
-                {
476
-                        if (!is_numeric($radius))
477
-                        {
478
-                                return false;
479
-                        }
480
-                }
466
+		if ($lng != '')
467
+				{
468
+						if (!is_numeric($lng))
469
+						{
470
+								return false;
471
+						}
472
+				}
473
+
474
+				if ($radius != '')
475
+				{
476
+						if (!is_numeric($radius))
477
+						{
478
+								return false;
479
+						}
480
+				}
481 481
 		$additional_query = '';
482
-        if ($interval != '')
483
-                {
484
-                        if (!is_string($interval))
485
-                        {
486
-                                //$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';
487
-			        return false;
488
-                        } else {
489
-                if ($interval == '1m')
490
-                {
491
-                    $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';
492
-                } else if ($interval == '15m'){
493
-                    $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date ';
494
-                } 
495
-            }
496
-                } else {
497
-         $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';   
498
-        }
499
-
500
-                $query  = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live 
482
+		if ($interval != '')
483
+				{
484
+						if (!is_string($interval))
485
+						{
486
+								//$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';
487
+					return false;
488
+						} else {
489
+				if ($interval == '1m')
490
+				{
491
+					$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';
492
+				} else if ($interval == '15m'){
493
+					$additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 15 MINUTE) <= spotter_live.date ';
494
+				} 
495
+			}
496
+				} else {
497
+		 $additional_query = ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 MINUTE) <= spotter_live.date ';   
498
+		}
499
+
500
+				$query  = "SELECT spotter_live.*, ( 6371 * acos( cos( radians(:lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(:lng) ) + sin( radians(:lat) ) * sin( radians( latitude ) ) ) ) AS distance FROM spotter_live 
501 501
                    WHERE spotter_live.latitude <> '' 
502 502
                                    AND spotter_live.longitude <> '' 
503 503
                    ".$additional_query."
504 504
                    HAVING distance < :radius  
505 505
                                    ORDER BY distance";
506 506
 
507
-                $spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius));
507
+				$spotter_array = $Spotter->getDataFromDB($query, array(':lat' => $lat, ':lng' => $lng,':radius' => $radius));
508 508
 
509
-                return $spotter_array;
510
-        }
509
+				return $spotter_array;
510
+		}
511 511
 
512 512
     
513
-        /**
514
-	* Gets all the spotter information based on a particular callsign
515
-	*
516
-	* @return Array the spotter information
517
-	*
518
-	*/
513
+		/**
514
+		 * Gets all the spotter information based on a particular callsign
515
+		 *
516
+		 * @return Array the spotter information
517
+		 *
518
+		 */
519 519
 	public function getLastLiveSpotterDataByIdent($ident)
520 520
 	{
521 521
 		$Spotter = new Spotter($this->db);
522 522
 		date_default_timezone_set('UTC');
523 523
 
524 524
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
525
-                $query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
525
+				$query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
526 526
 
527 527
 		$spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident),'',true);
528 528
 
529 529
 		return $spotter_array;
530 530
 	}
531 531
 
532
-        /**
533
-	* Gets all the spotter information based on a particular callsign
534
-	*
535
-	* @return Array the spotter information
536
-	*
537
-	*/
532
+		/**
533
+		 * Gets all the spotter information based on a particular callsign
534
+		 *
535
+		 * @return Array the spotter information
536
+		 *
537
+		 */
538 538
 	public function getDateLiveSpotterDataByIdent($ident,$date)
539 539
 	{
540 540
 		$Spotter = new Spotter($this->db);
541 541
 		date_default_timezone_set('UTC');
542 542
 
543 543
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
544
-                $query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
544
+				$query  = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate ORDER BY spotter_live.date DESC';
545 545
 
546
-                $date = date('c',$date);
546
+				$date = date('c',$date);
547 547
 		$spotter_array = $Spotter->getDataFromDB($query,array(':ident' => $ident,':date' => $date));
548 548
 
549 549
 		return $spotter_array;
550 550
 	}
551 551
 
552
-        /**
553
-	* Gets last spotter information based on a particular callsign
554
-	*
555
-	* @return Array the spotter information
556
-	*
557
-	*/
552
+		/**
553
+		 * Gets last spotter information based on a particular callsign
554
+		 *
555
+		 * @return Array the spotter information
556
+		 *
557
+		 */
558 558
 	public function getLastLiveSpotterDataById($id)
559 559
 	{
560 560
 		$Spotter = new Spotter($this->db);
@@ -565,12 +565,12 @@  discard block
 block discarded – undo
565 565
 		return $spotter_array;
566 566
 	}
567 567
 
568
-        /**
569
-	* Gets last spotter information based on a particular callsign
570
-	*
571
-	* @return Array the spotter information
572
-	*
573
-	*/
568
+		/**
569
+		 * Gets last spotter information based on a particular callsign
570
+		 *
571
+		 * @return Array the spotter information
572
+		 *
573
+		 */
574 574
 	public function getDateLiveSpotterDataById($id,$date)
575 575
 	{
576 576
 		$Spotter = new Spotter($this->db);
@@ -583,21 +583,21 @@  discard block
 block discarded – undo
583 583
 		return $spotter_array;
584 584
 	}
585 585
 
586
-        /**
587
-	* Gets altitude information based on a particular callsign
588
-	*
589
-	* @return Array the spotter information
590
-	*
591
-	*/
586
+		/**
587
+		 * Gets altitude information based on a particular callsign
588
+		 *
589
+		 * @return Array the spotter information
590
+		 *
591
+		 */
592 592
 	public function getAltitudeLiveSpotterDataByIdent($ident)
593 593
 	{
594 594
 
595 595
 		date_default_timezone_set('UTC');
596 596
 
597 597
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
598
-                $query  = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident';
598
+				$query  = 'SELECT spotter_live.altitude, spotter_live.date FROM spotter_live WHERE spotter_live.ident = :ident';
599 599
 
600
-    		try {
600
+			try {
601 601
 			
602 602
 			$sth = $this->db->prepare($query);
603 603
 			$sth->execute(array(':ident' => $ident));
@@ -610,12 +610,12 @@  discard block
 block discarded – undo
610 610
 		return $spotter_array;
611 611
 	}
612 612
 
613
-        /**
614
-	* Gets all the spotter information based on a particular id
615
-	*
616
-	* @return Array the spotter information
617
-	*
618
-	*/
613
+		/**
614
+		 * Gets all the spotter information based on a particular id
615
+		 *
616
+		 * @return Array the spotter information
617
+		 *
618
+		 */
619 619
 	public function getAllLiveSpotterDataById($id,$liveinterval = false)
620 620
 	{
621 621
 		global $globalDBdriver, $globalLiveInterval;
@@ -643,18 +643,18 @@  discard block
 block discarded – undo
643 643
 		return $spotter_array;
644 644
 	}
645 645
 
646
-        /**
647
-	* Gets all the spotter information based on a particular ident
648
-	*
649
-	* @return Array the spotter information
650
-	*
651
-	*/
646
+		/**
647
+		 * Gets all the spotter information based on a particular ident
648
+		 *
649
+		 * @return Array the spotter information
650
+		 *
651
+		 */
652 652
 	public function getAllLiveSpotterDataByIdent($ident)
653 653
 	{
654 654
 		date_default_timezone_set('UTC');
655 655
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
656 656
 		$query  = self::$global_query.' WHERE spotter_live.ident = :ident';
657
-    		try {
657
+			try {
658 658
 			
659 659
 			$sth = $this->db->prepare($query);
660 660
 			$sth->execute(array(':ident' => $ident));
@@ -668,23 +668,23 @@  discard block
 block discarded – undo
668 668
 
669 669
 
670 670
 	/**
671
-	* Deletes all info in the table
672
-	*
673
-	* @return String success or false
674
-	*
675
-	*/
671
+	 * Deletes all info in the table
672
+	 *
673
+	 * @return String success or false
674
+	 *
675
+	 */
676 676
 	public function deleteLiveSpotterData()
677 677
 	{
678 678
 		global $globalDBdriver;
679 679
 		if ($globalDBdriver == 'mysql') {
680 680
 			//$query  = "DELETE FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 MINUTE) >= spotter_live.date";
681 681
 			$query  = 'DELETE FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 9 HOUR) >= spotter_live.date';
682
-            		//$query  = "DELETE FROM spotter_live WHERE spotter_live.id IN (SELECT spotter_live.id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= spotter_live.date)";
682
+					//$query  = "DELETE FROM spotter_live WHERE spotter_live.id IN (SELECT spotter_live.id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 HOUR) >= spotter_live.date)";
683 683
 		} else {
684 684
 			$query  = "DELETE FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' >= spotter_live.date";
685 685
 		}
686 686
         
687
-    		try {
687
+			try {
688 688
 			
689 689
 			$sth = $this->db->prepare($query);
690 690
 			$sth->execute();
@@ -696,18 +696,18 @@  discard block
 block discarded – undo
696 696
 	}
697 697
 
698 698
 	/**
699
-	* Deletes all info in the table for aircraft not seen since 2 HOUR
700
-	*
701
-	* @return String success or false
702
-	*
703
-	*/
699
+	 * Deletes all info in the table for aircraft not seen since 2 HOUR
700
+	 *
701
+	 * @return String success or false
702
+	 *
703
+	 */
704 704
 	public function deleteLiveSpotterDataNotUpdated()
705 705
 	{
706 706
 		global $globalDBdriver, $globalDebug;
707 707
 		if ($globalDBdriver == 'mysql') {
708 708
 			//$query = 'SELECT flightaware_id FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(), INTERVAL 1 HOUR) >= spotter_live.date AND spotter_live.flightaware_id NOT IN (SELECT flightaware_id FROM spotter_live WHERE DATE_SUB(UTC_TIMESTAMP(), INTERVAL 1 HOUR) < spotter_live.date) LIMIT 800 OFFSET 0';
709
-    			$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL 2 HOUR) >= s.max_date LIMIT 2000 OFFSET 0";
710
-    			try {
709
+				$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL 2 HOUR) >= s.max_date LIMIT 2000 OFFSET 0";
710
+				try {
711 711
 				
712 712
 				$sth = $this->db->prepare($query);
713 713
 				$sth->execute();
@@ -715,8 +715,8 @@  discard block
 block discarded – undo
715 715
 				return "error";
716 716
 			}
717 717
 			$query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN (';
718
-                        $i = 0;
719
-                        $j =0;
718
+						$i = 0;
719
+						$j =0;
720 720
 			$all = $sth->fetchAll(PDO::FETCH_ASSOC);
721 721
 			foreach($all as $row)
722 722
 			{
@@ -724,20 +724,20 @@  discard block
 block discarded – undo
724 724
 				$j++;
725 725
 				if ($j == 30) {
726 726
 					if ($globalDebug) echo ".";
727
-				    	try {
727
+						try {
728 728
 						
729 729
 						$sth = $this->db->prepare(substr($query_delete,0,-1).")");
730 730
 						$sth->execute();
731 731
 					} catch(PDOException $e) {
732 732
 						return "error";
733 733
 					}
734
-                                	$query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN (';
735
-                                	$j = 0;
734
+									$query_delete = 'DELETE FROM spotter_live WHERE flightaware_id IN (';
735
+									$j = 0;
736 736
 				}
737 737
 				$query_delete .= "'".$row['flightaware_id']."',";
738 738
 			}
739 739
 			if ($i > 0) {
740
-    				try {
740
+					try {
741 741
 					
742 742
 					$sth = $this->db->prepare(substr($query_delete,0,-1).")");
743 743
 					$sth->execute();
@@ -748,9 +748,9 @@  discard block
 block discarded – undo
748 748
 			return "success";
749 749
 		} elseif ($globalDBdriver == 'pgsql') {
750 750
 			//$query = "SELECT flightaware_id FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' >= spotter_live.date AND spotter_live.flightaware_id NOT IN (SELECT flightaware_id FROM spotter_live WHERE NOW() AT TIME ZONE 'UTC' - INTERVAL '9 HOURS' < spotter_live.date) LIMIT 800 OFFSET 0";
751
-    			//$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0";
752
-    			$query = "DELETE FROM spotter_live WHERE flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 2000 OFFSET 0)";
753
-    			try {
751
+				//$query = "SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 800 OFFSET 0";
752
+				$query = "DELETE FROM spotter_live WHERE flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT flightaware_id,MAX(date) as max_date FROM spotter_live GROUP BY flightaware_id) s ON s.flightaware_id = spotter_live.flightaware_id AND NOW() AT TIME ZONE 'UTC' - INTERVAL '2 HOURS' >= s.max_date LIMIT 2000 OFFSET 0)";
753
+				try {
754 754
 				
755 755
 				$sth = $this->db->prepare($query);
756 756
 				$sth->execute();
@@ -794,17 +794,17 @@  discard block
 block discarded – undo
794 794
 	}
795 795
 
796 796
 	/**
797
-	* Deletes all info in the table for an ident
798
-	*
799
-	* @return String success or false
800
-	*
801
-	*/
797
+	 * Deletes all info in the table for an ident
798
+	 *
799
+	 * @return String success or false
800
+	 *
801
+	 */
802 802
 	public function deleteLiveSpotterDataByIdent($ident)
803 803
 	{
804 804
 		$ident = filter_var($ident, FILTER_SANITIZE_STRING);
805 805
 		$query  = 'DELETE FROM spotter_live WHERE ident = :ident';
806 806
         
807
-    		try {
807
+			try {
808 808
 			
809 809
 			$sth = $this->db->prepare($query);
810 810
 			$sth->execute(array(':ident' => $ident));
@@ -816,17 +816,17 @@  discard block
 block discarded – undo
816 816
 	}
817 817
 
818 818
 	/**
819
-	* Deletes all info in the table for an id
820
-	*
821
-	* @return String success or false
822
-	*
823
-	*/
819
+	 * Deletes all info in the table for an id
820
+	 *
821
+	 * @return String success or false
822
+	 *
823
+	 */
824 824
 	public function deleteLiveSpotterDataById($id)
825 825
 	{
826 826
 		$id = filter_var($id, FILTER_SANITIZE_STRING);
827 827
 		$query  = 'DELETE FROM spotter_live WHERE flightaware_id = :id';
828 828
         
829
-    		try {
829
+			try {
830 830
 			
831 831
 			$sth = $this->db->prepare($query);
832 832
 			$sth->execute(array(':id' => $id));
@@ -839,11 +839,11 @@  discard block
 block discarded – undo
839 839
 
840 840
 
841 841
 	/**
842
-	* Gets the aircraft ident within the last hour
843
-	*
844
-	* @return String the ident
845
-	*
846
-	*/
842
+	 * Gets the aircraft ident within the last hour
843
+	 *
844
+	 * @return String the ident
845
+	 *
846
+	 */
847 847
 	public function getIdentFromLastHour($ident)
848 848
 	{
849 849
 		global $globalDBdriver, $globalTimezone;
@@ -869,14 +869,14 @@  discard block
 block discarded – undo
869 869
 			$ident_result = $row['ident'];
870 870
 		}
871 871
 		return $ident_result;
872
-        }
872
+		}
873 873
 
874 874
 	/**
875
-	* Check recent aircraft
876
-	*
877
-	* @return String the ident
878
-	*
879
-	*/
875
+	 * Check recent aircraft
876
+	 *
877
+	 * @return String the ident
878
+	 *
879
+	 */
880 880
 	public function checkIdentRecent($ident)
881 881
 	{
882 882
 		global $globalDBdriver, $globalTimezone;
@@ -902,14 +902,14 @@  discard block
 block discarded – undo
902 902
 			$ident_result = $row['flightaware_id'];
903 903
 		}
904 904
 		return $ident_result;
905
-        }
905
+		}
906 906
 
907 907
 	/**
908
-	* Check recent aircraft by id
909
-	*
910
-	* @return String the ident
911
-	*
912
-	*/
908
+	 * Check recent aircraft by id
909
+	 *
910
+	 * @return String the ident
911
+	 *
912
+	 */
913 913
 	public function checkIdRecent($id)
914 914
 	{
915 915
 		global $globalDBdriver, $globalTimezone;
@@ -935,14 +935,14 @@  discard block
 block discarded – undo
935 935
 			$ident_result = $row['flightaware_id'];
936 936
 		}
937 937
 		return $ident_result;
938
-        }
938
+		}
939 939
 
940 940
 	/**
941
-	* Check recent aircraft by ModeS
942
-	*
943
-	* @return String the ModeS
944
-	*
945
-	*/
941
+	 * Check recent aircraft by ModeS
942
+	 *
943
+	 * @return String the ModeS
944
+	 *
945
+	 */
946 946
 	public function checkModeSRecent($modes)
947 947
 	{
948 948
 		global $globalDBdriver, $globalTimezone;
@@ -972,11 +972,11 @@  discard block
 block discarded – undo
972 972
 	}
973 973
 
974 974
 	/**
975
-	* Gets the aircraft data from the last 20 seconds
976
-	*
977
-	* @return Array the spotter data
978
-	*
979
-	*/
975
+	 * Gets the aircraft data from the last 20 seconds
976
+	 *
977
+	 * @return Array the spotter data
978
+	 *
979
+	 */
980 980
 	public function getRealTimeData($q = '')
981 981
 	{
982 982
 		global $globalDBdriver;
@@ -1018,16 +1018,16 @@  discard block
 block discarded – undo
1018 1018
 	}
1019 1019
 
1020 1020
 	/**
1021
-	* Adds a new spotter data
1022
-	*
1023
-	* @param String $flightaware_id the ID from flightaware
1024
-	* @param String $ident the flight ident
1025
-	* @param String $aircraft_icao the aircraft type
1026
-	* @param String $departure_airport_icao the departure airport
1027
-	* @param String $arrival_airport_icao the arrival airport
1028
-	* @return String success or false
1029
-	*
1030
-	*/
1021
+	 * Adds a new spotter data
1022
+	 *
1023
+	 * @param String $flightaware_id the ID from flightaware
1024
+	 * @param String $ident the flight ident
1025
+	 * @param String $aircraft_icao the aircraft type
1026
+	 * @param String $departure_airport_icao the departure airport
1027
+	 * @param String $arrival_airport_icao the arrival airport
1028
+	 * @return String success or false
1029
+	 *
1030
+	 */
1031 1031
 	public function addLiveSpotterData($flightaware_id = '', $ident = '', $aircraft_icao = '', $departure_airport_icao = '', $arrival_airport_icao = '', $latitude = '', $longitude = '', $waypoints = '', $altitude = '', $altitude_real = '',$heading = '', $groundspeed = '', $date = '',$departure_airport_time = '', $arrival_airport_time = '', $squawk = '', $route_stop = '', $ModeS = '', $putinarchive = false,$registration = '',$pilot_id = '', $pilot_name = '', $verticalrate = '', $noarchive = false, $ground = false,$format_source = '', $source_name = '', $over_country = '')
1032 1032
 	{
1033 1033
 		global $globalURL, $globalArchive, $globalDebug;
@@ -1170,10 +1170,10 @@  discard block
 block discarded – undo
1170 1170
 		$arrival_airport_country = '';
1171 1171
 		
1172 1172
             	
1173
-            	if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL;
1174
-            	if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL;
1175
-            	if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0;
1176
-            	if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0;
1173
+				if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL;
1174
+				if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL;
1175
+				if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0;
1176
+				if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0;
1177 1177
 		
1178 1178
 		$query = '';
1179 1179
 		if ($globalArchive) {
@@ -1194,10 +1194,10 @@  discard block
 block discarded – undo
1194 1194
 			return "error : ".$e->getMessage();
1195 1195
 		}
1196 1196
 		if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) {
1197
-		    if ($globalDebug) echo '(Add to SBS archive : ';
1198
-		    $SpotterArchive = new SpotterArchive($this->db);
1199
-		    $result =  $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $altitude_real,$heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country);
1200
-		    if ($globalDebug) echo $result.')';
1197
+			if ($globalDebug) echo '(Add to SBS archive : ';
1198
+			$SpotterArchive = new SpotterArchive($this->db);
1199
+			$result =  $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $altitude_real,$heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country);
1200
+			if ($globalDebug) echo $result.')';
1201 1201
 		} elseif ($globalDebug && $putinarchive !== true) {
1202 1202
 			echo '(Not adding to archive)';
1203 1203
 		} elseif ($globalDebug && $noarchive === true) {
Please login to merge, or discard this patch.
airspace-geojson.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 $Connection = new Connection();
12 12
 
13 13
 if (!$Connection->tableExists('airspace')) {
14
-    die;
14
+	die;
15 15
 }
16 16
 
17 17
 if (isset($_GET['coord'])) 
18 18
 {
19 19
 	$coords = explode(',',$_GET['coord']);
20
-        if ($globalDBdriver == 'mysql') {
20
+		if ($globalDBdriver == 'mysql') {
21 21
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))";
22 22
 		try {
23 23
 			$sth = $Connection->db->prepare($query);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		}
38 38
 	}
39 39
 } else {
40
-        if ($globalDBdriver == 'mysql') {
40
+		if ($globalDBdriver == 'mysql') {
41 41
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace";
42 42
 	} else {
43 43
 		$query = "SELECT *, ST_AsBinary(wkb_geometry,'NDR') AS wkb FROM airspace";
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 $geojson = array(
54
-    'type' => 'FeatureCollection',
55
-    'features' => array()
54
+	'type' => 'FeatureCollection',
55
+	'features' => array()
56 56
 );
57 57
 
58 58
 while ($row = $sth->fetch(PDO::FETCH_ASSOC))
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 		}
116 116
 		if (isset($properties['type']) && $properties['type'] != '') {
117 117
 			$feature = array(
118
-			    'type' => 'Feature',
119
-			    'geometry' => json_decode($geom->out('json')),
120
-			    'properties' => $properties
118
+				'type' => 'Feature',
119
+				'geometry' => json_decode($geom->out('json')),
120
+				'properties' => $properties
121 121
 			);
122 122
 			array_push($geojson['features'], $feature);
123 123
 		}
Please login to merge, or discard this patch.
header.php 1 patch
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 // When button "Remove all filters" is clicked
39 39
 if (isset($_POST['removefilters'])) {
40 40
 	$allfilters = array_filter(array_keys($_COOKIE),function($key) {
41
-	    return strpos($key,'filter_') === 0;
41
+		return strpos($key,'filter_') === 0;
42 42
 	});
43 43
 	foreach ($allfilters as $filt) {
44 44
 		unset($_COOKIE[$filt]);
@@ -404,34 +404,34 @@  discard block
 block discarded – undo
404 404
 
405 405
       <ul class="nav navbar-nav">
406 406
 <?php
407
-    if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
407
+	if (isset($globalNewsFeeds['global']) && !empty($globalNewsFeeds['global'])) {
408 408
 ?>
409 409
     <li><a href="<?php print $globalURL; ?>/news"><?php echo _("News"); ?></a></li>
410 410
 <?php
411
-    }
411
+	}
412 412
 ?>
413 413
 
414 414
 <?php 
415
-    $sub = false;
416
-    if (
415
+	$sub = false;
416
+	if (
417 417
 	(
418
-	    (!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
418
+		(!isset($globalAircraft) || (isset($globalAircraft) && $globalAircraft === TRUE)) && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
419 419
 	) || 
420 420
 	(
421
-	    isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
421
+		isset($globalMarine) && $globalMarine === TRUE && ((isset($globalTracker) && $globalTracker === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
422 422
 	) || 
423 423
 	(
424
-	    isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
424
+		isset($globalTracker) && $globalTracker === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalSatellite) && $globalSatellite === TRUE))
425 425
 	) || 
426 426
 	(
427
-	    isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
427
+		isset($globalSatellite) && $globalSatellite === TRUE && ((isset($globalMarine) && $globalMarine === TRUE) || (isset($globalTracker) && $globalTracker === TRUE))
428 428
 	)
429
-    ) {
429
+	) {
430 430
 	$sub = true;
431
-    }
431
+	}
432 432
 ?>
433 433
 <?php
434
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
434
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
435 435
 ?>
436 436
     <li class="dropdown">
437 437
 <?php
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	<ul class="dropdown-menu multi-level">
443 443
       	<li class="dropdown-submenu">
444 444
 <?php
445
-        }
445
+		}
446 446
 ?>
447 447
 <?php
448 448
 	if (isset($globalNewsFeeds['aircraft']) && !empty($globalNewsFeeds['aircraft'])) {
@@ -457,25 +457,25 @@  discard block
 block discarded – undo
457 457
           <ul class="dropdown-menu">
458 458
           	<li><a href="<?php print $globalURL; ?>/aircraft"><?php echo _("Aircraft Types"); ?></a></li>
459 459
 <?php
460
-    if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
460
+	if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) {
461 461
 ?>
462 462
 			<li><a href="<?php print $globalURL; ?>/airline"><?php echo _("Airlines"); ?></a></li>
463 463
 <?php
464
-    }
464
+	}
465 465
 ?>
466 466
 			<li><a href="<?php print $globalURL; ?>/airport"><?php echo _("Airports"); ?></a></li>
467 467
 <?php
468
-    if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
468
+	if ((isset($globalUseOwner) && $globalUseOwner) || (!isset($globalUseOwner) && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalVAM) || !$globalVAM))) {
469 469
 ?>
470 470
 			<li><a href="<?php print $globalURL; ?>/owner"><?php echo _("Owners"); ?></a></li>
471 471
 <?php
472
-    } 
473
-    if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
472
+	} 
473
+	if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) {
474 474
 
475 475
 ?>
476 476
 			<li><a href="<?php print $globalURL; ?>/pilot"><?php echo _("Pilots"); ?></a></li>
477 477
 <?php
478
-    }
478
+	}
479 479
 ?>
480 480
 			<li><hr /></li>
481 481
             <li><a href="<?php print $globalURL; ?>/currently"><?php echo _("Current Activity"); ?></a></li>
@@ -483,43 +483,43 @@  discard block
 block discarded – undo
483 483
             <li><a href="<?php print $globalURL; ?>/date/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Activity"); ?></a></li>
484 484
             <li><a href="<?php print $globalURL; ?>/newest"><?php echo _("Newest by Category"); ?></a></li>
485 485
             <?php
486
-        	if ($globalACARS) {
487
-        	    if (isset($globalDemo) && $globalDemo) {
488
-    	    ?>
486
+			if ($globalACARS) {
487
+				if (isset($globalDemo) && $globalDemo) {
488
+			?>
489 489
             <li><hr /></li>
490 490
             <li><i><?php echo _('ACARS data not available publicly'); ?></i></li>
491 491
             <li><a href=""><?php echo _('Latest ACARS messages'); ?></a></li>
492 492
             <li><a href=""><?php echo _('Archive ACARS messages'); ?></a></li>
493 493
             <?php
494
-        	    } else {
495
-    	    ?>
494
+				} else {
495
+			?>
496 496
             <li><hr /></li>
497 497
             <li><a href="<?php print $globalURL; ?>/acars-latest"><?php echo _("Latest ACARS messages"); ?></a></li>
498 498
             <li><a href="<?php print $globalURL; ?>/acars-archive"><?php echo _("Archive ACARS messages"); ?></a></li>
499 499
             <?php
500
-        	    }
501
-        	}
502
-    	    ?>
500
+				}
501
+			}
502
+			?>
503 503
     	    <?php
504
-    	        if (isset($globalAccidents) && $globalAccidents) {
505
-    	    ?>
504
+				if (isset($globalAccidents) && $globalAccidents) {
505
+			?>
506 506
             <li><hr /></li>
507 507
             <li><a href="<?php print $globalURL; ?>/accident-latest"><?php echo _("Latest accident"); ?></a></li>
508 508
             <li><a href="<?php print $globalURL; ?>/accident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Accident"); ?></a></li>
509 509
             <li><a href="<?php print $globalURL; ?>/incident-latest"><?php echo _("Latest incident"); ?></a></li>
510 510
             <li><a href="<?php print $globalURL; ?>/incident/<?php print date("Y-m-d"); ?>"><?php echo _("Today's Incident"); ?></a></li>
511 511
             <?php
512
-        	}
513
-    	    ?>
512
+			}
513
+			?>
514 514
             <li><hr /></li>
515 515
             <li><a href="<?php print $globalURL; ?>/highlights/table"><?php echo _("Special Highlights"); ?></a></li>
516 516
             <?php
517 517
 		if (!isset($globalNoUpcoming) || $globalNoUpcoming === FALSE) {
518
-	    ?>
518
+		?>
519 519
             <li><a href="<?php print $globalURL; ?>/upcoming"><?php echo _("Upcoming Flights"); ?></a></li>
520 520
 	    <?php
521 521
 		}
522
-	    ?>
522
+		?>
523 523
           </ul>
524 524
         </li>
525 525
       	<li><a href="<?php print $globalURL; ?>/search"><?php echo _("Search"); ?></a></li>
@@ -546,14 +546,14 @@  discard block
 block discarded – undo
546 546
     </ul>
547 547
 <?php
548 548
 	}
549
-    }
549
+	}
550 550
 ?>
551 551
 <?php
552
-    if (isset($globalMarine) && $globalMarine) {
552
+	if (isset($globalMarine) && $globalMarine) {
553 553
 ?>
554 554
     <li class="dropdown">
555 555
 <?php
556
-        if ($sub) {
556
+		if ($sub) {
557 557
 ?>
558 558
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Marines"); ?> <b class="caret"></b></a>
559 559
 	<ul class="dropdown-menu multi-level">
@@ -587,14 +587,14 @@  discard block
 block discarded – undo
587 587
 	}
588 588
 ?>
589 589
 <?php
590
-    }
590
+	}
591 591
 ?>
592 592
 <?php
593
-    if (isset($globalTracker) && $globalTracker) {
593
+	if (isset($globalTracker) && $globalTracker) {
594 594
 ?>
595 595
     <li class="dropdown">
596 596
 <?php
597
-        if ($sub) {
597
+		if ($sub) {
598 598
 ?>
599 599
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Trackers"); ?> <b class="caret"></b></a>
600 600
 	<ul class="dropdown-menu multi-level">
@@ -628,14 +628,14 @@  discard block
 block discarded – undo
628 628
 	}
629 629
 ?>
630 630
 <?php
631
-    }
631
+	}
632 632
 ?>
633 633
 <?php
634
-    if (isset($globalSatellite) && $globalSatellite) {
634
+	if (isset($globalSatellite) && $globalSatellite) {
635 635
 ?>
636 636
     <li class="dropdown">
637 637
 <?php
638
-        if ($sub) {
638
+		if ($sub) {
639 639
 ?>
640 640
     <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo _("Satellites"); ?> <b class="caret"></b></a>
641 641
 	<ul class="dropdown-menu multi-level">
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 	}
672 672
 ?>
673 673
 <?php
674
-    }
674
+	}
675 675
 ?>
676 676
 
677 677
         <li class="dropdown">
@@ -680,12 +680,12 @@  discard block
 block discarded – undo
680 680
           	<li><a href="<?php print $globalURL; ?>/about"><?php echo _("About The Project"); ?></a></li>
681 681
           	<li><a href="<?php print $globalURL; ?>/about/export"><?php echo _("Exporting Data"); ?></a></li>
682 682
 <?php
683
-    if (!isset($globalAircraft) || $globalAircraft === TRUE) {
683
+	if (!isset($globalAircraft) || $globalAircraft === TRUE) {
684 684
 ?>
685 685
 		<li><hr /></li>
686 686
 		<li><a href="<?php print $globalURL; ?>/about/tv"><?php echo _("Spotter TV"); ?></a></li>
687 687
 <?php
688
-    }
688
+	}
689 689
 ?>
690 690
 	    <?php if (isset($globalContribute) && $globalContribute) { ?>
691 691
                 <li><hr /></li>
@@ -709,13 +709,13 @@  discard block
 block discarded – undo
709 709
   	    <form>
710 710
   		<select class="selectpicker" data-width="120px" onchange="language(this);">
711 711
   		    <?php
712
-  		        foreach ($alllang as $key => $lang) {
713
-  		            print '<option value="'.$key.'"';
714
-  		            if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
715
-  		            if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (&beta;eta)</option>';
716
-  		            else print '>'.$lang[0].'</option>';
717
-  		        }
718
-  		    ?>
712
+  				foreach ($alllang as $key => $lang) {
713
+  					print '<option value="'.$key.'"';
714
+  					if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected ';
715
+  					if ($lang[0] == 'Deutsch') print '>'.$lang[0].' (&beta;eta)</option>';
716
+  					else print '>'.$lang[0].'</option>';
717
+  				}
718
+  			?>
719 719
   		</select>
720 720
   	    </form>
721 721
   	</div>
@@ -748,18 +748,18 @@  discard block
 block discarded – undo
748 748
 ?>
749 749
     <div class="top-header clear" role="main">
750 750
 <?php
751
-    if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
751
+	if (isset($longitude) && isset($latitude) && $longitude != 0 && $latitude != 0) {
752 752
 ?>
753 753
     <div id="archive-map"></div>
754 754
 <?php
755
-    }
755
+	}
756 756
 ?>
757 757
     </div>
758 758
 <?php
759 759
 }
760 760
 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))
761 761
 {
762
-    ?>
762
+	?>
763 763
     <div class="top-header clear" role="main">
764 764
         <div id="map"></div>
765 765
 	<link rel="stylesheet" href="<?php print $globalURL; ?>/css/leaflet.css" />
@@ -770,15 +770,15 @@  discard block
 block discarded – undo
770 770
         var zoom = 13;
771 771
 //create the map
772 772
 <?php
773
-    if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
773
+	if (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($airport_array[0]['latitude'])) {
774 774
 ?>
775 775
   map = L.map('map', { zoomControl:true }).setView([<?php print $airport_array[0]['latitude']; ?>,<?php print $airport_array[0]['longitude']; ?>], zoom);
776 776
 <?php
777
-    } elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
777
+	} elseif (strpos(strtolower($current_page),'airport-') !== false && strpos(strtolower($current_page),'statistics-') === false) {
778 778
 ?>
779 779
   map = L.map('map', { zoomControl:true });
780 780
 <?php
781
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
781
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && isset($spotter_array[0]['departure_airport_latitude'])) {
782 782
 ?>
783 783
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['departure_airport_latitude']; ?>,<?php print $spotter_array[0]['arrival_airport_longitude']; ?>]);
784 784
     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);
@@ -786,22 +786,22 @@  discard block
 block discarded – undo
786 786
     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);
787 787
     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);
788 788
 <?php
789
-    } elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
789
+	} elseif (strpos(strtolower($current_page),'route-') !== false && strpos(strtolower($current_page),'statistics-') === false && !isset($spotter_array[0]['departure_airport_latitude']) && isset($spotter_array[0]['latitude'])) {
790 790
 ?>
791 791
   map = L.map('map', { zoomControl:true }).setView([<?php print $spotter_array[0]['latitude']; ?>,<?php print $spotter_array[0]['longitude']; ?>]);
792 792
 <?php
793
-    } elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
793
+	} elseif (!isset($spotter_array[0]['latitude']) && !isset($spotter_array[0]['longitude'])) {
794 794
 ?>
795 795
   map = L.map('map', { zoomControl:true });
796 796
 <?php
797
-    }
797
+	}
798 798
 ?>
799 799
   //initialize the layer group for the aircrft markers
800 800
   var layer_data = L.layerGroup();
801 801
 
802 802
   //a few title layers
803 803
 <?php
804
-    if ($globalMapProvider == 'Mapbox') {
804
+	if ($globalMapProvider == 'Mapbox') {
805 805
 ?>
806 806
   L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', {
807 807
     maxZoom: 18,
@@ -812,14 +812,14 @@  discard block
 block discarded – undo
812 812
     token : '<?php print $globalMapboxToken; ?>'
813 813
   }).addTo(map);
814 814
 <?php
815
-    } elseif ($globalMapProvider == 'Mapbox-GL') {
815
+	} elseif ($globalMapProvider == 'Mapbox-GL') {
816 816
 ?>
817 817
     L.mapboxGL({
818 818
 	accessToken: '<?php print $globalMapboxToken; ?>',
819 819
 	style: 'mapbox://styles/mapbox/bright-v8'
820 820
   }).addTo(map);
821 821
 <?php
822
-    } elseif ($globalMapProvider == 'MapQuest-OSM') {
822
+	} elseif ($globalMapProvider == 'MapQuest-OSM') {
823 823
 ?>
824 824
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
825 825
     maxZoom: 18,
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
       'Tiles Courtesy of <a href="http://www.mapquest.com">MapQuest</a>'
829 829
   }).addTo(map);
830 830
 <?php
831
-    } elseif ($globalMapProvider == 'MapQuest-Aerial') {
831
+	} elseif ($globalMapProvider == 'MapQuest-Aerial') {
832 832
 ?>
833 833
   L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
834 834
     maxZoom: 18,
@@ -837,27 +837,27 @@  discard block
 block discarded – undo
837 837
       '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"'
838 838
   }).addTo(map);
839 839
 <?php
840
-    } elseif ($globalMapProvider == 'Google-Roadmap') {
840
+	} elseif ($globalMapProvider == 'Google-Roadmap') {
841 841
 ?>
842 842
     var googleLayer = new L.Google('ROADMAP');
843 843
     map.addLayer(googleLayer);
844 844
 <?php
845
-    } elseif ($globalMapProvider == 'Google-Satellite') {
845
+	} elseif ($globalMapProvider == 'Google-Satellite') {
846 846
 ?>
847 847
     var googleLayer = new L.Google('SATELLITE');
848 848
     map.addLayer(googleLayer);
849 849
 <?php
850
-    } elseif ($globalMapProvider == 'Google-Hybrid') {
850
+	} elseif ($globalMapProvider == 'Google-Hybrid') {
851 851
 ?>
852 852
     var googleLayer = new L.Google('HYBRID');
853 853
     map.addLayer(googleLayer);
854 854
 <?php
855
-    } elseif ($globalMapProvider == 'Google-Terrain') {
855
+	} elseif ($globalMapProvider == 'Google-Terrain') {
856 856
 ?>
857 857
     var googleLayer = new L.Google('Terrain');
858 858
     map.addLayer(googleLayer);
859 859
 <?php
860
-    } elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
860
+	} elseif (isset($globalMapCustomLayer[$globalMapProvider])) {
861 861
 	$customid = $globalMapProvider;
862 862
 ?>
863 863
     L.tileLayer('<?php print $globalMapCustomLayer[$customid]['url']; ?>/{z}/{x}/{y}.png', {
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
         attribution: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
868 868
     }).addTo(map);
869 869
 <?php
870
-    } elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) {
870
+	} elseif ($globalMapProvider == 'offline' || (isset($globalMapOffline) && $globalMapOffline === TRUE)) {
871 871
 ?>
872 872
     var center = map.getCenter();
873 873
     map.options.crs = L.CRS.EPSG4326;
@@ -882,8 +882,8 @@  discard block
 block discarded – undo
882 882
         attribution: 'Natural Earth'
883 883
     }).addTo(map);
884 884
 <?php
885
-    //} elseif ($globalMapProvider == 'OpenStreetMap') {
886
-    } else {
885
+	//} elseif ($globalMapProvider == 'OpenStreetMap') {
886
+	} else {
887 887
 ?>
888 888
   L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
889 889
     maxZoom: 18,
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
   }).addTo(map);
893 893
 
894 894
 <?php
895
-    }
895
+	}
896 896
 ?>
897 897
         </script>
898 898
     </div>
Please login to merge, or discard this patch.
js/map-tracker.2d.js.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -575,8 +575,8 @@  discard block
 block discarded – undo
575 575
 			}
576 576
                     }
577 577
 		    <?php
578
-            		} else {
579
-            	    ?>
578
+					} else {
579
+					?>
580 580
 		    if (map.getZoom() > 7) {
581 581
                 	var style = {
582 582
                     	    "color": "#1a3151",
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
                 	layer_tracker_data.addLayer(layer);
596 596
 		    }
597 597
 <?php
598
-            		}
598
+					}
599 599
 ?>
600 600
 				}
601 601
 			    }
@@ -740,11 +740,11 @@  discard block
 block discarded – undo
740 740
 $( document ).ready(function() {
741 741
 	map.on('moveend', function() {
742 742
 <?php
743
-    if (isset($globalMapUseBbox) && $globalMapUseBbox && (!isset($archive) || $archive === false)) {
743
+	if (isset($globalMapUseBbox) && $globalMapUseBbox && (!isset($archive) || $archive === false)) {
744 744
 ?>
745 745
 		getLiveTrackerData(1);
746 746
 <?php
747
-    }
747
+	}
748 748
 ?>
749 749
 	});
750 750
 
Please login to merge, or discard this patch.
js/map-tracker.3d.js.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -98,21 +98,21 @@  discard block
 block discarded – undo
98 98
 			var entityid = entity.id;
99 99
 			var lastupdateentity = entity.properties.valueOf('lastupdate')._lastupdate._value;
100 100
 			<?php 
101
-			    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
101
+				if (isset($globalMapUseBbox) && $globalMapUseBbox) {
102 102
 			?>
103 103
 			if (lastupdateentity != lastupdatetracker) {
104 104
 				viewer.dataSources.get(dsn).entities.remove(entity);
105 105
 				czmldstracker.entities.removeById(entityid);
106 106
 			}
107 107
 			<?php
108
-			    } else {
108
+				} else {
109 109
 			?>
110 110
 			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) {
111 111
 				viewer.dataSources.get(dsn).entities.remove(entity);
112 112
 				czmldstracker.entities.removeById(entityid);
113 113
 			}
114 114
 			<?php
115
-			    }
115
+				}
116 116
 			?>
117 117
 		}
118 118
 	}
@@ -145,15 +145,15 @@  discard block
 block discarded – undo
145 145
 function updateTrackerData() {
146 146
 	lastupdatetracker = Date.now();
147 147
 <?php
148
-    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
148
+	if (isset($globalMapUseBbox) && $globalMapUseBbox) {
149 149
 ?>
150 150
 	var livetrackerdata = czmldstracker.process('<?php print $globalURL; ?>/live-czml.php?tracker&coord='+bbox()+'&update=' + lastupdatetracker);
151 151
 <?php
152
-    } else {
152
+	} else {
153 153
 ?>
154 154
 	var livetrackerdata = czmldstracker.process('<?php print $globalURL; ?>/live-czml.php?tracker&update=' + lastupdatetracker);
155 155
 <?php
156
-    }
156
+	}
157 157
 ?>  
158 158
 	livetrackerdata.then(function (data) { 
159 159
 		displayTrackerData(data);
@@ -209,13 +209,13 @@  discard block
 block discarded – undo
209 209
 }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
210 210
 camera.moveEnd.addEventListener(function() {
211 211
 <?php
212
-    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
212
+	if (isset($globalMapUseBbox) && $globalMapUseBbox) {
213 213
 ?>
214 214
 	if (typeof archive == 'undefined' || archive == false) {
215 215
 		updateTrackerData();
216 216
 	}
217 217
 <?php
218
-    }
218
+	}
219 219
 ?>
220 220
 });
221 221
 
Please login to merge, or discard this patch.
js/map-aircraft.3d.js.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
 			var entityid = entity.id;
290 290
 			var lastupdateentity = entity.properties.lastupdate;
291 291
 			<?php 
292
-			    if (isset($globalMapUseBbox) && $globalMapUseBbox) {
293
-			    // Remove flights not in latest CZML
292
+				if (isset($globalMapUseBbox) && $globalMapUseBbox) {
293
+				// Remove flights not in latest CZML
294 294
 			?>
295 295
 			if (lastupdateentity != lastupdate) {
296 296
 				console.log('Remove...');
@@ -298,14 +298,14 @@  discard block
 block discarded – undo
298 298
 				czmlds.entities.removeById(entityid);
299 299
 			}
300 300
 			<?php
301
-			    } else {
301
+				} else {
302 302
 			?>
303 303
 			if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) {
304 304
 				viewer.dataSources.get(dsn).entities.remove(entity);
305 305
 				czmlds.entities.removeById(entityid);
306 306
 			}
307 307
 			<?php
308
-			    }
308
+				}
309 309
 			?>
310 310
 		}
311 311
 	}
@@ -762,12 +762,12 @@  discard block
 block discarded – undo
762 762
 }
763 763
 
764 764
 <?php
765
-    if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) {
765
+	if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) {
766 766
 ?>
767 767
 update_atcLayer();
768 768
 setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
769 769
 <?php
770
-    }
770
+	}
771 771
 ?>
772 772
 
773 773
 function iconColor(color) {
Please login to merge, or discard this patch.
js/map.2d.js.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	};
386 386
 
387 387
 <?php
388
-    if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) {
388
+	if (isset($globalTSK) && $globalTSK && isset($_GET['tsk'])) {
389 389
 ?>
390 390
 	function tskPopup (feature, layer) {
391 391
 		var output = '';
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 	};
421 421
 	update_tsk();
422 422
 <?php
423
-    }
423
+	}
424 424
 ?>
425 425
 	map.on('moveend', function() {
426 426
 		if (map.hasLayer(locationsLayer) == true) {
@@ -434,10 +434,10 @@  discard block
 block discarded – undo
434 434
 		setInterval(function(){if (noTimeout) { map.removeLayer(locationsLayer); update_locationsLayer();} },<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
435 435
 	}
436 436
 <?php
437
-    // Add support for custom json via $globalMapJson
438
-    if (isset($globalMapJson) && is_array($globalMapJson)) {
437
+	// Add support for custom json via $globalMapJson
438
+	if (isset($globalMapJson) && is_array($globalMapJson)) {
439 439
 	foreach ($globalMapJson as $json) {
440
-	    if (isset($json['url'])) {
440
+		if (isset($json['url'])) {
441 441
 ?>
442 442
 update_genLayer('<?php print $json['url']; ?>');
443 443
 <?php
@@ -446,9 +446,9 @@  discard block
 block discarded – undo
446 446
 setInterval(function(){if (noTimeout) update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>);
447 447
 <?php
448 448
 		}
449
-	    }
449
+		}
450
+	}
450 451
 	}
451
-    }
452 452
 
453 453
 ?>
454 454
 //adds the bootstrap tooltip to the map icons
Please login to merge, or discard this patch.