Jump to content

Recommended Posts

  • 2 weeks later...
Posted

1ST SEARCH in this post 3rd page its this:

So ... we have in CORE/COMMON/FSCalculator/FCalculator.class.php :

<?php

class FCalculator extends CodonData

{

public function findaircraft()

{

$sql = "SELECT DISTINCT name FROM".TABLE_PREFIX."aircraft";

return DB::get_results($sql);

}

You must edit /replace the RED line with : $sql = "SELECT * FROM phpvms_aircraft";

And thats all !! Hope to be a solution for all and not only for my ..PC/phpvms sistem

Posted

1ST SEARCH in this post 3rd page its this:

So ... we have in CORE/COMMON/FSCalculator/FCalculator.class.php :

<?php

class FCalculator extends CodonData

{

public function findaircraft()

{

$sql = "SELECT DISTINCT name FROM".TABLE_PREFIX."aircraft";

return DB::get_results($sql);

}

You must edit /replace the RED line with : $sql = "SELECT * FROM phpvms_aircraft";

And thats all !! Hope to be a solution for all and not only for my ..PC/phpvms sistem

working now. thanks.

  • 3 months later...
  • Moderators
Posted

is there a way to short the airplanes?? for example our va has 4 A318, 4 A320 etc..in the dropdown menu is it possible to saw only one A318???

It's already there. There must be a slight difference between the aircraft names that causes that.

  • 1 month later...
Posted

i uploaded all files. - O.K.

made database import. - O.K.

but:

Make a link to access it by <?php echo url('fuelcalculator');?> for your pilots.

Where should i make a link...in which file?

  • Moderators
Posted

i uploaded all files. - O.K.

made database import. - O.K.

but:

Make a link to access it by <?php echo url('fuelcalculator');?> for your pilots.

Where should i make a link...in which file?

layout.php in your top nav menu

  • 5 months later...
Posted
On 19/11/2013 at 10:42 PM, maaneken_pis said:

Hello guys ....

I had the same problem ... no aircrafts listed at "SET PARAMETERS".

I solved in my way ... and at lest for me ..works !

So ... we have in CORE/COMMON/FSCalculator/FCalculator.class.php :

<?php

class FCalculator extends CodonData

{

public function findaircraft()

{

$sql = "SELECT DISTINCT name FROM".TABLE_PREFIX."aircraft";

return DB::get_results($sql);

}

You must edit /replace the RED line with : $sql = "SELECT * FROM phpvms_aircraft";

And thats all !! Hope to be a solution for all and not only for my ..PC/phpvms sistem

Thanks now ready there worked

  • 5 months later...
  • Moderators
Posted
11 hours ago, Txmmy83 said:

what would be the right multiplicator for a 1hour 15 fuelreserve?

Open fuelcalculator.php in module folder and look for the following:

$flndg = $fuelhr * 3/4;

1 hr 15 minutes would be 75 minutes which is "$fuelhr * 1.25 ", so change "fuelhr * 3/4" to that every where you see the code line

Posted
On 13.9.2013 at 4:03 PM, mischka said:

You can get the fuel flow from your own PIREPS. Once you have 20-30 pireps per aircraft type it should be reliable enough. Obviously the more pireps the more reliable the calculations will be.

I use the following code to update a field "fuelflow" in my aircraft table:

 


function CalcFuelFlows ()
{
 $sql="select icao, count(icao) amount, sum(fuelused) totalfuelused, sum(duration) totalduration, sum(fuelused)/sum(duration) average from  (";
 $sql=$sql." SELECT aircraft,  icao, fuelused, flighttime_stamp, hour(flighttime_stamp)+ (minute(flighttime_stamp)/60) duration";
 $sql=$sql." FROM `ACS_pireps`, ACS_aircraft";
 $sql=$sql." WHERE ACS_pireps.aircraft=ACS_aircraft.id and ACS_aircraft.fuelflow<>0) pireps group by icao";
 $averages = DB::get_results($sql);

 foreach($averages as $aircraft)
  {
   $sql="update `ACS_aircraft` set fuelflow=".$aircraft->average." WHERE icao='".$aircraft->icao."'";
   DB::query($sql);
   echo "<br>".$sql;
  }
 return "success";
}
 

 

That will set the average fuel flow for each aircraft type. You can then calculate the amount of fuel you need depending on the trip length plus an hour reserve and some hold/taxi fuel.

Note that if your phpvms counts fuel in Lb than these values will be in Lb, if you set it in KG it'll be in KG.

Note also if you want to use this for your system you must change the tablename prefix from ACS_ to whatever you have.

where to put this function?

  • 2 months later...
Posted

Could you explain in english for me please lol  where do i put this "FCalculator::CalcFuelFlows();"   in the Fuelcalculator.php in module inside index()

do i just paste this in or do i add it as a $param = FCalculator::CalcFuelFlows();

 

thank you

  • Moderators
Posted
On 12/21/2017 at 5:00 AM, Booagce said:

Could you explain in english for me please lol  where do i put this "FCalculator::CalcFuelFlows();"   in the Fuelcalculator.php in module inside index()

do i just paste this in or do i add it as a $param = FCalculator::CalcFuelFlows();

 

thank you

No! just paste it as is. Just so you know, if you assign it to a parameter then it will not be executed on page load. Basically, you would assign a value to a parameter to use it somewhere else :D

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