<?php if(!$airport && $action == 'editairport') { echo "Not found in Database! You need to first add this airport."; return; }?>

<h3>Airport Form - <?php echo $airport->icao; ?></h3>

<form name="charterops" action="<?php echo SITE_URL; ?>/admin/index.php/CharterOps/airportaction" method="post">
<table width="100%" cellspacing="10px">
<tr></tr>
<tr>
<td valign="top" style="font-weight:bold">Airport Icao*:</td>
<td><input type="text" name="icao" maxlength="5" value="<?php echo $airport->icao;?>" />
<br />
</td>
</tr>
<tr>
<td valign="top" style="font-weight:bold">Airport Name*:</td>
<td><input type="text" name="name" value="<?php echo $airport->name;?>" />
<br />
</td>
</tr>
<tr>
<td valign="top" style="font-weight:bold">Latitude*:</td>
<td><input type="text" name="latitude" value="<?php echo $airport->latitude;?>" />
<br />
</td>
</tr>
<tr>
<td valign="top" style="font-weight:bold">Longitude*:</td>
<td><input type="text" name="longitude" value="<?php echo $airport->longitude;?>" />
<br />
</td>
</tr>
<tr>
<td valign="top" style="font-weight:bold">Elevation in ft*:</td>
<td><input type="text" name="elevation" value="<?php echo $airport->elevation;?>" />
<br />
</td>
</tr>
<tr>
<td valign="top" style="font-weight:bold">Runway Length in ft*:</td>
<td><input type="number" name="runwaylength" maxlength="6" value="<?php echo $airport->runwaylength;?>" />
<br />
Only the length of the longest runway is required.
</td>
</tr>
<tr>
<td valign="top" style="font-weight:bold">City*:</td>
<td><input type="text" name="city" value="<?php echo $airport->city;?>" />
<br />
</td>
</tr>

<tr>
<td valign="top" style="font-weight:bold">Country:</td>
<td>
<select name="country" >
              <?php 
                
                         foreach($countries as $country) { 
                      
                         if($country->countrycode == $airport->countrycode) { $seltd = 'selected'; }
                      
                        ?>
                         
                         
				      <option value="<?php echo $country->countrycode ?>:<?php echo $country->countryname ?>" <?php echo $seltd ?>><?php echo $country->countryname ?></option>
<?php $seltd =''; } ?>
                
 </select>
<br />
 </td>
</tr>
<tr>
<td><input type="hidden" name="id" value="<?php echo $airport->id;?>" />
<input type="hidden" name="action" value="<?php echo $action;?>" />
</td>
<td><input type="submit" value="Save Airport Data"></td>
</tr>
</table>
</form>
<?php if($action == 'editairport') { ?>
<hr />

<h3>Delete</h3>

<a href="<?php echo SITE_URL; ?>/admin/index.php/CharterOps/deleteairport/<?php echo $airport->id;?>">Delete <?php echo $airport->icao;?> from Charters</a>

<?php } ?>


















