<h3>Edit Leg</h3>
Note that ALL Fields on this page MUST be filled! If you leave any fields blank there is a chance that you experience errors with the tour.

<form method="POST" action="<?php echo SITE_URL ?>/admin/index.php/tourcenter/saveeditleg">
<table width="100%" cellspacing="2px" style="background:#f0f0f0">
<tr>
<td rowspan="3" width="50px">Leg <?php echo $leg->legid ?></td>
<td>Departure Airport:<br />
<select name="depicao">
<?php if($airports) foreach($airports as $apt) { if($apt->icao == $leg->depicao) { $sel5 = "selected"; } ?>
<option value="<?php echo $apt->icao ?>" <?php echo $sel5 ?>><?php echo $apt->icao ?> - <?php echo $apt->name ?></option>
<?php $sel5 = ""; } ?>
</select>
</td>
<td>Departure Time (hh:mm):<br /><input type="text" name="deptime" value="<?php echo $leg->deptime; ?>" required/></td>
<td>Flighttime (hh:mm):<br /><input type="text" name="flighttime" value="<?php echo $leg->flighttime; ?>" required/></td>
<td>Altitude:<br /><input type="text" name="flightlevel" value="<?php echo $leg->flightlevel; ?>" required/></td>
</tr>
<tr>
<td>Arrival Airport:<br />
<select name="arricao">
<?php if($airports) foreach($airports as $apt) { if($apt->icao == $leg->arricao) { $sel6 = "selected"; } ?>
<option value="<?php echo $apt->icao ?>" <?php echo $sel6 ?>><?php echo $apt->icao ?> - <?php echo $apt->name ?></option>
<?php $sel6 = ""; } ?>
</select>
</td>
<td>Arrival Time (hh:mm):<br /><input type="text" name="arrtime" value="<?php echo $leg->arrtime; ?>" required/></td>
<td>Distance:<br /><input type="text" name="distance" value="<?php echo $leg->distance; ?>" required/></td>
<td>Ticket Price:<br /><input type="text" name="price" value="<?php echo $leg->price; ?>" required/></td>
</tr>
<tr>
<td colspan="2">
Flight Route:<br />
<textarea name="route" style="width:500px; height:100px;"><?php echo $leg->route; ?></textarea>
</td>
<td colspan="2">
Leg Description:<br />
<textarea name="legdescription" style="width:500px; height:100px;"><?php echo $leg->legdescription; ?></textarea>
</td>
</tr>
</table>

<br /><br />
<input type="hidden" name="id" value="<?php echo $leg->id; ?>" />
<input type="hidden" name="tourid" value="<?php echo $leg->tourid; ?>" />
<div style="margin: 0 auto;">
<input type="submit" name="submit" value="Edit Leg" />
</div>
</form>
<br /><br />