@@ -1,6 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once(dirname(__FILE__).'/require/settings.php'); |
| 3 | 3 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 4 | -if ($date == '') $date = date('Y-m-d'); |
|
| 4 | +if ($date == '') { |
|
| 5 | + $date = date('Y-m-d'); |
|
| 6 | +} |
|
| 5 | 7 | header('Location: '.$globalURL.'/accident/'.$date); |
| 6 | 8 | ?> |
| 7 | 9 | \ No newline at end of file |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Route by Waypoint"); |
| 7 | 7 | require_once('header.php'); |
| 8 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 8 | +if (!isset($filter_name)) { |
|
| 9 | + $filter_name = ''; |
|
| 10 | +} |
|
| 9 | 11 | include('statistics-sub-menu.php'); |
| 10 | 12 | |
| 11 | 13 | print '<div class="info"> |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Route by Airport"); |
| 7 | 7 | require_once('header.php'); |
| 8 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 8 | +if (!isset($filter_name)) { |
|
| 9 | + $filter_name = ''; |
|
| 10 | +} |
|
| 9 | 11 | include('statistics-sub-menu.php'); |
| 10 | 12 | |
| 11 | 13 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -1,6 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once(dirname(__FILE__).'/require/settings.php'); |
| 3 | 3 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 4 | -if ($date == '') $date = date('Y-m-d'); |
|
| 4 | +if ($date == '') { |
|
| 5 | + $date = date('Y-m-d'); |
|
| 6 | +} |
|
| 5 | 7 | header('Location: '.$globalURL.'/incident/'.$date); |
| 6 | 8 | ?> |
| 7 | 9 | \ No newline at end of file |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $limit_start = 0; |
| 32 | 32 | $limit_end = 25; |
| 33 | 33 | $absolute_difference = 25; |
| 34 | -} else { |
|
| 34 | +} else { |
|
| 35 | 35 | $limit_explode = explode(",", $_GET['limit']); |
| 36 | 36 | $limit_start = $limit_explode[0]; |
| 37 | 37 | $limit_end = $limit_explode[1]; |
@@ -50,20 +50,32 @@ discard block |
||
| 50 | 50 | print '</div>'; |
| 51 | 51 | |
| 52 | 52 | print '<div class="table column">'; |
| 53 | -if ($type == 'aircraft') print '<p>'._("The table below shows the detailed information of all current flights.").'</p>'; |
|
| 54 | -elseif ($type == 'marine') print '<p>'._("The table below shows the detailed information of all current vessels.").'</p>'; |
|
| 55 | -elseif ($type == 'tracker') print '<p>'._("The table below shows the detailed information of all current trackers.").'</p>'; |
|
| 53 | +if ($type == 'aircraft') { |
|
| 54 | + print '<p>'._("The table below shows the detailed information of all current flights.").'</p>'; |
|
| 55 | +} elseif ($type == 'marine') { |
|
| 56 | + print '<p>'._("The table below shows the detailed information of all current vessels.").'</p>'; |
|
| 57 | +} elseif ($type == 'tracker') { |
|
| 58 | + print '<p>'._("The table below shows the detailed information of all current trackers.").'</p>'; |
|
| 59 | +} |
|
| 56 | 60 | |
| 57 | 61 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 58 | 62 | if ($sort != '') { |
| 59 | - if ($type == 'aircraft') $spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference, $sort); |
|
| 60 | - elseif ($type == 'marine') $spotter_array = $MarineLive->getLiveMarineData($limit_start.",".$absolute_difference, $sort); |
|
| 61 | - elseif ($type == 'tracker') $spotter_array = $TrackerLive->getLiveTrackerData($limit_start.",".$absolute_difference, $sort); |
|
| 62 | -} else { |
|
| 63 | - if ($type == 'aircraft') $spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference); |
|
| 64 | - elseif ($type == 'marine') $spotter_array = $MarineLive->getLiveMarineData($limit_start.",".$absolute_difference); |
|
| 65 | - elseif ($type == 'tracker') $spotter_array = $TrackerLive->getLiveTrackerData($limit_start.",".$absolute_difference); |
|
| 66 | -} |
|
| 63 | + if ($type == 'aircraft') { |
|
| 64 | + $spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference, $sort); |
|
| 65 | + } elseif ($type == 'marine') { |
|
| 66 | + $spotter_array = $MarineLive->getLiveMarineData($limit_start.",".$absolute_difference, $sort); |
|
| 67 | + } elseif ($type == 'tracker') { |
|
| 68 | + $spotter_array = $TrackerLive->getLiveTrackerData($limit_start.",".$absolute_difference, $sort); |
|
| 69 | + } |
|
| 70 | + } else { |
|
| 71 | + if ($type == 'aircraft') { |
|
| 72 | + $spotter_array = $SpotterLive->getLiveSpotterData($limit_start.",".$absolute_difference); |
|
| 73 | + } elseif ($type == 'marine') { |
|
| 74 | + $spotter_array = $MarineLive->getLiveMarineData($limit_start.",".$absolute_difference); |
|
| 75 | + } elseif ($type == 'tracker') { |
|
| 76 | + $spotter_array = $TrackerLive->getLiveTrackerData($limit_start.",".$absolute_difference); |
|
| 77 | + } |
|
| 78 | + } |
|
| 67 | 79 | |
| 68 | 80 | if (!empty($spotter_array)) |
| 69 | 81 | { |
@@ -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">'; |