Completed
Push — master ( a93f87...671968 )
by Yannick
14:14
created
search-gpx.php 3 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -4,55 +4,55 @@
 block discarded – undo
4 4
 require_once('require/class.Language.php');
5 5
 $Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7
-        //for the date manipulation into the query
8
-        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
-                $start_date = $_GET['start_date'].":00";
10
-                $end_date = $_GET['end_date'].":00";
11
-                $sql_date = $start_date.",".$end_date;
12
-        } else if($_GET['start_date'] != ""){
13
-                $start_date = $_GET['start_date'].":00";
14
-                $sql_date = $start_date;
15
-        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
-                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
-                $sql_date = $end_date;
18
-        } else $sql_date = '';
7
+		//for the date manipulation into the query
8
+		if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
+				$start_date = $_GET['start_date'].":00";
10
+				$end_date = $_GET['end_date'].":00";
11
+				$sql_date = $start_date.",".$end_date;
12
+		} else if($_GET['start_date'] != ""){
13
+				$start_date = $_GET['start_date'].":00";
14
+				$sql_date = $start_date;
15
+		} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
+				$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
+				$sql_date = $end_date;
18
+		} else $sql_date = '';
19 19
 } else $sql_date = '';
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22
-        //for altitude manipulation
23
-        if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
-                $end_altitude = $_GET['highest_altitude'];
25
-                $start_altitude = $_GET['lowest_altitude'];
26
-                $sql_altitude = $start_altitude.",".$end_altitude;
27
-        } else if($_GET['highest_altitude'] != ""){
28
-                $end_altitude = $_GET['highest_altitude'];
29
-                $sql_altitude = $end_altitude;
30
-        } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
-                $start_altitude = $_GET['lowest_altitude'].",60000";
32
-                $sql_altitude = $start_altitude;
33
-        } else $sql_altitude = '';
22
+		//for altitude manipulation
23
+		if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
24
+				$end_altitude = $_GET['highest_altitude'];
25
+				$start_altitude = $_GET['lowest_altitude'];
26
+				$sql_altitude = $start_altitude.",".$end_altitude;
27
+		} else if($_GET['highest_altitude'] != ""){
28
+				$end_altitude = $_GET['highest_altitude'];
29
+				$sql_altitude = $end_altitude;
30
+		} else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31
+				$start_altitude = $_GET['lowest_altitude'].",60000";
32
+				$sql_altitude = $start_altitude;
33
+		} else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37 37
 if(!isset($_GET['limit']))
38 38
 {
39
-        if (!isset($_GET['number_results']))
40
-        {
41
-                $limit_start = 0;
42
-                $limit_end = 25;
43
-                $absolute_difference = 25;
44
-        } else {
45
-                if ($_GET['number_results'] > 1000){
46
-                        $_GET['number_results'] = 1000;
47
-                }
48
-                $limit_start = 0;
49
-                $limit_end = $_GET['number_results'];
50
-                $absolute_difference = $_GET['number_results'];
51
-        }
39
+		if (!isset($_GET['number_results']))
40
+		{
41
+				$limit_start = 0;
42
+				$limit_end = 25;
43
+				$absolute_difference = 25;
44
+		} else {
45
+				if ($_GET['number_results'] > 1000){
46
+						$_GET['number_results'] = 1000;
47
+				}
48
+				$limit_start = 0;
49
+				$limit_end = $_GET['number_results'];
50
+				$absolute_difference = $_GET['number_results'];
51
+		}
52 52
 }  else {
53
-        $limit_explode = explode(",", $_GET['limit']);
54
-        $limit_start = $limit_explode[0];
55
-        $limit_end = $limit_explode[1];
53
+		$limit_explode = explode(",", $_GET['limit']);
54
+		$limit_start = $limit_explode[0];
55
+		$limit_end = $limit_explode[1];
56 56
 }
57 57
 
58 58
 $absolute_difference = abs($limit_start - $limit_end);
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 $Spotter = new Spotter();
6 6
 if (isset($_GET['start_date'])) {
7 7
         //for the date manipulation into the query
8
-        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
8
+        if ($_GET['start_date'] != "" && $_GET['end_date'] != "") {
9 9
                 $start_date = $_GET['start_date'].":00";
10 10
                 $end_date = $_GET['end_date'].":00";
11 11
                 $sql_date = $start_date.",".$end_date;
12
-        } else if($_GET['start_date'] != ""){
12
+        } else if ($_GET['start_date'] != "") {
13 13
                 $start_date = $_GET['start_date'].":00";
14 14
                 $sql_date = $start_date;
15
-        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
15
+        } else if ($_GET['start_date'] == "" && $_GET['end_date'] != "") {
16 16
                 $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17 17
                 $sql_date = $end_date;
18 18
         } else $sql_date = '';
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 
21 21
 if (isset($_GET['highest_altitude'])) {
22 22
         //for altitude manipulation
23
-        if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
23
+        if ($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != "") {
24 24
                 $end_altitude = $_GET['highest_altitude'];
25 25
                 $start_altitude = $_GET['lowest_altitude'];
26 26
                 $sql_altitude = $start_altitude.",".$end_altitude;
27
-        } else if($_GET['highest_altitude'] != ""){
27
+        } else if ($_GET['highest_altitude'] != "") {
28 28
                 $end_altitude = $_GET['highest_altitude'];
29 29
                 $sql_altitude = $end_altitude;
30
-        } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
30
+        } else if ($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != "") {
31 31
                 $start_altitude = $_GET['lowest_altitude'].",60000";
32 32
                 $sql_altitude = $start_altitude;
33 33
         } else $sql_altitude = '';
34 34
 } else $sql_altitude = '';
35 35
 
36 36
 //calculuation for the pagination
