Jeff
April 9, 2011, 10:14pm
1
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>
Have a look in the sql statement and change that.
If i remember right its in the core -> Common-> RegistrationData.class
Jeff
April 9, 2011, 10:36pm
4
I looked in there prior to posting, but couldn’t find anything that even resembles AIRLINE(s)
Snipped by Nabeel
nabeel
April 11, 2011, 4:32pm
5
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
Jeff
April 12, 2011, 12:35am
6
Nabeel, that’s what I did earlier, but it’s not showing in alphabetical order…
nabeel
April 12, 2011, 1:34am
7
I think there’s a sort order in the local.config file for the airlines
Jeff
April 12, 2011, 3:25am
8
It’s neither in the local.config nor in app.config
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.
Jeff
April 26, 2011, 3:31pm
12
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.