Alex Posted November 23, 2010 Report Posted November 23, 2010 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. Quote
Guest lorathon Posted November 23, 2010 Report Posted November 23, 2010 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> Quote
Alex Posted November 24, 2010 Author Report Posted November 24, 2010 Excellent, thanks it works a treat.. Cheers Lorathon Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.