Jump to content

Only Display Scheduled Departure Airports in pirep file[SOLVED]


Alex

Recommended Posts

Hi all,

I want my pilots to only be able to file a pirep from any of my scheduled departure airfileds.

Currently a pilot can file a pirep from any airport, which creates problems for me.

The code i believe at the moment in the pireps_new.tpl is this.

<input type="text" name="depicao" value="<?php echo $_POST['depicao'] ?>" />

can someone point me in the right direction please.

Link to comment
Share on other sites

Guest lorathon

Change this field to a select by adding the following

Departing Airport

<?php $airports = OperationsData::GetAllAirports()?>
<select id="depicao" name="depicao">
<?php
if(!$airports) $airports = array();
foreach($airports as $airport)
       {
	echo '<option value="'.$airport->icao.'">'.$airport->icao.' ('.$airport->name.')</option>';
}
?>
</select>

You can do the same with Arrival Airport

Arriving Airport

<?php $airports = OperationsData::GetAllAirports()?>  <!-- if using both this can be removed on the second select.  It must come before both selects -->
<select id="arricao" name="arricao">
<?php
if(!$airports) $airports = array();
foreach($airports as $airport)
       {
	echo '<option value="'.$airport->icao.'">'.$airport->icao.' ('.$airport->name.')</option>';
}
?>
</select>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...