# Multiple Airlines \> Search by carrier

**URL:** <https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675>\
**Category:** phpVMS Legacy Support (v2/v5)\
**Created:** [May 17, 2010, 12:42pm UTC](https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675 "2010-05-17T12:42:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloudsurferuk](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@cloudsurferuk](https://forum.phpvms.net/u/cloudsurferuk)\
**Post date:** [May 17, 2010, 12:42pm UTC](https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675/1 "2010-05-17T12:42:26Z")

</div>

Have been exploring adding search by Carrier option to the search form but struggling a bit to get it to work. Any got any suggestions for the code to add to the search form in order to search by airline code? i.e. pull out all flights for a specific airline (we have 14).

---

<div class="post-metadata">

**Author:** ![cloudsurferuk](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@cloudsurferuk](https://forum.phpvms.net/u/cloudsurferuk)\
**Post date:** [May 18, 2010, 12:16pm UTC](https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675/2 "2010-05-18T12:16:44Z")

</div>

> Have been exploring adding search by Carrier option to the search form but struggling a bit to get it to work. Any got any suggestions for the code to add to the search form in order to search by airline code? i.e. pull out all flights for a specific airline (we have 14).

I know this may be getting ignored as a similair question came up and the anser was the realschedules module. However, all I want to do is add a list by carrier (code) option to the schedule search page so a drop down box shows all airline codes, and selcted will list all flights by that airline. Nabeel, you must have a quick solution for this surely?

---

<div class="post-metadata">

**Author:** ![nabeel](https://forum.phpvms.net/user_avatar/forum.phpvms.net/nabeel/32/2971_2.png) [@nabeel](https://forum.phpvms.net/u/nabeel)\
**Post date:** [May 18, 2010, 1:32pm UTC](https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675/3 "2010-05-18T13:32:39Z")

</div>

Hey,

No quick solution, if you know PHP it’s pretty quick. But if I have the time I willl add it for the next build

I’m thinking of replacing this with the way the schedules are handled in the admin side.

---

<div class="post-metadata">

**Author:** ![cloudsurferuk](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@cloudsurferuk](https://forum.phpvms.net/u/cloudsurferuk)\
**Post date:** [May 19, 2010, 10:50am UTC](https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675/4 "2010-05-19T10:50:41Z")

</div>

> Hey,
> 
> No quick solution, if you know PHP it’s pretty quick. But if I have the time I willl add it for the next build
> 
> I’m thinking of replacing this with the way the schedules are handled in the admin side.

Yeah am ok in it, have been using this

```
<div id="airlinetab">
	<p>Select by Airline:</p>
	<select id="code" name="code">
		<option value="">Select Airline</option>
	<?php

	if(!$airline) $airline = array();
	foreach($airline as $code)
	{
		echo '<option value="'.$code->name.'">'.$code->name.'</option>';
	}

	?>
	</select>
	<input type="submit" name="submit" value="Find Flights" />
</div>

```

No list of airline codes appears in drop down though, anything obvious?

---

<div class="post-metadata">

**Author:** ![nabeel](https://forum.phpvms.net/user_avatar/forum.phpvms.net/nabeel/32/2971_2.png) [@nabeel](https://forum.phpvms.net/u/nabeel)\
**Post date:** [May 19, 2010, 1:31pm UTC](https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675/5 "2010-05-19T13:31:41Z")

</div>

I’ll add it for 937 into the stock Schedules module

---

<div class="post-metadata">

**Author:** ![cloudsurferuk](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@cloudsurferuk](https://forum.phpvms.net/u/cloudsurferuk)\
**Post date:** [May 19, 2010, 1:47pm UTC](https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675/6 "2010-05-19T13:47:55Z")

</div>

Works like a charm, top man! Have made changes to airlineSearchResults.tpl though which make it display better, and more like standard search results.

```
<table>
 <tr>
   <th>Airline</th>
   <th>Flight #</th>    
   <th>Departure</th>
   <th>Departure Time</th>
   <th>Arrival</th>
   <th>Arrival Time</th>
   <th>Distance</th>
   <th>Aircraft</th>
   <th>Options</th>
 </tr>

<?php

if (!$results)
     { ?> 
               <tr><td>No Routes Found!</td></tr>
<?php }
else
   { ?>
               <?php foreach($results as $result) 
               { 
               ?>

       <tr>
          <td><?php echo $result->code;?></td>        
          <td><?php echo $result->code.$result->flightnum;?></td>
          <td><?php echo $result->depicao;?></td>
          <td><?php echo $result->deptime;?></td>
          <td><?php echo $result->arricao;?></td>
          <td><?php echo $result->arrtime;?></td>
          <td><?php echo $result->distance;?></td>
          <td><?php echo $result->aircraft;?> (<?php echo $result->registration;?>)</td>
          <td><a id="<?php echo $result->id; ?>" class="addbid" href="<?php echo SITE_URL?>.php/Schedules/addbid/">Add to Bid</a></td>                 
      </tr>
<?php }
   } ?>

</table>

```

---

<div class="post-metadata">

**Author:** ![Jakes](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/2acd7d/32.png) [@Jakes](https://forum.phpvms.net/u/Jakes)\
**Post date:** [February 16, 2011, 12:06pm UTC](https://forum.phpvms.net/t/multiple-airlines-search-by-carrier/2675/7 "2011-02-16T12:06:15Z")

</div>

Just a quick question:

Where do I place the airlineSearch Module? I have made a new folder /core/modules/airlinesearch and placed the airlineSearch.php inside the folder, but still getting this message:

> An Error Was Encountered
> 
> The module “AIRLINESEARCH” doesn’t exist!

Any help is appreciated