37
-if(!isset($_GET['limit']))
37
+if (!isset($_GET['limit']))
38 38
 {
39 39
         if (!isset($_GET['number_results']))
40 40
         {
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
                 $limit_end = 25;
43 43
                 $absolute_difference = 25;
44 44
         } else {
45
-                if ($_GET['number_results'] > 1000){
45
+                if ($_GET['number_results'] > 1000) {
46 46
                         $_GET['number_results'] = 1000;
47 47
                 }
48 48
                 $limit_start = 0;
49 49
                 $limit_end = $_GET['number_results'];
50 50
                 $absolute_difference = $_GET['number_results'];
51 51
         }
52
-}  else {
52
+} else {
53 53
         $limit_explode = explode(",", $_GET['limit']);
54 54
         $limit_start = $limit_explode[0];
55 55
         $limit_end = $limit_explode[1];
@@ -69,23 +69,23 @@  discard block
 block discarded – undo
69 69
 
70 70
 if (isset($_GET['sort'])) $sort = $_GET['sort'];
71 71
 else $sort = '';
72
-$q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73
-$registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74
-$aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
75
-$manufacturer = filter_input(INPUT_GET,'manufacturer',FILTER_SANITIZE_STRING);
76
-$highlights = filter_input(INPUT_GET,'highlights',FILTER_SANITIZE_STRING);
77
-$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING);
78
-$airline_country = filter_input(INPUT_GET,'airline_country',FILTER_SANITIZE_STRING);
79
-$airline_type = filter_input(INPUT_GET,'airline_type',FILTER_SANITIZE_STRING);
80
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
81
-$airport_country = filter_input(INPUT_GET,'airport_country',FILTER_SANITIZE_STRING);
82
-$callsign = filter_input(INPUT_GET,'callsign',FILTER_SANITIZE_STRING);
83
-$owner = filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING);
84
-$pilot_id = filter_input(INPUT_GET,'pilot_id',FILTER_SANITIZE_STRING);
85
-$pilot_name = filter_input(INPUT_GET,'pilot_name',FILTER_SANITIZE_STRING);
86
-$departure_airport_route = filter_input(INPUT_GET,'departure_airport_route',FILTER_SANITIZE_STRING);
87
-$arrival_airport_route = filter_input(INPUT_GET,'arrival_airport_route',FILTER_SANITIZE_STRING);
88
-$spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'');
72
+$q = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
73
+$registration = filter_input(INPUT_GET, 'registratrion', FILTER_SANITIZE_STRING);
74
+$aircraft = filter_input(INPUT_GET, 'aircraft', FILTER_SANITIZE_STRING);
75
+$manufacturer = filter_input(INPUT_GET, 'manufacturer', FILTER_SANITIZE_STRING);
76
+$highlights = filter_input(INPUT_GET, 'highlights', FILTER_SANITIZE_STRING);
77
+$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING);
78
+$airline_country = filter_input(INPUT_GET, 'airline_country', FILTER_SANITIZE_STRING);
79
+$airline_type = filter_input(INPUT_GET, 'airline_type', FILTER_SANITIZE_STRING);
80
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
81
+$airport_country = filter_input(INPUT_GET, 'airport_country', FILTER_SANITIZE_STRING);
82
+$callsign = filter_input(INPUT_GET, 'callsign', FILTER_SANITIZE_STRING);
83
+$owner = filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING);
84
+$pilot_id = filter_input(INPUT_GET, 'pilot_id', FILTER_SANITIZE_STRING);
85
+$pilot_name = filter_input(INPUT_GET, 'pilot_name', FILTER_SANITIZE_STRING);
86
+$departure_airport_route = filter_input(INPUT_GET, 'departure_airport_route', FILTER_SANITIZE_STRING);
87
+$arrival_airport_route = filter_input(INPUT_GET, 'arrival_airport_route', FILTER_SANITIZE_STRING);
88
+$spotter_array = $Spotter->searchSpotterData($q, $registration, $aircraft, strtolower(str_replace("-", " ", $manufacturer)), $highlights, $airline, $airline_country, $airline_type, $airport, $airport_country, $callsign, $departure_airport_route, $arrival_airport_route, $owner, $pilot_id, $pilot_name, $sql_altitude, $sql_date, $limit_start.",".$absolute_difference, $sort, '');
89 89
        
90 90
       
91 91
 $output = '<?xml version="1.0" encoding="UTF-8"?>';
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		
95 95
 if (!empty($spotter_array))
96 96
 {
97
-	foreach($spotter_array as $spotter_item)
97
+	foreach ($spotter_array as $spotter_item)
98 98
 	{
99 99
 		$altitude = $spotter_item['altitude'].'00';
100 100
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,8 +15,12 @@  discard block
 block discarded – undo
15 15
         } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16 16
                 $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17 17
                 $sql_date = $end_date;
18
-        } else $sql_date = '';
19
-} else $sql_date = '';
18
+        } else {
19
+        	$sql_date = '';
20
+        }
21
+        } else {
22
+	$sql_date = '';
23
+}
20 24
 
21 25
 if (isset($_GET['highest_altitude'])) {
22 26
         //for altitude manipulation
@@ -30,8 +34,12 @@  discard block
 block discarded – undo
30 34
         } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
31 35
                 $start_altitude = $_GET['lowest_altitude'].",60000";
32 36
                 $sql_altitude = $start_altitude;
33
-        } else $sql_altitude = '';
34
-} else $sql_altitude = '';
37
+        } else {
38
+        	$sql_altitude = '';
39
+        }
40
+        } else {
41
+	$sql_altitude = '';
42
+}
35 43
 
36 44
 //calculuation for the pagination
37 45
 if(!isset($_GET['limit']))
@@ -49,7 +57,7 @@  discard block
 block discarded – undo
49 57
                 $limit_end = $_GET['number_results'];
50 58
                 $absolute_difference = $_GET['number_results'];
51 59
         }
52
-}  else {
60
+} else {
53 61
         $limit_explode = explode(",", $_GET['limit']);
54 62
         $limit_start = $limit_explode[0];
55 63
         $limit_end = $limit_explode[1];
@@ -67,8 +75,11 @@  discard block
 block discarded – undo
67 75
 
68 76
 header('Content-Type: text/xml');
69 77
 
70
-if (isset($_GET['sort'])) $sort = $_GET['sort'];
71
-else $sort = '';
78
+if (isset($_GET['sort'])) {
79
+	$sort = $_GET['sort'];
80
+} else {
81
+	$sort = '';
82
+}
72 83
 $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING);
73 84
 $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING);
74 85
 $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
install/install_db.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@
 block discarded – undo
1 1
 #!/usr/bin/php
2 2
 <?php
