Merge pull request #456 from Struart88/patch-2
[FlightAirMap.git] / highlights-table.php
blob0d5db15b9111678eb78f8a215d25d761c8fbdbdf
1 <?php
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 = _("Special Highlights - Table View");
7 require_once('header.php');
9 //calculuation for the pagination
10 if(!isset($_GET['limit']) || $_GET['limit'] == "")
12 $limit_start = 0;
13 $limit_end = 25;
14 $absolute_difference = 25;
15 } else {
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))) {
20 $limit_start = 0;
21 $limit_end = 25;
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.'/highlights/table';
31 print '<div class="info column">';
32 print '<div class="view-type">';
33 print '<a href="'.$globalURL.'/highlights" alt="'._("Display View").'" title="'._("Display View").'"><i class="fa fa-th"></i></a>';
34 print '<a href="'.$globalURL.'/highlights/table" class="active" alt="'._("Table View").'" title="'._("Table View").'"><i class="fa fa-table"></i></a>';
35 print '</div>';
36 print '<h1>'._("Special Highlights - Table View").'</h1>';
37 print '</div>';
39 print '<div class="table column">';
40 print '<p>'._("The table below shows the detailed information of all custom selected flights who have special aspects to it, such as unique liveries, destinations etc.").'</p>';
42 $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
43 if ($sort != '') {
44 $spotter_array = $Spotter->getSpotterDataByHighlight($limit_start.",".$absolute_difference, $sort);
45 } else {
46 $spotter_array = $Spotter->getSpotterDataByHighlight($limit_start.",".$absolute_difference);
49 if (!empty($spotter_array))
51 $showSpecial = true;
52 include('table-output.php');
54 print '<div class="pagination">';
55 if ($limit_previous_1 >= 0)
57 print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'/'.$sort.'">&laquo;'._("Previous Page").'</a>';
59 if ($spotter_array[0]['query_number_rows'] == $absolute_difference)
61 print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'/'.$sort.'">'._("Next Page").'&raquo;</a>';
63 print '</div>';
64 print '</div>';
68 require_once('footer.php');