Jump to content
simpilot

Schedule Search (Airline, Aircraft, Arrival, Departure)

Recommended Posts

Guest itrobb

How do I customize this? e.g: I only want the departure and arrival fields, and a few custom fields that won't have any actions.

Share this post


Link to post
Share on other sites
Guest itrobb

Well.... I have been away for a week on vacation and you need to have a little patience...

Well one I was meaning the entire forum, but preferably you, and two, I am not used to forums that take a week to get a reply, I'm more used to within a few hours.

Share this post


Link to post
Share on other sites

Hi, folks!

Does anyone have an extension for this great module to add the possibility to search for the day of flight? I had some tries, but it doesn't really work for me.

So, is it possible to select the day of flight in addition to the other values or has someone already coded this?

Doesn't matter if it is not possible, would be just a nice extension :)

Kind regards

Bueno

Share this post


Link to post
Share on other sites

Hello all,

Is there a way to let the outcome be sorted on departure time rather then Flightnumber. When you use the original schedules module it looks at the config and there I changed it so the outcome has to be sorted on deptime. But in this modules it isn't workimg.

Tnx and have a great 2011

Regards,

Cor

Share this post


Link to post
Share on other sites

Dave,

I am trying go to restrict the return to enabled schedules only and aircraft would be good but more importantly enabled schedules only, I have tried putting a WHERE enabled='1' but its not making any difference, can you help please?

This is the FrontSchedulesData.class.php code that i tried it in.

<?php
//by:simpilot
//www.simpilotgroup.com
class FrontSchedulesData extends CodonData
{
   public function findschedules($arricao, $depicao, $airline, $aircraft)   {
       $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration
               FROM phpvms_schedules, phpvms_aircraft
               WHERE phpvms_schedules.depicao LIKE '$depicao'
               AND phpvms_schedules.arricao LIKE '$arricao'
               AND phpvms_schedules.code LIKE '$airline'
               AND phpvms_schedules.aircraft LIKE '$aircraft'
               AND phpvms_aircraft.id LIKE '$aircraft'";

       return DB::get_results($query);
   }

    public function findschedule($arricao, $depicao, $airline)   {
       $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration
               FROM phpvms_schedules, phpvms_aircraft
               WHERE phpvms_schedules.depicao LIKE '$depicao'
               AND phpvms_schedules.arricao LIKE '$arricao'
               AND phpvms_schedules.code LIKE '$airline'
               AND phpvms_aircraft.id LIKE phpvms_schedules.aircraft";

       return DB::get_results($query);
   }

   public function findaircrafttypes() {
       $query = "SELECT DISTINCT icao
               FROM phpvms_aircraft";

       return DB::get_results($query);
   }

   public function findaircraft($aircraft) {
       $query = "SELECT id
               FROM phpvms_aircraft
               WHERE icao='$aircraft'";

       return DB::get_results($query);
   }

   public function findcountries() {
       $query = "SELECT DISTINCT country
               FROM phpvms_airports";

       return DB::get_results($query);
   }

}

Share this post


Link to post
Share on other sites

For reference,

<?php
//by:simpilot
//www.simpilotgroup.com
class FrontSchedulesData extends CodonData
{
   public function findschedules($arricao, $depicao, $airline, $aircraft)   {
       $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration
               FROM phpvms_schedules, phpvms_aircraft
               WHERE phpvms_schedules.depicao LIKE '$depicao'
	  AND phpvms_schedules .enabled=1
               AND phpvms_schedules.arricao LIKE '$arricao'
               AND phpvms_schedules.code LIKE '$airline'
               AND phpvms_schedules.aircraft LIKE '$aircraft'
               AND phpvms_aircraft.id LIKE '$aircraft'";

       return DB::get_results($query);
   }

    public function findschedule($arricao, $depicao, $airline)   {
       $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration
               FROM phpvms_schedules, phpvms_aircraft
               WHERE phpvms_schedules.depicao LIKE '$depicao'
	  AND phpvms_schedules .enabled=1
               AND phpvms_schedules.arricao LIKE '$arricao'
               AND phpvms_schedules.code LIKE '$airline'
               AND phpvms_aircraft.id LIKE phpvms_schedules.aircraft";

       return DB::get_results($query);
   }