3
-    require_once('../require/settings.php');
4
-    if ($globalInstalled) {
5
-        echo '$globalInstalled must be set to FALSE in require/settings.php';
6
-        exit;
7
-    }
8
-    require('class.create_db.php');
9
-    echo "Create and import all tables...";
10
-    create_db::import_all_db('../db/');
11
-    echo "Done !\n";
3
+	require_once('../require/settings.php');
4
+	if ($globalInstalled) {
5
+		echo '$globalInstalled must be set to FALSE in require/settings.php';
6
+		exit;
7
+	}
8
+	require('class.create_db.php');
9
+	echo "Create and import all tables...";
10
+	create_db::import_all_db('../db/');
11
+	echo "Done !\n";
12 12
 
13
-    require('class.update_db.php');
14
-    echo "Populate all tables...\n";
15
-    update_db::update_all();
16
-    echo "\nInstall waypoints...(VERY slow!)";
17
-    update_db::update_waypoints();
18
-    echo "Done !\n";
19
-    echo "Install airspace...";
20
-    update_db::update_airspace();
21
-    echo "Done !\n";
22
-    echo 'All is now installed ! Thanks'."\n";
23
-    if ($globalSBS1) {
24
-            echo 'You need to run cron-sbs.php as a daemon. You can use init script in the install/init directory.'."\n";
25
-    }
26
-    if ($globalACARS) {
27
-            echo 'You need to run cron-acars.php as a daemon. You can use init script in the install/init directory.'."\n";
28
-    }
13
+	require('class.update_db.php');
14
+	echo "Populate all tables...\n";
15
+	update_db::update_all();
16
+	echo "\nInstall waypoints...(VERY slow!)";
17
+	update_db::update_waypoints();
18
+	echo "Done !\n";
19
+	echo "Install airspace...";
20
+	update_db::update_airspace();
21
+	echo "Done !\n";
22
+	echo 'All is now installed ! Thanks'."\n";
23
+	if ($globalSBS1) {
24
+			echo 'You need to run cron-sbs.php as a daemon. You can use init script in the install/init directory.'."\n";
25
+	}
26
+	if ($globalACARS) {
27
+			echo 'You need to run cron-acars.php as a daemon. You can use init script in the install/init directory.'."\n";
28
+	}
29 29
     
30 30
 ?>
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
install/populate_ivao.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@
 block discarded – undo
1 1
 #!/usr/bin/php
2 2
 <?php
3
-    require_once('../require/settings.php');
4
-    if ($globalInstalled) {
5
-        echo '$globalInstalled must be set to FALSE in require/settings.php';
6
-        exit;
7
-    }
8
-    require('class.update_db.php');
9
-    if (isset($globalVATSIM) && $globalVATSIM) {
3
+	require_once('../require/settings.php');
4
+	if ($globalInstalled) {
5
+		echo '$globalInstalled must be set to FALSE in require/settings.php';
6
+		exit;
7
+	}
8
+	require('class.update_db.php');
9
+	if (isset($globalVATSIM) && $globalVATSIM) {
10 10
 	echo "Install VATSIM airlines...";
11 11
 	update_db::update_vatsim();
12 12
 	echo "Done !\n";
13
-    }
14
-    if (isset($globalIVAO) && $globalIVAO) {
13
+	}
14
+	if (isset($globalIVAO) && $globalIVAO) {
15 15
 	if (!file_exists('tmp/ivae_feb2013.zip')) {
16 16
 		echo "You have to download the file ivae_feb2013.zip from https://www.ivao.aero/softdev/mirrors.asp?software=IvAeDataUp and put it in install/tmp directory";
17 17
 	} else {
18
-	        echo "Install IVAO airlines and logos...";
19
-	        update_db::update_IVAO();
18
+			echo "Install IVAO airlines and logos...";
19
+			update_db::update_IVAO();
20 20
 		echo "Done !\n";
21 21
 	}
22
-    }
22
+	}
23 23
 ?>
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
install/install-action.php 3 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -68,27 +68,27 @@  discard block
 block discarded – undo
68 68
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') {
69 69
 	if (update_schema::check_version(false) == '0') {
70 70
 		if ($globalDBdriver == 'mysql') {
71
-		    $error .= create_db::import_all_db('../db/');
71
+			$error .= create_db::import_all_db('../db/');
72 72
 		} elseif ($globalDBdriver == 'pgsql') {
73
-		    $error .= create_db::import_all_db('../db/pgsql/');
73
+			$error .= create_db::import_all_db('../db/pgsql/');
74 74
 		}
75 75
 		if ($error != '') {
76
-                        $_SESSION['error'] = $error;
76
+						$_SESSION['error'] = $error;
77 77
 		}
78 78
 		$_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables'));
79 79
 		if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) {
80 80
 			$_SESSION['install'] = 'populate';
81 81
 			$_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B';
82 82
 		} else {
83
-		    $_SESSION['install'] = 'sources';
84
-		    $_SESSION['next'] = 'Insert data in source table';
83
+			$_SESSION['install'] = 'sources';
84
+			$_SESSION['next'] = 'Insert data in source table';
85 85
 		}
86 86
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
87 87
 		print json_encode($result);
88 88
 	} else {
89 89
 		$error .= update_schema::check_version(true);
90 90
 		if ($error != '') {
91
-                        $_SESSION['error'] = $error;
91
+						$_SESSION['error'] = $error;
92 92
 		}
93 93
 		$_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed'));
94 94
 		$_SESSION['install'] = 'sources';
@@ -118,25 +118,25 @@  discard block
 block discarded – undo
118 118
 	$error .= update_db::update_countries();
119 119
 	$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database'));
120 120
 	if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') {
121
-	    $_SESSION['install'] = 'notam';
122
-	    $_SESSION['next'] = 'Populate NOTAM table with externals data';
123
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
124
-	    print json_encode($result);
121
+		$_SESSION['install'] = 'notam';
122
+		$_SESSION['next'] = 'Populate NOTAM table with externals data';
123
+		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
124
+		print json_encode($result);
125 125
 	} elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) {
126
-	    $_SESSION['install'] = 'owner';
127
-	    $_SESSION['next'] = 'Populate owner table with externals data';
128
-	    unset($_SESSION['owner']);
129
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
130
-	    print json_encode($result);
126
+		$_SESSION['install'] = 'owner';
127
+		$_SESSION['next'] = 'Populate owner table with externals data';
128
+		unset($_SESSION['owner']);
129
+		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
130
+		print json_encode($result);
131 131
 	} else {
132
-	    $_SESSION['install'] = 'sources';
133
-	    $_SESSION['next'] = 'Insert data in source table';
134
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
135
-	    print json_encode($result);
132
+		$_SESSION['install'] = 'sources';
133
+		$_SESSION['next'] = 'Insert data in source table';
134
+		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
135
+		print json_encode($result);
136 136
 	}
