tutmeister Posted September 8, 2011 Report Share Posted September 8, 2011 When searching for a route, the default schedule search when searching under destination and arrival airports shows a HTML select with options for each all airports. As we have 23000+ airports, this causes a huge unnecessary burden on our system. We'd like to limit the search to airports served by our routes only, so could someone help me with the code for this? I've looked through the API, but I don't have a test install environment right now, so can't afford to screw it up! Quote Link to comment Share on other sites More sharing options...
tutmeister Posted September 9, 2011 Author Report Share Posted September 9, 2011 OK, I believe I have solved my own question. In Core/Modules/Schedules/Schedules.php on Line 161, change: $depapts = OperationsData::GetAllAirports(); to read: $depapts = SchedulesData::getDepartureAirports(UV); $arrapts = SchedulesData::getArrivalAiports(UV); Where UV is your airline code. In lib/skins/yourtheme/schedule_searchform.tpl, change starting on line 32: <?php if(!$depairports) $depairports = array(); foreach($depairports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao .' ('.$airport->name.')</option>'; } ?> To read: <?php if(!$arrairports) $arrairports = array(); foreach($arrairports as $airport) { echo '<option value="'.$airport->icao.'">'.$airport->icao .' ('.$airport->name.')</option>'; } ?> Quote Link to comment Share on other sites More sharing options...
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.