   public function findaircrafttypes() {
       $query = "SELECT DISTINCT icao
               FROM phpvms_aircraft";

       return DB::get_results($query);
   }

   public function findaircraft($aircraft) {
       $query = "SELECT id
               FROM phpvms_aircraft
               WHERE icao='$aircraft'";

       return DB::get_results($query);
   }

   public function findcountries() {
       $query = "SELECT DISTINCT country
               FROM phpvms_airports";

       return DB::get_results($query);
   }

}

Share this post


Link to post
Share on other sites

G'day Simpilot,

For some reason i recieve this error whenever i attempt to use you module

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/qantasvi/public_html//lib/skins/brilliancev1/<h4>Schedule Search</h4> <form action="http://qantasvirtual.com/index.php/FrontSchedules" method="post" enctype="multipart/form-data"> <table width="100%" cellpadding="10px"> <tr> <td>Select An Aircraft Type</td> <td> <select class="search" name="aircraft"> <option value="">All</option> <br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/home/qantasvi/public_html/lib/skins/brilliancev1/airport_search.tpl</b> on line <b>21</b><br /> </select> </td> </tr> <tr> <td>S in /home/qantasvi/public_html/core/classes/TemplateSet.class.php on line 96

Share this post


Link to post
Share on other sites

You need this changed in php.ini -> open_basedir restriction in effect

Ok my php.ini is empty, apparently i am meant to comment it out, but there is nothing to comment out haha. Actually it isnt completely empty, i have timezone configuraition info in there.

So how can i go about disabling this feature ?

Regards

Share this post


Link to post
Share on other sites

Ok my php.ini is empty, apparently i am meant to comment it out, but there is nothing to comment out haha. Actually it isnt completely empty, i have timezone configuraition info in there.

So how can i go about disabling this feature ?

Regards

If you do not have root access to the server you are probably going to have to conatct your host as most shared environments do not allow some configuration items in local php.ini files.

Share this post


Link to post
Share on other sites

Hi Simpilot,

I'm looking at adding the schedule search to the new website, but I'm having problems with getting the depname and arrname to show. I've checked what variables are available (depicao and arricao are). I've been trying to figure out how to get these to display in the search results. Any assistance you can offer would be very much appreciated.

Thanks,

Stuart

Share this post


Link to post
Share on other sites

Well after a couple of days trying, and many failed attempts in trying to get the airport name to be output in the schedule search results, I've finally cracked the problem

To get the airport names to appear in the search results page I used the following code on the schedules_results.tpl page:

For the departure airport name:

 <?php $field = OperationsData::getAirportInfo($route->depicao);?>
<td><?php echo $field->name;?></td>

for the arrival airport name:

<?php $field = OperationsData::getAirportInfo($route->arricao);?>
<td><?php echo $field->name;?></td>

I tried creating new queries, modules, and also templates, trying to figure out how to get around the problem, and it turns out all I needed was one extra line of code :P I knew there was a simple way but struggled finding it!

Share this post


Link to post
Share on other sites

I've also modified the departure form field, so that when a pilot is logged in, the first option in that field will be the airport they are currently located at (or their hub if they've never filed a PIREP). This means that pilots can easily view flights only from their current location, and also view all other flights too. If they want to view flights which are departing from their current location, they just select the option. If they want to view flights from other depart airports, they select them etc.

If a person viewing the page is not logged in, then this option will not appear. I think this works much better than restricting flight viewing permissions being listed by altering the schedules_result.tpl file.

Here's the code:

On the airport_search.tpl file of this addon, enter the following at the top of the page:

<?php $lastreport = PIREPData::GetLastReports(Auth::$userinfo, 1);
if(!$lastreport) {$location = Auth::$userinfo->hub; }
else {$location = $lastreport->arricao;} ?>

Then in the departure airport search field part of the same file, I made the following adjustment:

Original:

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

Amended Code:

       <tr>
           <td>Select A Departure Airfield</td>
           <td>
               <select class="search" name="depicao">
               <?php if(Auth::LoggedIn()) {echo '<option value="'.$location.'">Your Current Location</option>';}?>
                   <option value="">All</option>                   
                   <?php
                       foreach ($airports as $airport)
                           {echo '<option value="'.$airport->icao.'">'.$airport->icao.' - '.$airport->name.'</option>';}
                   ?>
               </select>
           </td>
       </tr>

