Completed
Push — master ( e14a40...cfb98e )
by Yannick
54:46 queued 27:34
created
require/libs/Predict/Predict/Time.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
         /* Modification to support Y2K */
44 44
         /* Valid 1957 through 2056     */
45
-        $day = self::modf($epoch * 1E-3, $year) * 1E3;
45
+        $day = self::modf($epoch*1E-3, $year)*1E3;
46 46
         if ($year < 57) {
47 47
             $year = $year + 2000;
48 48
         } else {
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     /* Equivalent to the C modf function */
57 57
     public static function modf($x, &$ipart) {
58
-        $ipart = (int)$x;
58
+        $ipart = (int) $x;
59 59
         return $x - $ipart;
60 60
     }
61 61
 
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
         /* Astronomical Formulae for Calculators, Jean Meeus, */
69 69
         /* pages 23-25. Calculate Julian Date of 0.0 Jan year */
70 70
         $year = $year - 1;
71
-        $i = (int) ($year / 100);
71
+        $i = (int) ($year/100);
72 72
         $A = $i;
73
-        $i = (int) ($A / 4);
73
+        $i = (int) ($A/4);
74 74
         $B = (int) (2 - $A + $i);
75
-        $i = (int) (365.25 * $year);
76
-        $i += (int) (30.6001 * 14);
75
+        $i = (int) (365.25*$year);
76
+        $i += (int) (30.6001*14);
77 77
         $jdoy = $i + 1720994.5 + $B;
78 78
 
79 79
         return $jdoy;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         /* Modification to support Y2K */
94 94
         /* Valid 1957 through 2056     */
95 95
         $year = 0;
96
-        $day = self::modf($epoch * 1E-3, $year) * 1E3;
96
+        $day = self::modf($epoch*1E-3, $year)*1E3;
97 97
 
98 98
         if ($year < 57) {
99 99
             $year += 2000;
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 
105 105
         $UT = fmod($day, $day);
106 106
         $jd = self::Julian_Date_of_Year($year) + $day;
107
-        $TU = ($jd - 2451545.0) / 36525;
108
-        $GMST = 24110.54841 + $TU * (8640184.812866 + $TU * (0.093104 - $TU * 6.2E-6));
109
-        $GMST = Predict_Math::Modulus($GMST + Predict::secday * Predict::omega_E * $UT, Predict::secday);
107
+        $TU = ($jd - 2451545.0)/36525;
108
+        $GMST = 24110.54841 + $TU*(8640184.812866 + $TU*(0.093104 - $TU*6.2E-6));
109
+        $GMST = Predict_Math::Modulus($GMST + Predict::secday*Predict::omega_E*$UT, Predict::secday);
110 110
         $deep_arg->ds50 = $jd - 2433281.5 + $UT;
111 111
 
112
-        return Predict_Math::FMod2p(6.3003880987 * $deep_arg->ds50 + 1.72944494);
112
+        return Predict_Math::FMod2p(6.3003880987*$deep_arg->ds50 + 1.72944494);
113 113
     }
114 114
 
115 115
     /* See the ThetaG doc block above */
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
         /* Reference:  The 1992 Astronomical Almanac, page B6. */
119 119
         $UT   = Predict_Math::Frac($jd + 0.5);
120 120
         $jd   = $jd - $UT;
121
-        $TU   = ($jd - 2451545.0) / 36525;
122
-        $GMST = 24110.54841 + $TU * (8640184.812866 + $TU * (0.093104 - $TU * 6.2E-6));
123
-        $GMST = Predict_Math::Modulus($GMST + Predict::secday * Predict::omega_E * $UT, Predict::secday);
121
+        $TU   = ($jd - 2451545.0)/36525;
122
+        $GMST = 24110.54841 + $TU*(8640184.812866 + $TU*(0.093104 - $TU*6.2E-6));
123
+        $GMST = Predict_Math::Modulus($GMST + Predict::secday*Predict::omega_E*$UT, Predict::secday);
124 124
 
125
-        return Predict::twopi * $GMST / Predict::secday;
125
+        return Predict::twopi*$GMST/Predict::secday;
126 126
     }