137 137
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') {
138 138
 	if (!is_writable('tmp')) {
139
-                $error = 'The directory <i>install/tmp</i> must be writable.';
139
+				$error = 'The directory <i>install/tmp</i> must be writable.';
140 140
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
141 141
 		print json_encode($result);
142 142
 	} else {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	}
153 153
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') {
154 154
 	if (!is_writable('tmp')) {
155
-                $error = 'The directory <i>install/tmp</i> must be writable.';
155
+				$error = 'The directory <i>install/tmp</i> must be writable.';
156 156
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
157 157
 		print json_encode($result);
158 158
 	} else {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	}
186 186
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') {
187 187
 	if (!is_writable('tmp')) {
188
-                $error = 'The directory <i>install/tmp</i> must be writable.';
188
+				$error = 'The directory <i>install/tmp</i> must be writable.';
189 189
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
190 190
 		print json_encode($result);
191 191
 	} else {
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	}
201 201
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') {
202 202
 	if (!is_writable('tmp')) {
203
-                $error = 'The directory <i>install/tmp</i> must be writable.';
203
+				$error = 'The directory <i>install/tmp</i> must be writable.';
204 204
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
205 205
 		print json_encode($result);
206 206
 	} else {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	}
230 230
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') {
231 231
 	if (!is_writable('tmp')) {
232
-                $error = 'The directory <i>install/tmp</i> must be writable.';
232
+				$error = 'The directory <i>install/tmp</i> must be writable.';
233 233
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
234 234
 		print json_encode($result);
235 235
 	} else {
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	}
245 245
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') {
246 246
 	if (!is_writable('tmp')) {
247
-                $error = 'The directory <i>install/tmp</i> must be writable.';
247
+				$error = 'The directory <i>install/tmp</i> must be writable.';
248 248
 		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
249 249
 		print json_encode($result);
250 250
 	} else {
@@ -296,17 +296,17 @@  discard block
 block discarded – undo
296 296
 */
297 297
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'sources') {
298 298
 	if (isset($_SESSION['sources']) && count($_SESSION['sources']) > 0) {
299
-	    $sources = $_SESSION['sources'];
299
+		$sources = $_SESSION['sources'];
300 300
 
301
-	    include_once('../require/class.Source.php');
302
-	    $globalDebug = FALSE;
303
-	    $Source = new Source();
304
-	    $Source->deleteAllLocation();
305
-	    foreach ($sources as $src) {
301
+		include_once('../require/class.Source.php');
302
+		$globalDebug = FALSE;
303
+		$Source = new Source();
304
+		$Source->deleteAllLocation();
305
+		foreach ($sources as $src) {
306 306
 		if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png');
307
-	    }
308
-	    $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table'));
309
-	    unset($_SESSION['sources']);
307
+		}
308
+		$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table'));
309
+		unset($_SESSION['sources']);
310 310
 	}
311 311
 	/*
312 312
 	if (isset($globalIVAO) && $globalIVAO) $_SESSION['install'] = 'ivao';
Please login to merge, or discard this patch.
Braces   +23 added lines, -9 removed lines patch added patch discarded remove patch
@@ -164,15 +164,21 @@  discard block
 block discarded – undo
164 164
 
165 165
 		if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
166 166
 			$_SESSION['install'] = 'vatsim';
167
-			if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data';
168
-			else $_SESSION['next'] = 'Insert VATSIM data';
167
+			if (file_exists('tmp/ivae_feb2013.zip')) {
168
+				$_SESSION['next'] = 'Insert IVAO data';
169
+			} else {
170
+				$_SESSION['next'] = 'Insert VATSIM data';
171
+			}
169 172
 		} elseif (isset($globalVATSIM) && $globalVATSIM) {
170 173
 			$_SESSION['install'] = 'vatsim';
171 174
 			$_SESSION['next'] = 'Insert VATSIM data';
172 175
 		} elseif (isset($globalIVAO) && $globalIVAO) {
173 176
 			$_SESSION['install'] = 'vatsim';
174
-			if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data';
175
-			else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)';
177
+			if (file_exists('tmp/ivae_feb2013.zip')) {
178
+				$_SESSION['next'] = 'Insert IVAO data';
179
+			} else {
180
+				$_SESSION['next'] = 'Insert VATSIM data (IVAO not found)';
181
+			}
176 182
 		} elseif (isset($globalphpVMS) && $globalphpVMS) {
177 183
 			$_SESSION['install'] = 'vatsim';
178 184
 			$_SESSION['next'] = 'Insert phpVMS data';
@@ -303,7 +309,9 @@  discard block
 block discarded – undo
303 309
 	    $Source = new Source();
304 310
 	    $Source->deleteAllLocation();
305 311
 	    foreach ($sources as $src) {
306
-		if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png');
312
+		if (isset($src['latitude']) && $src['latitude'] != '') {
313
+			$Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png');
314
+		}
307 315
 	    }
308 316
 	    $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table'));
309 317
 	    unset($_SESSION['sources']);
@@ -314,15 +322,21 @@  discard block
 block discarded – undo
314 322
 	*/
315 323
 	if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
316 324
 		$_SESSION['install'] = 'vatsim';
317
-		if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data';
318
-		else $_SESSION['next'] = 'Insert VATSIM data';
325
+		if (file_exists('tmp/ivae_feb2013.zip')) {
326
+			$_SESSION['next'] = 'Insert IVAO data';
327
+		} else {
328
+			$_SESSION['next'] = 'Insert VATSIM data';
329
+		}
319 330
 	} elseif (isset($globalVATSIM) && $globalVATSIM) {
320 331
 		$_SESSION['install'] = 'vatsim';
321 332
 		$_SESSION['next'] = 'Insert VATSIM data';
322 333
 	} elseif (isset($globalIVAO) && $globalIVAO) {
323 334
 		$_SESSION['install'] = 'vatsim';
324
-		if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data';
325
-		else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)';
335
+		if (file_exists('tmp/ivae_feb2013.zip')) {
336
+			$_SESSION['next'] = 'Insert IVAO data';
337
+		} else {
338
+			$_SESSION['next'] = 'Insert VATSIM data (IVAO not found)';
339
+		}
326 340
 	} elseif (isset($globalphpVMS) && $globalphpVMS) {
327 341
 		$_SESSION['install'] = 'vatsim';
328 342
 		$_SESSION['next'] = 'Insert phpVMS data';
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -68,15 +68,15 @@  discard block
 block discarded – undo
68 68
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_create') {
69 69
 	$dbroot = $_SESSION['database_root'];
70 70
 	$dbrootpass = $_SESSION['database_rootpass'];
71
-	$error .= create_db::create_database($dbroot,$dbrootpass,$globalDBuser,$globalDBpass,$globalDBname,$globalDBdriver,$globalDBhost);
71
+	$error .= create_db::create_database($dbroot, $dbrootpass, $globalDBuser, $globalDBpass, $globalDBname, $globalDBdriver, $globalDBhost);
72 72
 	sleep(5);
73 73
 	if ($error != '') {
74 74
 		$_SESSION['error'] = $error;
75 75
 	}
76
-	$_SESSION['done'] = array_merge($_SESSION['done'],array('Create database'));
76
+	$_SESSION['done'] = array_merge($_SESSION['done'], array('Create database'));
77 77
 	$_SESSION['install'] = 'database_import';
78 78
 	$_SESSION['next'] = 'Create and import tables';
79
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
79
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
80 80
 	print json_encode($result);
81 81
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') {
82 82
 	if (update_schema::check_version(false) == '0') {
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		if ($error != '') {
89 89
                         $_SESSION['error'] = $error;
90 90
 		}
91
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables'));
91
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Create and import tables'));
92 92
 		if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) {
93 93
 			$_SESSION['install'] = 'populate';
94 94
 			$_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B';
@@ -96,84 +96,84 @@  discard block
 block discarded – undo
96 96
 		    $_SESSION['install'] = 'sources';
97 97
 		    $_SESSION['next'] = 'Insert data in source table';
98 98
 		}
99
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
99
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
100 100
 		print json_encode($result);
101 101
 	} else {
102 102
 		$error .= update_schema::check_version(true);
103 103
 		if ($error != '') {
104 104
                         $_SESSION['error'] = $error;
105 105
 		}
106
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed'));
106
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Update schema if needed'));
107 107
 		$_SESSION['install'] = 'sources';
108 108
 		$_SESSION['next'] = 'Insert data in source table';
109
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
109
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
110 110
 		print json_encode($result);
111 111
 	}
