Completed
Push — master ( 3f174d...72d96f )
by Yannick
12:45
created
require/class.SpotterArchive.php 1 patch
Braces   +23 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,10 +16,17 @@  discard block
 block discarded – undo
16 16
         if ($over_country == '') {
17 17
 	        $Spotter = new Spotter($this->db);
18 18
 	        $data_country = $Spotter->getCountryFromLatitudeLongitude($latitude,$longitude);
19
-		if (!empty($data_country)) $country = $data_country['iso2'];
20
-		else $country = '';
21
-	} else $country = $over_country;
22
-	if ($airline_type === NULL) $airline_type ='';
19
+		if (!empty($data_country)) {
20
+			$country = $data_country['iso2'];
21
+		} else {
22
+			$country = '';
23
+		}
24
+	} else {
25
+		$country = $over_country;
26
+	}
27
+	if ($airline_type === NULL) {
28
+		$airline_type ='';
29
+	}
23 30
 	
24 31
 	//if ($country == '') echo "\n".'************ UNKNOW COUNTRY ****************'."\n";
25 32
 	//else echo "\n".'*/*/*/*/*/*/*/ Country : '.$country.' */*/*/*/*/*/*/*/*/'."\n";
@@ -495,7 +502,9 @@  discard block
 block discarded – undo
495 502
 		    $additional_query .= "(spotter_archive_output.pilot_name like '%".$q_item."%') OR ";
496 503
 		    $additional_query .= "(spotter_archive_output.ident like '%".$q_item."%') OR ";
497 504
 		    $translate = $Translation->ident2icao($q_item);
498
-		    if ($translate != $q_item) $additional_query .= "(spotter_archive_output.ident like '%".$translate."%') OR ";
505
+		    if ($translate != $q_item) {
506
+		    	$additional_query .= "(spotter_archive_output.ident like '%".$translate."%') OR ";
507
+		    }
499 508
 		    $additional_query .= "(spotter_archive_output.highlight like '%".$q_item."%')";
500 509
 		    $additional_query .= ")";
501 510
 		}
@@ -713,7 +722,9 @@  discard block
 block discarded – undo
713 722
 		date_default_timezone_set($globalTimezone);
714 723
 		$datetime = new DateTime();
715 724
 		$offset = $datetime->format('P');
716
-	    } else $offset = '+00:00';
725
+	    } else {
726
+	    	$offset = '+00:00';
727
+	    }
717 728
 
718 729
 
719 730
 	    if ($date_array[1] != "")
@@ -876,9 +887,13 @@  discard block
 block discarded – undo
876 887
 				$query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'";
877 888
 			}
878 889
 		}
879
-                if ($sincedate != '') $query .= "AND date > '".$sincedate."' ";
890
+                if ($sincedate != '') {
891
+                	$query .= "AND date > '".$sincedate."' ";
892
+                }
880 893
 	$query .= "GROUP BY c.name, c.iso3, c.iso2 ORDER BY nb DESC";
881
-	if ($limit) $query .= " LIMIT 0,10";
894
+	if ($limit) {
895
+		$query .= " LIMIT 0,10";
896
+	}
882 897
       
883 898
 	
884 899
 	$sth = $this->db->prepare($query);
Please login to merge, or discard this patch.