Jump to content

Recommended Posts

Posted

I have edited this code until I was blue in the face :unsure:. 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>

  • Administrators
Posted

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

  • 2 weeks later...
Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...