<div class="blueIce-layout-wrapper">
<div class="blueIce-content-layout">
<div class="blueIce-content-layout-row">
<div class="blueIce-layout-cell blueIce-sidebar1">
<!--Begin  Messages -->
<?php
if(!Auth::LoggedIn())
{
// Show these if they haven't logged in yet
?>
<?php
}
else
{
// Show these items only if they are logged in
?>
<a href="<?php echo SITE_URL ?>/index.php/Mail"><?php MainController::Run('Mail', 'checkmail'); ?></a>
<?php
}
?>

<!--End  Messages -->
<!--Begin  Statistics -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Statistics</h3>
</div>
<div class="blueIce-blockcontent">
<!--Begin  Stats -->
<table class="blueIce_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 Statistics -->
<!--Begin  Airline Join Counter -->
<div class="alert alert-info">
<script>
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countup(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var paststring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1)
years=parseInt(difference/365)
difference=difference%365
difference+=" days"
document.write("It\'s been "+years+" years and "+difference+" since the launch of <?php echo SITE_NAME; ?>. We have been flying in the sky since December 14, 2015")
}
//enter the count up date using the format year/month/day
countup(2016,09,01)
</script>
</div>
<!--  End Airline Join Counter -->
</div>
</div>
<!-- Begin Top Landings -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t"><?php echo date('F Y'); ?> Top Landings</h3>
</div>
<div class="blueIce-blockcontent"><div>
<?php
$lstats = TouchdownStatsData::get_stats_by_cur_month(5);
if(!$lstats)
{
echo 'No Greased Landings Recorded ';
echo 'For '.date('F Y');
}
else
{
echo '<center>';
echo '<table width="250px" border="0" cellspacing="0" cellpadding="0" class="blueIce_table">';
echo '<thead><tr><th>Pilot</th><th>Aircraft</th><th>Landing</th></tr></thead>';
foreach ($lstats as $row)
{
$pilot2 = PilotData::GetPilotData($row->pilotid);
echo '<tr><td>';
echo PilotData::GetPilotCode($row->code, $row->pilotid).'</td><td>';
$aircraft = OperationsData::getAircraftInfo($row->aircraft);
echo $aircraft->icao.'</td><td>';
echo $row->landingrate;
echo '</td></tr>';
}
echo '</table>';
echo '</center>';
}
?>
</div>
</div>
</div>
<!-- End Top Landings -->
<!-- Begin VA Central -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">VA Central Rank</h3>
</div>
<div class="blueIce-blockcontent"><div>
<?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: #053076'> {$xml->rank} </div>";?>
</div>
</div>
</div>
<!-- End VA Central -->
<!-- Begin Supported Simulators -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Supported Simultors</h3>
</div>
<div class="blueIce-blockcontent"><div>      
<p><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/fsx_logo.png" width="220" height="54" alt="" " /></a></p>
<p><a href="http://www.prepar3d.com" target="_blank"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/p3d.png" width="220" height="32" alt="" " /></a></p>
<p><a href="http://www.x-plane.com" target="_blank"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/xp10.png" width="220" height="83" alt="" " /></a></p>
</div>
</div>
</div>
<!-- End Supported Simulators -->
<!--Begin Partners -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Partners</h3>
</div>
<div class="blueIce-blockcontent"><div>
<div align="center">
<p><a href="http://www.simpilotgroup.com"target="new"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/partner_simpilotgroup2.png" width="150" height="30" alt="" " /></a></p>
<p><a href="http://www.fs-products.net"target="new"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/partner_fsproducts_small.png" width="150" height="35" alt="" " /></a></p>
<p><a href="http://php-mods.eu"target="new"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/partners_phpmods.png" width="137" height="40" alt="" " /></a></p>
<p><a href="http://www.crazycreatives.com"target="new"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/partner_crazy_creatives.png" width="137" height="40" alt="" " /></a></p>
<p><a href="http://www.vatsim.net"target="new"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/partner_vatsim.png" width="150" height="35" alt="" " /></a></p>
</div>
</div>
</div>
</div>
</div>
<!--End Partners -->
<!--Begin Company News -->
<div class="blueIce-layout-cell blueIce-content"><div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Company News</h3>
</div>
<div class="blueIce-blockcontent"><p>
<?php
// Show the News module, call the function ShowNewsFront
//  This is in the modules/Frontpage folder
MainController::Run('News', 'ShowNewsFront', 1);
?>
<br></p></div>
</div>
<!--End Company News -->
<!--Begin Live Flights -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Live Flights</h3>
</div>
<div class="blueIce-blockcontent"><p>
<?php Template::Show('frontpage_acars.php'); ?>
<br></p></div>
</div>
<!--End Live Flights -->
<!--Begin Recent Flights -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Recent Flights</h3>
</div>
<div class="blueIce-blockcontent"><p>
<?php Template::Show('frontpage_reports.php'); ?> 
<br></p></div>
</div>
<!--End Recent Flights -->
</div>
<div class="blueIce-layout-cell blueIce-sidebar2">
<!--Begin Average Landing -->
<center><button type="button" class="btn btn-landing">Average Landing <span class="badge"><span class="counter"><?php echo ''.round(TouchdownStatsData::airline_average('airline'), 0); ?></span></span></button></center>
<!--End Average Landing -->
<!--Begin Newest Pilots -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Newest Pilots</h3>
</div>
<div class="blueIce-blockcontent"><p>
<?php MainController::Run('Pilots', 'RecentFrontPage', 5); ?>
</p>
</div>
</div>
<!--End Newest Pilots -->
<!--Begin Pilots Online -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Pilots Online</h3>
</div>
<div class="blueIce-blockcontent"><p>
There have been <?php echo count($usersonline)?> user(s), and <?php echo count($guestsonline);?> guest(s) online in the past <?php echo Config::Get('USERS_ONLINE_TIME')?> minutes.
<br><br>
<?php
$shown = array();
echo "<table class=\"blueIce_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></p>
</div>
</div>
<!--End Pilots Online -->
<!--Begin Recent Bids -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Recent Bids</h3>
</div>
<div class="blueIce-blockcontent">
<?php MainController::Run('FrontBids', 'RecentFrontPage', 4); ?>
</div>
</div>
<!--End Recent Bids -->
<!--Begin Recent Activity -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Recent Activity</h3>
</div>
<div class="blueIce-blockcontent">
<?php
MainController::Run('Activity', 'Frontpage', 3);
?>
</div>
</div>
<!--End Recent Activity -->
<!--Begin Social Media -->
<div class="blueIce-block clearfix">
<div class="blueIce-blockheader">
<h3 class="t">Social Media</h3>
</div>
<div class="blueIce-blockcontent"><p>
<br>
<center>
<a href="http://www.facebook.com"target="new" data-toggle="tooltip" data-placement="top" title="Like us on Facebook!"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/icons/facebook.png" width="100" height="100"border="0" alt=""></a>
<a href="http://www.twitter.com"target="new" data-toggle="tooltip" data-placement="top" title="Follow us on Twitter!"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/icons/twitter.png" width="100" height="100"border="0" alt=""></a><br />
<a href="http;//www.youtube.com"target="new" data-toggle="tooltip" data-placement="top" title="Check out our videos!"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/icons/youtube.png" width="100" height="100"border="0" alt=""></a>
<a href="http;//www.googleplus.com"target="new" data-toggle="tooltip" data-placement="top" title="Follow us on Google+"><img src="<?php echo SITE_URL?>/lib/skins/blueIce/images/icons/google+.png" width="100" height="100"border="0" alt=""></a>
</center>
</p>
</div>
</div>
</div>
<!--End Social Media -->
</div>
</div>
            

           


