Exemplo n.º 1
0
if ($prev >= 0) {
    echo '<a href="' . $_SERVER['PHP_SELF'] . '?limit=' . $prev . ',' . $recordcount . '">«Previous Page</a>';
}
echo '<a href="' . $_SERVER['PHP_SELF'] . '?limit=' . ($offsetzero + $recordcount) . ',' . $recordcount . '">Next Page»</a>';
echo "</div>";
$stmt = "SELECT ID, ModeS, Country, Registration, AircraftModel, ModelCode, Operator, OperatorCode, Callsign, FromIATA, FromICAO, FromName, FromLocation, FromCountry, ToIATA, ToICAO, ToName, ToLocation, ToCountry, NumPositionReports, Mlat, DATE_FORMAT(`LastSeen`, '%Y-%m-%dT%H:%i:%s') as LastSeenAgo FROM {$flightsdatabasetable} ORDER by LastSeen DESC LIMIT {$limit}";
$result = $conn->query($stmt);
echo '<div class="info">Flights ' . $offset . ' to ' . ($recordcount + $offsetzero) . '	<form action="' . $_SERVER['PHP_SELF'] . '" method="get" class="limit">
       		  	<div class="limit"><label class="limit">Number of Results per Page</label> 
    		    <select name="recordcount" id="limit" onchange="this.form.submit()">
    		    <option value="25">25</option><option value="50">50</option><option value="100">100</option><option value="150">150</option><option value="200">200</option><option value="250">250</option><option value="300">300</option><option value="400">400</option><option value="500">500</option><option value="600">600</option><option value="700">700</option><option value="800">800</option><option value="900">900</option><option value="1000">1000</option></select></div>
				<script type="text/javascript">document.getElementById("limit").value = "' . $recordcount . '";</script>
    		  </form></div>';
if ($result->num_rows > 0) {
    echo "<div class=\"table-responsive\">";
    // *** Call function to write the flight table ***
    writeFlightTable($result);
    echo "</div>";
    // Display navigation links
    echo '<div class="pagination">';
    if ($prev >= 0) {
        echo '<a href="' . $_SERVER['PHP_SELF'] . '?limit=' . $prev . ',' . $recordcount . '">«Previous Page</a>';
    }
    echo '<a href="' . $_SERVER['PHP_SELF'] . '?limit=' . ($offsetzero + $recordcount) . ',' . $recordcount . '">Next Page»</a>';
    echo "</div>";
} else {
    echo "0 results";
}
$conn->close();
echo '</div></section>';
echo '</body></html>';
Exemplo n.º 2
0
    }
    if ($Registration != "") {
        echo 'registration = <span>' . $Registration . '</span>';
    }
    if ($FromAirport != "") {
        echo 'from = <span>' . $FromAirport . '</span>';
    }
    if ($ToAirport != "") {
        echo 'to = <span>' . $ToAirport . '</span>';
    }
    echo 'distinct airframes = <span>' . $modes_distinct . '</span>
	limit per page = <span>' . $recordcount . '</div>';
    if ($result->num_rows > 0) {
        echo "<div class=\"table-responsive\">";
        // Call function to write the flight table
        writeFlightTable($result, $conn);
        echo "</div>";
        // Display navigation links
        echo '<div class="pagination">';
        echo '<p>';
        if ($prev >= 0) {
            echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . $freshquerystring . '&limit=' . $prev . ',' . $recordcount . '">«Previous Page</a>';
        }
        if ($resultcount > $recordcount + $offsetzero) {
            echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . $freshquerystring . '&limit=' . ($offsetzero + $recordcount) . ',' . $recordcount . '">Next Page»</a>';
        }
        echo "</div>";
    } else {
        echo "0 results";
    }
}