Jump to content

is it possible?


Txmmy83

Recommended Posts

  • Moderators

yes it's possible. You need to get the route's aircraft, put it in a function to see if it's enabled. The results will be 0 for disabled or 1 for enabled then you say if the route's aircraft enabled is equal to 0 (disabled) then continue showing the next route meaning hiding the route from the results. :D

Link to comment
Share on other sites

  • Moderators

Try this:

1. In your OperationsData.class.php add the following function:


public function get_aircraft_by_name($name)
 {
  $sql = "SELECT * FROM phpvms_aircraft WHERE name='$name'";
  return DB::get_row($sql);
 }

2. In your schedule_results.tpl after "foreach" loop add the following:


$enable = OperationsData::get_aircraft_by_name($route->aircraft);

if($enable->enabled == "0")
  {
  continue;
  }

I have not tested this so just give it a try and if it has an issue let me know. ;)

  • Like 1
Link to comment
Share on other sites

  • Moderators

The code is looking for all aircraft that has the same name and checks if they're enabled or disabled, so I think it should work just fine with aircraft name. Check if Nigeria aircraft has the same name as "B737-700" if not change it so that it works. ;)

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