@@ -1,8 +1,10 @@ discard block |
||
| 1 | 1 | </section> |
| 2 | 2 | <div class="pub onmap"> |
| 3 | 3 | <?php |
| 4 | - if (isset($globalPub)) print $globalPub; |
|
| 5 | -?> |
|
| 4 | + if (isset($globalPub)) { |
|
| 5 | + print $globalPub; |
|
| 6 | + } |
|
| 7 | + ?> |
|
| 6 | 8 | </div> |
| 7 | 9 | <footer class="container"> |
| 8 | 10 | <?php |
@@ -13,7 +15,10 @@ discard block |
||
| 13 | 15 | <?php |
| 14 | 16 | } |
| 15 | 17 | ?> |
| 16 | - <span>Developed in Barrie by <a href="http://www.mariotrunz.me/" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) print $globalURL; ?>/about#source">Source & Credits</a></span> - <span><a href="https://www.flightairmap.com/" target="_blank">Get source code</a></span> |
|
| 18 | + <span>Developed in Barrie by <a href="http://www.mariotrunz.me/" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) { |
|
| 19 | + print $globalURL; |
|
| 20 | +} |
|
| 21 | +?>/about#source">Source & Credits</a></span> - <span><a href="https://www.flightairmap.com/" target="_blank">Get source code</a></span> |
|
| 17 | 22 | </footer> |
| 18 | 23 | |
| 19 | 24 | <div class="notifications bottom-left"></div> |
@@ -304,7 +304,12 @@ discard block |
||
| 304 | 304 | <?php |
| 305 | 305 | } else { |
| 306 | 306 | ?> |
| 307 | - if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
| 307 | + if (parseInt(lastupdateentity) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
| 308 | + print $globalMapRefresh*2000; |
|
| 309 | +} else { |
|
| 310 | + print '60000'; |
|
| 311 | +} |
|
| 312 | +?>)) { |
|
| 308 | 313 | viewer.dataSources.get(dsn).entities.remove(entity); |
| 309 | 314 | czmlds.entities.removeById(entityid); |
| 310 | 315 | } |
@@ -588,7 +593,12 @@ discard block |
||
| 588 | 593 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
| 589 | 594 | ?> |
| 590 | 595 | update_polarLayer(); |
| 591 | -setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 596 | +setInterval(function(){update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 597 | + print $globalMapRefresh*1000*2; |
|
| 598 | +} else { |
|
| 599 | + print '60000'; |
|
| 600 | +} |
|
| 601 | +?>); |
|
| 592 | 602 | <?php |
| 593 | 603 | } |
| 594 | 604 | ?> |
@@ -700,7 +710,12 @@ discard block |
||
| 700 | 710 | console.log('Reload...'); |
| 701 | 711 | updateData(); |
| 702 | 712 | } |
| 703 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
| 713 | + ,<?php if (isset($globalMapRefresh)) { |
|
| 714 | + print $globalMapRefresh*1000; |
|
| 715 | +} else { |
|
| 716 | + print '30000'; |
|
| 717 | +} |
|
| 718 | +?>); |
|
| 704 | 719 | } else { |
| 705 | 720 | var clockViewModel = new Cesium.ClockViewModel(viewer.clock); |
| 706 | 721 | var animationViewModel = new Cesium.AnimationViewModel(clockViewModel); |
@@ -729,7 +744,12 @@ discard block |
||
| 729 | 744 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
| 730 | 745 | ?> |
| 731 | 746 | update_atcLayer(); |
| 732 | -setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 747 | +setInterval(function(){update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 748 | + print $globalMapRefresh*1000*2; |
|
| 749 | +} else { |
|
| 750 | + print '60000'; |
|
| 751 | +} |
|
| 752 | +?>); |
|
| 733 | 753 | <?php |
| 734 | 754 | } |
| 735 | 755 | ?> |
@@ -28,7 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
| 30 | 30 | $output .= ',"clock": {"currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"'; |
| 31 | -if (!isset($_GET['now'])) $output .= ',"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z"'; |
|
| 31 | +if (!isset($_GET['now'])) { |
|
| 32 | + $output .= ',"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z"'; |
|
| 33 | +} |
|
| 32 | 34 | $output .= '}'; |
| 33 | 35 | //$output .= ',"clock": {"currentTime" : "'.date("c",time()).'","multiplier" : 300,"range" : "UNBOUNDED","step": "TICK_DEPENDENT"}'; |
| 34 | 36 | //$output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
@@ -37,7 +39,9 @@ discard block |
||
| 37 | 39 | $output .= '},'; |
| 38 | 40 | $output .= '{'; |
| 39 | 41 | $output .= '"id": "santaclaus",'; |
| 40 | -if (!isset($_GET['now'])) $output .= '"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z",'; |
|
| 42 | +if (!isset($_GET['now'])) { |
|
| 43 | + $output .= '"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z",'; |
|
| 44 | +} |
|
| 41 | 45 | $output .= '"properties": {'; |
| 42 | 46 | $output .= '"type": "santa"'; |
| 43 | 47 | $output .= '},'; |
@@ -81,10 +81,15 @@ |
||
| 81 | 81 | // $launch_date = '15 November 1974'; |
| 82 | 82 | } else { |
| 83 | 83 | $ident = $sat; |
| 84 | - if (strpos($sat,'(')) $satname = $sat; |
|
| 85 | - else $satname = str_replace(array(' '),'-',$sat); |
|
| 84 | + if (strpos($sat,'(')) { |
|
| 85 | + $satname = $sat; |
|
| 86 | + } else { |
|
| 87 | + $satname = str_replace(array(' '),'-',$sat); |
|
| 88 | + } |
|
| 89 | + } |
|
| 90 | +if (!isset($satname)) { |
|
| 91 | + $satname = $sat; |
|
| 86 | 92 | } |
| 87 | -if (!isset($satname)) $satname = $sat; |
|
| 88 | 93 | if ($satname != 'santaclaus') { |
| 89 | 94 | $info = $Satellite->get_info(strtolower(trim($satname))); |
| 90 | 95 | $position = $Satellite->position($sat); |
@@ -7,8 +7,10 @@ discard block |
||
| 7 | 7 | $showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop'); |
| 8 | 8 | if (isset($globalVM) && $globalVM && isset($type) && $type == 'marine') { |
| 9 | 9 | $showDuration = $Common->multiKeyExists($spotter_array,'race_time'); |
| 10 | - if ($showDuration === false) $showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
|
| 11 | -} else { |
|
| 10 | + if ($showDuration === false) { |
|
| 11 | + $showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
|
| 12 | + } |
|
| 13 | + } else { |
|
| 12 | 14 | $showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
| 13 | 15 | } |
| 14 | 16 | if (isset($globalVM) && $globalVM && isset($type) && $type == 'marine') { |
@@ -16,7 +18,9 @@ discard block |
||
| 16 | 18 | } |
| 17 | 19 | |
| 18 | 20 | |
| 19 | -if (!isset($type)) $type = 'aircraft'; |
|
| 21 | +if (!isset($type)) { |
|
| 22 | + $type = 'aircraft'; |
|
| 23 | +} |
|
| 20 | 24 | |
| 21 | 25 | if (!isset($_GET['sort'])) |
| 22 | 26 | { |
@@ -593,7 +597,9 @@ discard block |
||
| 593 | 597 | if (isset($globalTimezone)) |
| 594 | 598 | { |
| 595 | 599 | date_default_timezone_set($globalTimezone); |
| 596 | - } else date_default_timezone_set('UTC'); |
|
| 600 | + } else { |
|
| 601 | + date_default_timezone_set('UTC'); |
|
| 602 | + } |
|
| 597 | 603 | if ($showSpecial === true) |
| 598 | 604 | { |
| 599 | 605 | print '<tr class="special">'."\n"; |
@@ -608,7 +614,9 @@ discard block |
||
| 608 | 614 | print '<tr class="active">'; |
| 609 | 615 | } elseif (isset($spotter_item['spotted_registration'])) { |
| 610 | 616 | print '<tr class="info">'; |
| 611 | - } else print '<tr>'; |
|
| 617 | + } else { |
|
| 618 | + print '<tr>'; |
|
| 619 | + } |
|
| 612 | 620 | } |
| 613 | 621 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive" || strtolower($current_page) == "currently" || strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") { |
| 614 | 622 | if ($type == 'aircraft') { |
@@ -616,8 +624,9 @@ discard block |
||
| 616 | 624 | { |
| 617 | 625 | print '<td class="aircraft_thumbnail">'."\n"; |
| 618 | 626 | if ($spotter_item['image_source'] == 'planespotters') { |
| 619 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
| 620 | - else { |
|
| 627 | + if ($spotter_item['image_source_website'] != '') { |
|
| 628 | + $image_src = $spotter_item['image_source_website']; |
|
| 629 | + } else { |
|
| 621 | 630 | $planespotter_url_array = explode("_", $spotter_item['image']); |
| 622 | 631 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 623 | 632 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -630,7 +639,9 @@ discard block |
||
| 630 | 639 | } else { |
| 631 | 640 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 632 | 641 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 633 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 642 | + } else { |
|
| 643 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 644 | + } |
|
| 634 | 645 | if (isset($spotter_item['airline_name'])) { |
| 635 | 646 | 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">© '.$spotter_item['image_copyright'].'</div>'; |
| 636 | 647 | } else { |
@@ -656,7 +667,9 @@ discard block |
||
| 656 | 667 | print '<td class="aircraft_thumbnail">'."\n"; |
| 657 | 668 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 658 | 669 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 659 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 670 | + } else { |
|
| 671 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 672 | + } |
|
| 660 | 673 | if (isset($spotter_item['mmsi']) && $spotter_item['mmsi'] != '') { |
| 661 | 674 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 662 | 675 | } else { |
@@ -678,7 +691,9 @@ discard block |
||
| 678 | 691 | print '<td class="aircraft_thumbnail">'."\n"; |
| 679 | 692 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 680 | 693 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 681 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 694 | + } else { |
|
| 695 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 696 | + } |
|
| 682 | 697 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 683 | 698 | print '</td>'."\n"; |
| 684 | 699 | } else { |
@@ -731,8 +746,9 @@ discard block |
||
| 731 | 746 | print '<td class="aircraft_thumbnail">'."\n"; |
| 732 | 747 | //print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
| 733 | 748 | if ($spotter_item['image_source'] == 'planespotters') { |
| 734 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
| 735 | - else { |
|
| 749 | + if ($spotter_item['image_source_website'] != '') { |
|
| 750 | + $image_src = $spotter_item['image_source_website']; |
|
| 751 | + } else { |
|
| 736 | 752 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
| 737 | 753 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
| 738 | 754 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -749,7 +765,9 @@ discard block |
||
| 749 | 765 | } else { |
| 750 | 766 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 751 | 767 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 752 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 768 | + } else { |
|
| 769 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 770 | + } |
|
| 753 | 771 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
| 754 | 772 | 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">© '.$spotter_item['image_copyright'].'</div>'; |
| 755 | 773 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -789,13 +807,19 @@ discard block |
||
| 789 | 807 | print '<td class="aircraft_thumbnail">'."\n"; |
| 790 | 808 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 791 | 809 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 792 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 810 | + } else { |
|
| 811 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 812 | + } |
|
| 793 | 813 | if (isset($spotter_item['mmsi']) && $spotter_item['mmsi'] != '') { |
| 794 | 814 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n"; |
| 795 | - if ($spotter_item['image_copyright'] != '') print '<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 815 | + if ($spotter_item['image_copyright'] != '') { |
|
| 816 | + print '<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 817 | + } |
|
| 796 | 818 | } else { |
| 797 | 819 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['ident'].'" data-content="'._("Ident:").' '.$spotter_item['ident'].'" data-html="true" width="100px" />'."\n"; |
| 798 | - if ($spotter_item['image_copyright'] != '') print '<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 820 | + if ($spotter_item['image_copyright'] != '') { |
|
| 821 | + print '<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
| 822 | + } |
|
| 799 | 823 | } |
| 800 | 824 | print '</td>'."\n"; |
| 801 | 825 | } else { |
@@ -813,7 +837,9 @@ discard block |
||
| 813 | 837 | print '<td class="aircraft_thumbnail">'."\n"; |
| 814 | 838 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
| 815 | 839 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 816 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 840 | + } else { |
|
| 841 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
| 842 | + } |
|
| 817 | 843 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
| 818 | 844 | print '</td>'."\n"; |
| 819 | 845 | } else { |
@@ -931,8 +957,11 @@ discard block |
||
| 931 | 957 | print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n"; |
| 932 | 958 | } else { |
| 933 | 959 | $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
| 934 | - if (count($aircraft_names) == 1) print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n"; |
|
| 935 | - else print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n"; |
|
| 960 | + if (count($aircraft_names) == 1) { |
|
| 961 | + print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n"; |
|
| 962 | + } else { |
|
| 963 | + print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n"; |
|
| 964 | + } |
|
| 936 | 965 | } |
| 937 | 966 | print '<span class="mobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n"; |
| 938 | 967 | } elseif ($type == 'marine') { |
@@ -975,15 +1004,21 @@ discard block |
||
| 975 | 1004 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
| 976 | 1005 | if ($spotter_item['departure_airport_time'] > 2460) { |
| 977 | 1006 | $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
| 978 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 1007 | + } else { |
|
| 1008 | + $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
| 1009 | + } |
|
| 979 | 1010 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 980 | 1011 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
| 981 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 1012 | + } else { |
|
| 1013 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 1014 | + } |
|
| 982 | 1015 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
| 983 | 1016 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
| 984 | 1017 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
| 985 | 1018 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
| 986 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 1019 | + } else { |
|
| 1020 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
| 1021 | + } |
|
| 987 | 1022 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
| 988 | 1023 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
| 989 | 1024 | if ($spotter_item['departure_airport_time'] > 2460) { |
@@ -1005,7 +1040,9 @@ discard block |
||
| 1005 | 1040 | $longitude = $spotter_item['longitude']; |
| 1006 | 1041 | } |
| 1007 | 1042 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
| 1008 | - } else $distance = ''; |
|
| 1043 | + } else { |
|
| 1044 | + $distance = ''; |
|
| 1045 | + } |
|
| 1009 | 1046 | if ($distance != '') { |
| 1010 | 1047 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 1011 | 1048 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -1032,7 +1069,9 @@ discard block |
||
| 1032 | 1069 | } else { |
| 1033 | 1070 | if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) { |
| 1034 | 1071 | print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n"; |
| 1035 | - if (!isset($Spotter)) $Spotter = new Spotter(); |
|
| 1072 | + if (!isset($Spotter)) { |
|
| 1073 | + $Spotter = new Spotter(); |
|
| 1074 | + } |
|
| 1036 | 1075 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']); |
| 1037 | 1076 | print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n"; |
| 1038 | 1077 | print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n"; |
@@ -1048,20 +1087,28 @@ discard block |
||
| 1048 | 1087 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
| 1049 | 1088 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 1050 | 1089 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
| 1051 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 1090 | + } else { |
|
| 1091 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 1092 | + } |
|
| 1052 | 1093 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 1053 | 1094 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
| 1054 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 1095 | + } else { |
|
| 1096 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 1097 | + } |
|
| 1055 | 1098 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
| 1056 | 1099 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
| 1057 | 1100 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
| 1058 | 1101 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
| 1059 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 1102 | + } else { |
|
| 1103 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
| 1104 | + } |
|
| 1060 | 1105 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
| 1061 | 1106 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
| 1062 | 1107 | if ($spotter_item['arrival_airport_time'] > 2460) { |
| 1063 | 1108 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
| 1064 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 1109 | + } else { |
|
| 1110 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
| 1111 | + } |
|
| 1065 | 1112 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
| 1066 | 1113 | } |
| 1067 | 1114 | if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
@@ -1074,7 +1121,9 @@ discard block |
||
| 1074 | 1121 | $longitude = $spotter_item['longitude']; |
| 1075 | 1122 | } |
| 1076 | 1123 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
| 1077 | - } else $distance = ''; |
|
| 1124 | + } else { |
|
| 1125 | + $distance = ''; |
|
| 1126 | + } |
|
| 1078 | 1127 | if ($distance != '') { |
| 1079 | 1128 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
| 1080 | 1129 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -18,7 +18,9 @@ discard block |
||
| 18 | 18 | public function __construct($dbc = null) { |
| 19 | 19 | $Connection = new Connection($dbc); |
| 20 | 20 | $this->db = $Connection->db; |
| 21 | - if ($this->db === null) die('Error: No DB connection. (Source)'); |
|
| 21 | + if ($this->db === null) { |
|
| 22 | + die('Error: No DB connection. (Source)'); |
|
| 23 | + } |
|
| 22 | 24 | } |
| 23 | 25 | |
| 24 | 26 | public function getAllLocationInfo() { |
@@ -83,7 +85,9 @@ discard block |
||
| 83 | 85 | $query .= " AND source_location.latitude BETWEEN ".$minlat." AND ".$maxlat." AND source_location.longitude BETWEEN ".$minlong." AND ".$maxlong." AND source_location.latitude <> 0 AND source_location.longitude <> 0"; |
| 84 | 86 | } |
| 85 | 87 | $query .= " ORDER BY last_seen DESC"; |
| 86 | - if ($limit) $query .= " LIMIT 1000"; |
|
| 88 | + if ($limit) { |
|
| 89 | + $query .= " LIMIT 1000"; |
|
| 90 | + } |
|
| 87 | 91 | $query_values = array(':type' => $type); |
| 88 | 92 | try { |
| 89 | 93 | $sth = $this->db->prepare($query); |
@@ -122,7 +126,9 @@ discard block |
||
| 122 | 126 | } |
| 123 | 127 | |
| 124 | 128 | public function addLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '', $description = '') { |
| 125 | - if ($last_seen == '') $last_seen = date('Y-m-d H:i:s'); |
|
| 129 | + if ($last_seen == '') { |
|
| 130 | + $last_seen = date('Y-m-d H:i:s'); |
|
| 131 | + } |
|
| 126 | 132 | $query = "INSERT INTO source_location (name,latitude,longitude,altitude,country,city,logo,source,type,source_id,last_seen,location_id,description) VALUES (:name,:latitude,:longitude,:altitude,:country,:city,:logo,:source,:type,:source_id,:last_seen,:location_id,:description)"; |
| 127 | 133 | $query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description); |
| 128 | 134 | try { |
@@ -134,7 +140,9 @@ discard block |
||
| 134 | 140 | } |
| 135 | 141 | |
| 136 | 142 | public function updateLocation($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0,$location_id = 0,$last_seen = '',$description = '') { |
| 137 | - if ($last_seen == '') $last_seen = date('Y-m-d H:i:s'); |
|
| 143 | + if ($last_seen == '') { |
|
| 144 | + $last_seen = date('Y-m-d H:i:s'); |
|
| 145 | + } |
|
| 138 | 146 | $query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, source_id = :source_id, last_seen = :last_seen,location_id = :location_id, description = :description WHERE name = :name AND source = :source"; |
| 139 | 147 | $query_values = array(':name' => $name,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':source_id' => $source_id,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description); |
| 140 | 148 | try { |
@@ -157,7 +165,9 @@ discard block |
||
| 157 | 165 | } |
| 158 | 166 | |
| 159 | 167 | public function updateLocationByLocationID($name,$latitude,$longitude,$altitude,$city,$country,$source,$logo = 'antenna.png',$type = '',$source_id = 0, $location_id,$last_seen = '',$description = '') { |
| 160 | - if ($last_seen == '') $last_seen = date('Y-m-d H:i:s'); |
|
| 168 | + if ($last_seen == '') { |
|
| 169 | + $last_seen = date('Y-m-d H:i:s'); |
|
| 170 | + } |
|
| 161 | 171 | $query = "UPDATE source_location SET latitude = :latitude,longitude = :longitude,altitude = :altitude,country = :country,city = :city,logo = :logo,type = :type, last_seen = :last_seen, description = :description WHERE location_id = :location_id AND source = :source AND source_id = :source_id"; |
| 162 | 172 | $query_values = array(':source_id' => $source_id,':latitude' => $latitude, ':longitude' => $longitude,':altitude' => $altitude,':city' => $city,':country' => $country,':logo' => $logo,':source' => $source,':type' => $type,':last_seen' => $last_seen,':location_id' => $location_id,':description' => $description); |
| 163 | 173 | try { |
@@ -57,21 +57,30 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | document.cookie = 'MapFormat=3d; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
| 59 | 59 | <?php |
| 60 | - if (isset($_COOKIE['MapType3D'])) $MapType = $_COOKIE['MapType3D']; |
|
| 61 | - else $MapType = $globalMapProvider; |
|
| 62 | -// unset($_COOKIE['MapType']); |
|
| 60 | + if (isset($_COOKIE['MapType3D'])) { |
|
| 61 | + $MapType = $_COOKIE['MapType3D']; |
|
| 62 | + } else { |
|
| 63 | + $MapType = $globalMapProvider; |
|
| 64 | + } |
|
| 65 | + // unset($_COOKIE['MapType']); |
|
| 63 | 66 | |
| 64 | 67 | if ($MapType != 'Mapbox' && $MapType != 'OpenStreetMap' && $MapType != 'Bing-Aerial' && $MapType != 'Bing-Hybrid' && $MapType != 'Bing-Road' && $MapType != 'offline' && $MapType != 'ArcGIS-Streetmap' && $MapType != 'ArcGIS-Satellite' && $MapType != 'NatGeo-Street') { |
| 65 | - if (isset($globalBingMapKey) && $globalBingMapKey != '') $MapType = 'Bing-Aerial'; |
|
| 66 | - else $MapType = 'OpenStreetMap'; |
|
| 68 | + if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
| 69 | + $MapType = 'Bing-Aerial'; |
|
| 70 | + } else { |
|
| 71 | + $MapType = 'OpenStreetMap'; |
|
| 72 | + } |
|
| 67 | 73 | } |
| 68 | 74 | if (($MapType == 'Bing-Aerial' || $MapType == 'Bing-Hybrid' || $MapType == 'Bing-Road') && (!isset($globalBingMapKey) || $globalBingMapKey == '')) { |
| 69 | 75 | $MapType = 'OpenStreetMap'; |
| 70 | 76 | } |
| 71 | 77 | if ($MapType == 'Mapbox') { |
| 72 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
| 73 | - else $MapBoxId = $_COOKIE['MapType3DId']; |
|
| 74 | -?> |
|
| 78 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
| 79 | + $MapBoxId = $globalMapboxId; |
|
| 80 | + } else { |
|
| 81 | + $MapBoxId = $_COOKIE['MapType3DId']; |
|
| 82 | + } |
|
| 83 | + ?> |
|
| 75 | 84 | var imProv = Cesium.MapboxImageryProvider({ |
| 76 | 85 | credit: 'Map data © OpenStreetMap contributors, ' + |
| 77 | 86 | 'CC-BY-SA, ' + |
@@ -153,13 +162,23 @@ discard block |
||
| 153 | 162 | credit : 'Imagery courtesy Natural Earth' |
| 154 | 163 | }); |
| 155 | 164 | <?php |
| 156 | - } elseif (isset($globalMapCustomLayer[$MapType])) { |
|
| 165 | + } elseif (isset($globalMapCustomLayer[$MapType])) { |
|
| 157 | 166 | $customid = $MapType; |
| 158 | 167 | ?> |
| 159 | 168 | var imProv = Cesium.createOpenStreetMapImageryProvider({ |
| 160 | 169 | url : '<?php print $globalMapCustomLayer[$customid]['url']; ?>', |
| 161 | - maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '99'; ?>, |
|
| 162 | - minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
| 170 | + maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
| 171 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
| 172 | +} else { |
|
| 173 | + print '99'; |
|
| 174 | +} |
|
| 175 | +?>, |
|
| 176 | + minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
| 177 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
| 178 | +} else { |
|
| 179 | + print '0'; |
|
| 180 | +} |
|
| 181 | +?>, |
|
| 163 | 182 | credit: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
| 164 | 183 | }); |
| 165 | 184 | <?php |
@@ -449,7 +468,12 @@ discard block |
||
| 449 | 468 | imageryProvider : imProv, |
| 450 | 469 | timeline : archive, |
| 451 | 470 | animation : false, |
| 452 | - shadows : <?php if ((isset($globalMap3DShadows) && $globalMap3DShadows === FALSE) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'true')) print 'false'; else print 'true'; ?>, |
|
| 471 | + shadows : <?php if ((isset($globalMap3DShadows) && $globalMap3DShadows === FALSE) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'true')) { |
|
| 472 | + print 'false'; |
|
| 473 | +} else { |
|
| 474 | + print 'true'; |
|
| 475 | +} |
|
| 476 | +?>, |
|
| 453 | 477 | infoBox : false, |
| 454 | 478 | navigationHelpButton : false, |
| 455 | 479 | geocoder : false, |
@@ -464,8 +488,11 @@ discard block |
||
| 464 | 488 | if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) { |
| 465 | 489 | if (isset($_COOKIE['lastcentercoord'])) { |
| 466 | 490 | $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
| 467 | - if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0; |
|
| 468 | - else $zoom = $lastcentercoord[3]; |
|
| 491 | + if (!isset($lastcentercoord[3])) { |
|
| 492 | + $zoom = $lastcentercoord[2]*1000000.0; |
|
| 493 | + } else { |
|
| 494 | + $zoom = $lastcentercoord[3]; |
|
| 495 | + } |
|
| 469 | 496 | $viewcenterlatitude = $lastcentercoord[0]; |
| 470 | 497 | $viewcenterlongitude = $lastcentercoord[1]; |
| 471 | 498 | } else { |
@@ -597,7 +624,12 @@ discard block |
||
| 597 | 624 | ?> |
| 598 | 625 | |
| 599 | 626 | update_locationsLayer(); |
| 600 | -setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
| 627 | +setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) { |
|
| 628 | + print $globalMapRefresh*1000*2; |
|
| 629 | +} else { |
|
| 630 | + print '60000'; |
|
| 631 | +} |
|
| 632 | +?>); |
|
| 601 | 633 | |
| 602 | 634 | var currentposition; |
| 603 | 635 | viewer.camera.moveEnd.addEventListener(function() { |
@@ -755,5 +787,10 @@ discard block |
||
| 755 | 787 | } |
| 756 | 788 | } |
| 757 | 789 | } |
| 758 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
| 790 | + ,<?php if (isset($globalMapRefresh)) { |
|
| 791 | + print $globalMapRefresh*1000; |
|
| 792 | +} else { |
|
| 793 | + print '30000'; |
|
| 794 | +} |
|
| 795 | +?>); |
|
| 759 | 796 | } |
@@ -15,8 +15,12 @@ discard block |
||
| 15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | - } else $sql_date = ''; |
|
| 19 | -} else $sql_date = ''; |
|
| 18 | + } else { |
|
| 19 | + $sql_date = ''; |
|
| 20 | + } |
|
| 21 | + } else { |
|
| 22 | + $sql_date = ''; |
|
| 23 | +} |
|
| 20 | 24 | |
| 21 | 25 | if (isset($_GET['highest_altitude'])) { |
| 22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
| 30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 31 | 35 | $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
| 32 | 36 | $sql_altitude = $start_altitude; |
| 33 | - } else $sql_altitude = ''; |
|
| 34 | -} else $sql_altitude = ''; |
|
| 37 | + } else { |
|
| 38 | + $sql_altitude = ''; |
|
| 39 | + } |
|
| 40 | + } else { |
|
| 41 | + $sql_altitude = ''; |
|
| 42 | +} |
|
| 35 | 43 | |
| 36 | 44 | //calculuation for the pagination |
| 37 | 45 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
| 49 | 57 | $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
| 50 | 58 | $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
| 51 | 59 | } |
| 52 | -} else { |
|
| 60 | +} else { |
|
| 53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 62 | $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
| 55 | 63 | $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
@@ -70,8 +78,11 @@ discard block |
||
| 70 | 78 | |
| 71 | 79 | $date = date("c", time()); |
| 72 | 80 | |
| 73 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
| 74 | -else $sort = ''; |
|
| 81 | +if (isset($_GET['sort'])) { |
|
| 82 | + $sort = $_GET['sort']; |
|
| 83 | +} else { |
|
| 84 | + $sort = ''; |
|
| 85 | +} |
|
| 75 | 86 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
| 76 | 87 | $id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_STRING); |
| 77 | 88 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
@@ -15,8 +15,12 @@ discard block |
||
| 15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | - } else $sql_date = ''; |
|
| 19 | -} else $sql_date = ''; |
|
| 18 | + } else { |
|
| 19 | + $sql_date = ''; |
|
| 20 | + } |
|
| 21 | + } else { |
|
| 22 | + $sql_date = ''; |
|
| 23 | +} |
|
| 20 | 24 | |
| 21 | 25 | if (isset($_GET['highest_altitude'])) { |
| 22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
| 30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 31 | 35 | $start_altitude = filter_input(INPUT_GET,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT).",60000"; |
| 32 | 36 | $sql_altitude = $start_altitude; |
| 33 | - } else $sql_altitude = ''; |
|
| 34 | -} else $sql_altitude = ''; |
|
| 37 | + } else { |
|
| 38 | + $sql_altitude = ''; |
|
| 39 | + } |
|
| 40 | + } else { |
|
| 41 | + $sql_altitude = ''; |
|
| 42 | +} |
|
| 35 | 43 | |
| 36 | 44 | //calculuation for the pagination |
| 37 | 45 | if(!isset($_GET['limit'])) |
@@ -48,7 +56,7 @@ discard block |
||
| 48 | 56 | $limit_end = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
| 49 | 57 | $absolute_difference = filter_input(INPUT_GET,'number_results',FILTER_SANITIZE_NUMBER_INT); |
| 50 | 58 | } |
| 51 | -} else { |
|
| 59 | +} else { |
|
| 52 | 60 | $limit_explode = explode(",", $_GET['limit']); |
| 53 | 61 | $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT); |
| 54 | 62 | $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT); |
@@ -66,8 +74,11 @@ discard block |
||
| 66 | 74 | |
| 67 | 75 | header("Content-type: text/plain"); |
| 68 | 76 | |
| 69 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
| 70 | -else $sort = ''; |
|
| 77 | +if (isset($_GET['sort'])) { |
|
| 78 | + $sort = $_GET['sort']; |
|
| 79 | +} else { |
|
| 80 | + $sort = ''; |
|
| 81 | +} |
|
| 71 | 82 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
| 72 | 83 | $id = filter_input(INPUT_GET,'id',FILTER_SANITIZE_NUMBER_INT); |
| 73 | 84 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |