Completed
Push — master ( 64a0a6...a96b73 )
by Yannick
05:21
created
require/libs/Predict/Predict/TLE.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -12,30 +12,30 @@  discard block
 block discarded – undo
12 12
  */
13 13
 class Predict_TLE
14 14
 {
15
-    public $header;     /* Header line of TLE file */
16
-    public $line1;      /* Line 1 of TLE */
17
-    public $line2;      /* Line 2 of TLE */
18
-    public $epoch;      /*!< Epoch Time in NORAD TLE format YYDDD.FFFFFFFF */
15
+    public $header; /* Header line of TLE file */
16
+    public $line1; /* Line 1 of TLE */
17
+    public $line2; /* Line 2 of TLE */
18
+    public $epoch; /*!< Epoch Time in NORAD TLE format YYDDD.FFFFFFFF */
19 19
     public $epoch_year; /*!< Epoch: year */
20
-    public $epoch_day;  /*!< Epoch: day of year */
21
-    public $epoch_fod;  /*!< Epoch: Fraction of day. */
22
-    public $xndt2o;     /*!< 1. time derivative of mean motion */
23
-    public $xndd6o;     /*!< 2. time derivative of mean motion */
24
-    public $bstar;      /*!< Bstar drag coefficient. */
25
-    public $xincl;      /*!< Inclination */
26
-    public $xnodeo;     /*!< R.A.A.N. */
27
-    public $eo;         /*!< Eccentricity */
28
-    public $omegao;     /*!< argument of perigee */
29
-    public $xmo;        /*!< mean anomaly */
30
-    public $xno;        /*!< mean motion */
31
-
32
-    public $catnr;      /*!< Catalogue Number.  */
33
-    public $elset;      /*!< Element Set number. */
34
-    public $revnum;     /*!< Revolution Number at epoch. */
35
-
36
-    public $sat_name;   /*!< Satellite name string. */
37
-    public $idesg;      /*!< International Designator. */
38
-    public $status;     /*!< Operational status. */
20
+    public $epoch_day; /*!< Epoch: day of year */
21
+    public $epoch_fod; /*!< Epoch: Fraction of day. */
22
+    public $xndt2o; /*!< 1. time derivative of mean motion */
23
+    public $xndd6o; /*!< 2. time derivative of mean motion */
24
+    public $bstar; /*!< Bstar drag coefficient. */
25
+    public $xincl; /*!< Inclination */
26
+    public $xnodeo; /*!< R.A.A.N. */
27
+    public $eo; /*!< Eccentricity */
28
+    public $omegao; /*!< argument of perigee */
29
+    public $xmo; /*!< mean anomaly */
30
+    public $xno; /*!< mean motion */
31
+
32
+    public $catnr; /*!< Catalogue Number.  */
33
+    public $elset; /*!< Element Set number. */
34
+    public $revnum; /*!< Revolution Number at epoch. */
35
+
36
+    public $sat_name; /*!< Satellite name string. */
37
+    public $idesg; /*!< International Designator. */
38
+    public $status; /*!< Operational status. */
39 39
 
40 40
     /* values needed for squint calculations */
41 41
     public $xincl1;
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
         $this->xndt2o = (float) substr($line1, 33, 10);
94 94
 
95 95
         /* Satellite's Second Time Derivative */
96
-        $this->xndd6o = (float) (substr($line1, 44, 1) . '.' . substr($line1, 45, 5) . 'E' . substr($line1, 50, 2));
96
+        $this->xndd6o = (float) (substr($line1, 44, 1).'.'.substr($line1, 45, 5).'E'.substr($line1, 50, 2));
97 97
 
98 98
         /* Satellite's bstar drag term
99 99
            FIXME: How about buff[0] ????
100 100
         */
101
-        $this->bstar = (float) (substr($line1, 53, 1) . '.' . substr($line1, 54, 5) . 'E' . substr($line1, 59, 2));
101
+        $this->bstar = (float) (substr($line1, 53, 1).'.'.substr($line1, 54, 5).'E'.substr($line1, 59, 2));
102 102
 
103 103
         /* Element Number */
104 104
         $this->elset = (int) substr($line1, 64, 4);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $this->xnodeo = (float) substr($line2, 17, 8);
112 112
 
113 113
         /* Satellite's Orbital Eccentricity */
114
-        $this->eo = (float) ('.' . substr($line2, 26, 7));
114
+        $this->eo = (float) ('.'.substr($line2, 26, 7));
115 115
 
116 116
         /* Satellite's Argument of Perigee (degrees) */
117 117
         $this->omegao = (float) substr($line2, 34, 8);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         for ($i = 0; $i < 68; $i++) {
146 146
             if (($tle_set[$i] >= '0') && ($tle_set[$i] <= '9')) {
147 147
                 $value = $tle_set[$i] - '0';
148
-            } else if ($tle_set[$i] == '-' ) {
148
+            } else if ($tle_set[$i] == '-') {
149 149
                 $value = 1;
150 150
             } else {
151 151
                 $value = 0;
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         for ($i = 0; $i < 68; $i++) {
217 217
             if (($line[$i] >= '0') && ($line[$i] <= '9')) {
218 218
                 $value = (int) $line[$i];
219
-            } else if ($line[$i] == '-' ) {
219
+            } else if ($line[$i] == '-') {
220 220
                 $value = 1;
221 221
             } else {
222 222
                 $value = 0;
Please login to merge, or discard this patch.
require/libs/Predict/Predict/QTH.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@
 block discarded – undo
7 7
  */
8 8
 class Predict_QTH
9 9
 {
10
-     public $name;   /*!< Name, eg. callsign. */
11
-     public $loc;    /*!< Location, eg City, Country. */
12
-     public $desc;   /*!< Short description. */
13
-     public $lat;    /*!< Latitude in dec. deg. North. */
14
-     public $lon;    /*!< Longitude in dec. deg. East. */
15
-     public $alt;    /*!< Altitude above sea level in meters. */
16
-     public $qra;    /*!< QRA locator */
17
-     public $wx;     /*!< Weather station code (4 chars). */
10
+     public $name; /*!< Name, eg. callsign. */
11
+     public $loc; /*!< Location, eg City, Country. */
12
+     public $desc; /*!< Short description. */
13
+     public $lat; /*!< Latitude in dec. deg. North. */
14
+     public $lon; /*!< Longitude in dec. deg. East. */
15
+     public $alt; /*!< Altitude above sea level in meters. */
16
+     public $qra; /*!< QRA locator */
17
+     public $wx; /*!< Weather station code (4 chars). */
18 18
 
19
-     public $data;   /*!< Raw data from cfg file. */
19
+     public $data; /*!< Raw data from cfg file. */
20 20
 }
Please login to merge, or discard this patch.
require/libs/Predict/Predict/Sat.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -29,42 +29,42 @@  discard block
 block discarded – undo
29 29
     public $nickname = null;
30 30
     public $website  = null;
31 31
 
32
-    public $tle      = null;   /*!< Keplerian elements */
33
-    public $flags    = 0;      /*!< Flags for algo ctrl */
32
+    public $tle      = null; /*!< Keplerian elements */
33
+    public $flags    = 0; /*!< Flags for algo ctrl */
34 34
     public $sgps     = null;
35 35
     public $dps      = null;
36 36
     public $deep_arg = null;
37
-    public $pos      = null;   /*!< Raw position and range */
38
-    public $vel      = null;   /*!< Raw velocity */
37
+    public $pos      = null; /*!< Raw position and range */
38
+    public $vel      = null; /*!< Raw velocity */
39 39
 
40 40
     /*** FIXME: REMOVE */
41
-    public $bearing = null;   /*!< Az, El, range and vel */
42
-    public $astro   = null;   /*!< Ra and Decl */
41
+    public $bearing = null; /*!< Az, El, range and vel */
42
+    public $astro   = null; /*!< Ra and Decl */
43 43
     /*** END */
44 44
 
45 45
     /* time keeping fields */
46 46
     public $jul_epoch = null;
47 47
     public $jul_utc   = null;
48 48
     public $tsince    = null;
49
-    public $aos       = null;    /*!< Next AOS. */
50
-    public $los       = null;    /*!< Next LOS */
51
-
52
-    public $az         = null;   /*!< Azimuth [deg] */
53
-    public $el         = null;   /*!< Elevation [deg] */
54
-    public $range      = null;   /*!< Range [km] */
55
-    public $range_rate = null;   /*!< Range Rate [km/sec] */
56
-    public $ra         = null;   /*!< Right Ascension [deg] */
57
-    public $dec        = null;   /*!< Declination [deg] */
58
-    public $ssplat     = null;   /*!< SSP latitude [deg] */
59
-    public $ssplon     = null;   /*!< SSP longitude [deg] */
60
-    public $alt        = null;   /*!< altitude [km] */
61
-    public $velo       = null;   /*!< velocity [km/s] */
62
-    public $ma         = null;   /*!< mean anomaly */
63
-    public $footprint  = null;   /*!< footprint */
64
-    public $phase      = null;   /*!< orbit phase */
65
-    public $meanmo     = null;   /*!< mean motion kept in rev/day */
66
-    public $orbit      = null;   /*!< orbit number */
67
-    public $otype      = null;   /*!< orbit type. */
49
+    public $aos       = null; /*!< Next AOS. */
50
+    public $los       = null; /*!< Next LOS */
51
+
52
+    public $az         = null; /*!< Azimuth [deg] */
53
+    public $el         = null; /*!< Elevation [deg] */
54
+    public $range      = null; /*!< Range [km] */
55
+    public $range_rate = null; /*!< Range Rate [km/sec] */
56
+    public $ra         = null; /*!< Right Ascension [deg] */
57
+    public $dec        = null; /*!< Declination [deg] */
58
+    public $ssplat     = null; /*!< SSP latitude [deg] */
59
+    public $ssplon     = null; /*!< SSP longitude [deg] */
60
+    public $alt        = null; /*!< altitude [km] */
61
+    public $velo       = null; /*!< velocity [km/s] */
62
+    public $ma         = null; /*!< mean anomaly */
63
+    public $footprint  = null; /*!< footprint */
64
+    public $phase      = null; /*!< orbit phase */
65
+    public $meanmo     = null; /*!< mean motion kept in rev/day */
66
+    public $orbit      = null; /*!< orbit number */
67
+    public $otype      = null; /*!< orbit type. */
68 68
 
69 69
     public function __construct(Predict_TLE $tle)
70 70
     {
@@ -93,30 +93,30 @@  discard block
 block discarded – undo
93 93
         $this->tle->omegao *= Predict::de2ra;
94 94
         $this->tle->xmo    *= Predict::de2ra;
95 95
         $this->tle->xincl  *= Predict::de2ra;
96
-        $temp = Predict::twopi / Predict::xmnpda / Predict::xmnpda;
96
+        $temp = Predict::twopi/Predict::xmnpda/Predict::xmnpda;
97 97
 
98 98
         /* store mean motion before conversion */
99 99
         $this->meanmo       = $this->tle->xno;
100
-        $this->tle->xno     = $this->tle->xno * $temp * Predict::xmnpda;
100
+        $this->tle->xno     = $this->tle->xno*$temp*Predict::xmnpda;
101 101
         $this->tle->xndt2o *= $temp;
102
-        $this->tle->xndd6o  = $this->tle->xndd6o * $temp / Predict::xmnpda;
102
+        $this->tle->xndd6o  = $this->tle->xndd6o*$temp/Predict::xmnpda;
103 103
         $this->tle->bstar  /= Predict::ae;
104 104
 
105 105
         /* Period > 225 minutes is deep space */
106
-        $dd1 = Predict::xke / $this->tle->xno;
106
+        $dd1 = Predict::xke/$this->tle->xno;
107 107
         $dd2 = Predict::tothrd;
108 108
         $a1 = pow($dd1, $dd2);
109 109
         $r1 = cos($this->tle->xincl);
110
-        $dd1 = 1.0 - $this->tle->eo * $this->tle->eo;
111
-        $temp = Predict::ck2 * 1.5 * ($r1 * $r1 * 3.0 - 1.0) / pow($dd1, 1.5);
112
-        $del1 = $temp / ($a1 * $a1);
113
-        $ao = $a1 * (1.0 - $del1 * (Predict::tothrd * 0.5 + $del1 *
114
-                                 ($del1 * 1.654320987654321 + 1.0)));
115
-        $delo = $temp / ($ao * $ao);
116
-        $xnodp = $this->tle->xno / ($delo + 1.0);
110
+        $dd1 = 1.0 - $this->tle->eo*$this->tle->eo;
111
+        $temp = Predict::ck2*1.5*($r1*$r1*3.0 - 1.0)/pow($dd1, 1.5);
112
+        $del1 = $temp/($a1*$a1);
113
+        $ao = $a1*(1.0 - $del1*(Predict::tothrd*0.5 + $del1*
114
+                                 ($del1*1.654320987654321 + 1.0)));
115
+        $delo = $temp/($ao*$ao);
116
+        $xnodp = $this->tle->xno/($delo + 1.0);
117 117
 
118 118
         /* Select a deep-space/near-earth ephemeris */
119
-        if (Predict::twopi / $xnodp / Predict::xmnpda >= .15625) {
119
+        if (Predict::twopi/$xnodp/Predict::xmnpda >= .15625) {
120 120
             $this->flags |= Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG;
121 121
         } else {
122 122
             $this->flags &= ~Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG;
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 
143 143
         /* initialise observer location */
144 144
         if ($qth != null) {
145
-            $obs_geodetic->lon = $qth->lon * Predict::de2ra;
146
-            $obs_geodetic->lat = $qth->lat * Predict::de2ra;
147
-            $obs_geodetic->alt = $qth->alt / 1000.0;
145
+            $obs_geodetic->lon = $qth->lon*Predict::de2ra;
146
+            $obs_geodetic->lat = $qth->lat*Predict::de2ra;
147
+            $obs_geodetic->alt = $qth->alt/1000.0;
148 148
             $obs_geodetic->theta = 0;
149 149
         }
150 150
         else {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
         /* execute computations */
158 158
         $sdpsgp = Predict_SGPSDP::getInstance($sat);
159
-        if ($sat->flags & Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG) {
159
+        if ($sat->flags&Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG) {
160 160
             $sdpsgp->SDP4($sat, 0.0);
161 161
         } else {
162 162
             $sdpsgp->SGP4($sat, 0.0);
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         Predict_Math::Convert_Sat_State($sat->pos, $sat->vel);
167 167
 
168 168
         /* get the velocity of the satellite */
169
-        $sat->vel->w = sqrt($sat->vel->x * $sat->vel->x + $sat->vel->y * $sat->vel->y + $sat->vel->z * $sat->vel->z);
169
+        $sat->vel->w = sqrt($sat->vel->x*$sat->vel->x + $sat->vel->y*$sat->vel->y + $sat->vel->z*$sat->vel->z);
170 170
         $sat->velo = $sat->vel->w;
171 171
         Predict_SGPObs::Calculate_Obs($jul_utc, $sat->pos, $sat->vel, $obs_geodetic, $obs_set);
172 172
         Predict_SGPObs::Calculate_LatLonAlt($jul_utc, $sat->pos, $sat_geodetic);
@@ -187,12 +187,12 @@  discard block
 block discarded – undo
187 187
         $sat->ssplon = Predict_Math::Degrees($sat_geodetic->lon);
188 188
         $sat->alt = $sat_geodetic->alt;
189 189
         $sat->ma = Predict_Math::Degrees($sat->phase);
190
-        $sat->ma *= 256.0 / 360.0;
191
-        $sat->footprint = 2.0 * Predict::xkmper * acos (Predict::xkmper/$sat->pos->w);
190
+        $sat->ma *= 256.0/360.0;
191
+        $sat->footprint = 2.0*Predict::xkmper*acos(Predict::xkmper/$sat->pos->w);
192 192
         $age = 0.0;
193
-        $sat->orbit = floor(($sat->tle->xno * Predict::xmnpda / Predict::twopi +
194
-                                   $age * $sat->tle->bstar * Predict::ae) * $age +
195
-                                  $sat->tle->xmo / Predict::twopi) + $sat->tle->revnum - 1;
193
+        $sat->orbit = floor(($sat->tle->xno*Predict::xmnpda/Predict::twopi +
194
+                                   $age*$sat->tle->bstar*Predict::ae)*$age +
195
+                                  $sat->tle->xmo/Predict::twopi) + $sat->tle->revnum - 1;
196 196
 
197 197
         /* orbit type */
198 198
         $sat->otype = $sat->get_orbit_type($sat);
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
              It is time dependent. Also sat->jul_utc is often zero
257 257
              when this function is called
258 258
         ***/
259
-        if ((10.0 * abs($sat->tle->xndt2o / (Predict::twopi / Predict::xmnpda / Predict::xmnpda))) == 0) {
259
+        if ((10.0*abs($sat->tle->xndt2o/(Predict::twopi/Predict::xmnpda/Predict::xmnpda))) == 0) {
260 260
     		return true;
261
-    	} elseif ($sat->jul_epoch + ((16.666666 - $sat->meanmo) /
262
-                               (10.0 * abs($sat->tle->xndt2o / (Predict::twopi / Predict::xmnpda / Predict::xmnpda)))) < $sat->jul_utc) {
261
+    	} elseif ($sat->jul_epoch + ((16.666666 - $sat->meanmo)/
262
+                               (10.0*abs($sat->tle->xndt2o/(Predict::twopi/Predict::xmnpda/Predict::xmnpda)))) < $sat->jul_utc) {
263 263
               return true;
264 264
         } else {
265 265
               return false;
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         $observerGeo      = new Predict_Geodetic();
299 299
         $observerGeo->lat = Predict_Math::Radians($qth->lat);
300 300
         $observerGeo->lon = Predict_Math::Radians($qth->lon);
301
-        $observerGeo->alt = $qth->alt * 1000;
301
+        $observerGeo->alt = $qth->alt*1000;
302 302
 
303 303
         // Now determine the sun and observer positions
304 304
         $observerPos      = new Predict_Vector();
@@ -311,12 +311,12 @@  discard block
 block discarded – undo
311 311
         $observerSatPos = new Predict_Vector();
312 312
         Predict_Math::Vec_Sub($this->pos, $observerPos, $observerSatPos);
313 313
         $phaseAngle = Predict_Math::Degrees(Predict_Math::Angle($solarVector, $observerSatPos));
314
-        $illum      = $phaseAngle / 180;
314
+        $illum      = $phaseAngle/180;
315 315
 
316
-        $illuminationChange            = $illum / $imag['illum'];
317
-        $inverseSquareOfDistanceChange = pow(($imag['distance'] / $this->range), 2);
316
+        $illuminationChange            = $illum/$imag['illum'];
317
+        $inverseSquareOfDistanceChange = pow(($imag['distance']/$this->range), 2);
318 318
         $changeInMagnitude             = log(
319
-            $illuminationChange * $inverseSquareOfDistanceChange,
319
+            $illuminationChange*$inverseSquareOfDistanceChange,
320 320
             self::POGSONS_RATIO
321 321
         );
322 322
 
Please login to merge, or discard this patch.
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.
require/class.Satellite.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		try {
20 20
 			$sth = $this->db->prepare($query);
21 21
 			$sth->execute(array(':name' => $name));
22
-		} catch(PDOException $e) {
22
+		} catch (PDOException $e) {
23 23
 			echo $e->getMessage();
24 24
 		}
25 25
 		$result = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		try {
32 32
 			$sth = $this->db->prepare($query);
33 33
 			$sth->execute();
34
-		} catch(PDOException $e) {
34
+		} catch (PDOException $e) {
35 35
 			echo $e->getMessage();
36 36
 		}
37 37
 		$result = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		try {
44 44
 			$sth = $this->db->prepare($query);
45 45
 			$sth->execute();
46
-		} catch(PDOException $e) {
46
+		} catch (PDOException $e) {
47 47
 			echo $e->getMessage();
48 48
 		}
49 49
 		$result = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		try {
56 56
 			$sth = $this->db->prepare($query);
57 57
 			$sth->execute(array(':type' => $type));
58
-		} catch(PDOException $e) {
58
+		} catch (PDOException $e) {
59 59
 			echo $e->getMessage();
60 60
 		}
61 61
 		$result = $sth->fetchAll(PDO::FETCH_ASSOC);
@@ -63,27 +63,27 @@  discard block
 block discarded – undo
63 63
 		else return array();
64 64
 	}
65 65
 	
66
-	public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) {
66
+	public function position_all($timestamp_begin = '', $timestamp_end = '', $second = 10) {
67 67
 		$all_sat = $this->get_tle_names();
68 68
 		$result = array();
69 69
 		foreach ($all_sat as $sat) {
70
-			$position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second);
71
-			$result = array_merge($position,$result);
70
+			$position = $this->position($sat['tle_name'], $timestamp_begin, $timestamp_end, $second);
71
+			$result = array_merge($position, $result);
72 72
 		}
73 73
 		return $result;
74 74
 	}
75 75
 
76
-	public function position_all_type($type,$timestamp_begin = '',$timestamp_end = '',$second = 10) {
76
+	public function position_all_type($type, $timestamp_begin = '', $timestamp_end = '', $second = 10) {
77 77
 		$all_sat = $this->get_tle_names_type($type);
78 78
 		$result = array();
79 79
 		foreach ($all_sat as $sat) {
80
-			$position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second);
81
-			$result = array_merge($position,$result);
80
+			$position = $this->position($sat['tle_name'], $timestamp_begin, $timestamp_end, $second);
81
+			$result = array_merge($position, $result);
82 82
 		}
83 83
 		return $result;
84 84
 	}
85 85
 	
86
-	public function position($name,$timestamp_begin = '',$timestamp_end = '',$second = 10) {
86
+	public function position($name, $timestamp_begin = '', $timestamp_end = '', $second = 10) {
87 87
 		$qth = new Predict_QTH();
88 88
 		$qth->lat = 37.790252;
89 89
 		$qth->lon = -122.419968;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		$tle_file = $this->get_tle($name);
92 92
 		//print_r($tle_file);
93 93
 		$type = $tle_file['tle_type'];
94
-		$tle = new Predict_TLE($tle_file['tle_name'],$tle_file['tle_tle1'],$tle_file['tle_tle2']);
94
+		$tle = new Predict_TLE($tle_file['tle_name'], $tle_file['tle_tle1'], $tle_file['tle_tle2']);
95 95
 		$sat = new Predict_Sat($tle);
96 96
 		$predict = new Predict();
97 97
 		//if ($timestamp == '') $now = Predict_Time::get_current_daynum();
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
 		if ($timestamp_end == '') {
100 100
 			$now = Predict_Time::unix2daynum($timestamp_begin);
101 101
 			//echo $now;
102
-			$predict->predict_calc($sat,$qth,$now);
103
-			return array('name' => $name, 'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp_begin,'type' => $type);
102
+			$predict->predict_calc($sat, $qth, $now);
103
+			return array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp_begin, 'type' => $type);
104 104
 		} else {
105
-			for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp=$timestamp+$second) {
105
+			for ($timestamp = $timestamp_begin; $timestamp <= $timestamp_end; $timestamp = $timestamp + $second) {
106 106
 				//echo $timestamp."\n";
107 107
 				$now = Predict_Time::unix2daynum($timestamp);
108 108
 				//echo $now;
109
-				$predict->predict_calc($sat,$qth,$now);
110
-				$result[] = array('name' => $name,'latitude' => $sat->ssplat,'longitude' => $sat->ssplon, 'altitude' => $sat->alt,'speed' => $sat->velo*60*60,'timestamp' => $timestamp,'type' => $type);
109
+				$predict->predict_calc($sat, $qth, $now);
110
+				$result[] = array('name' => $name, 'latitude' => $sat->ssplat, 'longitude' => $sat->ssplon, 'altitude' => $sat->alt, 'speed' => $sat->velo*60*60, 'timestamp' => $timestamp, 'type' => $type);
111 111
 			}
112 112
 			return $result;
113 113
 		}
Please login to merge, or discard this patch.
space-data.php 1 patch
Spacing   +5 added lines, -5 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
-$sat = filter_input(INPUT_GET,'sat',FILTER_SANITIZE_STRING);
10
+$sat = filter_input(INPUT_GET, 'sat', FILTER_SANITIZE_STRING);
11 11
 $sat = urldecode($sat);
12 12
 
13 13
 if ($sat == 'ISS (ZARYA)') {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	$aircraft_name = 'INTEGRAL';
43 43
 //	$ground_speed = 14970;
44 44
 	$launch_date = '17 October 2002';
45
-} elseif (strpos($sat,'IRIDIUM') !== false) {
45
+} elseif (strpos($sat, 'IRIDIUM') !== false) {
46 46
 	$image = 'https://upload.wikimedia.org/wikipedia/commons/b/b6/Iridium_Satellite.jpg';
47 47
 	$image_copyright = 'Cliff';
48 48
 	$ident = 'Iridium satellite constellation';
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
 	$aircraft_name = $sat;
51 51
 //	$ground_speed = 14970;
52 52
 //	$launch_date = '29 september 2011';
53
-} elseif (strpos($sat,'ORBCOMM') !== false) {
53
+} elseif (strpos($sat, 'ORBCOMM') !== false) {
54 54
 	$ident = 'Orbcomm';
55 55
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Orbcomm_(satellite)';
56 56
 	$aircraft_name = $sat;
57
-} elseif (strpos($sat,'GLOBALSTAR') !== false) {
57
+} elseif (strpos($sat, 'GLOBALSTAR') !== false) {
58 58
 	$ident = 'Globalstar';
59 59
 	$aircraft_wiki = 'https://en.wikipedia.org/wiki/Globalstar';
60 60
 	$aircraft_name = $sat;
61
-} elseif (strpos($sat,'OSCAR 7') !== false) {
61
+} elseif (strpos($sat, 'OSCAR 7') !== false) {
62 62
 	$image = 'https://upload.wikimedia.org/wikipedia/en/a/ad/AMSAT-OSCAR_7.jpg';
63 63
 	$image_copyright = 'Amsat.org';
64 64
 	$ident = 'AMSAT-OSCAR 7';
Please login to merge, or discard this patch.
live-sat-czml.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -20,17 +20,17 @@  discard block
 block discarded – undo
20 20
 
21 21
 $spotter_array = array();
22 22
 if (isset($_COOKIE['sattypes']) && $_COOKIE['sattypes'] != '') {
23
-	$sattypes = explode(',',$_COOKIE['sattypes']);
23
+	$sattypes = explode(',', $_COOKIE['sattypes']);
24 24
 	foreach ($sattypes as $sattype) {
25
-		$spotter_array = array_merge($Satellite->position_all_type($sattype,$timeb-$globalLiveInterval,$timeb),$spotter_array);
25
+		$spotter_array = array_merge($Satellite->position_all_type($sattype, $timeb - $globalLiveInterval, $timeb), $spotter_array);
26 26
 	}
27 27
 }
28 28
 if (isset($_COOKIE['displayiss']) && $_COOKIE['displayiss']) {
29
-	$spotter_array = array_merge($Satellite->position('ISS (ZARYA)',time()-$globalLiveInterval,time()),$spotter_array);
30
-	$spotter_array = array_merge($Satellite->position('TIANGONG 1',time()-$globalLiveInterval,time()),$spotter_array);
31
-	$spotter_array = array_merge($Satellite->position('TIANGONG-2',time()-$globalLiveInterval,time()),$spotter_array);
29
+	$spotter_array = array_merge($Satellite->position('ISS (ZARYA)', time() - $globalLiveInterval, time()), $spotter_array);
30
+	$spotter_array = array_merge($Satellite->position('TIANGONG 1', time() - $globalLiveInterval, time()), $spotter_array);
31
+	$spotter_array = array_merge($Satellite->position('TIANGONG-2', time() - $globalLiveInterval, time()), $spotter_array);
32 32
 }
33
-$spotter_array = array_unique($spotter_array,SORT_REGULAR);
33
+$spotter_array = array_unique($spotter_array, SORT_REGULAR);
34 34
 /*
35 35
 $modelsdb = array();
36 36
 if (file_exists('models/space/space_modelsdb')) {
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 //	$output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}';
55 55
 
56 56
 //	$output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
57
-$output .= ',"clock": {"currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
57
+$output .= ',"clock": {"currentTime" : "'.date("c", time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
58 58
 //$output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
59 59
 
60 60
 //	$output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"step": "SYSTEM_CLOCK_MULTIPLIER"}';
61 61
 $output .= '},';
62 62
 if (!empty($spotter_array) && is_array($spotter_array))
63 63
 {
64
-	foreach($spotter_array as $spotter_item)
64
+	foreach ($spotter_array as $spotter_item)
65 65
 	{
66 66
 		$j++;
67 67
 		date_default_timezone_set('UTC');
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 			$orientation = '';
77 77
 			$prev_satname = $spotter_item['name'];
78 78
 			$output .= '{';
79
-			$output .= '"id": "'.trim(str_replace(array('[+]','[-]'),'',$spotter_item['name'])).'",';
79
+			$output .= '"id": "'.trim(str_replace(array('[+]', '[-]'), '', $spotter_item['name'])).'",';
80 80
 			$output .= '"properties": {';
81 81
 			// Not yet supported in CZML with Cesium
82 82
 			$output .= '},';
@@ -114,23 +114,23 @@  discard block
 block discarded – undo
114 114
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/cubiesat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
115 115
 				} elseif ($spotter_item['name'] == 'TERRA') {
116 116
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/terra.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
117
-				} elseif (strpos($spotter_item['name'],'O3B') !== false) {
117
+				} elseif (strpos($spotter_item['name'], 'O3B') !== false) {
118 118
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/o3b.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
119
-				} elseif (strpos($spotter_item['name'],'GLOBALSTAR') !== false) {
119
+				} elseif (strpos($spotter_item['name'], 'GLOBALSTAR') !== false) {
120 120
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/globalstar.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
121
-				} elseif (strpos($spotter_item['name'],'GPS') !== false) {
121
+				} elseif (strpos($spotter_item['name'], 'GPS') !== false) {
122 122
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/gps.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
123
-				} elseif (strpos($spotter_item['name'],'GENESIS') !== false) {
123
+				} elseif (strpos($spotter_item['name'], 'GENESIS') !== false) {
124 124
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/genesis.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
125
-				} elseif (strpos($spotter_item['name'],'OSCAR 7') !== false) {
125
+				} elseif (strpos($spotter_item['name'], 'OSCAR 7') !== false) {
126 126
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/oscar7.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
127
-				} elseif (strpos($spotter_item['name'],'FLOCK') !== false) {
127
+				} elseif (strpos($spotter_item['name'], 'FLOCK') !== false) {
128 128
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/cubesat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
129
-				} elseif (strpos($spotter_item['name'],'PLEIADES') !== false) {
129
+				} elseif (strpos($spotter_item['name'], 'PLEIADES') !== false) {
130 130
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/pleiades.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
131
-				} elseif (strpos($spotter_item['name'],'DUCHIFAT') !== false) {
131
+				} elseif (strpos($spotter_item['name'], 'DUCHIFAT') !== false) {
132 132
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/duchifat.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
133
-				} elseif (strpos($spotter_item['name'],'FORMOSAT-2') !== false) {
133
+				} elseif (strpos($spotter_item['name'], 'FORMOSAT-2') !== false) {
134 134
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/formosat2.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
135 135
 				} elseif ($spotter_item['type'] == 'iridium') {
136 136
 					$output .= '"model": {"gltf" : "'.$globalURL.'/models/space/iridium.glb'.'","scale" : 1.0,"minimumPixelSize": 25,"maximunPixelSize": 300 },';
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
 	//		$output .= '"interpolationDegree" : 5,';
152 152
 	//		$output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", ';
153 153
 			$output .= '"cartographicDegrees": [';
154
-			$output .= '"'.date("c",$spotter_item['timestamp']).'", ';
154
+			$output .= '"'.date("c", $spotter_item['timestamp']).'", ';
155 155
 			$output .= $spotter_item['longitude'].', ';
156 156
 			$output .= $spotter_item['latitude'].', ';
157 157
 			$output .= $spotter_item['altitude']*1000;
158 158
 			$orientation = '"orientation" : { ';
159 159
 			$orientation .= '"unitQuaternion": [';
160 160
 		} else {
161
-			$output .= ',"'.date("c",$spotter_item['timestamp']).'", ';
161
+			$output .= ',"'.date("c", $spotter_item['timestamp']).'", ';
162 162
 			$output .= $spotter_item['longitude'].', ';
163 163
 			$output .= $spotter_item['latitude'].', ';
164 164
 			$output .= $spotter_item['altitude']*1000;
Please login to merge, or discard this patch.
table-output.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	}
93 93
 	print '<th class="more"></th>';
94 94
 	print '</thead>';
95
-} else if (strtolower($current_page) == "upcoming"){
95
+} else if (strtolower($current_page) == "upcoming") {
96 96
 	print '<thead>';
97 97
 	if ($_GET['sort'] == "airline_name_asc")
98 98
 	{
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	}
143 143
 	*/
144 144
 	print '</thead>';
145
-} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){
145
+} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") {
146 146
 	print '<thead>';
147 147
 	print '<th class="aircraft_thumbnail"></th>';
148 148
 	print '<th class="logo">'._("Airline").'</th>';
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	print '</thead>';
154 154
 } else {
155 155
 
156
-	if ($hide_th_links === true){
156
+	if ($hide_th_links === true) {
157 157
 		print '<thead>';
158 158
 		print '<th class="aircraft_thumbnail"></th>';
159 159
 		if ($_GET['sort'] == "airline_name_asc")
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 }
335 335
 
336 336
 print '<tbody>'."\n";
337
-foreach($spotter_array as $spotter_item)
337
+foreach ($spotter_array as $spotter_item)
338 338
 {
339 339
 	if (isset($globalTimezone))
340 340
 	{
@@ -365,13 +365,13 @@  discard block
 block discarded – undo
365 365
                                         $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
366 366
 				}
367 367
 				if (isset($spotter_item['airline_name'])) {
368
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
368
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
369 369
 				} else {
370
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
370
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
371 371
 				}
372 372
                         } else {
373 373
                     		if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
374
-                    		$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
374
+                    		$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
375 375
                     		} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
376 376
 				if (isset($spotter_item['airline_name'])) {
377 377
 					print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 			print '</td>'."\n";
387 387
 		}
388 388
 	}
389
-	if(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){
389
+	if (strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") {
390 390
 		if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) {
391 391
 		    $spotter_item['squawk'] = '-';
392 392
 		}
@@ -402,17 +402,17 @@  discard block
 block discarded – undo
402 402
                                         $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id;
403 403
 				}
404 404
 				if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
405
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
405
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
406 406
 				} elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) {
407
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
407
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
408 408
 				} elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) {
409
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
409
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
410 410
 				} else {
411
-					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
411
+					print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
412 412
 				}
413 413
 			} else {
414 414
                     		if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') {
415
-                    		$image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']);
415
+                    		$image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']);
416 416
                     		} else 	$image_thumbnail = $spotter_item['image_thumbnail'];
417 417
 				if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) {
418 418
 					print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">&copy; '.$spotter_item['image_copyright'].'</div>';
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 	}
472 472
 	print '</td>'."\n";
473 473
 	// Aircraft type
474
-	if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){
474
+	if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") {
475 475
 		print '<td class="type">'."\n";
476 476
 		if (!isset($spotter_item['aircraft_name'])) {
477 477
 			print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'._("Not available").'</a></span>'."\n";
@@ -493,22 +493,22 @@  discard block
 block discarded – undo
493 493
 	}
494 494
 	if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) {
495 495
 		if ($spotter_item['departure_airport_time'] > 2460) {
496
-			$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
497
-		} else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
496
+			$departure_airport_time = date('H:m', $spotter_item['departure_airport_time']);
497
+		} else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2);
498 498
 		if ($spotter_item['real_departure_airport_time'] > 2460) {
499
-			$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
499
+			$real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']);
500 500
 		} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
501 501
 		print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n";
502 502
 	} elseif (isset($spotter_item['real_departure_airport_time'])) {
503 503
 		if ($spotter_item['real_departure_airport_time'] > 2460) {
504
-			$real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']);
504
+			$real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']);
505 505
 		} else $real_departure_airport_time = $spotter_item['real_departure_airport_time'];
506 506
 		print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n";
507 507
 	} elseif (isset($spotter_item['departure_airport_time'])) {
508 508
 		if ($spotter_item['departure_airport_time'] > 2460) {
509
-			$departure_airport_time = date('H:m',$spotter_item['departure_airport_time']);
509
+			$departure_airport_time = date('H:m', $spotter_item['departure_airport_time']);
510 510
 		} else {
511
-			$departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2);
511
+			$departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2);
512 512
 		}
513 513
 		print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n";
514 514
 	}
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 				$latitude = $spotter_item['latitude'];
524 524
 				$longitude = $spotter_item['longitude'];
525 525
 			}
526
-			$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude);
526
+			$distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude);
527 527
 		} else $distance = '';
