| @@ 14-102 (lines=89) @@ | ||
| 11 | if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
| 12 | else $spotter_array = array(); |
|
| 13 | ||
| 14 | if (!empty($spotter_array)) |
|
| 15 | { |
|
| 16 | $title = sprintf(_("Most Common Airlines by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 17 | require_once('header.php'); |
|
| 18 | print '<div class="select-item">'; |
|
| 19 | print '<form action="'.$globalURL.'/date" method="post">'; |
|
| 20 | print '<label for="date">'._("Select a Date").'</label>'; |
|
| 21 | print '<input type="text" id="date" name="date" value="'.$date.'" size="8" readonly="readonly" class="custom" />'; |
|
| 22 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
|
| 23 | print '</form>'; |
|
| 24 | print '</div>'; |
|
| 25 | ||
| 26 | print '<div class="info column">'; |
|
| 27 | print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 28 | print '</div>'; |
|
| 29 | ||
| 30 | include('date-sub-menu.php'); |
|
| 31 | print '<div class="column">'; |
|
| 32 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
|
| 33 | print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 34 | ||
| 35 | $airline_array = $Spotter->countAllAirlineCountriesByDate($date); |
|
| 36 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
|
| 37 | print '<div id="chartCountry" class="chart" width="100%"></div> |
|
| 38 | <script> |
|
| 39 | google.load("visualization", "1", {packages:["geochart"]}); |
|
| 40 | google.setOnLoadCallback(drawChart); |
|
| 41 | function drawChart() { |
|
| 42 | var data = google.visualization.arrayToDataTable([ |
|
| 43 | ["'._("Country").'", "'._("# of times").'"], '; |
|
| 44 | $country_data = ''; |
|
| 45 | foreach($airline_array as $airline_item) |
|
| 46 | { |
|
| 47 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
|
| 48 | } |
|
| 49 | $country_data = substr($country_data, 0, -1); |
|
| 50 | print $country_data; |
|
| 51 | print ']); |
|
| 52 | ||
| 53 | var options = { |
|
| 54 | legend: {position: "none"}, |
|
| 55 | chartArea: {"width": "80%", "height": "60%"}, |
|
| 56 | height:500, |
|
| 57 | colors: ["#8BA9D0","#1a3151"] |
|
| 58 | }; |
|
| 59 | ||
| 60 | var chart = new google.visualization.GeoChart(document.getElementById("chartCountry")); |
|
| 61 | chart.draw(data, options); |
|
| 62 | } |
|
| 63 | $(window).resize(function(){ |
|
| 64 | drawChart(); |
|
| 65 | }); |
|
| 66 | </script>'; |
|
| 67 | ||
| 68 | if (!empty($airline_array)) |
|
| 69 | { |
|
| 70 | print '<div class="table-responsive">'; |
|
| 71 | print '<table class="common-country table-striped">'; |
|
| 72 | print '<thead>'; |
|
| 73 | print '<th></th>'; |
|
| 74 | print '<th>'._("Country").'</th>'; |
|
| 75 | print '<th>'._("# of times").'</th>'; |
|
| 76 | print '</thead>'; |
|
| 77 | print '<tbody>'; |
|
| 78 | $i = 1; |
|
| 79 | foreach($airline_array as $airline_item) |
|
| 80 | { |
|
| 81 | print '<tr>'; |
|
| 82 | print '<td><strong>'.$i.'</strong></td>'; |
|
| 83 | print '<td>'; |
|
| 84 | print '<a href="'.$globalURL.'/country/'.strtolower(str_replace(" ", "-", $airline_item['airline_country'])).'">'.$airline_item['airline_country'].'</a>'; |
|
| 85 | print '</td>'; |
|
| 86 | print '<td>'; |
|
| 87 | print $airline_item['airline_country_count']; |
|
| 88 | print '</td>'; |
|
| 89 | print '</tr>'; |
|
| 90 | $i++; |
|
| 91 | } |
|
| 92 | print '<tbody>'; |
|
| 93 | print '</table>'; |
|
| 94 | print '</div>'; |
|
| 95 | } |
|
| 96 | print '</div>'; |
|
| 97 | } else { |
|
| 98 | $title = _("Unknown Date"); |
|
| 99 | require_once('header.php'); |
|
| 100 | print '<h1>'._("Error").'</h1>'; |
|
| 101 | print '<p>'._("Sorry, this date does not exist in this database. :(").'</p>'; |
|
| 102 | } |
|
| 103 | require_once('footer.php'); |
|
| 104 | ?> |
|
| @@ 12-100 (lines=89) @@ | ||
| 9 | if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 10 | else $spotter_array = array(); |
|
| 11 | ||
| 12 | if (!empty($spotter_array)) |
|
| 13 | { |
|
| 14 | $title = sprintf(_("Most Common Airlines by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 15 | require_once('header.php'); |
|
| 16 | print '<div class="select-item">'; |
|
| 17 | print '<form action="'.$globalURL.'/date" method="post">'; |
|
| 18 | print '<label for="date">'._("Select a Date").'</label>'; |
|
| 19 | print '<input type="text" id="date" name="date" value="'.$_GET['date'].'" size="8" readonly="readonly" class="custom" />'; |
|
| 20 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
|
| 21 | print '</form>'; |
|
| 22 | print '</div>'; |
|
| 23 | ||
| 24 | print '<div class="info column">'; |
|
| 25 | print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 26 | print '</div>'; |
|
| 27 | ||
| 28 | include('date-sub-menu.php'); |
|
| 29 | print '<div class="column">'; |
|
| 30 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
|
| 31 | print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 32 | ||
| 33 | $airline_array = $Spotter->countAllAirlineCountriesByDate($_GET['date']); |
|
| 34 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
|
| 35 | print '<div id="chartCountry" class="chart" width="100%"></div> |
|
| 36 | <script> |
|
| 37 | google.load("visualization", "1", {packages:["geochart"]}); |
|
| 38 | google.setOnLoadCallback(drawChart); |
|
| 39 | function drawChart() { |
|
| 40 | var data = google.visualization.arrayToDataTable([ |
|
| 41 | ["'._("Country").'", "'._("# of times").'"], '; |
|
| 42 | $country_data = ''; |
|
| 43 | foreach($airline_array as $airline_item) |
|
| 44 | { |
|
| 45 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
|
| 46 | } |
|
| 47 | $country_data = substr($country_data, 0, -1); |
|
| 48 | print $country_data; |
|
| 49 | print ']); |
|
| 50 | ||
| 51 | var options = { |
|
| 52 | legend: {position: "none"}, |
|
| 53 | chartArea: {"width": "80%", "height": "60%"}, |
|
| 54 | height:500, |
|
| 55 | colors: ["#8BA9D0","#1a3151"] |
|
| 56 | }; |
|
| 57 | ||
| 58 | var chart = new google.visualization.GeoChart(document.getElementById("chartCountry")); |
|
| 59 | chart.draw(data, options); |
|
| 60 | } |
|
| 61 | $(window).resize(function(){ |
|
| 62 | drawChart(); |
|
| 63 | }); |
|
| 64 | </script>'; |
|
| 65 | ||
| 66 | if (!empty($airline_array)) |
|
| 67 | { |
|
| 68 | print '<div class="table-responsive">'; |
|
| 69 | print '<table class="common-country table-striped">'; |
|
| 70 | print '<thead>'; |
|
| 71 | print '<th></th>'; |
|
| 72 | print '<th>'._("Country").'</th>'; |
|
| 73 | print '<th>'._("# of times").'</th>'; |
|
| 74 | print '</thead>'; |
|
| 75 | print '<tbody>'; |
|
| 76 | $i = 1; |
|
| 77 | foreach($airline_array as $airline_item) |
|
| 78 | { |
|
| 79 | print '<tr>'; |
|
| 80 | print '<td><strong>'.$i.'</strong></td>'; |
|
| 81 | print '<td>'; |
|
| 82 | print '<a href="'.$globalURL.'/country/'.strtolower(str_replace(" ", "-", $airline_item['airline_country'])).'">'.$airline_item['airline_country'].'</a>'; |
|
| 83 | print '</td>'; |
|
| 84 | print '<td>'; |
|
| 85 | print $airline_item['airline_country_count']; |
|
| 86 | print '</td>'; |
|
| 87 | print '</tr>'; |
|
| 88 | $i++; |
|
| 89 | } |
|
| 90 | print '<tbody>'; |
|
| 91 | print '</table>'; |
|
| 92 | print '</div>'; |
|
| 93 | } |
|
| 94 | print '</div>'; |
|
| 95 | } else { |
|
| 96 | $title = _("Unknown Date"); |
|
| 97 | require_once('header.php'); |
|
| 98 | print '<h1>'._("Error").'</h1>'; |
|
| 99 | print '<p>'._("Sorry, this date does not exist in this database. :(").'</p>'; |
|
| 100 | } |
|
| 101 | require_once('footer.php'); |
|
| 102 | ?> |
|
| @@ 9-97 (lines=89) @@ | ||
| 6 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 7 | $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 8 | ||
| 9 | if (!empty($spotter_array)) |
|
| 10 | { |
|
| 11 | $title = sprintf(_("Most Common Arrival Airports by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 12 | require_once('header.php'); |
|
| 13 | print '<div class="select-item">'; |
|
| 14 | print '<form action="'.$globalURL.'/date" method="post">'; |
|
| 15 | print '<label for="date">'._("Select a Date").'</label>'; |
|
| 16 | print '<input type="text" id="date" name="date" value="'.$_GET['date'].'" size="8" readonly="readonly" class="custom" />'; |
|
| 17 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
|
| 18 | print '</form>'; |
|
| 19 | print '</div>'; |
|
| 20 | print '<div class="info column">'; |
|
| 21 | print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 22 | print '</div>'; |
|
| 23 | ||
| 24 | include('date-sub-menu.php'); |
|
| 25 | print '<div class="column">'; |
|
| 26 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
|
| 27 | print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 28 | ||
| 29 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByDate($_GET['date']); |
|
| 30 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
|
| 31 | print '<div id="chartCountry" class="chart" width="100%"></div> |
|
| 32 | <script> |
|
| 33 | google.load("visualization", "1", {packages:["geochart"]}); |
|
| 34 | google.setOnLoadCallback(drawChart); |
|
| 35 | function drawChart() { |
|
| 36 | var data = google.visualization.arrayToDataTable([ |
|
| 37 | ["'._("Country").'", "'._("# of times").'"], '; |
|
| 38 | ||
| 39 | $country_data = ''; |
|
| 40 | foreach($airport_country_array as $airport_item) |
|
| 41 | { |
|
| 42 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
|
| 43 | } |
|
| 44 | $country_data = substr($country_data, 0, -1); |
|
| 45 | print $country_data; |
|
| 46 | print ']); |
|
| 47 | ||
| 48 | var options = { |
|
| 49 | legend: {position: "none"}, |
|
| 50 | chartArea: {"width": "80%", "height": "60%"}, |
|
| 51 | height:500, |
|
| 52 | colors: ["#8BA9D0","#1a3151"] |
|
| 53 | }; |
|
| 54 | ||
| 55 | var chart = new google.visualization.GeoChart(document.getElementById("chartCountry")); |
|
| 56 | chart.draw(data, options); |
|
| 57 | } |
|
| 58 | $(window).resize(function(){ |
|
| 59 | drawChart(); |
|
| 60 | }); |
|
| 61 | </script>'; |
|
| 62 | ||
| 63 | if (!empty($airport_country_array)) |
|
| 64 | { |
|
| 65 | print '<div class="table-responsive">'; |
|
| 66 | print '<table class="common-country table-striped">'; |
|
| 67 | print '<thead>'; |
|
| 68 | print '<th></th>'; |
|
| 69 | print '<th>'._("Country").'</th>'; |
|
| 70 | print '<th>'._("# of times").'</th>'; |
|
| 71 | print '</thead>'; |
|
| 72 | print '<tbody>'; |
|
| 73 | $i = 1; |
|
| 74 | foreach($airport_country_array as $airport_item) |
|
| 75 | { |
|
| 76 | print '<tr>'; |
|
| 77 | print '<td><strong>'.$i.'</strong></td>'; |
|
| 78 | print '<td>'; |
|
| 79 | print '<a href="'.$globalURL.'/country/'.strtolower(str_replace(" ", "-", $airport_item['arrival_airport_country'])).'">'.$airport_item['arrival_airport_country'].'</a>'; |
|
| 80 | print '</td>'; |
|
| 81 | print '<td>'; |
|
| 82 | print $airport_item['airport_arrival_country_count']; |
|
| 83 | print '</td>'; |
|
| 84 | print '</tr>'; |
|
| 85 | $i++; |
|
| 86 | } |
|
| 87 | print '<tbody>'; |
|
| 88 | print '</table>'; |
|
| 89 | print '</div>'; |
|
| 90 | } |
|
| 91 | print '</div>'; |
|
| 92 | } else { |
|
| 93 | $title = _("Unknown Date"); |
|
| 94 | require_once('header.php'); |
|
| 95 | print '<h1>'._("Error").'</h1>'; |
|
| 96 | print '<p>'._("Sorry, this date does not exist in this database. :(").'</p>'; |
|
| 97 | } |
|
| 98 | ||
| 99 | require_once('footer.php'); |
|
| 100 | ?> |
|
| @@ 9-97 (lines=89) @@ | ||
| 6 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 7 | $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 8 | ||
| 9 | if (!empty($spotter_array)) |
|
| 10 | { |
|
| 11 | $title = sprintf(_("Most Common Departure Airports by Country on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 12 | ||
| 13 | require_once('header.php'); |
|
| 14 | print '<div class="select-item">'; |
|
| 15 | print '<form action="'.$globalURL.'/date" method="post">'; |
|
| 16 | print '<label for="date">'._("Select a Date").'</label>'; |
|
| 17 | print '<input type="text" id="date" name="date" value="'.$_GET['date'].'" size="8" readonly="readonly" class="custom" />'; |
|
| 18 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
|
| 19 | print '</form>'; |
|
| 20 | print '</div>'; |
|
| 21 | ||
| 22 | print '<div class="info column">'; |
|
| 23 | print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 24 | print '</div>'; |
|
| 25 | ||
| 26 | include('date-sub-menu.php'); |
|
| 27 | print '<div class="column">'; |
|
| 28 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
|
| 29 | print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 30 | $airport_country_array = $Spotter->countAllDepartureAirportCountriesByDate($_GET['date']); |
|
| 31 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
|
| 32 | print '<div id="chartCountry" class="chart" width="100%"></div> |
|
| 33 | <script> |
|
| 34 | google.load("visualization", "1", {packages:["geochart"]}); |
|
| 35 | google.setOnLoadCallback(drawChart); |
|
| 36 | function drawChart() { |
|
| 37 | var data = google.visualization.arrayToDataTable([ |
|
| 38 | ["'._("Country").'", "'._("# of times").'"], '; |
|
| 39 | $country_data = ''; |
|
| 40 | foreach($airport_country_array as $airport_item) |
|
| 41 | { |
|
| 42 | $country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],'; |
|
| 43 | } |
|
| 44 | $country_data = substr($country_data, 0, -1); |
|
| 45 | print $country_data; |
|
| 46 | print ']); |
|
| 47 | ||
| 48 | var options = { |
|
| 49 | legend: {position: "none"}, |
|
| 50 | chartArea: {"width": "80%", "height": "60%"}, |
|
| 51 | height:500, |
|
| 52 | colors: ["#8BA9D0","#1a3151"] |
|
| 53 | }; |
|
| 54 | ||
| 55 | var chart = new google.visualization.GeoChart(document.getElementById("chartCountry")); |
|
| 56 | chart.draw(data, options); |
|
| 57 | } |
|
| 58 | $(window).resize(function(){ |
|
| 59 | drawChart(); |
|
| 60 | }); |
|
| 61 | </script>'; |
|
| 62 | ||
| 63 | if (!empty($airport_country_array)) |
|
| 64 | { |
|
| 65 | print '<div class="table-responsive">'; |
|
| 66 | print '<table class="common-country table-striped">'; |
|
| 67 | print '<thead>'; |
|
| 68 | print '<th></th>'; |
|
| 69 | print '<th>'._("Country").'</th>'; |
|
| 70 | print '<th>'._("# of times").'</th>'; |
|
| 71 | print '</thead>'; |
|
| 72 | print '<tbody>'; |
|
| 73 | $i = 1; |
|
| 74 | foreach($airport_country_array as $airport_item) |
|
| 75 | { |
|
| 76 | print '<tr>'; |
|
| 77 | print '<td><strong>'.$i.'</strong></td>'; |
|
| 78 | print '<td>'; |
|
| 79 | print '<a href="'.$globalURL.'/country/'.strtolower(str_replace(" ", "-", $airport_item['departure_airport_country'])).'">'.$airport_item['departure_airport_country'].'</a>'; |
|
| 80 | print '</td>'; |
|
| 81 | print '<td>'; |
|
| 82 | print $airport_item['airport_departure_country_count']; |
|
| 83 | print '</td>'; |
|
| 84 | print '</tr>'; |
|
| 85 | $i++; |
|
| 86 | } |
|
| 87 | print '<tbody>'; |
|
| 88 | print '</table>'; |
|
| 89 | print '</div>'; |
|
| 90 | } |
|
| 91 | print '</div>'; |
|
| 92 | } else { |
|
| 93 | $title = _("Unknown Date"); |
|
| 94 | require_once('header.php'); |
|
| 95 | print '<h1>'._("Error").'</h1>'; |
|
| 96 | print '<p>'._("Sorry, this date does not exist in this database. :(").'</p>'; |
|
| 97 | } |
|
| 98 | ||
| 99 | require_once('footer.php'); |
|
| 100 | ?> |
|