I have three airlines in my VA, AVA,AVC and AVE, i’m trying to search for only schedules by each of them using this code, but i cant get it to work and i’m kinda tying myself up losing where i’m at. I know its fairly simple but i’m passed that stage.
I have seen daves add on, however i could not get it to display the aircraft selection properly. i just kept getting Airport Icao’s when i tried to search by aircraft.
(i changed in frontscheduledata.class line 38
$query = "SELECT DISTINCT icao
to
$query = "SELECT DISTINCT name
but now i get an error poining to this line in the frontschedlue.php of daves addon
The $allairlines variable must be empty. How are you supplying the data to that in the module? Try a print_r($allairlines) at the start of your template to see if there is anything in the variable. If that is not printing anything out then start working your way back through the module and then the data class to see where the variable is being dropped.
The $allairlines variable must be empty. How are you supplying the data to that in the module? Try a print_r($allairlines) at the start of your template to see if there is anything in the variable. If that is not printing anything out then start working your way back through the module and then the data class to see where the variable is being dropped.
Out of my depth i think.
i looked into the module/schedules/shedules.php which gives this.
If you look in Schedules.php and follow the function that gives you the results for the schedules index you will find that it ends up using the
showSchedules()
function. There is no data call for getting the information for your airlines within that function. You will have to add the data call and assign it to a variable in your template. ie - $allairlines
I entered that into schdules.php but got a syntax error, i changed it slightly and now have the form popluated with all the airlines, so thats sorted,
however when selecting an individual airline, it just returns ALL flights from ALL airlines, so the actual search funtion for each airline isn’t working.
Heres what i changed the schedules.php to.
public function showSchedules()
{
$depapts = OperationsData::GetAllAirports();
$equip = OperationsData::GetAllAircraftSearchList(true);
$airline = OperationsData::GetAllAirlines();
$this->set('allairlines', $airline);
$this->set('depairports', $depapts);
$this->set('equipment', $equip);
$this->render('schedule_searchform.tpl');
You are going to have to intergrate a new search function into the js for that panel. You may be able to use parts of the module I wrote for schedule searches for airline sand airframes here ->
i think that will be way passed my skill level, i hoped that i could just copy the initial format as i posted in the first post to make this work, but it’s clearly not that easy.
i tried to incorporate some of your code from frontschedules.php but failed miserably.
failed almost fatally, ended up none of my pilots could file a pirep and all schedules dissapeared, don’t know what i did but luckily a backup provided an escape.
i’m looking now at the common/schedules/schedulesdata.class.php and from reading nabeels comments in there i need to add something to the findflights part.
i cobbled together this, but still no luck in the actual search function working.
Dave, your frontschedules module works for me (as you directed in the posts above) however the search by aircraft type just displays the ICAO of airports in my list.
I’d be happy just to get either one working correctly without me messing it up again.
You are going to have to intergrate a new search function into the js for that panel. You may be able to use parts of the module I wrote for schedule searches for airline sand airframes here ->
Dave, by this do you mean the Java Script? I’m still struggling with this airline search function.
Ok in SchedulesDataClass i noticed that there was no search for the airline in the public function.
It appears that the airline is searched for using “s.code” is this correct?
i added the s.code as airline in the mysql queury added what i think should go but i’m probably way out. as it still doesnt search for the airline.
public static function findSchedules($params, $count = '', $start = '')
{
$sql = 'SELECT s.*,
a.id as aircraftid, s.code as airline, a.name as aircraft, a.registration,
a.minrank as aircraft_minrank, a.ranklevel as aircraftlevel,
dep.name as depname, dep.lat AS deplat, dep.lng AS deplng,
arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng
FROM '.TABLE_PREFIX.'schedules AS s
LEFT JOIN '.TABLE_PREFIX.'airports AS dep ON dep.icao = s.depicao
LEFT JOIN '.TABLE_PREFIX.'airports AS arr ON arr.icao = s.arricao
LEFT JOIN '.TABLE_PREFIX.'airline AS air ON s.code = s.code
LEFT JOIN '.TABLE_PREFIX.'aircraft AS a ON a.id = s.aircraft ';
This is really getting me down now, i have tried lots of trial and error and reading up of the API DOCS, to no avail.
i should clarify that whilst i state it doesnt search each individual airline, it does bring all the airlines up.
I have 2 airline codes in my schedules and they both search fine by selecting the airline, sorry to sound a but stupid but have you tried a copy and paste from the default template in to yours and adapt that? Or even still trying with the default skin see if its doing what you want.