registration_mainform.tpl edit [SOLVED]

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

I looked in there prior to posting, but couldn’t find anything that even resembles AIRLINE(s)

Snipped by Nabeel

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

Nabeel, that’s what I did earlier, but it’s not showing in alphabetical order…

I think there’s a sort order in the local.config file for the airlines

It’s neither in the local.config nor in app.config

Anything yet?

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.

Where it says

code

Change it to

name

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.