528 528
 		if ($distance != '') {
529 529
 		    if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -564,20 +564,20 @@  discard block
 block discarded – undo
564 564
 	}
565 565
 	if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) {
566 566
 		if ($spotter_item['arrival_airport_time'] > 2460) {
567
-			$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
567
+			$arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']);
568 568
 		} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
569 569
 		if ($spotter_item['real_arrival_airport_time'] > 2460) {
570
-			$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
570
+			$real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']);
571 571
 		} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
572 572
 		print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n";
573 573
 	} elseif (isset($spotter_item['real_arrival_airport_time'])) {
574 574
 		if ($spotter_item['real_arrival_airport_time'] > 2460) {
575
-			$real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']);
575
+			$real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']);
576 576
 		} else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time'];
577 577
 		print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n";
578 578
 	} elseif (isset($spotter_item['arrival_airport_time'])) {
579 579
 		if ($spotter_item['arrival_airport_time'] > 2460) {
580
-			$arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']);
580
+			$arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']);
581 581
 		} else $arrival_airport_time = $spotter_item['arrival_airport_time'];
582 582
 		print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n";
583 583
 	}
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 				$latitude = $spotter_item['latitude'];
591 591
 				$longitude = $spotter_item['longitude'];
592 592
 			}
593
-			$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude);
593
+			$distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude);
594 594
 		} else $distance = '';