112 112
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'waypoints') {
113 113
 	include_once('class.update_db.php');
114 114
 	$error .= update_db::update_waypoints();
115
-	$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate waypoints database'));
115
+	$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate waypoints database'));
116 116
 
117 117
 	$_SESSION['install'] = 'airspace';
118 118
 	$_SESSION['next'] = 'Populate airspace table';
119
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
119
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
120 120
 	print json_encode($result);
121 121
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'airspace') {
122 122
 	include_once('class.update_db.php');
123 123
 	$error .= update_db::update_airspace_fam();
124
-	$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate airspace database'));
124
+	$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate airspace database'));
125 125
 	$_SESSION['install'] = 'countries';
126 126
 	$_SESSION['next'] = 'Populate countries table';
127
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
127
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
128 128
 	print json_encode($result);
129 129
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'countries') {
130 130
 	include_once('class.update_db.php');
131 131
 	$error .= update_db::update_countries();
132
-	$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database'));
132
+	$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate countries database'));
133 133
 	if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') {
134 134
 	    $_SESSION['install'] = 'notam';
135 135
 	    $_SESSION['next'] = 'Populate NOTAM table with externals data';
136
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
136
+	    $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
137 137
 	    print json_encode($result);
138 138
 	} elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) {
139 139
 	    $_SESSION['install'] = 'owner';
140 140
 	    $_SESSION['next'] = 'Populate owner table with externals data';
141 141
 	    unset($_SESSION['owner']);
142
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
142
+	    $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
143 143
 	    print json_encode($result);
144 144
 	} else {
145 145
 	    $_SESSION['install'] = 'sources';
146 146
 	    $_SESSION['next'] = 'Insert data in source table';
147
-	    $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
147
+	    $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
148 148
 	    print json_encode($result);
149 149
 	}
150 150
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') {
151 151
 	if (!is_writable('tmp')) {
152 152
                 $error = 'The directory <i>install/tmp</i> must be writable.';
153
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
153
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
154 154
 		print json_encode($result);
155 155
 	} else {
156 156
 		include_once('class.update_db.php');
157 157
 		$globalDebug = FALSE;
158 158
 		$error .= update_db::update_ModeS_fam();
159
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for ADS-B'));
159
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for ADS-B'));
160 160
 
161 161
 		$_SESSION['install'] = 'populate_flarm';
162 162
 		$_SESSION['next'] = 'Populate aircraft_modes table with externals data for FLARM';
163
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
163
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
164 164
 		print json_encode($result);
165 165
 	}
166 166
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') {
167 167
 	if (!is_writable('tmp')) {
168 168
                 $error = 'The directory <i>install/tmp</i> must be writable.';
169
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
169
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
170 170
 		print json_encode($result);
171 171
 	} else {
172 172
 		include_once('class.update_db.php');
173 173
 		$globalDebug = FALSE;
174 174
 		//$error .= update_db::update_ModeS_flarm();
175 175
 		$error .= update_db::update_ModeS_ogn();
176
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for FLARM'));
176
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for FLARM'));
177 177
 
178 178
 		if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
179 179
 			$_SESSION['install'] = 'vatsim';
@@ -193,34 +193,34 @@  discard block
 block discarded – undo
193 193
 			$_SESSION['install'] = 'routes';
194 194
 			$_SESSION['next'] = 'Populate routes table with externals data';
195 195
 		}
196
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
196
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
197 197
 		print json_encode($result);
198 198
 	}
