<h3>Hub Information <?php echo $hub->name; ?> (<?php echo $hub->icao; ?>)</h3>
<table>
<tr>
    <td valign="top" width="60%" style="padding-right:10px;"><?php echo $detail->pagecontent; ?></td>
    <td valign="top"><img src="<?php echo $detail->image; ?>" style="max-width:100%;" /></td>
</tr>
</table>



<?php if($detail->showstats == '1') { ?>
<br />
<br />
<hr />
<table width="100%">
<tr>
<td valign="top" width="60%" style="padding-right:10px;">
<h3>Top Aircraft Types</h3>
<?php if(!$topaircraft)
{
    echo "No Aircraft Statistics available!";
} else { ?>
    <table class="cc_hubadm_tablea">
    <tr>
        <th>#</th>
        <th>Flights</th>
        <th>Type</th>
        </tr>
        <?php $i = "1"; foreach($topaircraft as $acft) { ?>
        <tr>
        <td><?php echo $i; ?></td>
        <td><?php echo $acft->routesflown; ?></td>
        <td><?php echo $acft->aircraftname; ?></td>
        </tr>
        <?php $i++; } ?>
    </table>
    <?php } ?>
</td>
<td>
<h3>Top Pilots by Flights</h3>
<?php if(!$topflightpilots)
{
    echo "No Statistics available!";
} else { ?>
    <table class="cc_hubadm_tablea">
    <tr>
        <th>#</th>
        <th>Flights</th>
        <th>Pilot</th>
        </tr>
        <?php $i = "1"; foreach($topflightpilots as $pil) { ?>
        <tr>
        <td><?php echo $i; ?></td>
        <td><?php echo $pil->routesflown; ?></td>
        <td><?php echo $pil->firstname.' '.$pil->lastname; ?></td>
        </tr>
        <?php $i++; } ?>
    </table>
    <?php } ?>
</td>
    </tr>
</table>


<table width="100%">
<tr>
<td valign="top" width="60%" style="padding-right:10px;">
<h3>Top Pilots by Flights (month)</h3>
<?php if(!$topflightpilotsmonth)
{
    echo "No Statistics available!";
} else { ?>
    <table class="cc_hubadm_tablea">
    <tr>
        <th>#</th>
        <th>Flights</th>
        <th>Pilot</th>
        </tr>
        <?php $i = "1"; foreach($topflightpilotsmonth as $pil) { ?>
        <tr>
        <td><?php echo $i; ?></td>
        <td><?php echo $pil->routesflown; ?></td>
        <td><?php echo $pil->firstname.' '.$pil->lastname; ?></td>
        </tr>
        <?php $i++; } ?>
    </table>
    <?php } ?>
    </td>
    <td>
        <h3>Top Pilots by Hours</h3>
     <?php if(!$tophourpilots)
{
    echo "No Statistics available!";
} else { ?>
    <table class="cc_hubadm_tablea">
    <tr>
        <th>#</th>
        <th>Time</th>
        <th>Pilot</th>
        </tr>
        <?php $i = "1"; foreach($tophourpilots as $pil) { ?>
        <tr>
        <td><?php echo $i; ?></td>
        <td><?php echo explode(':', $pil->totaltime)[0].":".explode(':', $pil->totaltime)[1]; ?></td>
        <td><?php echo $pil->firstname.' '.$pil->lastname; ?></td>
        </tr>
        <?php $i++; } ?>
    </table>
    <?php } ?>
    </td>
    </tr>
</table>


<table width="100%">
<tr>
<td valign="top" width="60%" style="padding-right:10px;">
<h3>Top Pilots by Hours (month)</h3>
<?php if(!$tophourpilotsmonth)
{
    echo "No Statistics available!";
} else { ?>
    <table class="cc_hubadm_tablea">
    <tr>
        <th>#</th>
        <th>Time</th>
        <th>Pilot</th>
        </tr>
        <?php $i = "1"; foreach($tophourpilotsmonth as $pil) { ?>
        <tr>
        <td><?php echo $i; ?></td>
        <td><?php echo explode(':', $pil->totaltime)[0].":".explode(':', $pil->totaltime)[1]; ?></td>
        <td><?php echo $pil->firstname.' '.$pil->lastname; ?></td>
        </tr>
        <?php $i++; } ?>
    </table>
    <?php } ?>
    </td>
    <td>
        <h3>Top Landings</h3>
         <?php if(!$toplandingrates)
{
    echo "No Statistics available!";
} else { ?>
    <table class="cc_hubadm_tablea">
    <tr>
        <th>#</th>
        <th>V/S</th>
        <th>A/C</th>
        <th>Airport</th>
        <th>Pilot</th>
        </tr>
        <?php $i = "1"; foreach($toplandingrates as $pil) { ?>
        <tr>
        <td><?php echo $i; ?></td>
        <td><?php echo $pil->landingrate; ?> ft/min</td>
        <td><?php echo $pil->acicao; ?></td>
        <td><?php echo $pil->arricao; ?></td>
        <td><?php echo $pil->firstname.' '.$pil->lastname; ?></td>
        </tr>
        <?php $i++; } ?>
    </table>
    <?php } ?>
    </td>
    </tr>
</table>


<table width="100%">
<tr>
<td valign="top" width="60%" style="padding-right:10px;">
<h3>Top Landings (month)</h3>
<?php if(!$toplandingratesmonth)
{
    echo "No Statistics available!";
} else { ?>
    <table class="cc_hubadm_tablea">
    <tr>
        <th>#</th>
        <th>V/S</th>
        <th>A/C</th>
        <th>Airport</th>
        <th>Pilot</th>
        </tr>
        <?php $i = "1"; foreach($toplandingratesmonth as $pil) { ?>
        <tr>
        <td><?php echo $i; ?></td>
        <td><?php echo $pil->landingrate; ?> ft/min</td>
        <td><?php echo $pil->acicao; ?></td>
        <td><?php echo $pil->arricao; ?></td>
        <td><?php echo $pil->firstname.' '.$pil->lastname; ?></td>
        </tr>
        <?php $i++; } ?>
    </table>
    <?php } ?>
    </td>
    <td>
    </td>
    </tr>
</table>
<?php } ?>

<?php if($detail->showpilots == '1') { ?>
<br />
<br />
<hr />
<?php echo Template::Get('pilots_list.tpl'); ?>
<?php } ?>