本文整理汇总了PHP中Spotter::getSpotterDataByRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP Spotter::getSpotterDataByRoute方法的具体用法?PHP Spotter::getSpotterDataByRoute怎么用?PHP Spotter::getSpotterDataByRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spotter
的用法示例。
在下文中一共展示了Spotter::getSpotterDataByRoute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
if ($_GET['departure_airport'] == "" || $_GET['arrival_airport'] == "") {
header('Location: /');
}
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
$Spotter = new Spotter();
$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $sort);
if (!empty($spotter_array)) {
$title = 'Most Common Aircraft between ' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . ' - ' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'];
require 'header.php';
print '<div class="info column">';
print '<h1>Flights between ' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . ' - ' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'] . '</h1>';
print '<div><span class="label">Coming From</span><a href="' . $globalURL . '/airport/' . $spotter_array[0]['departure_airport_icao'] . '">' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . '</a></div>';
print '<div><span class="label">Flying To</span><a href="' . $globalURL . '/airport/' . $spotter_array[0]['arrival_airport_icao'] . '">' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'] . '</a></div>';
print '</div>';
include 'route-sub-menu.php';
print '<div class="column">';
print '<h2>Most Common Aircraft</h2>';
print '<p>The statistic below shows the most common aircrafts of flights between <strong>' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . '</strong> and <strong>' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'] . '</strong>.</p>';
$aircraft_array = $Spotter->countAllAircraftTypesByRoute($_GET['departure_airport'], $_GET['arrival_airport']);
if (!empty($aircraft_array)) {
print '<div class="table-responsive">';
print '<table class="common-type table-striped">';
print '<thead>';
print '<th></th>';
print '<th>Aircraft Type</th>';
print '<th># of Times</th>';
print '<th></th>';
示例2: header
<?php
if ($_GET['departure_airport'] == "" || $_GET['arrival_airport'] == "") {
header('Location: /');
}
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
$spotter_array = Spotter::getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], "0,1", $_GET['sort']);
if (!empty($spotter_array)) {
$title = 'Most Common Time of Day between ' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . ' - ' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'];
require 'header.php';
print '<div class="info column">';
print '<h1>Flights between ' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . ' - ' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'] . '</h1>';
print '<div><span class="label">Coming From</span><a href="' . $globalURL . '/airport/' . $spotter_array[0]['departure_airport_icao'] . '">' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . '</a></div>';
print '<div><span class="label">Flying To</span><a href="' . $globalURL . '/airport/' . $spotter_array[0]['arrival_airport_icao'] . '">' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'] . '</a></div>';
print '</div>';
include 'route-sub-menu.php';
print '<div class="column">';
print '<h2>Most Common Time of Day</h2>';
print '<p>The statistic below shows the most common time of day of flights between <strong>' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . '</strong> and <strong>' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'] . '</strong>.</p>';
$hour_array = Spotter::countAllHoursByRoute($_GET['departure_airport'], $_GET['arrival_airport']);
print '<div id="chartHour" class="chart" width="100%"></div>
<script>
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
["Hour", "# of Flights"], ';
foreach ($hour_array as $hour_item) {
$hour_data .= '[ "' . date("ga", strtotime($hour_item['hour_name'] . ":00")) . '",' . $hour_item['hour_count'] . '],';
}
示例3: explode
if (!isset($_GET['limit'])) {
$limit_start = 0;
$limit_end = 25;
$absolute_difference = 25;
} else {
$limit_explode = explode(",", $_GET['limit']);
$limit_start = $limit_explode[0];
$limit_end = $limit_explode[1];
}
$absolute_difference = abs($limit_start - $limit_end);
$limit_next = $limit_end + $absolute_difference;
$limit_previous_1 = $limit_start - $absolute_difference;
$limit_previous_2 = $limit_end - $absolute_difference;
$page_url = $globalURL . '/route/' . $_GET['departure_airport'] . '/' . $_GET['arrival_airport'];
if (isset($_GET['sort'])) {
$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], $limit_start . "," . $absolute_difference, $_GET['sort']);
} else {
$spotter_array = $Spotter->getSpotterDataByRoute($_GET['departure_airport'], $_GET['arrival_airport'], $limit_start . "," . $absolute_difference, '');
}
if (!empty($spotter_array)) {
$title = 'Detailed View for flights between ' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . ' - ' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'];
require 'header.php';
print '<div class="info column">';
print '<h1>Flights between ' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . ' - ' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'] . '</h1>';
print '<div><span class="label">Coming From</span><a href="' . $globalURL . '/airport/' . $spotter_array[0]['departure_airport_icao'] . '">' . $spotter_array[0]['departure_airport_name'] . ' (' . $spotter_array[0]['departure_airport_icao'] . '), ' . $spotter_array[0]['departure_airport_country'] . '</a></div>';
print '<div><span class="label">Flying To</span><a href="' . $globalURL . '/airport/' . $spotter_array[0]['arrival_airport_icao'] . '">' . $spotter_array[0]['arrival_airport_name'] . ' (' . $spotter_array[0]['arrival_airport_icao'] . '), ' . $spotter_array[0]['arrival_airport_country'] . '</a></div>';
print '</div>';
include 'route-sub-menu.php';
print '<div class="table column">';
print '<p>The table below shows the detailed information of all flights that used the route <strong>' . $spotter_array[0]['departure_airport_icao'] . ' - ' . $spotter_array[0]['arrival_airport_icao'] . '</strong>.</p>';
include 'table-output.php';