Jeff Posted April 9, 2011 Report 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
Moderators mark1million Posted April 9, 2011 Moderators Report Posted April 9, 2011 Have a look in the sql statement and change that. Quote
Moderators mark1million Posted April 9, 2011 Moderators Report Posted April 9, 2011 If i remember right its in the core -> Common-> RegistrationData.class Quote
Jeff Posted April 9, 2011 Author Report 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
Administrators Nabeel Posted April 11, 2011 Administrators Report 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
Jeff Posted April 12, 2011 Author Report Posted April 12, 2011 Nabeel, that's what I did earlier, but it's not showing in alphabetical order... Quote
Administrators Nabeel Posted April 12, 2011 Administrators Report Posted April 12, 2011 I think there's a sort order in the local.config file for the airlines Quote
Jeff Posted April 12, 2011 Author Report Posted April 12, 2011 It's neither in the local.config nor in app.config Quote
Nuclear Posted April 26, 2011 Report 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
Administrators Nabeel Posted April 26, 2011 Administrators Report Posted April 26, 2011 Where it says `code` Change it to `name` Quote
Jeff Posted April 26, 2011 Author Report 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
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.