Jump to content

Schedule Search in sidebar


truemo9

Recommended Posts

Guest lorathon

The select drop down width is based on the largest option. I would just have the airport ICAO or Name. You could also style the select for a specific width.

Link to comment
Share on other sites

There you go. That should do it. Does it still say YOUR CURRENT LOCATION, or did it change back to ALL?

Also, when you choose the Departure Airport, you don't have to choose the Arrival. You can leave it alone and when you click Search it will show all flights out of that airport, and vice-versa.

Link to comment
Share on other sites

Anyone interested:

If you'd like to just show the airport names instead of the ICAO and Name, here is the edited code:

<form action="<?php echo url('/Schedules');?>" method="post" enctype="multipart/form-data">
   <table align="left" border="0" width="100%">
       <tr>
           <td width="20px"><b>Dep:</b></font></td>
           <td>
               <select class="search" name="depicao">
                   <option value="">All</option>
<?php 
if (Auth::LoggedIn()) {
   $report = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED);
   if($report) {
       echo '<option value="'.$report->arricao.'">All ('.$report->arricao.')</option>';
   }
   else {
       echo '<option value="'.Auth::$userinfo->hub.'">All ('.Auth::$userinfo->hub.')</option>';
   }
}

$airports = OperationsData::getAllAirports();
foreach ($airports as $airport) {
   echo '<option value="'.$airport->icao.'">'.$airport->name.'</option>';
}?>
               </select>
           </td>
       </tr>
           <td width="20px"><b>Arr:</b></font></td>
           <td>
               <select class="search" name="arricao">
                   <option value="">All</option>
                   <?php
                       foreach ($airports as $airport) {
                           echo '<option value="'.$airport->icao.'">'.$airport->name.'</option>';
                       }
                   ?>
               </select>
           </td>
       </tr>
       <tr>
           <td>
               <input type="hidden" name="action" value="findflight" />
               <input title="Click here to search for flights" type="submit" name="submit" value="Search" />
           </td>
       </tr>
   </table>
</form>

Link to comment
Share on other sites

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...