chris2 Posted March 16, 2012 Report Posted March 16, 2012 Hi, I have been trying to get a schedules search function on my frount page, however i have not been able to find out a way. Does anyone know how to do this. thanks chris Quote
Moderators Kyle Posted March 16, 2012 Moderators Report Posted March 16, 2012 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. Quote
chris2 Posted March 16, 2012 Author Report Posted March 16, 2012 Thanks Kyle, i will give it a go chris Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.