199 199
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') {
200 200
 	if (!is_writable('tmp')) {
201 201
                 $error = 'The directory <i>install/tmp</i> must be writable.';
202
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
202
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
203 203
 		print json_encode($result);
204 204
 	} else {
205 205
 		include_once('class.update_db.php');
206 206
 		$globalDebug = FALSE;
207 207
 		$error .= update_db::update_routes();
208
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate routes table with externals data'));
208
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate routes table with externals data'));
209 209
 		$_SESSION['install'] = 'translation';
210 210
 		$_SESSION['next'] = 'Populate translation table with externals data';
211
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
211
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
212 212
 		print json_encode($result);
213 213
 	}
214 214
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') {
215 215
 	if (!is_writable('tmp')) {
216 216
                 $error = 'The directory <i>install/tmp</i> must be writable.';
217
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
217
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
218 218
 		print json_encode($result);
219 219
 	} else {
220 220
 		include_once('class.update_db.php');
221 221
 		$globalDebug = FALSE;
222 222
 		$error .= update_db::update_translation();
223
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate translation table with externals data'));
223
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate translation table with externals data'));
224 224
 
225 225
 		if ($_SESSION['waypoints'] == 1) {
226 226
 			$_SESSION['install'] = 'waypoints';
@@ -237,48 +237,48 @@  discard block
 block discarded – undo
237 237
 			$_SESSION['install'] = 'sources';
238 238
 			$_SESSION['next'] = 'Insert data in source table';
239 239
 		}
240
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
240
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
241 241
 		print json_encode($result);
242 242
 	}
243 243
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') {
244 244
 	if (!is_writable('tmp')) {
245 245
                 $error = 'The directory <i>install/tmp</i> must be writable.';
246
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
246
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
247 247
 		print json_encode($result);
248 248
 	} else {
249 249
 		include_once('class.update_db.php');
250 250
 		$globalDebug = FALSE;
251 251
 		$error = update_db::update_owner_fam();
252
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate owner table with externals data'));
252
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate owner table with externals data'));
253 253
 		$_SESSION['install'] = 'sources';
254 254
 		$_SESSION['next'] = 'Insert data in source table';
255
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
255
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
256 256
 		print json_encode($result);
257 257
 	}
258 258
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') {
259 259
 	if (!is_writable('tmp')) {
260 260
                 $error = 'The directory <i>install/tmp</i> must be writable.';
261
-		$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
261
+		$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
262 262
 		print json_encode($result);
263 263
 	} else {
264 264
 		include_once('class.update_db.php');
265 265
 		$globalDebug = FALSE;
266 266
 		if (isset($globalNOTAMSource) && $globalNOTAMSource != '') {
267 267
 			$error .= update_db::update_notam();
268
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data'));
268
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data'));
269 269
 		} else {
270
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data (no source defined)'));
270
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data (no source defined)'));
271 271
 		}
272 272
 		if (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) {
273 273
 			$_SESSION['install'] = 'owner';
274 274
 			$_SESSION['next'] = 'Populate owner table';
275 275
 			unset($_SESSION['owner']);
276
-			$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
276
+			$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
277 277
 			print json_encode($result);
278 278
 		} else {
279 279
 			$_SESSION['install'] = 'sources';
280 280
 			$_SESSION['next'] = 'Insert data in source table';
281
-			$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
281
+			$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
282 282
 			print json_encode($result);
283 283
 		}
284 284
 	}
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
 	    $Source = new Source();
317 317
 	    $Source->deleteAllLocation();
318 318
 	    foreach ($sources as $src) {
319
-		if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png');
319
+		if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'], $src['latitude'], $src['longitude'], $src['altitude'], $src['city'], $src['country'], $src['source'], 'antenna.png');
320 320
 	    }
321
-	    $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table'));
321
+	    $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert data in source table'));
322 322
 	    unset($_SESSION['sources']);
323 323
 	}
324 324
 	/*
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 		$_SESSION['install'] = 'finish';
344 344
 		$_SESSION['next'] = 'finish';
345 345
 	}
346
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
346
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
347 347
 	print json_encode($result);
348 348
 } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'vatsim') {
349 349
 	include_once('../install/class.create_db.php');
@@ -353,36 +353,36 @@  discard block
 block discarded – undo
353 353
 	if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) {
354 354
 		if (file_exists('tmp/ivae_feb2013.zip')) {
355 355
 			$error .= update_db::update_IVAO();
356
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data'));
356
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data'));
357 357
 		} else {
358 358
 			$error .= update_db::update_vatsim();
359
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data'));
359
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data'));
360 360
 		}
361 361
 	} elseif (isset($globalVATSIM) && $globalVATSIM) {
362 362
 		$error .= update_db::update_vatsim();
363
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data'));
363
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data'));
364 364
 	} elseif (isset($globalIVAO) && $globalIVAO) {
365 365
 		if (file_exists('tmp/ivae_feb2013.zip')) {
366 366
 			$error .= update_db::update_IVAO();
367
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data'));
367
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data'));
368 368
 		} else {
369 369
 			$error .= update_db::update_vatsim();
370
-			$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data (IVAO not found)'));
370
+			$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data (IVAO not found)'));
371 371
 		}
372 372
 	} elseif (isset($globalphpVMS) && $globalphpVMS) {
373
-		$_SESSION['done'] = array_merge($_SESSION['done'],array('Insert phpVMS data'));
373
+		$_SESSION['done'] = array_merge($_SESSION['done'], array('Insert phpVMS data'));
374 374
 	}
375 375
 	//$_SESSION['install'] = 'routes';
376 376
 	//$_SESSION['next'] = 'Populate routes table with externals data';
377 377
 	$_SESSION['install'] = 'finish';
378 378
 	$_SESSION['next'] = 'finish';
379 379
 
380
-	$result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']);
380
+	$result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
381 381
 	print json_encode($result);
382 382
 } else {
383 383
 	//unset($_SESSION['install']);
384 384
 	$_SESSION['error'] = 'Unknwon task : '.$_SESSION['install'];
385
-	$result = array('error' => 'Unknwon task : '.$_SESSION['install'],'done' => $_SESSION['done'],'next' => 'finish','install' => 'finish');
385
+	$result = array('error' => 'Unknwon task : '.$_SESSION['install'], 'done' => $_SESSION['done'], 'next' => 'finish', 'install' => 'finish');
386 386
 	print json_encode($result);
387 387
 }
388 388
 ?>
389 389
\ No newline at end of file
Please login to merge, or discard this patch.
install/update_arrival_airport.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
  *    This Script will try to find all real arrival airports for all flights in DB
5 5
  *
6 6
 */
