Jeff Posted April 9, 2011 Report Share Posted April 9, 2011 I have edited this code until I was blue in the face . I can't seem to figure out how to remove the code (AA - American Airlines) and have it list the airlines alphabetically... American Airlines British Airways Continental Airlines ...and so on <dt>Select Airline: <font color="#FF0000">*</font></dt> <dd> <select name="code" id="code"> <?php foreach($allairlines as $airline) { echo '<option value="'.$airline->code.'">'.$airline->code.' - ('.$airline->name.')</option>'; } ?> </select> </dd> Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 9, 2011 Moderators Report Share Posted April 9, 2011 Have a look in the sql statement and change that. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted April 9, 2011 Moderators Report Share Posted April 9, 2011 If i remember right its in the core -> Common-> RegistrationData.class Quote Link to comment Share on other sites More sharing options...
Jeff Posted April 9, 2011 Author Report Share Posted April 9, 2011 I looked in there prior to posting, but couldn't find anything that even resembles AIRLINE(s) Snipped by Nabeel Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 11, 2011 Administrators Report Share Posted April 11, 2011 Remove this peice: '.$airline->code.' So it's: <dt>Select Airline: <font color="#FF0000">*</font></dt> <dd> <select name="code" id="code"> <?php foreach($allairlines as $airline) { echo '<option value="'.$airline->code.'">'.$airline->name.'</option>'; } ?> </select> </dd> Sorting should be alpha by default Quote Link to comment Share on other sites More sharing options...
Jeff Posted April 12, 2011 Author Report Share Posted April 12, 2011 Nabeel, that's what I did earlier, but it's not showing in alphabetical order... Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 12, 2011 Administrators Report Share Posted April 12, 2011 I think there's a sort order in the local.config file for the airlines Quote Link to comment Share on other sites More sharing options...
Jeff Posted April 12, 2011 Author Report Share Posted April 12, 2011 It's neither in the local.config nor in app.config Quote Link to comment Share on other sites More sharing options...
Jeff Posted April 26, 2011 Author Report Share Posted April 26, 2011 Anything yet? Quote Link to comment Share on other sites More sharing options...
Nuclear Posted April 26, 2011 Report Share Posted April 26, 2011 The SQL is in the getAllAirlines() function in OperationsData.class: if($all_airlines === false) { $sql = 'SELECT * FROM ' . TABLE_PREFIX ."airlines $where} ORDER BY `code` ASC"; $all_airlines= DB::get_results($sql); CodonCache::write($key, $all_airlines, 'long'); } You could change the ORDER BY clause, but I don't know if that might break something somewhere else. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 26, 2011 Administrators Report Share Posted April 26, 2011 Where it says `code` Change it to `name` Quote Link to comment Share on other sites More sharing options...
Jeff Posted April 26, 2011 Author Report Share Posted April 26, 2011 Thank you Michael and Nabeel, that did the trick. I was actually looking in the right file, but couldn't figure out which one it was to change. 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.