127 127
 
128 128
     /**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public static function unix2daynum($sec, $usec = 0)
150 150
     {
151
-        $time = ((($sec + $usec) / 86400.0) - 3651.0);
151
+        $time = ((($sec + $usec)/86400.0) - 3651.0);
152 152
         return $time + 2444238.5;
153 153
     }
154 154
 
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
       /* Values determined using data from 1950-1991 in the 1990
163 163
          Astronomical Almanac.  See DELTA_ET.WQ1 for details. */
164 164
 
165
-      $delta_et = 26.465 + 0.747622 * ($year - 1950) +
166
-                 1.886913 * sin(Predict::twopi * ($year - 1975) / 33);
165
+      $delta_et = 26.465 + 0.747622*($year - 1950) +
166
+                 1.886913*sin(Predict::twopi*($year - 1975)/33);
167 167
 
168 168
       return $delta_et;
169 169
     }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     public static function daynum2unix($dn) {
179 179
         // Converts a daynum to a UNIX timestamp
180 180
 
181
-        return (86400.0 * ($dn - 2444238.5 + 3651.0));
181
+        return (86400.0*($dn - 2444238.5 + 3651.0));
182 182
     }
183 183
 
184 184
     /**
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     public static function daynum2readable($dn, $zone = 'America/Los_Angeles', $format = 'm-d-Y H:i:s')
194 194
     {
195 195
         $unix = self::daynum2unix($dn);
196
-        $date = new DateTime("@" . round($unix));
196
+        $date = new DateTime("@".round($unix));
197 197
         $dateTimezone = new DateTimezone($zone);
198 198
         $date->setTimezone($dateTimezone);
199 199
         return $date->format($format);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     {
211 211
         $year = $tle->epoch_year;
212 212
         $day  = $tle->epoch_day;
213
-        $sec  = round(86400 * $tle->epoch_fod);
213
+        $sec  = round(86400*$tle->epoch_fod);
214 214
 
215 215
         $zone = new DateTimeZone('GMT');
216 216
         $date = new DateTime();
@@ -218,6 +218,6 @@  discard block
 block discarded – undo
218 218
         $date->setDate($year, 1, 1);
219 219
         $date->setTime(0, 0, 0);
220 220
 
221
-        return $date->format('U') + (86400 * $day) + $sec - 86400;
221
+        return $date->format('U') + (86400*$day) + $sec - 86400;
222 222
     }
223 223
 }
Please login to merge, or discard this patch.
require/libs/Predict/Predict/SGPObs.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -37,18 +37,18 @@  discard block
 block discarded – undo
37 37
 
38 38
         $sinGeodeticLat = sin($geodetic->lat); /* Only run sin($geodetic->lat) once */
39 39
 