7
-    require_once('../require/settings.php');
8
-    if ($globalInstalled) {
9
-        echo '$globalInstalled must be set to FALSE in require/settings.php';
10
-        exit;
11
-    }
12
-    require('../require/class.Spotter.php');
13
-    $Spotter = new Spotter();
14
-    $Spotter->updateArrivalAirports();
7
+	require_once('../require/settings.php');
8
+	if ($globalInstalled) {
9
+		echo '$globalInstalled must be set to FALSE in require/settings.php';
10
+		exit;
11
+	}
12
+	require('../require/class.Spotter.php');
13
+	$Spotter = new Spotter();
14
+	$Spotter->updateArrivalAirports();
15 15
 
16 16
 ?>
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
airport-detailed.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 			$metar_info = $METAR->getMETAR($airport_icao);
47 47
 			//print_r($metar_info);
48 48
 			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
49
-            		//print_r($metar_parse);
49
+					//print_r($metar_parse);
50 50
 		}
51 51
 		
52 52
 		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
                       function drawChart6() {
100 100
                         var data = google.visualization.arrayToDataTable([
101 101
                             ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], ';
102
-                            $airport_data = '';
103
-                                foreach($all_data as $data)
104
-                                {
105
-                                        $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],';
106
-                                }
107
-                                $airport_data = substr($airport_data, 0, -1);
108
-                                print $airport_data.']);
102
+							$airport_data = '';
103
+								foreach($all_data as $data)
104
+								{
105
+										$airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],';
106
+								}
107
+								$airport_data = substr($airport_data, 0, -1);
108
+								print $airport_data.']);
109 109
 
110 110
                         var options = {
111 111
                     	    legend: {position: "none"},
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		$limit_start = 0;
16 16
 		$limit_end = 25;
17 17
 		$absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -46,7 +46,9 @@  discard block
 block discarded – undo
46 46
 			$METAR = new METAR();
47 47
 			$metar_info = $METAR->getMETAR($airport_icao);
48 48
 			//print_r($metar_info);
49
-			if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']);
49
+			if (isset($metar_info[0]['metar'])) {
50
+				$metar_parse = $METAR->parse($metar_info[0]['metar']);
51
+			}
50 52
             		//print_r($metar_parse);
51 53
 		}
52 54
 		
@@ -60,7 +62,9 @@  discard block
 block discarded – undo
60 62
 		print '<option></option>';
61 63
 		$Stats = new Stats();
62 64
 		$airport_names = $Stats->getAllAirportNames();
63
-		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
65
+		if (empty($airport_names)) {
66
+			$airport_names = $Spotter->getAllAirportNames();
67
+		}
64 68
 		ksort($airport_names);
65 69
 		foreach($airport_names as $airport_name)
66 70
 		{
@@ -102,7 +106,9 @@  discard block
 block discarded – undo
102 106
 			// Use spotter also
103 107
 			if (isset($globalTimezone)) {
104 108
 				date_default_timezone_set($globalTimezone);
105
-			} else date_default_timezone_set('UTC');
109
+			} else {
110
+				date_default_timezone_set('UTC');
111
+			}
106 112
 			if (count($all_data) > 0) {
107 113
 				print '<div id="chart6" class="chart" width="100%"></div>
108 114
                     <script> 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Stats.php');
6 6
 require_once('require/class.METAR.php');
7 7
 
8
-if (!isset($_GET['airport'])){
8
+if (!isset($_GET['airport'])) {
9 9
 	header('Location: '.$globalURL.'/airport');
10 10
 } else {
11 11
 	$Spotter = new Spotter();
12 12
 	//calculation for the pagination
13
-	if(!isset($_GET['limit']))
13
+	if (!isset($_GET['limit']))
14 14
 	{
15 15
 		$limit_start = 0;
16 16
 		$limit_end = 25;
17 17
 		$absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -28,15 +28,15 @@  discard block
 block discarded – undo
28 28
 	$limit_next = $limit_end + $absolute_difference;
29 29
 	$limit_previous_1 = $limit_start - $absolute_difference;
30 30
 	$limit_previous_2 = $limit_end - $absolute_difference;
31
-	$airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
31
+	$airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
32 32
 	$airport = $airport_icao;
33 33
 	$page_url = $globalURL.'/airport/'.$airport_icao;
34 34
 	
35 35
 	if (isset($_GET['sort'])) {
36
-		$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
37
-		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $sort);
36
+		$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
37
+		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $sort);
38 38
 	} else {
39
-		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, '');
39
+		$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, '');
40 40
 	}
41 41
 	$airport_array = $Spotter->getAllAirportInfo($airport_icao);
42 42
 	
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             		//print_r($metar_parse);
52 52
 		}
53 53
 		
54
-		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
54
+		$title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
55 55
 
56 56
 		require_once('header.php');
57 57
 		
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 		$airport_names = $Stats->getAllAirportNames();
64 64
 		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
65 65
 		ksort($airport_names);
