Ysurac /
FlightAirMap
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | $id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
||
| 3 | if ($id == "") |
||
| 4 | { |
||
| 5 | header('Location: /'); |
||
| 6 | } |
||
| 7 | |||
| 8 | require_once('require/class.Connection.php'); |
||
| 9 | require_once('require/class.Spotter.php'); |
||
| 10 | require_once('require/class.Language.php'); |
||
| 11 | require_once('require/class.SpotterArchive.php'); |
||
| 12 | $Spotter = new Spotter(); |
||
| 13 | $SpotterArchive = new SpotterArchive(); |
||
| 14 | $spotter_array = $Spotter->getSpotterDataByID($id); |
||
| 15 | |||
| 16 | |||
| 17 | if (!empty($spotter_array)) |
||
| 18 | { |
||
| 19 | if(isset($spotter_array[0]['flightaware_id'])) { |
||
| 20 | $flightaware_id = $spotter_array[0]['flightaware_id']; |
||
| 21 | } |
||
| 22 | if(isset($spotter_array[0]['last_latitude']) && $spotter_array[0]['last_latitude'] != '') { |
||
| 23 | $latitude = $spotter_array[0]['last_latitude']; |
||
| 24 | } elseif(isset($spotter_array[0]['latitude'])) { |
||
| 25 | $latitude = $spotter_array[0]['latitude']; |
||
| 26 | } |
||
| 27 | if(isset($spotter_array[0]['last_longitude']) && $spotter_array[0]['last_longitude'] != '') { |
||
| 28 | $longitude = $spotter_array[0]['last_longitude']; |
||
| 29 | } elseif(isset($spotter_array[0]['longitude'])) { |
||
| 30 | $longitude = $spotter_array[0]['longitude']; |
||
| 31 | } |
||
| 32 | $title = ''; |
||
| 33 | if(isset($spotter_array[0]['ident'])) { |
||
| 34 | $title .= $spotter_array[0]['ident']; |
||
| 35 | } |
||
| 36 | if(isset($spotter_array[0]['airline_name'])) { |
||
| 37 | $title .= ' - '.$spotter_array[0]['airline_name']; |
||
| 38 | } |
||
| 39 | if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
||
| 40 | $title .= ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
||
| 41 | } |
||
| 42 | if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA' && $spotter_array[0]['registration'] != 'N/A') { |
||
| 43 | $title .= ' - '.$spotter_array[0]['registration']; |
||
| 44 | } |
||
| 45 | //$facebook_meta_image = $spotter_array[0]['image']; |
||
| 46 | require_once('header.php'); |
||
| 47 | |||
| 48 | if (isset($globalArchive) && $globalArchive) { |
||
| 49 | // Requirement for altitude graph |
||
| 50 | print '<br/><script type="text/javascript" src="https://www.google.com/jsapi"></script><br/>'; |
||
| 51 | $all_data = $SpotterArchive->getAltitudeSpeedArchiveSpotterDataById($spotter_array[0]['flightaware_id']); |
||
| 52 | |||
| 53 | if (isset($globalTimezone)) { |
||
| 54 | date_default_timezone_set($globalTimezone); |
||
| 55 | } else date_default_timezone_set('UTC'); |
||
| 56 | |||
| 57 | //date_default_timezone_set('UTC'); |
||
| 58 | if (is_array($all_data) && count($all_data) > 0) { |
||
| 59 | print '<br/><div id="chart6" class="chart" width="100%"></div> |
||
| 60 | <script> |
||
| 61 | google.load("visualization", "1.1", {packages:["line","corechart"]}); |
||
| 62 | google.setOnLoadCallback(drawChart6); |
||
| 63 | function drawChart6() { |
||
| 64 | var data = google.visualization.arrayToDataTable([ |
||
| 65 | ["Hour","Altitude","Speed"], '; |
||
| 66 | $altitude_data = ''; |
||
| 67 | foreach($all_data as $data) |
||
| 68 | { |
||
| 69 | $altitude_data .= '[ "'.date("G:i",strtotime($data['date']." UTC")).'",'.$data['altitude'].','.$data['ground_speed'].'],'; |
||
| 70 | } |
||
| 71 | $altitude_data = substr($altitude_data, 0, -1); |
||
| 72 | print $altitude_data.']); |
||
| 73 | |||
| 74 | var options = { |
||
| 75 | legend: {position: "none"}, |
||
| 76 | series: { |
||
| 77 | 0: {axis: "Altitude"}, |
||
| 78 | 1: {axis: "Speed"} |
||
| 79 | }, |
||
| 80 | axes: { |
||
| 81 | y: { |
||
| 82 | Altitude: {label: "Altitude (FL)"}, |
||
| 83 | Speed: {label: "Speed (knots)"}, |
||
| 84 | } |
||
| 85 | }, |
||
| 86 | height:210 |
||
| 87 | }; |
||
| 88 | |||
| 89 | var chart = new google.charts.Line(document.getElementById("chart6")); |
||
| 90 | chart.draw(data, options); |
||
| 91 | } |
||
| 92 | $(window).resize(function(){ |
||
| 93 | drawChart6(); |
||
| 94 | }); |
||
| 95 | </script>'; |
||
| 96 | } |
||
| 97 | } |
||
| 98 | |||
| 99 | |||
| 100 | print '<div class="info column">'; |
||
| 101 | print '<h1>'; |
||
| 102 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) { |
||
| 103 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" class="airline-logo" /></a> '; |
||
| 104 | } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) { |
||
| 105 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" class="airline-logo" /></a> '; |
||
| 106 | } else { |
||
| 107 | if ($spotter_array[0]['airline_name'] != "") { |
||
| 108 | print '<a href="'.$globalURL.'/airline/'.$spotter_array[0]['airline_icao'].'">'.$spotter_array[0]['airline_name'].'</a> '; |
||
| 109 | } |
||
| 110 | } |
||
| 111 | if(isset($spotter_array[0]['ident'])) { |
||
| 112 | print $spotter_array[0]['ident']; |
||
| 113 | } |
||
| 114 | if(isset($spotter_array[0]['airline_name'])) { |
||
| 115 | print ' - '.$spotter_array[0]['airline_name']; |
||
| 116 | } |
||
| 117 | if(isset($spotter_array[0]['aircraft_name']) && $spotter_array[0]['aircraft_name'] != 'Not Available') { |
||
| 118 | print ' - '.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')'; |
||
| 119 | } |
||
| 120 | if(isset($spotter_array[0]['registration']) && $spotter_array[0]['registration'] != 'NA') { |
||
| 121 | print ' - '.$spotter_array[0]['registration']; |
||
| 122 | } |
||
| 123 | print '</h1>'; |
||
| 124 | print '</div>'; |
||
| 125 | |||
| 126 | if ($spotter_array[0]['registration'] != "") { |
||
| 127 | //$highlight = $Spotter->getHighlightByRegistration($spotter_array[0]['registration']); |
||
| 128 | $highlight = $spotter_array[0]['highlight']; |
||
| 129 | if ($highlight != "") { |
||
| 130 | print '<div class="alert alert-warning">'.$highlight.'</div>'; |
||
| 131 | } |
||
| 132 | } |
||
| 133 | |||
| 134 | include('flightid-sub-menu.php'); |
||
| 135 | print '<div class="clear column">'; |
||
| 136 | print '<div class="image">'; |
||
| 137 | if ($spotter_array[0]['image'] != "") |
||
| 138 | { |
||
| 139 | if ($spotter_array[0]['image_source'] == 'planespotters') { |
||
| 140 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
||
| 141 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
||
| 142 | print '<a href="http://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id.'" target="_blank"><img src="'.$spotter_array[0]['image_thumbnail'].'" alt="Click image to view on Planespotters.net" title="Click image to view on Planespotters.net" width="100%" /></a>'; |
||
| 143 | print '<div class="note">Disclaimer: The images are courtesy of Planespotters.net and their respective uploaders. This system may not always 100% accuratly show the actual aircraft.</div>'; |
||
| 144 | print '<div class="note">Planespotters.net didn\'t allow us to show full size pics here. This pic is copyright '.$spotter_array[0]['image_copyright'].'</div>'; |
||
| 145 | } else { |
||
| 146 | if (isset($spotter_array[0]['image_source_website']) && $spotter_array[0]['image_source_website'] != '') { |
||
| 147 | print '<a href="'.$spotter_array[0]['image_source_website'].'"><img src="'.$spotter_array[0]['image'].'" width="100%" /></a>'; |
||
| 148 | } else { |
||
| 149 | print '<img src="'.$spotter_array[0]['image'].'" width="100%" />'; |
||
| 150 | } |
||
| 151 | print '<div class="note">Disclaimer: The source of the above image is '.$spotter_array[0]['image_source'].' and is copyright '.$spotter_array[0]['image_copyright'].'. This system may not show the actual aircraft with 100% accuracy.</div>'; |
||
| 152 | } |
||
| 153 | } else { |
||
|
0 ignored issues
–
show
|
|||
| 154 | //print '<img src="'.$globalURL.'/images/placeholder.png" alt="No image found!" title="No image found!" />'; |
||
| 155 | } |
||
| 156 | print '</div>'; |
||
| 157 | |||
| 158 | /* print '<div class="col-sm-4 details">'; |
||
| 159 | |||
| 160 | foreach($spotter_array as $spotter_item) |
||
| 161 | { |
||
| 162 | print '<div class="detail">'; |
||
| 163 | if (@getimagesize($globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png')) |
||
| 164 | { |
||
| 165 | print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'"><img src="'.$globalURL.'/images/airlines/'.$spotter_item['airline_icao'].'.png" /></a>'; |
||
| 166 | } else { |
||
| 167 | if (isset($spotter_item['airline_name']) && $spotter_item['airline_name'] != "") |
||
| 168 | { |
||
| 169 | print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'">'.$spotter_item['airline_name'].'</a>'; |
||
| 170 | } else { |
||
| 171 | print 'N/A'; |
||
| 172 | } |
||
| 173 | } |
||
| 174 | print '</div>'; |
||
| 175 | |||
| 176 | print '<div class="detail">'; |
||
| 177 | print '<div class="title">Ident/Callsign</div>'; |
||
| 178 | print '<div>'; |
||
| 179 | if ($spotter_item['ident'] != "") |
||
| 180 | { |
||
| 181 | print '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>'; |
||
| 182 | } else { |
||
| 183 | print 'N/A'; |
||
| 184 | } |
||
| 185 | print '</div>'; |
||
| 186 | print '</div>'; |
||
| 187 | |||
| 188 | print '<div class="detail">'; |
||
| 189 | print '<div class="title">Aircraft</div>'; |
||
| 190 | print '<div>'; |
||
| 191 | if (isset($spotter_item['aircraft_name'])) |
||
| 192 | { |
||
| 193 | print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
||
| 194 | } else { |
||
| 195 | if ($spotter_item['aircraft_type'] != "") |
||
| 196 | { |
||
| 197 | print $spotter_item['aircraft_type']; |
||
| 198 | } else { |
||
| 199 | print 'N/A'; |
||
| 200 | } |
||
| 201 | } |
||
| 202 | print '</div>'; |
||
| 203 | print '</div>'; |
||
| 204 | |||
| 205 | print '<div class="detail">'; |
||
| 206 | print '<div class="title">Registration</div>'; |
||
| 207 | print '<div>'; |
||
| 208 | if ($spotter_item['registration'] != "") |
||
| 209 | { |
||
| 210 | print '<a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'">'.$spotter_item['registration'].'</a>'; |
||
| 211 | } else { |
||
| 212 | print 'N/A'; |
||
| 213 | } |
||
| 214 | print '</div>'; |
||
| 215 | print '</div>'; |
||
| 216 | |||
| 217 | print '<div class="detail">'; |
||
| 218 | print '<div class="title">Coming from</div>'; |
||
| 219 | print '<div>'; |
||
| 220 | if ($spotter_item['departure_airport_name'] != "") |
||
| 221 | { |
||
| 222 | print '<a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'">'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].')</a>'; |
||
| 223 | } else { |
||
| 224 | print $spotter_item['departure_airport']; |
||
| 225 | } |
||
| 226 | print '</div>'; |
||
| 227 | print '</div>'; |
||
| 228 | |||
| 229 | print '<div class="detail">'; |
||
| 230 | print '<div class="title">Flying to</div>'; |
||
| 231 | print '<div>'; |
||
| 232 | if ($spotter_item['arrival_airport_name'] != "") |
||
| 233 | { |
||
| 234 | print '<a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a>'; |
||
| 235 | } else { |
||
| 236 | print $spotter_item['arrival_airport']; |
||
| 237 | } |
||
| 238 | print '</div>'; |
||
| 239 | print '</div>'; |
||
| 240 | |||
| 241 | print '<div class="detail">'; |
||
| 242 | print '<div class="title">Date</div>'; |
||
| 243 | print '<div>'; |
||
| 244 | |||
| 245 | print '<a href="'.$globalURL.'/date/'.date("Y-m-d", strtotime($spotter_item['date_iso_8601'])).'">'.date("M j, Y, g:i a", strtotime($spotter_item['date_iso_8601'])).'</a>'; |
||
| 246 | print '</div>'; |
||
| 247 | print '</div>'; |
||
| 248 | } |
||
| 249 | |||
| 250 | print '</div>'; |
||
| 251 | |||
| 252 | |||
| 253 | print '<div class="col-sm-7 col-sm-offset-1 image">'; |
||
| 254 | |||
| 255 | print '<div class="image">'; |
||
| 256 | |||
| 257 | |||
| 258 | if ($spotter_array[0]['image'] != "") |
||
| 259 | { |
||
| 260 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
||
| 261 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
||
| 262 | print '<a href="http://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id.'" target="_blank"><img src="'.$spotter_array[0]['image'].'" alt="Click image to view on Planespotters.net" title="Click image to view on Planespotters.net" /></a>'; |
||
| 263 | |||
| 264 | } else { |
||
| 265 | print '<img src="'.$globalURL.'/images/placeholder.png" alt="No image found!" title="No image found!" />'; |
||
| 266 | } |
||
| 267 | |||
| 268 | print '</div>'; |
||
| 269 | print '<div class="note">Disclaimer: The images are courtesy of Planespotters.net and may not always be 100% accurate of the actual aircraft that has flown over.</div>'; |
||
| 270 | print '</div>'; |
||
| 271 | print '</div>'; |
||
| 272 | */ |
||
| 273 | |||
| 274 | foreach($spotter_array as $spotter_item) |
||
| 275 | { |
||
| 276 | print '<div class="details">'; |
||
| 277 | print '<h3>Flight Information</h3>'; |
||
| 278 | print '<div class="detail callsign">'; |
||
| 279 | print '<div class="title">Ident/Callsign</div>'; |
||
| 280 | print '<div>'; |
||
| 281 | if ($spotter_item['ident'] != "") |
||
| 282 | { |
||
| 283 | print '<a href="'.$globalURL.'/ident/'.$spotter_item['ident'].'">'.$spotter_item['ident'].'</a>'; |
||
| 284 | } else { |
||
| 285 | print 'N/A'; |
||
| 286 | } |
||
| 287 | print '</div>'; |
||
| 288 | print '</div>'; |
||
| 289 | |||
| 290 | if (isset($spotter_item['aircraft_owner']) && $spotter_item['aircraft_owner'] != '') |
||
| 291 | { |
||
| 292 | print '<div class="detail fa-user">'; |
||
| 293 | print '<div class="title">Owner</div>'; |
||
| 294 | print '<div>'; |
||
| 295 | print $spotter_item['aircraft_owner']; |
||
| 296 | print '</div>'; |
||
| 297 | print '</div>'; |
||
| 298 | } elseif ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
||
| 299 | print '<div class="detail fa-user">'; |
||
| 300 | print '<div class="title">Pilot Name</div>'; |
||
| 301 | print '<div>'; |
||
| 302 | if (isset($spotter_item['pilot_id']) && $spotter_item['pilot_id'] != "") |
||
| 303 | { |
||
| 304 | if ($spotter_item['format_source'] == 'whazzup') print '<a href="https://www.ivao.aero/Member.aspx?ID='.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
||
| 305 | elseif ($spotter_item['format_source'] == 'vatsimtxt') print '<a href="http://www.vataware.com/pilot/'.$spotter_item['pilot_id'].'">'.$spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')</a>'; |
||
| 306 | else print $spotter_item['pilot_name'].' ('.$spotter_item['pilot_id'].')'; |
||
| 307 | } else { |
||
| 308 | if (isset($spotter_item['pilot_name']) && $spotter_item['pilot_name'] != "") |
||
| 309 | { |
||
| 310 | print $spotter_item['pilot_name']; |
||
| 311 | } else { |
||
| 312 | print 'N/A'; |
||
| 313 | } |
||
| 314 | } |
||
| 315 | print '</div>'; |
||
| 316 | print '</div>'; |
||
| 317 | } |
||
| 318 | |||
| 319 | print '<div class="detail airline">'; |
||
| 320 | print '<div class="title">Airline</div>'; |
||
| 321 | print '<div>'; |
||
| 322 | if ($spotter_item['airline_name'] != "") |
||
| 323 | { |
||
| 324 | print '<a href="'.$globalURL.'/airline/'.$spotter_item['airline_icao'].'">'.$spotter_item['airline_name'].'</a>'; |
||
| 325 | } else { |
||
| 326 | print 'N/A'; |
||
| 327 | } |
||
| 328 | print '</div>'; |
||
| 329 | print '</div>'; |
||
| 330 | |||
| 331 | print '<div class="detail aircraft">'; |
||
| 332 | print '<div class="title">Aircraft</div>'; |
||
| 333 | print '<div>'; |
||
| 334 | if ($spotter_item['aircraft_name'] != "") |
||
| 335 | { |
||
| 336 | print '<a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')</a>'; |
||
| 337 | } else { |
||
| 338 | if ($spotter_item['aircraft_type'] != "") |
||
| 339 | { |
||
| 340 | print $spotter_item['aircraft_type']; |
||
| 341 | } else { |
||
| 342 | print 'N/A'; |
||
| 343 | } |
||
| 344 | } |
||
| 345 | print '</div>'; |
||
| 346 | print '</div>'; |
||
| 347 | |||
| 348 | print '<div class="detail registration">'; |
||
| 349 | print '<div class="title">Registration</div>'; |
||
| 350 | print '<div>'; |
||
| 351 | if ($spotter_item['registration'] != "") |
||
| 352 | { |
||
| 353 | print '<a href="'.$globalURL.'/registration/'.$spotter_item['registration'].'">'.$spotter_item['registration'].'</a>'; |
||
| 354 | } else { |
||
| 355 | print 'N/A'; |
||
| 356 | } |
||
| 357 | print '</div>'; |
||
| 358 | print '</div>'; |
||
| 359 | |||
| 360 | if ($spotter_item['departure_airport'] != 'NA') { |
||
| 361 | print '<div class="detail departure">'; |
||
| 362 | print '<div class="title">Departure Airport</div>'; |
||
| 363 | print '<div>'; |
||
| 364 | if ($spotter_item['departure_airport_name'] != "") |
||
| 365 | { |
||
| 366 | print '<a href="'.$globalURL.'/airport/'.$spotter_item['departure_airport'].'">'.$spotter_item['departure_airport_city'].', '.$spotter_item['departure_airport_name'].', '.$spotter_item['departure_airport_country'].' ('.$spotter_item['departure_airport'].')</a>'; |
||
| 367 | } else { |
||
| 368 | print $spotter_item['departure_airport']; |
||
| 369 | } |
||
| 370 | print '</div>'; |
||
| 371 | if (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != '') { |
||
| 372 | if ($spotter_item['departure_airport_time'] > 2460) { |
||
| 373 | print '<div class="time">'; |
||
| 374 | print 'at '.date('H:m',$spotter_item['departure_airport_time']); |
||
| 375 | print '</div>'; |
||
| 376 | } else { |
||
| 377 | print '<div class="time">'; |
||
| 378 | print 'at '.$spotter_item['departure_airport_time']; |
||
| 379 | print '</div>'; |
||
| 380 | } |
||
| 381 | } |
||
| 382 | print '</div>'; |
||
| 383 | } |
||
| 384 | |||
| 385 | if ($spotter_item['arrival_airport'] != 'NA') { |
||
| 386 | print '<div class="detail arrival">'; |
||
| 387 | print '<div class="title">Arrival Airport</div>'; |
||
| 388 | print '<div>'; |
||
| 389 | if ($spotter_item['arrival_airport_name'] != "") |
||
| 390 | { |
||
| 391 | print '<a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_name'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a>'; |
||
| 392 | } else { |
||
| 393 | print $spotter_item['arrival_airport']; |
||
| 394 | } |
||
| 395 | print '</div>'; |
||
| 396 | if (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != '') { |
||
| 397 | print '<div class="time">'; |
||
| 398 | print 'at '.$spotter_item['arrival_airport_time']; |
||
| 399 | print '</div>'; |
||
| 400 | } elseif (isset($spotter_item['real_arrival_airport_time']) && $spotter_item['real_arrival_airport_time'] != '') { |
||
| 401 | print '<div class="time">'; |
||
| 402 | print 'at '.$spotter_item['real_arrival_airport_time']; |
||
| 403 | print '</div>'; |
||
| 404 | } |
||
| 405 | print '</div>'; |
||
| 406 | } |
||
| 407 | |||
| 408 | if ($spotter_item['waypoints'] != "" || $spotter_item['route_stop'] != "") |
||
| 409 | { |
||
| 410 | print '<div class="detail coordinates">'; |
||
| 411 | print '<div class="title">Route</div>'; |
||
| 412 | print '<div>'; |
||
| 413 | if ($spotter_item['waypoints'] != "") |
||
| 414 | { |
||
| 415 | print $spotter_item['waypoints']; |
||
| 416 | } elseif ($spotter_item['route_stop'] != "") |
||
| 417 | { |
||
| 418 | print $spotter_item['route_stop']; |
||
| 419 | } |
||
| 420 | print '</div>'; |
||
| 421 | print '</div>'; |
||
| 422 | } |
||
| 423 | print '</div>'; |
||
| 424 | |||
| 425 | print '<div class="details">'; |
||
| 426 | print '<h3>Additional information as it flew nearby</h3>'; |
||
| 427 | if ($spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) { |
||
| 428 | print '<div class="detail speed">'; |
||
| 429 | print '<div class="title">Ground Speed</div>'; |
||
| 430 | print '<div>'; |
||
| 431 | if (isset($spotter_item['last_ground_speed']) && $spotter_item['last_ground_speed'] != '') { |
||
| 432 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
||
| 433 | print round($spotter_item['last_ground_speed']*1.15078).' mph'; |
||
| 434 | } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
||
| 435 | print $spotter_item['last_ground_speed'].' knots'; |
||
| 436 | } else { |
||
| 437 | print round($spotter_item['last_ground_speed']*1.852).' km/h'; |
||
| 438 | } |
||
| 439 | } else { |
||
| 440 | if ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'mph') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'mph')) { |
||
| 441 | print round($spotter_item['ground_speed']*1.15078).' mph'; |
||
| 442 | } elseif ((!isset($_COOKIE['unitspeed']) && isset($globalUnitSpeed) && $globalUnitSpeed == 'knots') || (isset($_COOKIE['unitspeed']) && $_COOKIE['unitspeed'] == 'knots')) { |
||
| 443 | print $spotter_item['ground_speed'].' knots'; |
||
| 444 | } else { |
||
| 445 | print round($spotter_item['ground_speed']*1.852).' km/h'; |
||
| 446 | } |
||
| 447 | } |
||
| 448 | print '</div>'; |
||
| 449 | print '</div>'; |
||
| 450 | |||
| 451 | print '<div class="detail heading">'; |
||
| 452 | print '<div class="title">Heading (degrees)</div>'; |
||
| 453 | print '<div>'; |
||
| 454 | print $spotter_item['heading'].' ('.$spotter_item['heading_name'].')'; |
||
| 455 | print '</div>'; |
||
| 456 | print '</div>'; |
||
| 457 | |||
| 458 | print '<div class="detail altitude">'; |
||
| 459 | print '<div class="title">Altitude</div>'; |
||
| 460 | print '<div>'; |
||
| 461 | if (isset($spotter_item['last_altitude']) && $spotter_item['last_altitude'] != '') { |
||
| 462 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
| 463 | print number_format($spotter_item['last_altitude'].'00').' feet'; |
||
| 464 | } else { |
||
| 465 | print round($spotter_item['last_altitude']*30.48).' m'; |
||
| 466 | } |
||
| 467 | } else { |
||
| 468 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
||
| 469 | print number_format($spotter_item['altitude'].'00').' feet'; |
||
| 470 | } else { |
||
| 471 | print round($spotter_item['altitude']*30.48).' m'; |
||
| 472 | } |
||
| 473 | } |
||
| 474 | print '</div>'; |
||
| 475 | print '</div>'; |
||
| 476 | |||
| 477 | print '<div class="detail coordinates">'; |
||
| 478 | print '<div class="title">Coordinates</div>'; |
||
| 479 | print '<div>'; |
||
| 480 | //print '<a href="https://www.google.com/maps/place/'.$spotter_item['latitude'].','.$spotter_item['longitude'].'/@'.$spotter_item['latitude'].','.$spotter_item['longitude'].',10z" target="_blank">Lat: '.$spotter_item['latitude'].' Lng: '.$spotter_item['longitude'].'</a>'; |
||
| 481 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
||
| 482 | print 'Lat: '.$spotter_item['last_latitude'].' Lng: '.$spotter_item['last_longitude']; |
||
| 483 | } else { |
||
| 484 | print 'Lat: '.$spotter_item['latitude'].' Lng: '.$spotter_item['longitude']; |
||
| 485 | } |
||
| 486 | print '</div>'; |
||
| 487 | print '</div>'; |
||
| 488 | } |
||
| 489 | print '<div class="detail date">'; |
||
| 490 | print '<div class="title">Date ('.$globalTimezone.')</div>'; |
||
| 491 | print '<div>'; |
||
| 492 | date_default_timezone_set($globalTimezone); |
||
| 493 | print '<a href="'.$globalURL.'/date/'.date("Y-m-d", strtotime($spotter_item['date_iso_8601'])).'">'.date("M j, Y g:i a", strtotime($spotter_item['date_iso_8601'])).'</a>'; |
||
| 494 | print '</div>'; |
||
| 495 | print '</div>'; |
||
| 496 | |||
| 497 | print '<div class="detail date">'; |
||
| 498 | print '<div class="title">Date (UTC)</div>'; |
||
| 499 | print '<div>'; |
||
| 500 | date_default_timezone_set('UTC'); |
||
| 501 | print date("M j, Y G:i", strtotime($spotter_item['date_iso_8601'])); |
||
| 502 | print '</div>'; |
||
| 503 | print '</div>'; |
||
| 504 | |||
| 505 | if (isset($spotter_item['departure_airport']) && $spotter_item['departure_airport'] != '' && $spotter_item['departure_airport'] != 'NA' && $spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) { |
||
| 506 | print '<div class="detail distance-departure">'; |
||
| 507 | print '<div class="title">Distance from Departure Airport</div>'; |
||
| 508 | print '<div>'; |
||
| 509 | $Common = new Common(); |
||
| 510 | $departure_airport_info = $Spotter->getAllAirportInfo($spotter_item['departure_airport']); |
||
| 511 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
||
| 512 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
||
| 513 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
||
| 514 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
||
| 515 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
||
| 516 | } else { |
||
| 517 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
||
| 518 | } |
||
| 519 | } else { |
||
| 520 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
||
| 521 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'nm').' nm'; |
||
| 522 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
||
| 523 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'mi').' mi'; |
||
| 524 | } else { |
||
| 525 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$departure_airport_info[0]['latitude'],$departure_airport_info[0]['longitude'],'km').' km'; |
||
| 526 | } |
||
| 527 | } |
||
| 528 | print '</div>'; |
||
| 529 | print '</div>'; |
||
| 530 | } |
||
| 531 | if (isset($spotter_item['arrival_airport']) && $spotter_item['arrival_airport'] != '' && $spotter_item['arrival_airport'] != 'NA' && $spotter_item['latitude'] != 0 && $spotter_item['longitude'] != 0) { |
||
| 532 | print '<div class="detail distance-arrival">'; |
||
| 533 | print '<div class="title">Distance to Arrival Airport</div>'; |
||
| 534 | print '<div>'; |
||
| 535 | $Common = new Common(); |
||
| 536 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['arrival_airport']); |
||
| 537 | if (isset($spotter_item['last_latitude']) && $spotter_item['last_latitude'] != '') { |
||
| 538 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
||
| 539 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
||
| 540 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
||
| 541 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
||
| 542 | } else { |
||
| 543 | print $Common->distance($spotter_item['last_latitude'],$spotter_item['last_longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
||
| 544 | } |
||
| 545 | } else { |
||
| 546 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
||
| 547 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'nm').' nm'; |
||
| 548 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
||
| 549 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'mi').' mi'; |
||
| 550 | } else { |
||
| 551 | print $Common->distance($spotter_item['latitude'],$spotter_item['longitude'],$arrival_airport_info[0]['latitude'],$arrival_airport_info[0]['longitude'],'km').' km'; |
||
| 552 | } |
||
| 553 | } |
||
| 554 | print '</div>'; |
||
| 555 | print '</div>'; |
||
| 556 | } |
||
| 557 | |||
| 558 | |||
| 559 | print '</div>'; |
||
| 560 | } |
||
| 561 | print '</div>'; |
||
| 562 | |||
| 563 | // print '<div id="archive-map"></div>'; |
||
| 564 | |||
| 565 | if ($spotter_array[0]['registration'] != "" && $spotter_array[0]['registration'] != "NA" && $spotter_array[0]['registration'] != "N/A") |
||
| 566 | { |
||
| 567 | print '<div class="last-flights">'; |
||
| 568 | print '<h3>Last 5 Flights of this Aircraft ('.$spotter_array[0]['registration'].')</h3>'; |
||
| 569 | $hide_th_links = true; |
||
| 570 | $spotter_array = $Spotter->getSpotterDataByRegistration($spotter_array[0]['registration'],"0,5", ""); |
||
| 571 | include('table-output.php'); |
||
| 572 | print '<div class="more">'; |
||
| 573 | print '<a href="'.$globalURL.'/registration/'.$spotter_array[0]['registration'].'" class="btn btn-default btn" role="button">See all Flights»</a>'; |
||
| 574 | print '</div>'; |
||
| 575 | print '</div>'; |
||
| 576 | } |
||
| 577 | /* ?> |
||
| 578 | <div class="column"> |
||
| 579 | |||
| 580 | <div class="share"> |
||
| 581 | <span class='st_facebook' displayText='Facebook'></span> |
||
| 582 | <span class='st_twitter' displayText='Tweet'></span> |
||
| 583 | <span class='st_googleplus' displayText='Google +'></span> |
||
| 584 | <span class='st_pinterest' displayText='Pinterest'></span> |
||
| 585 | <span class='st_email' displayText='Email'></span> |
||
| 586 | </div> |
||
| 587 | <script type="text/javascript">var switchTo5x=true;</script> |
||
| 588 | <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> |
||
| 589 | <script type="text/javascript">stLight.options({publisher: "ur-5a9fbd4d-de8a-6441-d567-29163a2526c7", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script> |
||
| 590 | |||
| 591 | <?php |
||
| 592 | print '</div>'; |
||
| 593 | */ |
||
| 594 | } else { |
||
| 595 | $title = "ID"; |
||
| 596 | require_once('header.php'); |
||
| 597 | print '<h1>Error</h1>'; |
||
| 598 | print '<p>Sorry, this flight is not in the database. :(</p>'; |
||
| 599 | } |
||
| 600 | |||
| 601 | require_once('footer.php'); |
||
| 602 | ?> |
This check looks for the
elsebranches ofifstatements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.These
elsebranches can be removed.could be turned into
This is much more concise to read.