Jump to content

Flying from last airport (Solved)


mattsmith

Recommended Posts

  • Moderators

Oh gosh. Ok, you will have to open your schedule_results.tpl or .php file and find this:

foreach($schedule_list as $schedule) {

You might have $schedules instead of $schedule_list in your file as per your phpVMS version. Before the above code and after the php opening tag (<?php), add this:

$last_location = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED);

and below the foreach statement add this:

if($last_location->arricao != $schedule->depicao) continue;

Let us know if you come up with any issue.

Link to comment
Share on other sites

  • Moderators

Basically you can update the schedule_searchform.tpl or .php template file and completely remove the "By Departure Airport" tab considering that your pilots will only be able to view schedules departing from one specific airport only so the search by departure airport is useless.

  • Like 1
Link to comment
Share on other sites

  • Moderators

Can you try replacing:

$last_location = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED);

with this:

$last_location = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, PIREP_ACCEPTED);
$last_location = isset($last_location->arricao) ? $last_location->arricao : Auth::$userinfo->hub;

Also, replace this:

if($last_location->arricao != $schedule->depicao) continue;

with this:

if($last_location != $schedule->depicao) continue;

In case the pilot does not have any validated pirep, the system will take into consideration the pilot's hub.

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