@@ -1,11 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once(dirname(__FILE__).'/require/settings.php'); |
| 3 | 3 | $type = 'aircraft'; |
| 4 | -if (isset($_GET['marine'])) $type = 'marine'; |
|
| 5 | -elseif (isset($_GET['tracker'])) $type = 'tracker'; |
|
| 4 | +if (isset($_GET['marine'])) { |
|
| 5 | + $type = 'marine'; |
|
| 6 | +} elseif (isset($_GET['tracker'])) { |
|
| 7 | + $type = 'tracker'; |
|
| 8 | +} |
|
| 6 | 9 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 7 | -if ($date == '') $date = date('Y-m-d'); |
|
| 8 | -if ($type == 'marine') header('Location: '.$globalURL.'/marine/date/'.$date); |
|
| 9 | -elseif ($type == 'tracker') header('Location: '.$globalURL.'/tracker/date/'.$date); |
|
| 10 | -else header('Location: '.$globalURL.'/date/'.$date); |
|
| 10 | +if ($date == '') { |
|
| 11 | + $date = date('Y-m-d'); |
|
| 12 | +} |
|
| 13 | +if ($type == 'marine') { |
|
| 14 | + header('Location: '.$globalURL.'/marine/date/'.$date); |
|
| 15 | +} elseif ($type == 'tracker') { |
|
| 16 | + header('Location: '.$globalURL.'/tracker/date/'.$date); |
|
| 17 | +} else { |
|
| 18 | + header('Location: '.$globalURL.'/date/'.$date); |
|
| 19 | +} |
|
| 11 | 20 | ?> |
| 12 | 21 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $limit_start = 0; |
| 30 | 30 | $limit_end = 25; |
| 31 | 31 | $absolute_difference = 25; |
| 32 | - } else { |
|
| 32 | + } else { |
|
| 33 | 33 | $limit_explode = explode(",", $_GET['limit']); |
| 34 | 34 | $limit_start = $limit_explode[0]; |
| 35 | 35 | $limit_end = $limit_explode[1]; |
@@ -46,21 +46,33 @@ discard block |
||
| 46 | 46 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 47 | 47 | if ($sort != '') |
| 48 | 48 | { |
| 49 | - if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 50 | - elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 51 | - else $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 49 | + if ($type == 'marine') { |
|
| 50 | + $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 51 | + } elseif ($type == 'tracker') { |
|
| 52 | + $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 53 | + } else { |
|
| 54 | + $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
| 55 | + } |
|
| 52 | 56 | } else { |
| 53 | - if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 54 | - elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 55 | - else $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 57 | + if ($type == 'marine') { |
|
| 58 | + $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 59 | + } elseif ($type == 'tracker') { |
|
| 60 | + $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 61 | + } else { |
|
| 62 | + $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference); |
|
| 63 | + } |
|
| 56 | 64 | } |
| 57 | 65 | |
| 58 | 66 | if (!empty($spotter_array)) |
| 59 | 67 | { |
| 60 | 68 | date_default_timezone_set($globalTimezone); |
| 61 | - if ($type == 'marine') $title = sprintf(_("Detailed View for vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 62 | - elseif ($type == 'tracker') $title = sprintf(_("Detailed View for trackers from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 63 | - else $title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 69 | + if ($type == 'marine') { |
|
| 70 | + $title = sprintf(_("Detailed View for vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 71 | + } elseif ($type == 'tracker') { |
|
| 72 | + $title = sprintf(_("Detailed View for trackers from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 73 | + } else { |
|
| 74 | + $title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 75 | + } |
|
| 64 | 76 | |
| 65 | 77 | require_once('header.php'); |
| 66 | 78 | print '<div class="select-item">'; |
@@ -78,15 +90,24 @@ discard block |
||
| 78 | 90 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
| 79 | 91 | print '<br />'; |
| 80 | 92 | print '<div class="info column">'; |
| 81 | - if ($type == 'marine') print '<h1>'.sprintf(_("Vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 82 | - else print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 93 | + if ($type == 'marine') { |
|
| 94 | + print '<h1>'.sprintf(_("Vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 95 | + } else { |
|
| 96 | + print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 97 | + } |
|
| 83 | 98 | print '</div>'; |
| 84 | 99 | |
| 85 | - if ($type == 'aircraft') include('date-sub-menu.php'); |
|
| 100 | + if ($type == 'aircraft') { |
|
| 101 | + include('date-sub-menu.php'); |
|
| 102 | + } |
|
| 86 | 103 | print '<div class="table column">'; |
| 87 | - if ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 88 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 89 | - else print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 104 | + if ($type == 'marine') { |
|
| 105 | + print '<p>'.sprintf(_("The table below shows the detailed information of all vessels on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 106 | + } elseif ($type == 'tracker') { |
|
| 107 | + print '<p>'.sprintf(_("The table below shows the detailed information of all trackers on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 108 | + } else { |
|
| 109 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 110 | + } |
|
| 90 | 111 | |
| 91 | 112 | include('table-output.php'); |
| 92 | 113 | print '<div class="pagination">'; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $limit_start = 0; |
| 29 | 29 | $limit_end = 25; |
| 30 | 30 | $absolute_difference = 25; |
| 31 | -} else { |
|
| 31 | +} else { |
|
| 32 | 32 | $limit_explode = explode(",", $_GET['limit']); |
| 33 | 33 | $limit_start = $limit_explode[0]; |
| 34 | 34 | $limit_end = $limit_explode[1]; |
@@ -47,9 +47,13 @@ discard block |
||
| 47 | 47 | print '<h1>'._("Latest Activity").'</h1>'; |
| 48 | 48 | print '</div>'; |
| 49 | 49 | print '<div class="table column">'; |
| 50 | -if ($type == 'marine') print '<p>'._("The table below shows the detailed information of all recent vessels.").'</p>'; |
|
| 51 | -elseif ($type == 'tracker') print '<p>'._("The table below shows the detailed information of all recent trackers.").'</p>'; |
|
| 52 | -else print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; |
|
| 50 | +if ($type == 'marine') { |
|
| 51 | + print '<p>'._("The table below shows the detailed information of all recent vessels.").'</p>'; |
|
| 52 | +} elseif ($type == 'tracker') { |
|
| 53 | + print '<p>'._("The table below shows the detailed information of all recent trackers.").'</p>'; |
|
| 54 | +} else { |
|
| 55 | + print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; |
|
| 56 | +} |
|
| 53 | 57 | |
| 54 | 58 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 55 | 59 | $sql_begin = microtime(true); |
@@ -16,11 +16,15 @@ discard block |
||
| 16 | 16 | $Tracker = new Tracker(); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 19 | +if (!isset($filter_name)) { |
|
| 20 | + $filter_name = ''; |
|
| 21 | +} |
|
| 20 | 22 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 21 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
| 22 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 23 | -} |
|
| 24 | + if (isset($globalFilter['airline'])) { |
|
| 25 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 26 | + } |
|
| 27 | + } |
|
| 24 | 28 | |
| 25 | 29 | require_once('header.php'); |
| 26 | 30 | include('statistics-sub-menu.php'); |
@@ -33,9 +37,13 @@ discard block |
||
| 33 | 37 | </div> |
| 34 | 38 | <p>'._("Below is a chart that plots the busiest day during the <strong>last 7 days</strong>.").'</p>'; |
| 35 | 39 | |
| 36 | -if ($type == 'aircraft') $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
| 37 | -elseif ($type == 'marine') $date_array = $Marine->countAllDatesLast7Days(); |
|
| 38 | -elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLast7Days(); |
|
| 40 | +if ($type == 'aircraft') { |
|
| 41 | + $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
| 42 | +} elseif ($type == 'marine') { |
|
| 43 | + $date_array = $Marine->countAllDatesLast7Days(); |
|
| 44 | +} elseif ($type == 'tracker') { |
|
| 45 | + $date_array = $Tracker->countAllDatesLast7Days(); |
|
| 46 | +} |
|
| 39 | 47 | if (count($date_array) == 0) { |
| 40 | 48 | print _("No data available"); |
| 41 | 49 | } else { |
@@ -61,9 +69,13 @@ discard block |
||
| 61 | 69 | } else { |
| 62 | 70 | print '<p>'._("Below are the <strong>Top 10</strong> most busiest dates.").'</p>'; |
| 63 | 71 | } |
| 64 | -if ($type == 'aircraft') $date_array = $Stats->countAllDates($airline_icao,$filter_name); |
|
| 65 | -elseif ($type == 'marine') $date_array = $Marine->countAllDates(); |
|
| 66 | -elseif ($type == 'tracker') $date_array = $Tracker->countAllDates(); |
|
| 72 | +if ($type == 'aircraft') { |
|
| 73 | + $date_array = $Stats->countAllDates($airline_icao,$filter_name); |
|
| 74 | +} elseif ($type == 'marine') { |
|
| 75 | + $date_array = $Marine->countAllDates(); |
|
| 76 | +} elseif ($type == 'tracker') { |
|
| 77 | + $date_array = $Tracker->countAllDates(); |
|
| 78 | +} |
|
| 67 | 79 | if (!empty($date_array)) |
| 68 | 80 | { |
| 69 | 81 | print '<div class="table-responsive">'; |
@@ -15,11 +15,15 @@ discard block |
||
| 15 | 15 | require_once('require/class.Tracker.php'); |
| 16 | 16 | $Tracker = new Tracker(); |
| 17 | 17 | } |
| 18 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 18 | +if (!isset($filter_name)) { |
|
| 19 | + $filter_name = ''; |
|
| 20 | +} |
|
| 19 | 21 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 20 | 22 | if ($airline_icao == '' && isset($globalFilter)) { |
| 21 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 22 | -} |
|
| 23 | + if (isset($globalFilter['airline'])) { |
|
| 24 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 25 | + } |
|
| 26 | + } |
|
| 23 | 27 | |
| 24 | 28 | require_once('header.php'); |
| 25 | 29 | include('statistics-sub-menu.php'); |
@@ -32,9 +36,13 @@ discard block |
||
| 32 | 36 | </div> |
| 33 | 37 | <p>'._("Below is a chart that plots the busiest day during the <strong>last month</strong>.").'</p>'; |
| 34 | 38 | |
| 35 | -if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
| 36 | -elseif ($type == 'marine') $date_array = $Marine->countAllDatesLastMonth(); |
|
| 37 | -elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLastMonth(); |
|
| 39 | +if ($type == 'aircraft') { |
|
| 40 | + $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
| 41 | +} elseif ($type == 'marine') { |
|
| 42 | + $date_array = $Marine->countAllDatesLastMonth(); |
|
| 43 | +} elseif ($type == 'tracker') { |
|
| 44 | + $date_array = $Tracker->countAllDatesLastMonth(); |
|
| 45 | +} |
|
| 38 | 46 | |
| 39 | 47 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
| 40 | 48 | $month_data = ''; |
@@ -75,8 +83,11 @@ discard block |
||
| 75 | 83 | print '<tr>'; |
| 76 | 84 | print '<td><strong>'.$i.'</strong></td>'; |
| 77 | 85 | print '<td>'; |
| 78 | - if ($type == 'aircraft') print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
| 79 | - else print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
| 86 | + if ($type == 'aircraft') { |
|
| 87 | + print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
| 88 | + } else { |
|
| 89 | + print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
| 90 | + } |
|
| 80 | 91 | print '</td>'; |
| 81 | 92 | print '<td>'; |
| 82 | 93 | print $date_item['date_count']; |
@@ -17,11 +17,15 @@ discard block |
||
| 17 | 17 | $title = _("Statistics").' - '._("Busiest Month of Last Year"); |
| 18 | 18 | |
| 19 | 19 | |
| 20 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 20 | +if (!isset($filter_name)) { |
|
| 21 | + $filter_name = ''; |
|
| 22 | +} |
|
| 21 | 23 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 22 | 24 | if ($airline_icao == '' && isset($globalFilter)) { |
| 23 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 24 | -} |
|
| 25 | + if (isset($globalFilter['airline'])) { |
|
| 26 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 27 | + } |
|
| 28 | + } |
|
| 25 | 29 | |
| 26 | 30 | require_once('header.php'); |
| 27 | 31 | include('statistics-sub-menu.php'); |
@@ -33,9 +37,13 @@ discard block |
||
| 33 | 37 | </div> |
| 34 | 38 | <p>'._("Below is a chart that plots the busiest month during the <strong>last year</strong>.").'</p>'; |
| 35 | 39 | |
| 36 | -if ($type == 'aircraft') $date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
| 37 | -elseif ($type == 'marine') $date_array = $Marine->countAllMonthsLastYear(true); |
|
| 38 | -elseif ($type == 'tracker') $date_array = $Tracker->countAllMonthsLastYear(true); |
|
| 40 | +if ($type == 'aircraft') { |
|
| 41 | + $date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
| 42 | +} elseif ($type == 'marine') { |
|
| 43 | + $date_array = $Marine->countAllMonthsLastYear(true); |
|
| 44 | +} elseif ($type == 'tracker') { |
|
| 45 | + $date_array = $Tracker->countAllMonthsLastYear(true); |
|
| 46 | +} |
|
| 39 | 47 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
| 40 | 48 | $year_data = ''; |
| 41 | 49 | $year_cnt = ''; |
@@ -53,9 +61,13 @@ discard block |
||
| 53 | 61 | axis: { x: { type: "timeseries", localtime: false,tick: { format: "%Y-%m"}}, y: { label: "#"}},legend: { show: false }});'; |
| 54 | 62 | print '</script>'; |
| 55 | 63 | |
| 56 | -if ($type == 'aircraft') $date_array = $Stats->countAllMonths($airline_icao); |
|
| 57 | -elseif ($type == 'marine') $date_array = $Marine->countAllMonths(); |
|
| 58 | -elseif ($type == 'tracker') $date_array = $Tracker->countAllMonths(); |
|
| 64 | +if ($type == 'aircraft') { |
|
| 65 | + $date_array = $Stats->countAllMonths($airline_icao); |
|
| 66 | +} elseif ($type == 'marine') { |
|
| 67 | + $date_array = $Marine->countAllMonths(); |
|
| 68 | +} elseif ($type == 'tracker') { |
|
| 69 | + $date_array = $Tracker->countAllMonths(); |
|
| 70 | +} |
|
| 59 | 71 | |
| 60 | 72 | if (!empty($date_array)) |
| 61 | 73 | { |
@@ -16,11 +16,15 @@ discard block |
||
| 16 | 16 | $Tracker = new Tracker(); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 19 | +if (!isset($filter_name)) { |
|
| 20 | + $filter_name = ''; |
|
| 21 | +} |
|
| 20 | 22 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 21 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
| 22 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 23 | -} |
|
| 24 | + if (isset($globalFilter['airline'])) { |
|
| 25 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 26 | + } |
|
| 27 | + } |
|
| 24 | 28 | |
| 25 | 29 | require_once('header.php'); |
| 26 | 30 | include('statistics-sub-menu.php'); |
@@ -33,9 +37,13 @@ discard block |
||
| 33 | 37 | </div> |
| 34 | 38 | <p>'._("Below is a list of the most common <strong>time of day</strong>.").'</p>'; |
| 35 | 39 | |
| 36 | -if ($type == 'aircraft') $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
| 37 | -elseif ($type == 'marine') $hour_array = $Marine->countAllHours('hour',true); |
|
| 38 | -elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('hour',true); |
|
| 40 | +if ($type == 'aircraft') { |
|
| 41 | + $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
| 42 | +} elseif ($type == 'marine') { |
|
| 43 | + $hour_array = $Marine->countAllHours('hour',true); |
|
| 44 | +} elseif ($type == 'tracker') { |
|
| 45 | + $hour_array = $Tracker->countAllHours('hour',true); |
|
| 46 | +} |
|
| 39 | 47 | print '<div id="chartHour" class="chart" width="100%"></div><script>'; |
| 40 | 48 | $hour_data = ''; |
| 41 | 49 | $hour_cnt = ''; |
@@ -53,9 +61,13 @@ discard block |
||
| 53 | 61 | axis: { x: { type: "category", categories: '.$hour_data.'},y: { label: "# of Flights"}},legend: { show: false }});'; |
| 54 | 62 | print '</script>'; |
| 55 | 63 | |
| 56 | -if ($type == 'aircraft') $hour_array = $Stats->countAllHours('count',true,$airline_icao,$filter_name); |
|
| 57 | -elseif ($type == 'marine') $hour_array = $Marine->countAllHours('count',true); |
|
| 58 | -elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('count',true); |
|
| 64 | +if ($type == 'aircraft') { |
|
| 65 | + $hour_array = $Stats->countAllHours('count',true,$airline_icao,$filter_name); |
|
| 66 | +} elseif ($type == 'marine') { |
|
| 67 | + $hour_array = $Marine->countAllHours('count',true); |
|
| 68 | +} elseif ($type == 'tracker') { |
|
| 69 | + $hour_array = $Tracker->countAllHours('count',true); |
|
| 70 | +} |
|
| 59 | 71 | if (!empty($hour_array)) |
| 60 | 72 | { |
| 61 | 73 | print '<div class="table-responsive">'; |
@@ -5,11 +5,15 @@ discard block |
||
| 5 | 5 | $Stats = new Stats(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft"); |
| 7 | 7 | |
| 8 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 8 | +if (!isset($filter_name)) { |
|
| 9 | + $filter_name = ''; |
|
| 10 | +} |
|
| 9 | 11 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
| 10 | 12 | if ($airline_icao == '' && isset($globalFilter)) { |
| 11 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
| 12 | -} |
|
| 13 | + if (isset($globalFilter['airline'])) { |
|
| 14 | + $airline_icao = $globalFilter['airline'][0]; |
|
| 15 | + } |
|
| 16 | + } |
|
| 13 | 17 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 14 | 18 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
| 15 | 19 | |
@@ -28,9 +32,12 @@ discard block |
||
| 28 | 32 | $aircraft_data = ''; |
| 29 | 33 | foreach($aircraft_array as $aircraft_item) |
| 30 | 34 | { |
| 31 | - if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
| 32 | - else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
| 33 | -} |
|
| 35 | + if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') { |
|
| 36 | + $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
| 37 | + } else { |
|
| 38 | + $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
|
| 39 | + } |
|
| 40 | + } |
|
| 34 | 41 | $aircraft_data = substr($aircraft_data, 0, -1); |
| 35 | 42 | print 'var series = ['.$aircraft_data.'];'; |
| 36 | 43 | print 'var dataset = [];var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
@@ -8,7 +8,9 @@ |
||
| 8 | 8 | $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
| 9 | 9 | $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
| 10 | 10 | $atc_data = $ATC->getById($atcid); |
| 11 | - if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
|
| 11 | + if (!isset($atc_data[0])) { |
|
| 12 | + $atc_data = $ATC->getByIdent($atcident); |
|
| 13 | + } |
|
| 12 | 14 | ?> |
| 13 | 15 | <div class="alldetails"> |
| 14 | 16 | <button type="button" class="close">×</button> |