<div class="deepBlue-layout-wrapper">
                <div class="deepBlue-content-layout">
                    <div class="deepBlue-content-layout-row">
                        <div class="deepBlue-layout-cell deepBlue-content"><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Company News</h3>
        </div>
        <div class="deepBlue-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><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Our Flights</h3>
        </div>
        <div class="deepBlue-blockcontent"><p>
  <ul class="nav nav-pills">
    <li class="active"><a data-toggle="tab" href="#home"><i class="fa fa-plane" aria-hidden="true"></i> Live Flights</a></li>
    <li><a data-toggle="tab" href="#menu1"><i class="fa fa-clock-o" aria-hidden="true"></i> Recent Flights</a></li>
    <li><a data-toggle="tab" href="#menu2"><i class="fa fa-road" aria-hidden="true"></i> Top Landings</a></li>
  </ul>
  <br />
  <div class="tab-content">
    <div id="home" class="tab-pane fade in active">
      <p><?php Template::Show('frontpage_acars.php'); ?></p>
    </div>
    <div id="menu1" class="tab-pane fade">
      <p><?php Template::Show('frontpage_reports.php'); ?></p>
    </div>
   <div id="menu2" class="tab-pane fade">
      <p>  <?php
                $lstats = TouchdownStatsData::get_landingstats_currentmonth(5);
                if(!$lstats)
                {
                    echo 'No Greased Landings Recorded ';
                    echo 'For '.date('F Y');
                }
                else
                {
                   echo '<center>';
                    echo '<table width="580px" border="0" cellspacing="0" cellpadding="0" class="deepBlue_table">';
                    echo '<thead><tr><th>Callsign</th><th>Pilot</th><th>Aircraft</th><th>Departure</th><th>Arrival</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>'.$pilot2->firstname.' '.$pilot2->lastname.'</td><td>';
                        $aircraft = OperationsData::getAircraftInfo($row->aircraft);
                        echo $aircraft->icao.'</td><td>';
                        echo $row->depicao.'</td><td>';
                        echo $row->arricao.'</td><td>';
                        echo $row->landingrate;
                        echo ' ft/min';
        echo '</td></tr>';
    }
    echo '</table>';
    echo '</center>';
}
?></p>
    </div>
        
  </div>
        <br></p></div>
</div>

<article class="deepBlue-post deepBlue-article">
                                
                                                
                <div class="deepBlue-postcontent deepBlue-postcontent-0 clearfix"><div class="deepBlue-content-layout">
    <div class="deepBlue-content-layout-row">
    <div class="deepBlue-layout-cell layout-item-0" style="width: 50%" >
        <p><br></p>
    </div><div class="deepBlue-layout-cell layout-item-0" style="width: 50%" >
        <p><br></p>
    </div>
    </div>
</div>
</div>


</article></div>
                        <div class="deepBlue-layout-cell deepBlue-sidebar1"><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Statistics</h3>
        </div>
        <div class="deepBlue-blockcontent"><p>
<table class="deepBlue_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>
<br />
<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 September 15, 2016")
}
//enter the count up date using the format year/month/day
countup(2016,09,15)
</script>
</div>
        <br></p></div>
</div><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Supported Simulators</h3>
        </div>
        <div class="deepBlue-blockcontent"><p>
<p><img src="<?php echo SITE_URL?>/lib/skins/deepBlue/img/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/deepBlue/img/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/deepBlue/img/xp10.png" width="220" height="83" alt="" " /></a></p>
        <br></p></div>
</div><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Partners</h3>
        </div>
        <div class="deepBlue-blockcontent"><p>
        <div align="center">
<p><a href="http://www.simpilotgroup.com"target="new"><img src="<?php echo SITE_URL?>/lib/skins/deepBlue/img/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/deepBlue/img/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/deepBlue/img/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/deepBlue/img/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/deepBlue/img/partner_vatsim.png" width="150" height="35" alt="" " /></a></p>
        <br></p></div></div>
</div><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Social Media</h3>
        </div>
        <div class="deepBlue-blockcontent"><p>
<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/deepBlue/img/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/deepBlue/img/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/deepBlue/img/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/deepBlue/img/icons/google+.png" width="100" height="100"border="0" alt=""></a>
</center>
        <br></p></div>
</div></div>
                        <div class="deepBlue-layout-cell deepBlue-sidebar2"><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Pilots Online</h3>
        </div>
        <div class="deepBlue-blockcontent"><div>
  <?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!';
 }
?>
</div></div>
</div><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Newest Pilots</h3>
        </div>
        <div class="deepBlue-blockcontent">
<?php MainController::Run('Pilots', 'RecentFrontPage', 5); ?>
</div><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Recent Bids</h3>
        </div>
        <div class="deepBlue-blockcontent"><div>
  <?php MainController::Run('FrontBids', 'RecentFrontPage', 4); ?>
</div></div>
</div><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">Recent Activity</h3>
        </div>
        <div class="deepBlue-blockcontent"><div>
  <?php
MainController::Run('Activity', 'Frontpage', 3);
?>
</div></div>
</div><div class="deepBlue-block clearfix">
        <div class="deepBlue-blockheader">
            <h3 class="t">METAR Search</h3>
        </div>
        <div class="deepBlue-blockcontent"><div>
        <br />
  <form name="check">
<input width="4" type="text" name="station" value="Enter Airport ICAO" /> 
<input type="submit" class="deepBlue-button" value="Search Airport" onclick="window.open ('ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/'+this.form.station.value.toUpperCase()+'.TXT', 'newWin', 'scrollbars=yes,status=yes,width=700,height=500')" /></form>
</div>
</div>

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

