Jump to content

Schedules search on frount page


chris2

Recommended Posts

  • Moderators

If you have simpilot's ScheduleSearch.... simply put this code in your frontpage anywhere. Whenever someone enters the params on what flights they look for, it'll go to the page with list of schedules.

<?php
$airports = OperationsData::GetAllAirports());
$airlines = OperationsData::getAllAirlines());
$aircrafts = FrontSchedulesData::findaircrafttypes());
$countries = FrontSchedulesData::findcountries());
?>
<form action="<?php echo url('/FrontSchedules');?>" method="post" enctype="multipart/form-data">
<table width="100%" cellpadding="10px">
<tr>
<td>Select An Airline</td>
<td>
<select class="search" name="airline">
<option value="">All</option>
<?php
foreach ($airlines as $airline)
{echo '<option value="'.$airline->code.'">'.$airline->name.'</option>';}
?>
</select>
</td>
</tr>
<tr>
<td>Select An Aircraft Type</td>
<td>
<select class="search" name="aircraft">
<option value="">All</option>
<?php
foreach ($aircrafts as $aircraft)
{echo '<option value="'.$aircraft->icao.'">'.$aircraft->icao.'</option>';}
?>
</select>
</td>
</tr>
<tr>
<td>Select A Departure Airfield</td>
<td>
<select class="search" name="depicao">
<option value="">All</option>
<?php
foreach ($airports as $airport)
{echo '<option value="'.$airport->icao.'">'.$airport->icao.' - '.$airport->name.'</option>';}
?>
</select>
</td>
</tr>
<tr>
<td>Select An Arrival Airfield</td>
<td>
<select class="search" name="arricao">
<option value="">All</option>
<?php
foreach ($airports as $airport)
{echo '<option value="'.$airport->icao.'">'.$airport->icao.' - '.$airport->name.'</option>';}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input type="hidden" name="action" value="findflight" />
<input type="submit" name="submit" value="Search For A Flight" />
</td>
</tr>
</table>
</form>

OR!!!

If you want want a simple code...

<?php MainController::Run('FrontSchedules', 'index'); ?>

Remember, if you use that code, and you change the TPL file for it, it'll change for the frontpage as well.

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