40
-        $geodetic->theta = Predict_Math::FMod2p(Predict_Time::ThetaG_JD($_time) + $geodetic->lon);/*LMST*/
41
-        $c = 1 / sqrt(1 + Predict::__f * (Predict::__f - 2) * $sinGeodeticLat * $sinGeodeticLat);
42
-        $sq = (1 - Predict::__f) * (1 - Predict::__f) * $c;
43
-        $achcp = (Predict::xkmper * $c + $geodetic->alt) * cos($geodetic->lat);
44
-        $obs_pos->x = $achcp * cos($geodetic->theta); /*kilometers*/
45
-        $obs_pos->y = $achcp * sin($geodetic->theta);
46
-        $obs_pos->z = (Predict::xkmper * $sq + $geodetic->alt) * $sinGeodeticLat;
47
-        $obs_vel->x = -Predict::mfactor * $obs_pos->y; /*kilometers/second*/
48
-        $obs_vel->y =  Predict::mfactor * $obs_pos->x;
49
-        $obs_vel->z =  0;
50
-        $obs_pos->w = sqrt($obs_pos->x * $obs_pos->x + $obs_pos->y * $obs_pos->y + $obs_pos->z * $obs_pos->z);
51
-        $obs_vel->w = sqrt($obs_vel->x * $obs_vel->x + $obs_vel->y * $obs_vel->y + $obs_vel->z * $obs_vel->z);
40
+        $geodetic->theta = Predict_Math::FMod2p(Predict_Time::ThetaG_JD($_time) + $geodetic->lon); /*LMST*/
41
+        $c = 1/sqrt(1 + Predict::__f*(Predict::__f - 2)*$sinGeodeticLat*$sinGeodeticLat);
42
+        $sq = (1 - Predict::__f)*(1 - Predict::__f)*$c;
43
+        $achcp = (Predict::xkmper*$c + $geodetic->alt)*cos($geodetic->lat);
44
+        $obs_pos->x = $achcp*cos($geodetic->theta); /*kilometers*/
45
+        $obs_pos->y = $achcp*sin($geodetic->theta);
46
+        $obs_pos->z = (Predict::xkmper*$sq + $geodetic->alt)*$sinGeodeticLat;
47
+        $obs_vel->x = -Predict::mfactor*$obs_pos->y; /*kilometers/second*/
48
+        $obs_vel->y = Predict::mfactor*$obs_pos->x;
49
+        $obs_vel->z = 0;
50
+        $obs_pos->w = sqrt($obs_pos->x*$obs_pos->x + $obs_pos->y*$obs_pos->y + $obs_pos->z*$obs_pos->z);
51
+        $obs_vel->w = sqrt($obs_vel->x*$obs_vel->x + $obs_vel->y*$obs_vel->y + $obs_vel->z*$obs_vel->z);
52 52
     }
53 53
 
54 54
     /* Procedure Calculate_LatLonAlt will calculate the geodetic  */
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     /* It is intended to be used to determine the ground track of */
57 57
     /* a satellite.  The calculations  assume the earth to be an  */
58 58
     /* oblate spheroid as defined in WGS '72.                     */