The added line is:

<?php if(Auth::LoggedIn()) {echo '<option value="'.$location.'">Your Current Location</option>';}?>

Cheers,

Stuart

EDIT: I've just finished modifying the airport_search.tpl and the schedule_results.tpl files, so that if a pilot is not at the airports shown in the search results lists, then the "add to bid" (or book flight) link will not show. It also won't show for flights that are not being operated on the day, and if the pilot is not ranked high enough. I didn't want pilots not to be able to see the schedules, so that's why I modded the two files. I also had to make a change or two in the frontschedulesdata.class.php file too. Here's a couple of screens:

This is the new despatch front page. Pilots start here, and search for a flight, or view them all.

despatch1.JPG

This is the results page. I've used the Datatables js script, so I can easily paginate and sort the table columns. Notice the options, where the add to bid (book flight) isn't present.

list.JPG

Share this post


Link to post
Share on other sites

That looks unreal stuart, great job ;)

Unfortunatley, i get this issue when i attempt to search. This great little module has a bone to pick with my site, everytime i go to use it haha

Warning: Invalid argument supplied for foreach() in /home/qantasvi/public_html/lib/skins/brilliancev1/schedule_results.tpl on line 59

Share this post


Link to post
Share on other sites

Module creates a schedule search form that includes the ability to choose the airline, aircraft type, arrival field, and departure field. You can choose one or all of the parameters to find what you are looking for in your schedule database.

To install

Download and unzip

Place the files in the proper paths as structured in the download

No new sql tables or anything needed.

Copy and place the airport_search.tpl file from the core/templates folder to your skin folder and skin it to match your site.

Point your browser to mysite/index.php/FrontSchedules and start searching.

Enjoy! ;)

Hy guys is possible to customize a search schedules by Deptime?

any idea?

Share this post


Link to post
Share on other sites

im having a problem. i have all of the a/c listed in the menu, but when i select on and search for a route, it says no routes found.. example here.

Share this post


Link to post
Share on other sites

Module creates a schedule search form that includes the ability to choose the airline, aircraft type, arrival field, and departure field. You can choose one or all of the parameters to find what you are looking for in your schedule database.

To install

Download and unzip

Place the files in the proper paths as structured in the download

No new sql tables or anything needed.

Copy and place the airport_search.tpl file from the core/templates folder to your skin folder and skin it to match your site.

Point your browser to mysite/index.php/FrontSchedules and start searching.

Enjoy! ;)

Hi it's possible please,to have a code for search by dep time on schedules search?

Thank's :-D

Share this post


Link to post
Share on other sites

im having a problem. i have all of the a/c listed in the menu, but when i select on and search for a route, it says no routes found.. example here.

still having this problem... can anyone help?

Share this post


Link to post
Share on other sites

so i restored the original files and now none of the routes work... i really need help fast because no flights can be booked

Share this post


Link to post
Share on other sites
Guest

Just let all u guys know found a way to get rid of that confirm refresh stuff.

Just change all "post" commands to "get" commands. I think in the files modules/Frontschedules/Frontschedules.php and airport_search.tpl

Share this post


Link to post
Share on other sites

im having a problem. i have all of the a/c listed in the menu, but when i select on and search for a route, it says no routes found.. example here.

It is an issue for anyone running the latest beta. The variable in the template has changed to $schedule_list from $allroutes

2 options for now:

1 - Change the variable name supplied to the template in FrontSchedules.php

OR

2 - Create a dupllicate of the schedule_results.tpl file, name it something else, change the reference from $schedule_list to $allroutes in the template, and change the template being called in FrontSchedules.php.

Share this post


Link to post
Share on other sites

G'day Simpilot,

I have come back to this module in an attempt to try and get it working within my site,

everytime i attempt a search, i recieve this error:

Warning: Invalid argument supplied for foreach() in /home/qantasvi/public_html/lib/skins/brilliancev1/schedule_results.tpl on line 58

I have also noticed that no aircraft display under the aircraft list

If you can give me some advice in fixing this up, that would be greatly appreciated, as it's driving my head in haha

Cheers

Tylor

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×