595 595
 		if ($distance != '') {
596 596
 		    if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 	}
605 605
 	print '</td>'."\n";
606 606
 	// Route stop
607
-	if(strtolower($current_page) != "upcoming"){
607
+	if (strtolower($current_page) != "upcoming") {
608 608
 		print '<td class="route_stop">'."\n";
609 609
 		if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '') {
610 610
 			print '<span class="nomobile">-</span>'."\n";
@@ -625,22 +625,22 @@  discard block
 block discarded – undo
625 625
 		} else {
626 626
 			//if (!isset($globalUnitDistance) || $globalUnitDistance == 'km') {
627 627
 			if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) {
628
-				print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n";
629
-				print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n";
628
+				print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n";
629
+				print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n";
630 630
 			//} elseif ($globalUnitDistance == 'mi') {
631 631
 			} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) {
632
-				print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n";
633
-				print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n";
632
+				print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n";
633
+				print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n";
634 634
 			//} elseif ($globalUnitDistance == 'nm') {
635 635
 			} elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) {
636
-				print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n";
637
-				print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n";
636
+				print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n";
637
+				print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n";
638 638
 			}
639 639
 		}
640 640
 		
641 641
 		print '</td>'."\n";
642 642
 	}
643
-	if(strtolower($current_page) != "upcoming"){
643
+	if (strtolower($current_page) != "upcoming") {
644 644
 		if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) {
645 645
 			print '<td class="pilot">'."\n";
646 646
 			if ((!isset($spotter_item['pilot_id']) || $spotter_item['pilot_id'] == '') && (!isset($spotter_item['pilot_name']) || $spotter_item['pilot_name'] == '')) {
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 	if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") {
678 678
 		if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') {
679 679
 			print '<td class="message"><p>'."\n";
680
-			print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
680
+			print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
681 681
 			print '</p><p class="decode">';
682 682
 			$decode_array = json_decode($spotter_item['decode']);
683 683
 			foreach ($decode_array as $key => $value) {
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 			print '</td>'."\n";
688 688
 		} else {
689 689
 			print '<td class="message">'."\n";
690
-			print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']);
690
+			print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']);
691 691
 			print '</td>'."\n";
692 692
 		}
693 693
 	}
Please login to merge, or discard this patch.