require 'require/class.Connection.php';
require 'require/class.Spotter.php';
$Spotter = new Spotter();
$title = "Statistic - Most common Route by Waypoint";
require 'header.php';
include 'statistics-sub-menu.php';
?>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
		<div class="info">
	  	<h1>Most common Route by Waypoint</h1>
	  </div>

      <p>Below are the <strong>Top 10</strong> most common routes, based on the waypoint data (as of May 1, 2014). Theoretically, since the waypoint data is the full 'planned flight route' this statistic would show the actual most common route.</p>
      
<?php 
$route_array = $Spotter->countAllRoutesWithWaypoints();
if (!empty($route_array)) {
    print '<div class="table-responsive">';
    print '<table class="common-routes-waypoints table-striped">';
    print '<thead>';
    print '<th></th>';
    print '<th>Departure Airport</th>';
    print '<th>Arrival Airport</th>';
    print '<th># of times</th>';
    print '<th></th>';
    print '</thead>';
    print '<tbody>';
    $i = 1;
    foreach ($route_array as $route_item) {
        print '<tr>';
        print '<td><strong>' . $i . '</strong></td>';
require 'require/class.Connection.php';
require 'require/class.Spotter.php';
$title = "Statistic - Most common Route by Waypoint";
require 'header.php';
include 'statistics-sub-menu.php';
?>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
		<div class="info">
	  	<h1>Most common Route by Waypoint</h1>
	  </div>

      <p>Below are the <strong>Top 10</strong> most common routes, based on the waypoint data (as of May 1, 2014). Theoretically, since the waypoint data is the full 'planned flight route' this statistic would show the actual most common route.</p>
      
<?php 
$route_array = Spotter::countAllRoutesWithWaypoints();
if (!empty($route_array)) {
    print '<div class="table-responsive">';
    print '<table class="common-routes-waypoints table-striped">';
    print '<thead>';
    print '<th></th>';
    print '<th>Departure Airport</th>';
    print '<th>Arrival Airport</th>';
    print '<th># of times</th>';
    print '<th></th>';
    print '</thead>';
    print '<tbody>';
    $i = 1;
    foreach ($route_array as $route_item) {
        print '<tr>';
        print '<td><strong>' . $i . '</strong></td>';