<!-- Blank Header -->
<div class="content-header">
    <div class="header-section">
        <h1>
            <i class="gi gi-sun fa-spin"></i><strong>WX</strong> Briefing room<br><small>Flight Operations | <?php echo SITE_NAME?> &copy; <?php echo date("Y"); ?></small>
        </h1>
    </div>
</div>
<!-- END Blank Header -->
<!-- Metar ICAO -->
<div class="row">
    <div class="col-md-4">
		<div class="block">
    		<!-- Metar ICAO  Title -->
    		<div class="block-title">
        		<h2><i class="gi gi-cloud"></i> Live Airport WX</h2>
    		</div>
    		<!-- END Metar ICAO  Title -->

    		<!-- Metar ICAO  Content -->
    		<form action="<?php echo url('/AdvancedWX/metarxml');?>" method="post" class="form-horizontal form-bordered">
                <div class="form-group">
                    <label class="col-md-3 control-label">Enter ICAO</label>
                    <div class="col-md-6">
                        <input type="text" name="icao" class="form-control" placeholder="<?php echo Auth::$userinfo->hub;?>" required="required"><br>
                        <input type="submit" class="btn btn-sm btn-primary" value="Get Current WX">
                        
                   	</div>
                </div>
            </form>    
    		<!-- END Metar ICAO  Content -->
		</div>
	</div>
	<div class="col-md-4">
		<div class="block">
			<div class="block-title">
				<h3><i class="gi gi-floppy_saved"></i> <strong>WX</strong> History</h3>
			</div>
			<?php $last_location = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED); ?>
			<h4 class="text-success">
				Your current ACARS location<br>
			</h4>
			<br>
			<p class="text-muted">
				<?php 
				if(!$last_location)
				{
					$icao = Auth::$pilot->hub;
				}
				else
				{
					$icao = $last_location->arricao; 
				}
				
				echo AirportData::getMETAR($icao);
					
				?>
			</p>
			
		</div>
	</div>
	
	<div class="col-md-12">
			<div class="block">
				<div class="block-title">
					<div class="block-options pull-right">
						<span class="label label-danger animation-pulse">LIVE</span>
					</div>
					<h3><strong>WX</strong> Map</h3>
				</div>
				<iframe width="1200" height="450" src="https://embed.windy.com/embed2.html?lat=<?php echo Config::Get('WINDY_LAT_PROFILE');?>&lon=<?php echo Config::Get('WINDY_LNG_PROFILE');?>&zoom=3&level=surface&overlay=wind&menu=&message=true&marker=&calendar=&pressure=&type=map&location=coordinates&detail=&detailLat=<?php echo Config::Get('WINDY_LAT_PROFILE');?>&detailLon=<?php echo Config::Get('WINDY_LNG_PROFILE');?>&metricWind=mph&metricTemp=%C2%B0F&radarRange=-1" frameborder="0"></iframe>
				<p class="text-muted"> iCrew Systems &copy; <?php echo date("Y"); ?> <br><small>Powered by <a href="http://windytv.com">windyty.com</a></small> </p>
			</div>
		</div>
		
		
</div>
	

		
<!-- END Metar ICAO  Block -->