Completed
Push — master ( e14a40...cfb98e )
by Yannick
54:46 queued 27:34
created
require/class.Tracker.php 1 patch
Indentation   +210 added lines, -210 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
 	}
15 15
 
16 16
 	/**
17
-	* Get SQL query part for filter used
18
-	* @param Array $filter the filter
19
-	* @return Array the SQL part
20
-	*/
17
+	 * Get SQL query part for filter used
18
+	 * @param Array $filter the filter
19
+	 * @return Array the SQL part
20
+	 */
21 21
 	
22 22
 	public function getFilter($filter = array(),$where = false,$and = false) {
23 23
 		global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver;
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
 	}
82 82
 
83 83
 	/**
84
-	* Executes the SQL statements to get the tracker information
85
-	*
86
-	* @param String $query the SQL query
87
-	* @param Array $params parameter of the query
88
-	* @param String $limitQuery the limit query
89
-	* @return Array the tracker information
90
-	*
91
-	*/
84
+	 * Executes the SQL statements to get the tracker information
85
+	 *
86
+	 * @param String $query the SQL query
87
+	 * @param Array $params parameter of the query
88
+	 * @param String $limitQuery the limit query
89
+	 * @return Array the tracker information
90
+	 *
91
+	 */
92 92
 	public function getDataFromDB($query, $params = array(), $limitQuery = '',$schedules = false)
