<div class="cc_hubadm_content">
    <div class="cc_hubadm_box cc_hubadm_full">
    <div class="cc_hubadm_boxtitle">Airport Form <?php echo $airport->icao; ?></div>
        <form id="flashForm" action="<?php echo SITE_URL ?>/<?php echo $mloc ?>.php/HubOps/saveairport" method="post">
<table width="100%" class="cc_hubadm_tablea">
<tr>
	<td>Airport ICAO Code *</td>
<td><input id="airporticao" name="icao" type="text" value="<?php echo $airport->icao?>" /> 
	<span id="lookupicao" class="cc_hubadm_greenbutt" onclick="lookupICAO(); return false;">Look Up</span><br />
	<div id="statusbox"></div>
</td>
	</tr>
<tr>
<td>Airport Name *</td>
<td><input id="airportname" name="name" type="text" value="<?php echo $airport->name?>" /></td>
	</tr>
<tr>
<td>Country Name *</td>
<td><input id="airportcountry" name="country" type="text" value="<?php echo $airport->country?>"  /></td>
</tr>
	
	<tr>
<td>Latitude *</td>
<td><input id="airportlat" name="lat" type="text" value="<?php echo $airport->lat?>" /></td>
</tr>
	
	<tr>
<td>Longitude *</td>
<td><input id="airportlong" name="lng" type="text" value="<?php echo $airport->lng?>" /></td>
</tr>
	
	<tr>
<td>Chart Link</td>
<td><input id="chartlink" name="chartlink" type="text" value="<?php echo $airport->chartlink?>" /></td>
</tr>
		
	<tr>
<td>Fuel Price *</td>
<td><input id="fuelprice" name="fuelprice" type="text" value="<?php echo $airport->fuelprice?>" />
<p>This is the price per <?php echo Config::Get('LIQUID_UNIT_NAMES', Config::Get('LiquidUnit'))?>. Leave blank or 0 (zero) to use the default value of <?php echo Config::Get('FUEL_DEFAULT_PRICE');?> (when live pricing is disabled).</p>
</td>
			</tr>

	<tr>
<td>Live price check:</td>
<td><p id="livepriceavailable">Waiting for ICAO change...</p>
</td>
		</tr>

	<tr>
<td>Hub</td>
<?php
	if($airport->hub == '1')
		$checked = 'checked ';
	else
		$checked = '';
?>
<td><input name="hub" type="checkbox" value="true" <?php echo $checked?>/></td>
		</tr>
	
	<tr>
<td></td>
<td>
	<input type="submit" name="submit" class="cc_hubadm_greenbutt" value="Save Airport" />
</td>
</tr>
			</table>
</form>
    </div>
</div>
<?php $fuelurl = SITE_URL."/".$mloc.".php/HubOps/getfuelprice?icao="; ?>
<script type="text/javascript">
$("#airporticao").on("blur", function(){
	$.get("<?php echo $fuelurl; ?>"+$(this).val(), function(data) {
		$("#livepriceavailable").html(data);
	});
});
</script>