@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
10 | +$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | if (isset($_GET['sort'])) { |
13 | 13 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
14 | 14 | } else { |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | |
18 | 18 | if (!empty($spotter_array)) |
19 | 19 | { |
20 | - $title = sprintf(_("Most Common Airlines of %s"),$country); |
|
20 | + $title = sprintf(_("Most Common Airlines of %s"), $country); |
|
21 | 21 | require_once('header.php'); |
22 | 22 | print '<div class="select-item">'; |
23 | 23 | print '<form action="'.$globalURL.'/country" method="post">'; |
24 | 24 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
25 | 25 | print '<option></option>'; |
26 | 26 | $all_countries = $Spotter->getAllCountries(); |
27 | - foreach($all_countries as $all_country) |
|
27 | + foreach ($all_countries as $all_country) |
|
28 | 28 | { |
29 | - if($country == $all_country['country']) |
|
29 | + if ($country == $all_country['country']) |
|
30 | 30 | { |
31 | 31 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
32 | 32 | } else { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if ($_GET['country'] != "NA") |
42 | 42 | { |
43 | 43 | print '<div class="info column">'; |
44 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
44 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
45 | 45 | print '</div>'; |
46 | 46 | } else { |
47 | 47 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | include('country-sub-menu.php'); |
51 | 51 | print '<div class="column">'; |
52 | 52 | print '<h2>'._("Most Common Airlines").'</h2>'; |
53 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from airports & airlines of <strong>%s</strong>."),$country).'</p>'; |
|
53 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines of flights from airports & airlines of <strong>%s</strong>."), $country).'</p>'; |
|
54 | 54 | |
55 | 55 | $airline_array = $Spotter->countAllAirlinesByCountry($country); |
56 | 56 | if (!empty($airline_array)) |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | print '</thead>'; |
67 | 67 | print '<tbody>'; |
68 | 68 | $i = 1; |
69 | - foreach($airline_array as $airline_item) |
|
69 | + foreach ($airline_array as $airline_item) |
|
70 | 70 | { |
71 | 71 | print '<tr>'; |
72 | 72 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['country'])) { |
6 | - header('Location: '.$globalURL.'/country'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/country'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['country'])){ |
|
6 | +if (!isset($_GET['country'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit'])) |
|
11 | + if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $country = ucwords(str_replace("-", " ", $_GET['country'])); |
31 | 31 | |
32 | 32 | $page_url = $globalURL.'/country/'.$_GET['country']; |
33 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
33 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
34 | 34 | if ($sort != '') { |
35 | 35 | $spotter_array = $Spotter->getSpotterDataByCountry($country, $limit_start.",".$absolute_difference, $sort); |
36 | 36 | } else { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | if (!empty($spotter_array)) |
41 | 41 | { |
42 | - $title = sprintf(_("Detailed View for Airports & Airlines from %s"),$country); |
|
42 | + $title = sprintf(_("Detailed View for Airports & Airlines from %s"), $country); |
|
43 | 43 | |
44 | 44 | require_once('header.php'); |
45 | 45 | print '<div class="select-item">'; |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
48 | 48 | print '<option></option>'; |
49 | 49 | $all_countries = $Spotter->getAllCountries(); |
50 | - foreach($all_countries as $all_country) |
|
50 | + foreach ($all_countries as $all_country) |
|
51 | 51 | { |
52 | - if($country == $all_country['country']) |
|
52 | + if ($country == $all_country['country']) |
|
53 | 53 | { |
54 | 54 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
55 | 55 | } else { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if ($_GET['country'] != "NA") |
65 | 65 | { |
66 | 66 | print '<div class="info column">'; |
67 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
67 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
68 | 68 | print '</div>'; |
69 | 69 | } else { |
70 | 70 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | include('country-sub-menu.php'); |
74 | 74 | print '<div class="table column">'; |
75 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."),$country).'</p>'; |
|
75 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights of airports (both departure & arrival) OR airlines from <strong>%s</strong>."), $country).'</p>'; |
|
76 | 76 | |
77 | 77 | include('table-output.php'); |
78 | 78 | print '<div class="pagination">'; |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | </span> |
16 | 16 | <div class="sub-menu sub-menu-container"> |
17 | 17 | <ul class="nav nav-pills"> |
18 | - <li><a href="<?php print $globalURL; ?>/registration/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-detailed"){ print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
18 | + <li><a href="<?php print $globalURL; ?>/registration/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-detailed") { print 'class="active"'; } ?>><?php echo _("Detailed"); ?></a></li> |
|
19 | 19 | <li class="dropdown"> |
20 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "registration-statistics-departure-airport" || strtolower($current_page) == "registration-statistics-departure-airport-country" || strtolower($current_page) == "registration-statistics-arrival-airport" || strtolower($current_page) == "registration-statistics-arrival-airport-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
20 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "registration-statistics-departure-airport" || strtolower($current_page) == "registration-statistics-departure-airport-country" || strtolower($current_page) == "registration-statistics-arrival-airport" || strtolower($current_page) == "registration-statistics-arrival-airport-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
21 | 21 | <?php _("Airport"); ?> <span class="caret"></span> |
22 | 22 | </a> |
23 | 23 | <ul class="dropdown-menu" role="menu"> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | <li><a href="<?php print $globalURL; ?>/registration/statistics/arrival-airport-country/<?php print $_GET['registration']; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
28 | 28 | </ul> |
29 | 29 | </li> |
30 | - <li><a href="<?php print $globalURL; ?>/registration/statistics/route/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-statistics-route"){ print 'class="active"'; } ?>><?php _("Route"); ?></a></li> |
|
31 | - <li><a href="<?php print $globalURL; ?>/registration/statistics/time/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-statistics-time"){ print 'class="active"'; } ?>><?php _("Time"); ?></a></li> |
|
30 | + <li><a href="<?php print $globalURL; ?>/registration/statistics/route/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-statistics-route") { print 'class="active"'; } ?>><?php _("Route"); ?></a></li> |
|
31 | + <li><a href="<?php print $globalURL; ?>/registration/statistics/time/<?php print $_GET['registration']; ?>" <?php if (strtolower($current_page) == "registration-statistics-time") { print 'class="active"'; } ?>><?php _("Time"); ?></a></li> |
|
32 | 32 | </ul> |
33 | 33 | </div> |
34 | 34 | \ No newline at end of file |
@@ -11,12 +11,12 @@ |
||
11 | 11 | //checks to see if FlightAware import is set |
12 | 12 | if ($globalFlightAware == TRUE) |
13 | 13 | { |
14 | - $SpotterLive = new SpotterLive(); |
|
15 | - $Spotter = new Spotter(); |
|
16 | - //deletes the spotter LIVE data |
|
17 | - $SpotterLive->deleteLiveSpotterData(); |
|
14 | + $SpotterLive = new SpotterLive(); |
|
15 | + $Spotter = new Spotter(); |
|
16 | + //deletes the spotter LIVE data |
|
17 | + $SpotterLive->deleteLiveSpotterData(); |
|
18 | 18 | |
19 | - //imports the new data from FlightAware |
|
20 | - $Spotter->importFromFlightAware(); |
|
19 | + //imports the new data from FlightAware |
|
20 | + $Spotter->importFromFlightAware(); |
|
21 | 21 | } |
22 | 22 | ?> |
23 | 23 | \ No newline at end of file |
@@ -5,8 +5,8 @@ |
||
5 | 5 | */ |
6 | 6 | require_once(dirname(__FILE__).'/../require/settings.php'); |
7 | 7 | if ($globalInstalled) { |
8 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
9 | - exit; |
|
8 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
9 | + exit; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | require_once('../require/class.Connection.php'); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
12 | 12 | $schema = new Connection(); |
13 | 13 | if ($schema->latest() === false) { |
14 | - echo "You MUST update to latest schema. Run install/index.php"; |
|
15 | - exit(); |
|
14 | + echo "You MUST update to latest schema. Run install/index.php"; |
|
15 | + exit(); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | $debug = true; |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | date_default_timezone_set('UTC'); |
22 | 22 | // signal handler - playing nice with sockets and dump1090 |
23 | 23 | pcntl_signal(SIGINT, function($signo) { |
24 | - global $sock; |
|
25 | - echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
|
26 | - socket_shutdown($sock, 0); |
|
27 | - socket_close($sock); |
|
28 | - die("Bye!\n"); |
|
24 | + global $sock; |
|
25 | + echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
|
26 | + socket_shutdown($sock, 0); |
|
27 | + socket_close($sock); |
|
28 | + die("Bye!\n"); |
|
29 | 29 | }); |
30 | 30 | pcntl_signal_dispatch(); |
31 | 31 | |
@@ -38,24 +38,24 @@ discard block |
||
38 | 38 | // Bind the source address |
39 | 39 | if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) ) |
40 | 40 | { |
41 | - $errorcode = socket_last_error(); |
|
42 | - $errormsg = socket_strerror($errorcode); |
|
41 | + $errorcode = socket_last_error(); |
|
42 | + $errormsg = socket_strerror($errorcode); |
|
43 | 43 | |
44 | - die("Could not bind socket : [$errorcode] $errormsg \n"); |
|
44 | + die("Could not bind socket : [$errorcode] $errormsg \n"); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | echo "LISTEN UDP MODE \n\n"; |
48 | 48 | while(1) { |
49 | - $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
|
50 | - |
|
51 | - // lets play nice and handle signals such as ctrl-c/kill properly |
|
52 | - pcntl_signal_dispatch(); |
|
53 | - $dataFound = false; |
|
54 | - // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
|
55 | - echo $buffer."\n"; |
|
56 | - $ACARS->add(trim($buffer)); |
|
57 | - socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
58 | - $ACARS->deleteLiveAcarsData(); |
|
49 | + $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
|
50 | + |
|
51 | + // lets play nice and handle signals such as ctrl-c/kill properly |
|
52 | + pcntl_signal_dispatch(); |
|
53 | + $dataFound = false; |
|
54 | + // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
|
55 | + echo $buffer."\n"; |
|
56 | + $ACARS->add(trim($buffer)); |
|
57 | + socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
58 | + $ACARS->deleteLiveAcarsData(); |
|
59 | 59 | } |
60 | 60 | pcntl_exec($_,$argv); |
61 | 61 | ?> |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | |
18 | 18 | $debug = true; |
19 | 19 | |
20 | -$ACARS=new ACARS(); |
|
20 | +$ACARS = new ACARS(); |
|
21 | 21 | date_default_timezone_set('UTC'); |
22 | 22 | // signal handler - playing nice with sockets and dump1090 |
23 | -pcntl_signal(SIGINT, function($signo) { |
|
23 | +pcntl_signal(SIGINT, function($signo) { |
|
24 | 24 | global $sock; |
25 | 25 | echo "\n\nctrl-c or kill signal received. Tidying up ... "; |
26 | 26 | socket_shutdown($sock, 0); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $sock = socket_create(AF_INET, SOCK_DGRAM, 0) or die("Unable to create socket\n"); |
37 | 37 | |
38 | 38 | // Bind the source address |
39 | -if( !socket_bind($sock, $globalACARSHost , $globalACARSPort) ) |
|
39 | +if (!socket_bind($sock, $globalACARSHost, $globalACARSPort)) |
|
40 | 40 | { |
41 | 41 | $errorcode = socket_last_error(); |
42 | 42 | $errormsg = socket_strerror($errorcode); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | echo "LISTEN UDP MODE \n\n"; |
48 | -while(1) { |
|
48 | +while (1) { |
|
49 | 49 | $r = socket_recvfrom($sock, $buffer, 512, 0, $remote_ip, $remote_port); |
50 | 50 | |
51 | 51 | // lets play nice and handle signals such as ctrl-c/kill properly |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | // (null) 2 23/02/2015 14:46:06 0 -16 X .D-AIPW ! 1L 7 M82A LH077P 010952342854:VP-MIBI+W+0)-V+(),GB1 |
55 | 55 | echo $buffer."\n"; |
56 | 56 | $ACARS->add(trim($buffer)); |
57 | - socket_sendto($sock, "OK " . $buffer , 100 , 0 , $remote_ip , $remote_port); |
|
57 | + socket_sendto($sock, "OK ".$buffer, 100, 0, $remote_ip, $remote_port); |
|
58 | 58 | $ACARS->deleteLiveAcarsData(); |
59 | 59 | } |
60 | -pcntl_exec($_,$argv); |
|
60 | +pcntl_exec($_, $argv); |
|
61 | 61 | ?> |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Arrival Airports of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Arrival Airports of %s"), $spotter_array[0]['ident']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('ident-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | $airport_airport_array = $Spotter->countAllArrivalAirportsByIdent($ident); |
29 | 29 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
30 | 30 | <script> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ["'._("Airport").'", "'._("# of times").'"],'; |
40 | 40 | |
41 | 41 | $airport_data = ''; |
42 | - foreach($airport_airport_array as $airport_item) |
|
42 | + foreach ($airport_airport_array as $airport_item) |
|
43 | 43 | { |
44 | 44 | $name = $airport_item['airport_arrival_city'].', '.$airport_item['airport_arrival_country'].' ('.$airport_item['airport_arrival_icao'].')'; |
45 | 45 | $name = str_replace("'", "", $name); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | print '</thead>'; |
79 | 79 | print '<tbody>'; |
80 | 80 | $i = 1; |
81 | - foreach($airport_airport_array as $airport_item) |
|
81 | + foreach ($airport_airport_array as $airport_item) |
|
82 | 82 | { |
83 | 83 | print '<tr>'; |
84 | 84 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['ident'])) { |
6 | - header('Location: '.$globalURL.'/ident'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/ident'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | $page_url = $globalURL.'/acars-archive'; |
10 | 10 | |
11 | -if(!isset($_GET['limit'])) |
|
11 | +if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
@@ -36,8 +36,12 @@ |
||
36 | 36 | if (!empty($spotter_array)) { |
37 | 37 | include('table-output.php'); |
38 | 38 | print '<div class="pagination">'; |
39 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
40 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
39 | + if ($limit_previous_1 >= 0) { |
|
40 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
41 | + } |
|
42 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
43 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
44 | + } |
|
41 | 45 | print '</div>'; |
42 | 46 | } |
43 | 47 | print '</div>'; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | $Spotter = new Spotter(); |
7 | 7 | |
8 | 8 | if (isset($_GET['airport_icao'])) { |
9 | - $icao = filter_input(INPUT_GET,'airport_icao',FILTER_SANITIZE_STRING); |
|
9 | + $icao = filter_input(INPUT_GET, 'airport_icao', FILTER_SANITIZE_STRING); |
|
10 | 10 | $spotter_array = $Spotter->getAllAirportInfo($icao); |
11 | 11 | if (isset($globalMETAR) && $globalMETAR) { |
12 | 12 | $METAR = new METAR(); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | print '</div>'; |
56 | 56 | print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
57 | -print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
|
57 | +print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 3).', '.round($spotter_item['longitude'], 3).'</div>'; |
|
58 | 58 | if (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '' && isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') { |
59 | 59 | print '<div><span>'._("Links").'</span>'; |
60 | 60 | print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>"; |
104 | 104 | } |
105 | 105 | if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
106 | - $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
|
106 | + $humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1); |
|
107 | 107 | print _("Humidity:").' '.$humidity.'%'."<br/>"; |
108 | 108 | } |
109 | 109 | if (isset($metar_parse['QNH'])) { |
@@ -47,79 +47,79 @@ |
||
47 | 47 | print '</div>'; |
48 | 48 | print '<div><span>'._("Altitude").'</span>'; |
49 | 49 | if ((!isset($_COOKIE['unitaltitude']) && isset($globalUnitAltitude) && $globalUnitAltitude == 'feet') || (isset($_COOKIE['unitaltitude']) && $_COOKIE['unitaltitude'] == 'feet')) { |
50 | - print $spotter_item['altitude'].' feet'; |
|
50 | + print $spotter_item['altitude'].' feet'; |
|
51 | 51 | } else { |
52 | - print round($spotter_item['altitude']*0.3048).' m'; |
|
52 | + print round($spotter_item['altitude']*0.3048).' m'; |
|
53 | 53 | } |
54 | 54 | print '</div>'; |
55 | 55 | print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
56 | 56 | print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
57 | 57 | if (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '' && isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') { |
58 | - print '<div><span>'._("Links").'</span>'; |
|
59 | - print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
|
60 | - print ' - '; |
|
61 | - print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>'; |
|
62 | - print '</div>'; |
|
58 | + print '<div><span>'._("Links").'</span>'; |
|
59 | + print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
|
60 | + print ' - '; |
|
61 | + print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>'; |
|
62 | + print '</div>'; |
|
63 | 63 | } elseif (isset($spotter_item['home_link']) && $spotter_item['home_link'] != '') { |
64 | - print '<div><span>'._("Links").'</span>'; |
|
65 | - print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
|
66 | - print '</div>'; |
|
64 | + print '<div><span>'._("Links").'</span>'; |
|
65 | + print '<a href="'.$spotter_item['home_link'].'">'._("Homepage").'</a>'; |
|
66 | + print '</div>'; |
|
67 | 67 | } elseif (isset($spotter_item['wikipedia_link']) && $spotter_item['wikipedia_link'] != '') { |
68 | - print '<div><span>'._("Links").'</span>'; |
|
69 | - print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>'; |
|
70 | - print '</div>'; |
|
68 | + print '<div><span>'._("Links").'</span>'; |
|
69 | + print '<a href="'.$spotter_item['wikipedia_link'].'">Wikipedia</a>'; |
|
70 | + print '</div>'; |
|
71 | 71 | } |
72 | 72 | if ($spotter_item['type'] == 'medium_airport' || $spotter_item['type'] == 'large_airport') { |
73 | - print '<div><span>'._("Live Air Traffic").'</span>'; |
|
74 | - print '<a href="http://www.liveatc.net/search/?icao='.$spotter_item['icao'].'">LiveATC</a>'; |
|
75 | - print '</div>'; |
|
73 | + print '<div><span>'._("Live Air Traffic").'</span>'; |
|
74 | + print '<a href="http://www.liveatc.net/search/?icao='.$spotter_item['icao'].'">LiveATC</a>'; |
|
75 | + print '</div>'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | print '</div>'; |
79 | 79 | |
80 | 80 | if (isset($metar_parse)) { |
81 | - print '<div class="waypoints">'; |
|
82 | - print '<div><span>METAR</span>'; |
|
83 | - print '<i>'.$metar_info[0]['metar'].'</i><br />'; |
|
84 | - print '<b>'.$metar_info[0]['metar_date'].'</b><br />'; |
|
81 | + print '<div class="waypoints">'; |
|
82 | + print '<div><span>METAR</span>'; |
|
83 | + print '<i>'.$metar_info[0]['metar'].'</i><br />'; |
|
84 | + print '<b>'.$metar_info[0]['metar_date'].'</b><br />'; |
|
85 | 85 | // print_r($metar_parse); |
86 | - if (isset($metar_parse['wind'])) { |
|
87 | - print _("Wind:").' '; |
|
86 | + if (isset($metar_parse['wind'])) { |
|
87 | + print _("Wind:").' '; |
|
88 | 88 | if (isset($metar_parse['wind']['direction'])) { |
89 | - $direction = $Spotter->parseDirection($metar_parse['wind']['direction']); |
|
90 | - print $direction[0]['direction_fullname']; |
|
91 | - print ' ('.$metar_parse['wind']['direction'].'°) '; |
|
92 | - } |
|
93 | - if (isset($metar_parse['wind']['speed'])) { |
|
94 | - print $metar_parse['wind']['speed'].' m/s'; |
|
95 | - } |
|
89 | + $direction = $Spotter->parseDirection($metar_parse['wind']['direction']); |
|
90 | + print $direction[0]['direction_fullname']; |
|
91 | + print ' ('.$metar_parse['wind']['direction'].'°) '; |
|
92 | + } |
|
93 | + if (isset($metar_parse['wind']['speed'])) { |
|
94 | + print $metar_parse['wind']['speed'].' m/s'; |
|
95 | + } |
|
96 | 96 | print '<br/>'; |
97 | - } |
|
98 | - if (isset($metar_parse['visibility'])) { |
|
99 | - print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>"; |
|
100 | - } |
|
101 | - if (isset($metar_parse['weather'])) { |
|
102 | - print _("Weather:").' '.$metar_parse['weather']."<br/>"; |
|
103 | - } |
|
104 | - if (isset($metar_parse['temperature'])) { |
|
105 | - print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>"; |
|
106 | - } |
|
107 | - if (isset($metar_parse['dew'])) { |
|
108 | - print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>"; |
|
109 | - } |
|
110 | - if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
|
97 | + } |
|
98 | + if (isset($metar_parse['visibility'])) { |
|
99 | + print _("Visibility:").' '.$metar_parse['visibility'].' m'."<br/>"; |
|
100 | + } |
|
101 | + if (isset($metar_parse['weather'])) { |
|
102 | + print _("Weather:").' '.$metar_parse['weather']."<br/>"; |
|
103 | + } |
|
104 | + if (isset($metar_parse['temperature'])) { |
|
105 | + print _("Temperature:").' '.$metar_parse['temperature'].' °C'."<br/>"; |
|
106 | + } |
|
107 | + if (isset($metar_parse['dew'])) { |
|
108 | + print _("Dew point:").' '.$metar_parse['dew'].' °C'."<br/>"; |
|
109 | + } |
|
110 | + if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) { |
|
111 | 111 | $humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1); |
112 | 112 | print _("Humidity:").' '.$humidity.'%'."<br/>"; |
113 | - } |
|
114 | - if (isset($metar_parse['QNH'])) { |
|
115 | - print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>"; |
|
116 | - } |
|
113 | + } |
|
114 | + if (isset($metar_parse['QNH'])) { |
|
115 | + print _("Pressure:").' '.$metar_parse['QNH'].' hPa'."<br/>"; |
|
116 | + } |
|
117 | 117 | /* |
118 | 118 | if (isset($metar_parse['QNH'])) { |
119 | 119 | print 'Pressure : '.$metar_parse['QNH'].' hPa'."<br/>"; |
120 | 120 | } |
121 | 121 | */ |
122 | - print '</div>'; |
|
122 | + print '</div>'; |
|
123 | 123 | /* |
124 | 124 | Wind: from the NNE (020 degrees) at 5 MPH (4 KT) (direction variable):0 |
125 | 125 | Visibility: greater than 7 mile(s):0 |
@@ -12,7 +12,9 @@ |
||
12 | 12 | $METAR = new METAR(); |
13 | 13 | $metar_info = $METAR->getMETAR($icao); |
14 | 14 | //print_r($metar_info); |
15 | - if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
15 | + if (isset($metar_info[0]['metar'])) { |
|
16 | + $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
17 | + } |
|
16 | 18 | //print_r($metar_parse); |
17 | 19 | } |
18 | 20 | ?> |