2 require_once('require/class.Connection.php');
3 require_once('require/class.Spotter.php');
4 require_once('require/class.Language.php');
5 $Spotter = new Spotter();
6 $title = "Upcoming Flights";
7 require_once('header.php');
9 //calculuation for the pagination
10 if(!isset($_GET['limit']))
14 $absolute_difference = 25;
16 $limit_explode = explode(",", $_GET['limit']);
17 $limit_start = $limit_explode[0];
18 $limit_end = $limit_explode[1];
19 if (!ctype_digit(strval($limit_start)) ||
!ctype_digit(strval($limit_end))) {
24 $absolute_difference = abs($limit_start - $limit_end);
25 $limit_next = $limit_end +
$absolute_difference;
26 $limit_previous_1 = $limit_start - $absolute_difference;
27 $limit_previous_2 = $limit_end - $absolute_difference;
29 $page_url = $globalURL.'/upcoming';
31 print '<div class="info column">';
32 print '<h1>Upcoming Flights</h1>';
35 print '<div class="table column">';
36 print '<p>'._("This page shows all upcoming flights within the next 3 hours calculated using historical data, based on the number of same flights on the current day of the week & current time. This does not take into account real-time delays and other factors.").'</p>';
38 $sort = filter_input(INPUT_GET
,'sort',FILTER_SANITIZE_STRING
);
40 $spotter_array = $Spotter->getUpcomingFlights($limit_start.",".$absolute_difference, $sort);
42 $spotter_array = $Spotter->getUpcomingFlights($limit_start.",".$absolute_difference);
45 if (!empty($spotter_array))
47 include('table-output.php');
48 print '<div class="pagination">';
49 if ($limit_previous_1 >= 0)
51 print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'/'.$sort.'">«'._("Previous Page").'</a>';
53 if ($spotter_array[0]['query_number_rows'] == $absolute_difference)
55 print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'/'.$sort.'">'._("Next Page").'»</a>';
60 require_once('footer.php');