59
-    public static function Calculate_LatLonAlt($_time, Predict_Vector $pos,  Predict_Geodetic $geodetic)
59
+    public static function Calculate_LatLonAlt($_time, Predict_Vector $pos, Predict_Geodetic $geodetic)
60 60
     {
61 61
         /* Reference:  The 1992 Astronomical Almanac, page K12. */
62 62
 
@@ -64,18 +64,18 @@  discard block
 block discarded – undo
64 64
 
65 65
         $geodetic->theta = Predict_Math::AcTan($pos->y, $pos->x); /*radians*/
66 66
         $geodetic->lon = Predict_Math::FMod2p($geodetic->theta - Predict_Time::ThetaG_JD($_time)); /*radians*/
67
-        $r = sqrt(($pos->x * $pos->x) + ($pos->y * $pos->y));
68
-        $e2 = Predict::__f * (2 - Predict::__f);
67
+        $r = sqrt(($pos->x*$pos->x) + ($pos->y*$pos->y));
68
+        $e2 = Predict::__f*(2 - Predict::__f);
69 69
         $geodetic->lat = Predict_Math::AcTan($pos->z, $r); /*radians*/
70 70
 
71 71
         do {
72 72
             $phi    = $geodetic->lat;
73 73
             $sinPhi = sin($phi);
74
-            $c      = 1 / sqrt(1 - $e2 * ($sinPhi * $sinPhi));
75
-            $geodetic->lat = Predict_Math::AcTan($pos->z + Predict::xkmper * $c * $e2 * $sinPhi, $r);
74
+            $c      = 1/sqrt(1 - $e2*($sinPhi*$sinPhi));
75
+            $geodetic->lat = Predict_Math::AcTan($pos->z + Predict::xkmper*$c*$e2*$sinPhi, $r);
76 76
         } while (abs($geodetic->lat - $phi) >= 1E-10);
77 77
 
78
-        $geodetic->alt = $r / cos($geodetic->lat) - Predict::xkmper * $c;/*kilometers*/
78
+        $geodetic->alt = $r/cos($geodetic->lat) - Predict::xkmper*$c; /*kilometers*/
79 79
 
80 80
         if ($geodetic->lat > Predict::pio2) {
81 81
             $geodetic->lat -= Predict::twopi;
@@ -114,34 +114,34 @@  discard block
 block discarded – undo
114 114
         $rgvel->y = $vel->y - $obs_vel->y;
115 115
         $rgvel->z = $vel->z - $obs_vel->z;
116 116
 
117
-        $range->w = sqrt($range->x * $range->x + $range->y * $range->y + $range->z * $range->z);
117
+        $range->w = sqrt($range->x*$range->x + $range->y*$range->y + $range->z*$range->z);
118 118
 
119 119
         $sin_lat   = sin($geodetic->lat);
120 120
         $cos_lat   = cos($geodetic->lat);
121 121
         $sin_theta = sin($geodetic->theta);
122 122
         $cos_theta = cos($geodetic->theta);
123
-        $top_s = $sin_lat * $cos_theta * $range->x
124
-            + $sin_lat * $sin_theta * $range->y
125
-            - $cos_lat * $range->z;
126
-        $top_e = -$sin_theta * $range->x
127
-            + $cos_theta * $range->y;
128
-        $top_z = $cos_lat * $cos_theta * $range->x
129
-            + $cos_lat * $sin_theta * $range->y
130
-            + $sin_lat * $range->z;
131
-        $azim = atan(-$top_e / $top_s); /*Azimuth*/
123
+        $top_s = $sin_lat*$cos_theta*$range->x
124
+            + $sin_lat*$sin_theta*$range->y
125
+            - $cos_lat*$range->z;
126
+        $top_e = -$sin_theta*$range->x
127
+            + $cos_theta*$range->y;
128
+        $top_z = $cos_lat*$cos_theta*$range->x
129
+            + $cos_lat*$sin_theta*$range->y
130
+            + $sin_lat*$range->z;
131
+        $azim = atan(-$top_e/$top_s); /*Azimuth*/
132 132
         if ($top_s > 0) {
133 133
             $azim = $azim + Predict::pi;
134 134
         }
135
-        if ($azim < 0 ) {
135
+        if ($azim < 0) {
136 136
             $azim = $azim + Predict::twopi;
137 137
         }
138
-        $el = Predict_Math::ArcSin($top_z / $range->w);
139
-        $obs_set->az = $azim;        /* Azimuth (radians)  */
140
-        $obs_set->el = $el;          /* Elevation (radians)*/
138
+        $el = Predict_Math::ArcSin($top_z/$range->w);
139
+        $obs_set->az = $azim; /* Azimuth (radians)  */
140
+        $obs_set->el = $el; /* Elevation (radians)*/
141 141
         $obs_set->range = $range->w; /* Range (kilometers) */
142 142
 
143 143
         /* Range Rate (kilometers/second)*/
144
-        $obs_set->range_rate = Predict_Math::Dot($range, $rgvel) / $range->w;
144
+        $obs_set->range_rate = Predict_Math::Dot($range, $rgvel)/$range->w;
145 145
 
146 146
         /* Corrections for atmospheric refraction */
147 147
         /* Reference:  Astronomical Algorithms by Jean Meeus, pp. 101-104    */
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         //	obs_set->el = obs_set->el + Radians((1.02/tan(Radians(Degrees(el)+
150 150
         //							      10.3/(Degrees(el)+5.11))))/60);
151 151
         if ($obs_set->el < 0) {
152
-            $obs_set->el = $el;  /*Reset to true elevation*/
152
+            $obs_set->el = $el; /*Reset to true elevation*/
153 153
         }
154 154
     }
155 155
 }
Please login to merge, or discard this patch.
notam-data.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 <button type="button" class="close">&times;</button>
8 8
 <?php
9 9
 
10
-$notamref = filter_input(INPUT_GET,'notam',FILTER_SANITIZE_STRING);
10
+$notamref = filter_input(INPUT_GET, 'notam', FILTER_SANITIZE_STRING);
11 11
 $notamref = urldecode($notamref);
12 12
 $NOTAM = new NOTAM();
13 13
 $notam = $NOTAM->getNOTAMbyRef($notamref);
Please login to merge, or discard this patch.
waypoints-geojson.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 if (isset($_GET['coord'])) 
12 12
 {
13
-	$coords = explode(',',$_GET['coord']);
13
+	$coords = explode(',', $_GET['coord']);
14 14
 	$spotter_array = $Spotter->getAllWaypointsInfobyCoord($coords);
15 15
 } else {
16 16
 	die;
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 if (!empty($spotter_array))
22 22
 {	  
23 23
 //	print_r($spotter_array);
24
-	foreach($spotter_array as $spotter_item)
24
+	foreach ($spotter_array as $spotter_item)
25 25
 	{
26 26
 		date_default_timezone_set('UTC');
27 27
 		//waypoint plotting
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		    $output .= '"geometry": {';
103 103
 			$output .= '"type": "Point",';
104 104
 			$output .= '"coordinates": [';
105
-			    $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);;
105
+			    $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048); ;
106 106
 			$output .= ']';
107 107
 		    $output .= '}';
108 108
 
Please login to merge, or discard this patch.
airspace-data.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 <button type="button" class="close">&times;</button>
8 8
 <?php
9 9
 
10
-$airspaceid = filter_input(INPUT_GET,'airspace',FILTER_SANITIZE_NUMBER_INT);
10
+$airspaceid = filter_input(INPUT_GET, 'airspace', FILTER_SANITIZE_NUMBER_INT);
11 11
 //$notamref = urldecode($notamref);
12 12
 if ($globalDBdriver == 'mysql') {
13 13
 	$query = "SELECT * FROM airspace WHERE ogr_fid = :id";
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 try {
19 19
 	$sth = $Connection->db->prepare($query);
20 20
 	$sth->execute(array(':id' => $airspaceid));
21
-} catch(PDOException $e) {
21
+} catch (PDOException $e) {
22 22
 	echo "error";
23 23
 }
24
-$result=$sth->fetchAll(PDO::FETCH_ASSOC);
24
+$result = $sth->fetchAll(PDO::FETCH_ASSOC);
25 25
 $airspace = $result[0];
26 26
 date_default_timezone_set('UTC');
27 27
 print '<div class="top">';
Please login to merge, or discard this patch.
airspace-geojson.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
 if (isset($_GET['coord'])) 
18 18
 {
19
-	$coords = explode(',',$_GET['coord']);
19
+	$coords = explode(',', $_GET['coord']);
20 20
         if ($globalDBdriver == 'mysql') {
21 21
 		$query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))";
22 22
 		try {
23 23
 			$sth = $Connection->db->prepare($query);
24
-			$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3]));
24
+			$sth->execute(array(':minlon' => $coords[0], ':minlat' => $coords[1], ':maxlon' => $coords[2], ':maxlat' => $coords[3]));
25 25
 			//$sth->execute();
26
-		} catch(PDOException $e) {
26
+		} catch (PDOException $e) {
27 27
 			echo "error";
28 28
 		}