93 93
 	{
94 94
 		date_default_timezone_set('UTC');
@@ -201,11 +201,11 @@  discard block
 block discarded – undo
201 201
 	
202 202
 	
203 203
 	/**
204
-	* Gets all the tracker information based on the latest data entry
205
-	*
206
-	* @return Array the tracker information
207
-	*
208
-	*/
204
+	 * Gets all the tracker information based on the latest data entry
205
+	 *
206
+	 * @return Array the tracker information
207
+	 *
208
+	 */
209 209
 	public function getLatestTrackerData($limit = '', $sort = '', $filter = array())
210 210
 	{
211 211
 		global $global_query;
@@ -263,11 +263,11 @@  discard block
 block discarded – undo
263 263
 	}
264 264
 
265 265
 	/**
266
-	* Gets all the tracker information based on the callsign
267
-	*
268
-	* @return Array the tracker information
269
-	*
270
-	*/
266
+	 * Gets all the tracker information based on the callsign
267
+	 *
268
+	 * @return Array the tracker information
269
+	 *
270
+	 */
271 271
 	public function getTrackerDataByIdent($ident = '', $limit = '', $sort = '', $filter = array())
272 272
 	{
273 273
 		global $global_query;
@@ -378,12 +378,12 @@  discard block
 block discarded – undo
378 378
 
379 379
 
380 380
 	/**
381
-	* Gets all source name
382
-	*
383
-	* @param String type format of source
384
-	* @return Array list of source name
385
-	*
386
-	*/
381
+	 * Gets all source name
382
+	 *
383
+	 * @param String type format of source
384
+	 * @return Array list of source name
385
+	 *
386
+	 */
387 387
 	public function getAllSourceName($type = '',$filters = array())
388 388
 	{
389 389
 		$filter_query = $this->getFilter($filters,true,true);
@@ -413,11 +413,11 @@  discard block
 block discarded – undo
413 413
 
414 414
 
415 415
 	/**
416
-	* Gets a list of all idents/callsigns
417
-	*
418
-	* @return Array list of ident/callsign names
419
-	*
420
-	*/
416
+	 * Gets a list of all idents/callsigns
417
+	 *
418
+	 * @return Array list of ident/callsign names
419
+	 *
420
+	 */
421 421
 	public function getAllIdents($filters = array())
422 422
 	{
423 423
 		$filter_query = $this->getFilter($filters,true,true);
@@ -485,18 +485,18 @@  discard block
 block discarded – undo
485 485
 	
486 486
 	
487 487
 	/**
488
-	* Update ident tracker data
489
-	*
490
-	* @param String $flightaware_id the ID from flightaware
491
-	* @param String $ident the flight ident
492
-	* @return String success or false
493
-	*
494
-	*/	
488
+	 * Update ident tracker data
489
+	 *
490
+	 * @param String $flightaware_id the ID from flightaware
491
+	 * @param String $ident the flight ident
492
+	 * @return String success or false
493
+	 *
494
+	 */	
495 495
 	public function updateIdentTrackerData($famtrackid = '', $ident = '',$fromsource = NULL)
496 496
 	{
497 497
 
498 498
 		$query = 'UPDATE tracker_output SET ident = :ident WHERE famtrackid = :famtrackid';
499
-                $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident);
499
+				$query_values = array(':famtrackid' => $famtrackid,':ident' => $ident);
500 500
 
501 501
 		try {
502 502
 			$sth = $this->db->prepare($query);
@@ -509,18 +509,18 @@  discard block
 block discarded – undo
509 509
 
510 510
 	}
511 511
 	/**
512
-	* Update latest tracker data
513
-	*
514
-	* @param String $flightaware_id the ID from flightaware
515
-	* @param String $ident the flight ident
516
-	* @param String $arrival_airport_icao the arrival airport
517
-	* @return String success or false
518
-	*
519
-	*/	
512
+	 * Update latest tracker data
513
+	 *
514
+	 * @param String $flightaware_id the ID from flightaware
515
+	 * @param String $ident the flight ident
516
+	 * @param String $arrival_airport_icao the arrival airport
517
+	 * @return String success or false
518
+	 *
519
+	 */	
520 520
 	public function updateLatestTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $groundspeed = NULL, $date = '')
521 521
 	{
522 522
 		$query = 'UPDATE tracker_output SET ident = :ident, last_latitude = :last_latitude, last_longitude = :last_longitude, last_altitude = :last_altitude, last_seen = :last_seen, last_ground_speed = :last_ground_speed WHERE famtrackid = :famtrackid';
523
-                $query_values = array(':famtrackid' => $famtrackid,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':ident' => $ident);
523
+				$query_values = array(':famtrackid' => $famtrackid,':last_latitude' => $latitude,':last_longitude' => $longitude, ':last_altitude' => $altitude,':last_ground_speed' => $groundspeed,':last_seen' => $date,':ident' => $ident);
524 524
 
525 525
 		try {
526 526
 			$sth = $this->db->prepare($query);
@@ -534,32 +534,32 @@  discard block
 block discarded – undo
534 534
 	}
535 535
 
536 536
 	/**
537
-	* Adds a new tracker data
538
-	*
539
-	* @param String $flightaware_id the ID from flightaware
540
-	* @param String $ident the flight ident
541
-	* @param String $aircraft_icao the aircraft type
542
-	* @param String $departure_airport_icao the departure airport
543
-	* @param String $arrival_airport_icao the arrival airport
544
-	* @param String $latitude latitude of flight
545
-	* @param String $longitude latitude of flight
546
-	* @param String $waypoints waypoints of flight
547
-	* @param String $altitude altitude of flight
548
-	* @param String $heading heading of flight
549
-	* @param String $groundspeed speed of flight
550
-	* @param String $date date of flight
551
-	* @param String $departure_airport_time departure time of flight
552
-	* @param String $arrival_airport_time arrival time of flight
553
-	* @param String $squawk squawk code of flight
554
-	* @param String $route_stop route stop of flight
555
-	* @param String $highlight highlight or not
556
-	* @param String $ModeS ModesS code of flight
557
-	* @param String $registration registration code of flight
558
-	* @param String $pilot_id pilot id of flight (for virtual airlines)
559
-	* @param String $pilot_name pilot name of flight (for virtual airlines)
560
-	* @param String $verticalrate vertival rate of flight
561
-	* @return String success or false
562
-	*/
537
+	 * Adds a new tracker data
538
+	 *
539
+	 * @param String $flightaware_id the ID from flightaware
540
+	 * @param String $ident the flight ident
541
+	 * @param String $aircraft_icao the aircraft type
542
+	 * @param String $departure_airport_icao the departure airport
543
+	 * @param String $arrival_airport_icao the arrival airport
544
+	 * @param String $latitude latitude of flight
545
+	 * @param String $longitude latitude of flight
546
+	 * @param String $waypoints waypoints of flight
547
+	 * @param String $altitude altitude of flight
548
+	 * @param String $heading heading of flight
549
+	 * @param String $groundspeed speed of flight
550
+	 * @param String $date date of flight
551
+	 * @param String $departure_airport_time departure time of flight
552
+	 * @param String $arrival_airport_time arrival time of flight
553
+	 * @param String $squawk squawk code of flight
554
+	 * @param String $route_stop route stop of flight
555
+	 * @param String $highlight highlight or not
556
+	 * @param String $ModeS ModesS code of flight
557
+	 * @param String $registration registration code of flight
558
+	 * @param String $pilot_id pilot id of flight (for virtual airlines)
559
+	 * @param String $pilot_name pilot name of flight (for virtual airlines)
560
+	 * @param String $verticalrate vertival rate of flight
561
+	 * @return String success or false
562
+	 */
563 563
 	public function addTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $comment = '', $type = '',$format_source = '', $source_name = '')
564 564
 	{
565 565
 		global $globalURL;
@@ -644,16 +644,16 @@  discard block
 block discarded – undo
644 644
 		$comment = filter_var($comment,FILTER_SANITIZE_STRING);
645 645
 		$type = filter_var($type,FILTER_SANITIZE_STRING);
646 646
 	
647
-                if ($latitude == '' && $longitude == '') {
648
-            		$latitude = 0;
649
-            		$longitude = 0;
650
-            	}
651
-                if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
652
-                if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
653
-                $query  = "INSERT INTO tracker_output (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, comment, type) 
647
+				if ($latitude == '' && $longitude == '') {
648
+					$latitude = 0;
649
+					$longitude = 0;
650
+				}
651
+				if ($heading == '' || $Common->isInteger($heading) === false) $heading = 0;
652
+				if ($groundspeed == '' || $Common->isInteger($groundspeed) === false) $groundspeed = 0;
653
+				$query  = "INSERT INTO tracker_output (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, comment, type) 
654 654
                 VALUES (:famtrackid,:ident,:latitude,:longitude,:altitude,:heading,:speed,:date,:format_source, :source_name,:comment,:type)";
655 655
 
656
-                $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident,':latitude' => $latitude,':longitude' => $longitude,':altitude' => $altitude,':heading' => $heading,':speed' => $groundspeed,':date' => $date,':format_source' => $format_source, ':source_name' => $source_name,':comment' => $comment,':type' => $type);
656
+				$query_values = array(':famtrackid' => $famtrackid,':ident' => $ident,':latitude' => $latitude,':longitude' => $longitude,':altitude' => $altitude,':heading' => $heading,':speed' => $groundspeed,':date' => $date,':format_source' => $format_source, ':source_name' => $source_name,':comment' => $comment,':type' => $type);
657 657
 
658 658
 		try {
659 659
 		        
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 			$sth->execute($query_values);
662 662
 			$this->db = null;
663 663
 		} catch (PDOException $e) {
664
-		    return "error : ".$e->getMessage();
664
+			return "error : ".$e->getMessage();
665 665
 		}
666 666
 		
667 667
 		return "success";
@@ -670,11 +670,11 @@  discard block
 block discarded – undo
670 670
 	
671 671
   
672 672
 	/**
673
-	* Gets the aircraft ident within the last hour
674
-	*
675
-	* @return String the ident
676
-	*
677
-	*/
673
+	 * Gets the aircraft ident within the last hour
674
+	 *
675
+	 * @return String the ident
676
+	 *
677
+	 */
678 678
 	public function getIdentFromLastHour($ident)
679 679
 	{
680 680
 		global $globalDBdriver, $globalTimezone;
@@ -690,11 +690,11 @@  discard block
 block discarded – undo
690 690
 								AND tracker_output.date >= now() AT TIME ZONE 'UTC' - INTERVAL '1 HOURS'
691 691
 								AND tracker_output.date < now() AT TIME ZONE 'UTC'";
692 692
 			$query_data = array(':ident' => $ident);
693
-    		}
693
+			}
694 694
 		
695 695
 		$sth = $this->db->prepare($query);
696 696
 		$sth->execute($query_data);
697
-    		$ident_result='';
697
+			$ident_result='';
698 698
 		while($row = $sth->fetch(PDO::FETCH_ASSOC))
699 699
 		{
700 700
 			$ident_result = $row['ident'];
@@ -705,11 +705,11 @@  discard block
 block discarded – undo
705 705
 	
706 706
 	
707 707
 	/**
708
-	* Gets the aircraft data from the last 20 seconds
709
-	*
710
-	* @return Array the tracker data
711
-	*
712
-	*/
708
+	 * Gets the aircraft data from the last 20 seconds
709
+	 *
710
+	 * @return Array the tracker data
711
+	 *
712
+	 */
713 713
 	public function getRealTimeData($q = '')
714 714
 	{
715 715
 		global $globalDBdriver;
@@ -743,11 +743,11 @@  discard block
 block discarded – undo
743 743
 	}
744 744
 
745 745
 	/**
746
-	* Gets all number of flight over countries
747
-	*
748
-	* @return Array the airline country list
749
-	*
750
-	*/
746
+	 * Gets all number of flight over countries
747
+	 *
748
+	 * @return Array the airline country list
749
+	 *
750
+	 */
751 751
 	public function countAllTrackerOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array())
752 752
 	{
753 753
 		global $globalDBdriver, $globalArchive;
@@ -817,11 +817,11 @@  discard block
 block discarded – undo
817 817
 	}
818 818
 	
819 819
 	/**
820
-	* Gets all callsigns that have flown over
821
-	*
822
-	* @return Array the callsign list
823
-	*
824
-	*/
820
+	 * Gets all callsigns that have flown over
821
+	 *
822
+	 * @return Array the callsign list
823
+	 *
824
+	 */
825 825
 	public function countAllCallsigns($limit = true, $olderthanmonths = 0, $sincedate = '',$filters = array(),$year = '', $month = '', $day = '')
826 826
 	{
827 827
 		global $globalDBdriver;
@@ -888,11 +888,11 @@  discard block
 block discarded – undo
888 888
 
889 889
 
890 890
 	/**
891
-	* Counts all dates
892
-	*
893
-	* @return Array the date list
894
-	*
895
-	*/
891
+	 * Counts all dates
892
+	 *
893
+	 * @return Array the date list
894
+	 *
895
+	 */
896 896
 	public function countAllDates($filters = array())
897 897
 	{
898 898
 		global $globalTimezone, $globalDBdriver;
@@ -938,11 +938,11 @@  discard block
 block discarded – undo
938 938
 	
939 939
 	
940 940
 	/**
941
-	* Counts all dates during the last 7 days
942
-	*
943
-	* @return Array the date list
944
-	*
945
-	*/
941
+	 * Counts all dates during the last 7 days
942
+	 *
943
+	 * @return Array the date list
944
+	 *
945
+	 */
946 946
 	public function countAllDatesLast7Days($filters = array())
947 947
 	{
948 948
 		global $globalTimezone, $globalDBdriver;
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 			$query .= " GROUP BY date_name 
965 965
 								ORDER BY date_name ASC";
966 966
 			$query_data = array(':offset' => $offset);
967
-    		}
967
+			}
968 968
 		
969 969
 		$sth = $this->db->prepare($query);
970 970
 		$sth->execute($query_data);
@@ -984,11 +984,11 @@  discard block
 block discarded – undo
984 984
 	}
985 985
 
986 986
 	/**
987
-	* Counts all dates during the last month
988
-	*
989
-	* @return Array the date list
990
-	*
991
-	*/
987
+	 * Counts all dates during the last month
988
+	 *
989
+	 * @return Array the date list
990
+	 *
991
+	 */
992 992
 	public function countAllDatesLastMonth($filters = array())
993 993
 	{
994 994
 		global $globalTimezone, $globalDBdriver;
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 			$query .= " GROUP BY date_name 
1011 1011
 								ORDER BY date_name ASC";
1012 1012
 			$query_data = array(':offset' => $offset);
1013
-    		}
1013
+			}
1014 1014
 		
1015 1015
 		$sth = $this->db->prepare($query);
1016 1016
 		$sth->execute($query_data);
@@ -1032,11 +1032,11 @@  discard block
 block discarded – undo
1032 1032
 
1033 1033
 
1034 1034
 	/**
1035
-	* Counts all month
1036
-	*
1037
-	* @return Array the month list
1038
-	*
1039
-	*/
1035
+	 * Counts all month
1036
+	 *
1037
+	 * @return Array the month list
1038
+	 *
1039
+	 */
1040 1040
 	public function countAllMonths($filters = array())
1041 1041
 	{
1042 1042
 		global $globalTimezone, $globalDBdriver;
@@ -1081,11 +1081,11 @@  discard block
 block discarded – undo
1081 1081
 	
1082 1082
 
1083 1083
 	/**
1084
-	* Counts all dates during the last year
1085
-	*
1086
-	* @return Array the date list
1087
-	*
1088
-	*/
1084
+	 * Counts all dates during the last year
1085
+	 *
1086
+	 * @return Array the date list
1087
+	 *
1088
+	 */
1089 1089
 	public function countAllMonthsLastYear($filters)
1090 1090
 	{
1091 1091
 		global $globalTimezone, $globalDBdriver;
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 			$query .= " GROUP BY year_name, month_name
1108 1108
 								ORDER BY year_name, month_name ASC";
1109 1109
 			$query_data = array(':offset' => $offset);
1110
-    		}
1110
+			}
1111 1111
 		
1112 1112
 		$sth = $this->db->prepare($query);
1113 1113
 		$sth->execute($query_data);
@@ -1130,11 +1130,11 @@  discard block
 block discarded – undo
1130 1130
 	
1131 1131
 	
1132 1132
 	/**
1133
-	* Counts all hours
1134
-	*
1135
-	* @return Array the hour list
1136
-	*
1137
-	*/
1133
+	 * Counts all hours
1134
+	 *
1135
+	 * @return Array the hour list
1136
+	 *
1137
+	 */
1138 1138
 	public function countAllHours($orderby,$filters = array())
1139 1139
 	{
1140 1140
 		global $globalTimezone, $globalDBdriver;
@@ -1197,11 +1197,11 @@  discard block
 block discarded – undo
1197 1197
 	
1198 1198
 	
1199 1199
 	/**
1200
-	* Counts all hours by date
1201
-	*
1202
-	* @return Array the hour list
1203
-	*
1204
-	*/
1200
+	 * Counts all hours by date
1201
+	 *
1202
+	 * @return Array the hour list
1203
+	 *
1204
+	 */
1205 1205
 	public function countAllHoursByDate($date, $filters = array())
1206 1206
 	{
1207 1207
 		global $globalTimezone, $globalDBdriver;
@@ -1245,11 +1245,11 @@  discard block
 block discarded – undo
1245 1245
 	
1246 1246
 	
1247 1247
 	/**
1248
-	* Counts all hours by a ident/callsign
1249
-	*
1250
-	* @return Array the hour list
1251
-	*
1252
-	*/
1248
+	 * Counts all hours by a ident/callsign
1249
+	 *
1250
+	 * @return Array the hour list
1251
+	 *
1252
+	 */
1253 1253
 	public function countAllHoursByIdent($ident, $filters = array())
1254 1254
 	{
1255 1255
 		global $globalTimezone, $globalDBdriver;
@@ -1294,11 +1294,11 @@  discard block
 block discarded – undo
1294 1294
 	
1295 1295
 	
1296 1296
 	/**
1297
-	* Counts all trackers that have flown over
1298
-	*
1299
-	* @return Integer the number of trackers
1300
-	*
1301
-	*/
1297
+	 * Counts all trackers that have flown over
1298
+	 *
1299
+	 * @return Integer the number of trackers
1300
+	 *
1301
+	 */
1302 1302
 	public function countOverallTracker($filters = array(),$year = '',$month = '')
1303 1303
 	{
1304 1304
 		global $globalDBdriver;
@@ -1333,11 +1333,11 @@  discard block
 block discarded – undo
1333 1333
 	}
1334 1334
 	
1335 1335
 	/**
1336
-	* Counts all trackers type that have flown over
1337
-	*
1338
-	* @return Integer the number of flights
1339
-	*
1340
-	*/
1336
+	 * Counts all trackers type that have flown over
1337
+	 *
1338
+	 * @return Integer the number of flights
1339
+	 *
1340
+	 */
1341 1341
 	public function countOverallTrackerTypes($filters = array(),$year = '',$month = '')
1342 1342
 	{
1343 1343
 		global $globalDBdriver;
@@ -1372,11 +1372,11 @@  discard block
 block discarded – undo
1372 1372
 	
1373 1373
   
1374 1374
 	/**
1375
-	* Counts all hours of today
1376
-	*
1377
-	* @return Array the hour list
1378
-	*
1379
-	*/
1375
+	 * Counts all hours of today
1376
+	 *
1377
+	 * @return Array the hour list
1378
+	 *
1379
+	 */
1380 1380
 	public function countAllHoursFromToday($filters = array())
1381 1381
 	{
1382 1382
 		global $globalTimezone, $globalDBdriver;
@@ -1416,12 +1416,12 @@  discard block
 block discarded – undo
1416 1416
 	}
1417 1417
     
1418 1418
     
1419
-     /**
1420
-	* Gets the Barrie Spotter ID based on the FlightAware ID
1421
-	*
1422
-	* @return Integer the Barrie Spotter ID
1419
+	 /**
1420
+	  * Gets the Barrie Spotter ID based on the FlightAware ID
1421
+	  *
1422
+	  * @return Integer the Barrie Spotter ID
1423 1423
 q	*
1424
-	*/
1424
+	  */
1425 1425
 	public function getTrackerIDBasedOnFamTrackID($famtrackid)
1426 1426
 	{
1427 1427
 		$famtrackid = filter_var($famtrackid,FILTER_SANITIZE_STRING);
@@ -1442,13 +1442,13 @@  discard block
 block discarded – undo
1442 1442
   
1443 1443
  
1444 1444
 	/**
1445
-	* Parses a date string
1446
-	*
1447
-	* @param String $dateString the date string
1448
-	* @param String $timezone the timezone of a user
1449
-	* @return Array the time information
1450
-	*
1451
-	*/
1445
+	 * Parses a date string
1446
+	 *
1447
+	 * @param String $dateString the date string
1448
+	 * @param String $timezone the timezone of a user
1449
+	 * @return Array the time information
1450
+	 *
1451
+	 */
1452 1452
 	public function parseDateString($dateString, $timezone = '')
1453 1453
 	{
1454 1454
 		$time_array = array();
@@ -1481,12 +1481,12 @@  discard block
 block discarded – undo
1481 1481
 	}
1482 1482
 	
1483 1483
 	/**
1484
-	* Parses the direction degrees to working
1485
-	*
1486
-	* @param Float $direction the direction in degrees
1487
-	* @return Array the direction information
1488
-	*
1489
-	*/
1484
+	 * Parses the direction degrees to working
1485
+	 *
1486
+	 * @param Float $direction the direction in degrees
1487
+	 * @return Array the direction information
1488
+	 *
1489
+	 */
1490 1490
 	public function parseDirection($direction = 0)
1491 1491
 	{
1492 1492
 		if ($direction == '') $direction = 0;
@@ -1565,12 +1565,12 @@  discard block
 block discarded – undo
1565 1565
 	
1566 1566
 	
1567 1567
 	/**
1568
-	* Gets Country from latitude/longitude
1569
-	*
1570
-	* @param Float $latitude latitute of the flight
1571
-	* @param Float $longitude longitute of the flight
1572
-	* @return String the countrie
1573
-	*/
1568
+	 * Gets Country from latitude/longitude
1569
+	 *
1570
+	 * @param Float $latitude latitute of the flight
1571
+	 * @param Float $longitude longitute of the flight
1572
+	 * @return String the countrie
1573
+	 */
1574 1574
 	public function getCountryFromLatitudeLongitude($latitude,$longitude)
1575 1575
 	{
1576 1576
 		global $globalDBdriver, $globalDebug;
@@ -1607,11 +1607,11 @@  discard block
 block discarded – undo
1607 1607
 	}
1608 1608
 
1609 1609
 	/**
1610
-	* Gets Country from iso2
1611
-	*
1612
-	* @param String $iso2 ISO2 country code
1613
-	* @return String the countrie
1614
-	*/
1610
+	 * Gets Country from iso2
1611
+	 *
1612
+	 * @param String $iso2 ISO2 country code
1613
+	 * @return String the countrie
1614
+	 */
1615 1615
 	public function getCountryFromISO2($iso2)
1616 1616
 	{
1617 1617
 		global $globalDBdriver, $globalDebug;
@@ -1639,11 +1639,11 @@  discard block
 block discarded – undo
1639 1639
 	}
1640 1640
 
1641 1641
 	/**
1642
-	* Gets all vessels types that have flown over
1643
-	*
1644
-	* @return Array the vessel type list
1645
-	*
1646
-	*/
1642
+	 * Gets all vessels types that have flown over
1643
+	 *
1644
+	 * @return Array the vessel type list
1645
+	 *
1646
+	 */
1647 1647
 	public function countAllTrackerTypes($limit = true,$olderthanmonths = 0,$sincedate = '',$filters = array(),$year = '',$month = '',$day = '')
1648 1648
 	{
1649 1649
 		global $globalDBdriver;
@@ -1708,11 +1708,11 @@  discard block
 block discarded – undo
1708 1708
 	}
1709 1709
 
1710 1710
 	/**
1711
-	* Gets all the tracker information
1712
-	*
1713
-	* @return Array the tracker information
1714
-	*
1715
-	*/
1711
+	 * Gets all the tracker information
1712
+	 *
1713
+	 * @return Array the tracker information
1714
+	 *
1715
+	 */
1716 1716
 	public function searchTrackerData($q = '', $callsign = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '',$filters = array())
1717 1717
 	{
1718 1718
 		global $globalTimezone, $globalDBdriver;
@@ -1817,12 +1817,12 @@  discard block
 block discarded – undo
1817 1817
 	}
1818 1818
 
1819 1819
 	/**
1820
-	* Gets the short url from bit.ly
1821
-	*
1822
-	* @param String $url the full url
1823
-	* @return String the bit.ly url
1824
-	*
1825
-	*/
1820
+	 * Gets the short url from bit.ly
1821
+	 *
1822
+	 * @param String $url the full url
1823
+	 * @return String the bit.ly url
1824
+	 *
1825
+	 */
1826 1826
 	public function getBitlyURL($url)
1827 1827
 	{
1828 1828
 		global $globalBitlyAccessToken;
Please login to merge, or discard this patch.
country-statistics-registration.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['country'])) {
6
-        header('Location: '.$globalURL.'/country');
7
-        die();
6
+		header('Location: '.$globalURL.'/country');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
Please login to merge, or discard this patch.
airline-statistics-arrival-airport-country.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['airline'])) {
7
-        header('Location: '.$globalURL.'/airline');
8
-        die();
7
+		header('Location: '.$globalURL.'/airline');
8
+		die();
9 9
 }
10 10
 $airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));
11 11
 $Spotter = new Spotter();
Please login to merge, or discard this patch.
manufacturer-statistics-departure-airport.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['aircraft_manufacturer'])) {
7
-        header('Location: '.$globalURL.'/manufacturer');
8
-        die();
7
+		header('Location: '.$globalURL.'/manufacturer');
8
+		die();
9 9
 }
10 10
 $Spotter = new Spotter();
11 11
 $manufacturer = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))));