66
-		foreach($airport_names as $airport_name)
66
+		foreach ($airport_names as $airport_name)
67 67
 		{
68
-			if($airport_icao == $airport_name['airport_icao'])
68
+			if ($airport_icao == $airport_name['airport_icao'])
69 69
 			{
70 70
 				print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
71 71
 			} else {
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                         var data = google.visualization.arrayToDataTable([
114 114
                             ["'._("Date").'","'._("Departure").'","'._("Arrival").'"], ';
115 115
                             $airport_data = '';
116
-                                foreach($all_data as $data)
116
+                                foreach ($all_data as $data)
117 117
                                 {
118 118
                                         $airport_data .= '[ "'.$data['date'].'",'.$data['departure'].','.$data['arrival'].'],';
119 119
                                 }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 					print _("Dew point:").' '.$metar_parse['dew'].' °C'." - ";
167 167
 				}
168 168
 				if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
169
-					$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
169
+					$humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1);
170 170
 					print _("Humidity:").' '.$humidity.'%'." - ";
171 171
 				}
172 172
 				if (isset($metar_parse['QNH'])) {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		print '<div class="table column">';
183 183
 		if ($airport_array[0]['iata'] != "NA")
184 184
 		{
185
-			print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
185
+			print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
186 186
 		}
187 187
 		include('table-output.php');  
188 188
 		print '<div class="pagination">';
Please login to merge, or discard this patch.
route-statistics-time.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
           function drawChart() {
39 39
             var data = google.visualization.arrayToDataTable([
40 40
             	["'._("Hour").'", "'._("# of Flights").'"], ';
41
-            	$hour_data = '';
41
+				$hour_data = '';
42 42
 	foreach($hour_array as $hour_item)
43 43
 	{
44 44
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@  discard block
 block discarded – undo
9 9
 require_once('require/class.Language.php');
10 10
 
11 11
 $Spotter = new Spotter();
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$departure_airport = filter_input(INPUT_GET,'departure_airport',FILTER_SANITIZE_STRING);
14
-$arrival_airport = filter_input(INPUT_GET,'arrival_airport',FILTER_SANITIZE_STRING);
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$departure_airport = filter_input(INPUT_GET, 'departure_airport', FILTER_SANITIZE_STRING);
14
+$arrival_airport = filter_input(INPUT_GET, 'arrival_airport', FILTER_SANITIZE_STRING);
15 15
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
16 16
 	$spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, "0,1", $sort);
17 17
 } else $spotter_array = array();
18 18
 
19 19
 if (!empty($spotter_array))
20 20
 {
21
-	$title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']);
21
+	$title = sprintf(_("Most Common Time of Day between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']);
22 22
 	require_once('header.php');
23 23
 	print '<div class="info column">';
24 24
 	print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>';
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	include('route-sub-menu.php');
30 30
 	print '<div class="column">';
31 31
 	print '<h2>'._("Most Common Time of Day").'</h2>';
32
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']).'</p>';
32
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights between <strong>%s (%s), %s</strong> and <strong>%s (%s), %s</strong>."), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']).'</p>';
33 33
 
34 34
 	$hour_array = $Spotter->countAllHoursByRoute($departure_airport, $arrival_airport);
35 35
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             var data = google.visualization.arrayToDataTable([
42 42
             	["'._("Hour").'", "'._("# of Flights").'"], ';
43 43
             	$hour_data = '';
44
-	foreach($hour_array as $hour_item)
44
+	foreach ($hour_array as $hour_item)
45 45
 	{
46 46
 		$hour_data .= '[ "'.date("ga", strtotime($hour_item['hour_name'].":00")).'",'.$hour_item['hour_count'].'],';
47 47
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@
 block discarded – undo
14 14
 $arrival_airport = filter_input(INPUT_GET,'arrival_airport',FILTER_SANITIZE_STRING);
15 15
 if (isset($_GET['departure_airport']) && isset($_GET['arrival_airport'])) {
16 16
 	$spotter_array = $Spotter->getSpotterDataByRoute($departure_airport, $arrival_airport, "0,1", $sort);
17
-} else $spotter_array = array();
17
+} else {
18
+	$spotter_array = array();
19
+}
18 20
   
19 21
 if (!empty($spotter_array))
20 22
 {
Please login to merge, or discard this patch.
ident-statistics-departure-airport.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
         die();
8 8
 }
9 9
 $Spotter = new Spotter();
10
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
11
-$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
12
-$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort);
10
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
11
+$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING);
12
+$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort);
13 13
 
14 14
 if (!empty($spotter_array))
15 15
 {
16
-	$title = sprintf(_("Most Common Departure Airports of %s"),$spotter_array[0]['ident']);
16
+	$title = sprintf(_("Most Common Departure Airports of %s"), $spotter_array[0]['ident']);
17 17
 	require_once('header.php');
18 18
 	print '<div class="info column">';
19 19
 	print '<h1>'.$spotter_array[0]['ident'].'</h1>';
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	include('ident-sub-menu.php');
25 25
 	print '<div class="column">';
26 26
 	print '<h2>'._("Most Common Departure Airports").'</h2>';
27
-	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>';
27
+	print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>';
28 28
 	$airport_airport_array = $Spotter->countAllDepartureAirportsByIdent($ident);
29 29
 	print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>
30 30
     	<script>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         	["'._("Airport").'", "'._("# of times").'"],';
40 40
 
41 41
 	$airport_data = '';
42
-	foreach($airport_airport_array as $airport_item)
42
+	foreach ($airport_airport_array as $airport_item)
43 43
 	{
44 44
 		$name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')';
45 45
 		$name = str_replace("'", "", $name);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	print '</thead>';
79 79
 	print '<tbody>';
80 80
 	$i = 1;
81
-	foreach($airport_airport_array as $airport_item)
81
+	foreach ($airport_airport_array as $airport_item)
82 82
 	{
83 83
 		print '<tr>';
84 84
 		print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this 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['ident'])) {
6
-        header('Location: '.$globalURL.'/ident');
7
-        die();
6
+		header('Location: '.$globalURL.'/ident');
7
+		die();
8 8
 }
9 9
 $Spotter = new Spotter();
10 10
 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
Please login to merge, or discard this patch.
tools-notam.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 $page_url = $globalURL.'/tools-notam';
12 12
 
13
-$message = filter_input(INPUT_POST,'notam_message',FILTER_SANITIZE_STRING);
13
+$message = filter_input(INPUT_POST, 'notam_message', FILTER_SANITIZE_STRING);
14 14
 
15 15
 print '<div class="info column">';
16 16
 print '<h1>'._("Parse NOTAM messages").'</h1>';
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	if (!empty($notam_parse)) {
35 35
 		print '<p>'._("NOTAM message in human readable format:").'</p>';
36 36
 		foreach ($notam_parse as $key => $value) {
37
-			print '<b>'.strtoupper(str_replace('_',' ',$key)).'</b>: '.$value.'<br />';
37
+			print '<b>'.strtoupper(str_replace('_', ' ', $key)).'</b>: '.$value.'<br />';
38 38
 		}
39 39
 	} else {
40 40
 		print '<p>'._("This NOTAM message can't be translated in human readable format :(").'</p>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 print '<fieldset class="form-group">';
24 24
 print '<label for="notam_message">'._("NOTAM Message").'</label>';
25 25
 print '<textarea class="form-control" name="notam_message" id="notam_message" rows="5">';
26
-if ($message != '') print $message;
26
+if ($message != '') {
27
+	print $message;
28
+}
27 29
 print '</textarea>';
28 30
 print '</fieldset>';
29 31
 print '<button type="submit" class="btn btn-primary">Submit</button>';
Please login to merge, or discard this patch.