29 29
 	} else {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			$sth = $Connection->db->prepare($query);
33 33
 			//$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3]));
34 34
 			$sth->execute();
35
-		} catch(PDOException $e) {
35
+		} catch (PDOException $e) {
36 36
 			echo "error";
37 37
 		}
38 38
 	}
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	try {
46 46
 		$sth = $Connection->db->prepare($query);
47 47
 		$sth->execute();
48
-	} catch(PDOException $e) {
48
+	} catch (PDOException $e) {
49 49
 		echo "error";
50 50
 	}
51 51
 }
@@ -73,20 +73,20 @@  discard block
 block discarded – undo
73 73
 		elseif (isset($properties['ogc_fid'])) $properties['id'] = $properties['ogc_fid'];
74 74
 		if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling'];
75 75
 		if (isset($properties['floor'])) $properties['base'] = $properties['floor'];
76
-		if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) {
76
+		if (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['tops']), $matches)) {
77 77
 			$properties['upper_limit'] = round($matches['alt']*100*0.38048);
78
-		} elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['tops']),$matches)) {
78
+		} elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['tops']), $matches)) {
79 79
 			$properties['upper_limit'] = round($matches['alt']*0.38048);
80
-		} elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['tops']),$matches)) {
80
+		} elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['tops']), $matches)) {
81 81
 			$properties['upper_limit'] = $matches['alt'];
82 82
 		}
