<div class="sky-sheet clearfix">
            <div class="sky-layout-wrapper">
                <div class="sky-content-layout">
                    <div class="sky-content-layout-row">
                        <div class="sky-layout-cell sky-content"><article class="sky-post sky-article">

<!-- Begin Sub Menu Logged Out -->
<?php 
if(Auth::LoggedIn() == false)
{
?>
<?php Template::Show('sub_menu_out'); ?>
<?php
  }
 ?>
<!-- End Sub Menu Logged Out -->

<!-- Begin Sub Menu Logged In -->
<?php
if(!Auth::LoggedIn())
{
   // Show these if they haven't logged in yet
?>
<?php
}
else
{
   // Show these items only if they are logged in
?>
<?php Template::Show('sub_menu'); ?>
<?php
  }
 ?>
<!-- End Sub Menu Logged In -->




		<div class="sky-layout-cell layout-item-6" style="width: 50%" >
        <!-- Begin Company News -->
							
		<h1><i class="fa fa-newspaper-o fa-lg"></i> Latest Company News</h1>
        <p><?php

	// Show the News module, call the function ShowNewsFront
	//	This is in the modules/Frontpage folder
	
	MainController::Run('News', 'ShowNewsFront', 1);
?></p>
        <!-- End Company News -->

        <!-- Begin Live Flights -->

<h1><i class="fa fa-paper-plane fa-lg"></i> Our Flights</h1>
 <!-- Nav tabs -->
 <?php Template::Show('frontpage_acars.php'); ?>
    

<br><br>
      <!-- End Live FLights -->

      <!-- Begin Latest Flights -->
<h1><i class="fa fa-paper-plane fa-lg"></i> Latest Flights</h1>
<?php Template::Show('frontpage_reports.php'); ?> 

      <!-- End Latest Flights -->



    </div>
	<div class="sky-layout-cell layout-item-7" style="width: 33%" >
       
		

     <!--Begin Pilots Online -->
<h1><i class="fa fa-users fa-lg"></i> Pilots Online</h1>
	 <?php
$shown = array();
        echo "<table class=\"aka_table\" width=\"100%\" cellspacing=\"0\" cellpadding=\"1px\">";
        foreach($usersonline as $pilot)
{
        if(in_array($pilot->pilotid, $shown))
                continue;
        else
                $shown[] = $pilot->pilotid;
        echo "<tr><td>{$pilot->firstname} {$pilot->lastname}</td>";
        echo '<td><img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'"width="16:height="16"/></td></tr>';
}
       
	echo "</table>";

?>
    <center>
 <?php
 if(count($shown) < 1){
echo 'There are no pilots online!';
 }
?> 
</center><br>
     <!-- End Pilots Online -->

     <!-- Begin Statistics -->
<h1><i class="fa fa-bar-chart fa-lg"></i> Statistics</h1>

<!--Begin  Stats -->
<table class="sky_table" width="100%" cellspacing="0" border="0">
<!-- Begin Pilot Stats -->
<tr>
<td>Pilots:</td>
<td><span class="counter"><?php echo count(PilotGroups::getUsersInGroup('2')); ?></span>
</td>
</tr>
<!-- End Pilot Stats -->
<!-- Begin Airline Hours Stats -->
<td>Total Airline Hours:</td>
<td><span class="counter"><?php echo number_format(StatsData::TotalHours(), 0); ?></span>
</td>
</tr>
<!-- End Airline Hours Stats -->
<!-- Begin Flights Stats -->
<td>Flights:</td>
<td><span class="counter"><?php echo number_format(StatsData::TotalFlights()); ?></span>
</td>
<tr>
<!-- End Flights Stats -->
<!-- Begin Flights Today Stats -->
<td>Flights Today:</td>
<td><span class="counter"><?php echo StatsData::TotalFlightsToday(); ?></span>
</td>
</tr>
<!-- End Flights Today Stats -->
<!-- Begin Miles Flown Stats -->
<td>Miles Flown:</td>
<td><span class="counter"><?php echo number_format(StatsData::totalmilesflown()); ?></span>
</td>
</tr>
<!-- End Miles Flown Stats -->
<!-- Begin Aircraft Stats -->
<tr>
<td>Aircraft:</td>
<td><span class="counter"><?php echo StatsData::TotalAircraftInFleet(); ?></span>
</td>
</tr>
<!-- End Aircraft Stats -->
<!-- Begin Passengers Stats -->
<tr>
<td>Passengers:</td>
<td><span class="counter"><?php echo number_format(StatsData::totalpaxcarried()); ?></span>
</td>
</tr>
<!-- End Passengers Stats -->
<!-- Begin Routes Stats -->
<tr>
<td>Routes:</td>
<td><span class="counter"><?php echo StatsData::TotalSchedules(); ?></span>
</td>
</tr>
<!-- End Routes Stats -->
<?php
if(Auth::LoggedIn())
{
if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))
{ ?>
<!-- Begin PIREP's Pending Stats -->
<tr>
<td>Pending PIREPS:</td>
<td><span class="counter"><?php echo  count(PIREPData::GetAllReportsByAccept(PIREP_PENDING))?></span>
</td>
</tr>
<!-- End PIREP's Pending Stats -->
<!-- Begin PIREP's Pending Stats -->
<tr>
<td>Pilots Pending:</td>
<td><span class="counter"><?php echo count(PilotData::GetPendingPilots())?></span>
</td>
</tr>
<!-- End PIREP's Pending Stats -->
<?php } }?>
</table>
<center>
<!--  End Stats -->
<br><br>

<h1><i class="fa fa-user-times fa-lg"></i> Newest Pilots</h1>
<?php MainController::Run('Pilots', 'RecentFrontPage', 5); ?>
<br>

<h1><i class="fa fa-globe fa-lg"></i> VA Central Rank</h1>
<?php
$cws = new CodonWebService();
$xml = $cws->get('http://www.vacentral.net/airline/aka_alaskaadventures/xml');
$xml = simplexml_load_string($xml);
echo "<div style='text-align: center; font-weight: bold; font-size: 500%;      
color: #094981'> {$xml->rank} </div>";?>
<br><br>
       <!-- End Statistics -->

       <!-- Begin Twitter -->
<h1><i class="fa fa-twitter fa-lg"></i> Twitter</h1>
<a class="twitter-timeline" href="https://twitter.com/209studios" data-widget-id="671165673775767552">Tweets by @209studios</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    <!-- End Twitter -->

   
</div>
<div class="sky-content-layout layout-item-8">
    <div class="sky-content-layout-row">
    <div class="sky-layout-cell layout-item-9" style="width: 100%" >

         <!-- Begin Banner -->
        <p><a href="http://www.flytampa.org"target="new"><img src="<?php echo SITE_URL?>/lib/skins/sky_Blue/images/banner.png"width="855" height="240"border="0" alt=""><br></p></a>
        <!-- End Banner -->
    </div>
    </div>
</div>
</div>


</article>
</div>
                    </div>
                </div>
            </div>
    </div>

	