Please login to merge, or discard this patch.
airline-statistics-departure-airport-country.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['airline'])) {
7
-        header('Location: '.$globalURL.'/airline');
8
-        die();
7
+		header('Location: '.$globalURL.'/airline');
8
+		die();
9 9
 }
10 10
 $airline = urldecode(filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING));
11 11
 $Spotter = new Spotter();
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
 	}
119 119
 	$country_data = substr($country_data, 0, -1);
120 120
 	print $country_data;
121
-        print '];';
122
-        print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
123
-        print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
124
-        print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});';
125
-        print 'new Datamap({
121
+		print '];';
122
+		print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);';
123
+		print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);';
124
+		print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});';
125
+		print 'new Datamap({
126 126
 	    element: document.getElementById("chartCountry"),
127 127
 	    projection: "mercator", // big world map
128 128
 	    fills: { defaultFill: "#F5F5F5" },
Please login to merge, or discard this patch.
owner-statistics-registration.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['owner'])) {
6
-        header('Location: '.$globalURL.'/owner');
7
-        die();
6
+		header('Location: '.$globalURL.'/owner');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING));
Please login to merge, or discard this patch.
country-statistics-arrival-airport-country.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['country'])) {
6
-        header('Location: '.$globalURL.'/country');
7
-        die();
6
+		header('Location: '.$globalURL.'/country');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	include('country-sub-menu.php');
52 52
 	print '<div class="column">';
53 53
 	print '<h2>'._("Most Common Arrival Airports by Country").'</h2>';
54
-        print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
54
+		print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights of airports &amp; airlines from <strong>%s</strong>."),$country).'</p>';
55 55
 
56 56
 	$airport_country_array = $Spotter->countAllArrivalAirportCountriesByCountry($country);
57 57
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
Please login to merge, or discard this patch.
manufacturer-statistics-route.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 require_once('require/class.Stats.php');
5 5
 require_once('require/class.Language.php');
6 6
 if (!isset($_GET['aircraft_manufacturer'])) {
7
-        header('Location: '.$globalURL.'/manufacturer');
8
-        die();
7
+		header('Location: '.$globalURL.'/manufacturer');
8
+		die();
9 9
 }
10 10
 $Spotter = new Spotter();
11 11
 $manufacturer = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))));
Please login to merge, or discard this patch.
country-statistics-route.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 require_once('require/class.Spotter.php');
4 4
 require_once('require/class.Language.php');
5 5
 if (!isset($_GET['country'])) {
6
-        header('Location: '.$globalURL.'/country');
7
-        die();
6
+		header('Location: '.$globalURL.'/country');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $country = ucwords(str_replace("-", " ", urldecode(filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))));
Please login to merge, or discard this patch.