kopia lustrzana https://github.com/jprochazka/adsb-receiver
Merge pull request #481 from paveltar/pav_dev
Added ability to view first and last flights in Flights sectionpull/503/head
commit
6894c25e1d
|
@ -137,9 +137,29 @@
|
||||||
// Pass the number of seen paths which is equal to the last flight ID.
|
// Pass the number of seen paths which is equal to the last flight ID.
|
||||||
$pageData['pathsSeen'] = $pathsSeen;
|
$pageData['pathsSeen'] = $pathsSeen;
|
||||||
|
|
||||||
if (count($flightPaths) > 0) {
|
$countFlightPaths = count($flightPaths);
|
||||||
|
if ($countFlightPaths > 0) {
|
||||||
$pageData['flightPathsAvailable'] = "TRUE";
|
$pageData['flightPathsAvailable'] = "TRUE";
|
||||||
$pageData['flightPaths'] = $flightPaths;
|
$selectedFlightPath = $flightPaths;
|
||||||
|
|
||||||
|
if (isset($_GET["index"])) {
|
||||||
|
switch ($_GET["index"]) {
|
||||||
|
case "first":
|
||||||
|
$selectedFlightPath = [$flightPaths[0]];
|
||||||
|
break;
|
||||||
|
case "last":
|
||||||
|
$selectedFlightPath = [$flightPaths[$countFlightPaths - 1]];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (is_numeric($_GET["index"])) {
|
||||||
|
$selectedFlightPath = [$flightPaths[$_GET["index"]]];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$pageData['flightPaths'] = $selectedFlightPath;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$pageData['flightPathsAvailable'] = "FALSE";
|
$pageData['flightPathsAvailable'] = "FALSE";
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
{foreach page:flights as flight}
|
{foreach page:flights as flight}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="plot.php?flight={flight->flight}">{flight->flight}</a></td>
|
<td><a href="plot.php?flight={flight->flight}">{flight->flight}</a></td>
|
||||||
<td>{flight->lastSeen}</td>
|
<td><a href="plot.php?flight={flight->flight}&index=last">{flight->lastSeen}</a></td>
|
||||||
<td>{flight->firstSeen}</td>
|
<td><a href="plot.php?flight={flight->flight}&index=first">{flight->firstSeen}</a></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="http://flightaware.com/live/flight/{flight->flight}" target="_blank">FlightAware</a> |
|
<a href="http://flightaware.com/live/flight/{flight->flight}" target="_blank">FlightAware</a> |
|
||||||
<a href="https://planefinder.net/flight/{flight->flight}" target="_blank">Planefinder</a> |
|
<a href="https://planefinder.net/flight/{flight->flight}" target="_blank">Planefinder</a> |
|
||||||
|
|
Ładowanie…
Reference in New Issue