83 83
 		if ($properties['base'] == 'SFC' || $properties['base'] == 'MSL' || $properties['base'] == 'GROUND' || $properties['base'] == 'GND') {
84 84
 			$properties['lower_limit'] = 0;
85
-		} elseif (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['base']),$matches)) {
85
+		} elseif (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['base']), $matches)) {
86 86
 			$properties['lower_limit'] = round($matches['alt']*100*0.38048);
87
-		} elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['base']),$matches)) {
87
+		} elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['base']), $matches)) {
88 88
 			$properties['lower_limit'] = round($matches['alt']*0.38048);
89
-		} elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['base']),$matches)) {
89
+		} elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['base']), $matches)) {
90 90
 			$properties['lower_limit'] = $matches['alt'];
91 91
 		}
92 92
 		if ($properties['type'] == 'RESTRICTED' || $properties['type'] == 'R') {
Please login to merge, or discard this patch.
install/VAM/VAM-json.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,27 +11,27 @@
 block discarded – undo
11 11
 	die();
12 12
 }
13 13
 $query = 'select * from vam_live_flights rc, gvausers gu where gu.gvauser_id = rc.gvauser_id';  
14
-$json_data=array();  
14
+$json_data = array();  
15 15
 $result = $db->query($query);
16 16
 while ($rec = $result->fetch_assoc())
17 17
 {  
18
-	$json_array['gvauser_id']=$rec['gvauser_id']; // users "pilot unique ID" "40"
19
-	$json_array['flight_id']=$rec['flight_id']; // flight_id
20
-	$json_array['pilot_id']=$rec['callsign']; // users pilot_id "VAM500"
21
-	$json_array['callsign']=substr($rec['flight_id'],-7);  // substr icao Flight "AFR524"
22
-	$json_array['pilot_name']=$rec['name'] .' '.$rec['surname'] ;  // Users "name + surname"
23
-	$json_array['plane_type']=$rec['plane_type'];  // type Plane "B739"
24
-	$json_array['departure']=$rec['departure'];  // departure ICAO
25
-	$json_array['arrival']=$rec['arrival'];     // arrival Ident
26
-	$json_array['latitude']=$rec['latitude'];  // return 55.7328860921521
27
-	$json_array['longitude']=$rec['longitude'];  // return 8.87433614409404
28
-	$json_array['altitude']=$rec['altitude'];  // return "147"
29
-	$json_array['heading']=$rec['heading'];  // return "307"
30
-	$json_array['ias']=$rec['ias'];  // return speed "IAS"
31
-	$json_array['gs']=$rec['gs'];  // return speed "GS"
18
+	$json_array['gvauser_id'] = $rec['gvauser_id']; // users "pilot unique ID" "40"
19
+	$json_array['flight_id'] = $rec['flight_id']; // flight_id
20
+	$json_array['pilot_id'] = $rec['callsign']; // users pilot_id "VAM500"
21
+	$json_array['callsign'] = substr($rec['flight_id'], -7); // substr icao Flight "AFR524"
22
+	$json_array['pilot_name'] = $rec['name'].' '.$rec['surname']; // Users "name + surname"
23
+	$json_array['plane_type'] = $rec['plane_type']; // type Plane "B739"
24
+	$json_array['departure'] = $rec['departure']; // departure ICAO
25
+	$json_array['arrival'] = $rec['arrival']; // arrival Ident
26
+	$json_array['latitude'] = $rec['latitude']; // return 55.7328860921521
27
+	$json_array['longitude'] = $rec['longitude']; // return 8.87433614409404
28
+	$json_array['altitude'] = $rec['altitude']; // return "147"
29
+	$json_array['heading'] = $rec['heading']; // return "307"
30
+	$json_array['ias'] = $rec['ias']; // return speed "IAS"
31
+	$json_array['gs'] = $rec['gs']; // return speed "GS"
32 32
 	// $json_array['routes']=$rec['routes'];  // (unusable)
33
-	$json_array['flight_status']=$rec['flight_status'];  // "return Status"
34
-	$json_array['last_update']=$rec['last_update'];  // return "DateTime"
33
+	$json_array['flight_status'] = $rec['flight_status']; // "return Status"
34
+	$json_array['last_update'] = $rec['last_update']; // return "DateTime"
35 35
 	$json_data[] = $json_array;
36 36
  }  
37 37
 echo json_encode($json_data);
Please login to merge, or discard this patch.
airport-statistics-route.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
         header('Location: '.$globalURL.'/airport');
8 8
         die();
9 9
 }
10
-$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
10
+$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
11 11
 $Spotter = new Spotter();
12
-$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1","");
12
+$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", "");
13 13
 $airport_array = $Spotter->getAllAirportInfo($airport);
14 14
 
15 15
 if (!empty($airport_array))
16 16
 {
17
-	$title = sprintf(_("Most Common Routes to/from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
17
+	$title = sprintf(_("Most Common Routes to/from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
18 18
 
19 19
 	require_once('header.php');
20 20
 	print '<div class="select-item">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	$airport_names = $Stats->getAllAirportNames();
26 26
 	if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
27 27
 	ksort($airport_names);
28
-	foreach($airport_names as $airport_name)
28
+	foreach ($airport_names as $airport_name)
29 29
 	{
30
-		if($airport == $airport_name['airport_icao'])
30
+		if ($airport == $airport_name['airport_icao'])
31 31
 		{
32 32
 			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>';
33 33
 		} else {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	include('airport-sub-menu.php');
59 59
 	print '<div class="column">';
60 60
 	print '<h2>'._("Most Common Routes").'</h2>';
61
-	print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
61
+	print '<p>'.sprintf(_("The statistic below shows the most common routes to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
62 62
 
63 63
 	$route_array = $Spotter->countAllRoutesByAirport($airport);
64 64
 	if (!empty($route_array))
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		print '</thead>';
75 75
 		print '<tbody>';
76 76
 		$i = 1;
77
-		foreach($route_array as $route_item)
77
+		foreach ($route_array as $route_item)
78 78
 		{
79 79
 			print '<tr>';
80 80
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.
atc-geojson.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	header('Content-disposition: attachment; filename="atc.geojson"');
8 8
 }
9 9
 header('Content-Type: text/javascript');
10
-$ATC=new ATC();
10
+$ATC = new ATC();
11 11
 if (isset($_GET['coord'])) 
12 12
 {
13 13
 	//$coords = explode(',',$_GET['coord']);
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 $output = '{"type": "FeatureCollection","features": [';
20 20
 if (!empty($spotter_array))
21 21
 {	  
22
-	foreach($spotter_array as $spotter_item)
22
+	foreach ($spotter_array as $spotter_item)
23 23
 	{
24 24
 		date_default_timezone_set('UTC');
25 25
 		//waypoint plotting
Please login to merge, or discard this patch.