I got no idea … but it looks good ;D
okay the 4512 (well changes for every aircraft) is the fuel flow per hour. you have to check the internet to get accurate date for every aircraft. then, flighttime multiplied with 100 / 60 to get everything in minutes (because you have values like 1.5 which is not 1,5 hours… its 1 hours 50 minutes and so on…) than, those + 1000 (again depending on the aircraft) is the “extrafuel” or reserves or whatever you will call it
for the fuel flow, i just took values for aircrafts on FL300 so you really have to change those if you have something like an ATR or jetstream in your fleet as they will never reach that level. I am the whole time flying with those calculations and those are at least working very well for me. I will make an update soon, so it will automatically write the config from the aircrafts in your fleet list,.. also i will use more accurate data from burn tables and so on but thats future.. i am not a professional web developer and so i need to find out how to do that first.
and @ James200410:
be carefull.. you cant just replace those kg with lbs and thats it, you have to change the fuel flow than to lbs/h
and @ James200410:
be carefull.. you cant just replace those kg with lbs and thats it, you have to change the fuel flow than to lbs/h
lol thanks mate, I understand, its not on the live site, I need to go and set it up for my particular fleet, I was just amazed that I got it to work as Im not real good with all this php stuff ;D
Thanks again and looking forward to your future updates.
Regards
Adam
as is getting the JA’re running MYSQL
see
now is that I will break your head to make it work
help
<td><?php
if($schedule->flighttime == 0)
{
echo ‘no fuel data available’;
}
elseif($schedule->flighttime <= 1.0)
{
if <?php “{$schedule->aircraft}”; ?>')
{
$result = <?php “{$schedule->aircraft==$aircraft->fuelh}”; ?> * ($schedule->flighttime * 100 / 60) + <?php “{$schedule->aircraft==$aircraft->fuelr}”; ?>;
}
}
elseif($schedule->flighttime >= 1.01)
{
elseif($schedule->aircraft==‘<?php “{$schedule->aircraft}”; ?>’)
{
$result = <?php “{$schedule->aircraft==$aircraft->fuelh}”; ?> * ($schedule->flighttime * 100 / 60) + <?php “{$schedule->aircraft==$aircraft->fuelr}”; ?>;
}
}
else
{
echo’invalid information provided’;
}
if($schedule->flighttime > 0)
{
echo round ($result,-2);
echo ’ kg - this includes fuel for taxi and reserves’;
}
?></td>
how do I get data from mysql this aircraft.
CAUTION!!! DO NOT USE THE SYSTEM UNTIL I SAY SO
i made a big mistake which i try to solve at the moment. before i start, i will write some modul soon so its easier to change everything but i am not done yet. here is the mistake
my calculation in that system goes like that: “Fuelflow * time + reserves” The mistake is in the time. I am calculating with HH.MM which means if you have 2 hours 40 minutes, it will automatically calculate 2.4 and not 2,666667 hours.
Here is the new code i made. First i added this line
$ftinhours = explode(“:”, “$schedule->flighttime”);
behind the first row of that fuel calculation so it looks like that
<?
$ftinhours = explode(“.”, “$schedule->flighttime”);
…
then the calculation has to look like that:
$result = 8000 * $ftinhours[0] + 8000 * ($ftinhours[1] * 100 / 60) + 3000;
in my case, i took the MD11 which has a fuel flow of 8000kg per hour. the flight was 2 hours and 40 minutes and i put in reserves of 3000 so this is what the calculation looks like:
8000 * 2 + 8000 *(40 * 100 / 60 ) + 3000
but this doesnt work correctly.. what do i do wrong :S
edit: okay i think i will start from the beginning and try to write something like a clean code with modules and stuff. it will be done within the next 48 hours.
okay thats what i have so far. i removed the whole code and now i added one line to the table phpvms_aircraft which is called “fuelflow” here is the code but still, something is wrong cause it always shows 0 in the calculation. (i filled the mysql table with 3000 all the row down)
<?php
$flighttime = explode(“.”, “$schedule->flighttime”);
$flightminutes1 = $flighttime[1] / 60;
$fuelhours0 = $fuelflow * $flighttime[0];
$fuelminutes = $fuelflow * $flightminutes1;
$fuelflow=“SELECT fuelflow FROM aircraft WHERE id $aircraft-schedule”;
$result = $fuelhours + $fuelminutes;
if($schedule->flighttime == 0)
{
echo ‘no fuel data available’;
}
else
{
echo round ($result,-2);
echo ’ kg - this includes fuel for taxi and reserves’;
}
?>
as is getting the JA’re running MYSQL
see
[fuel.v1.0.zip](< base_url >/applications/core/interface/file/attachment.php?id=74)
then only this cumin to myql to the table to be easier to configure each aircraft i add the aircraft and it puts the fuel to spend hours just by what I now have to do this part are you doing I’m trying here too ok let go and that we will know aogem help us.
yea i just tried your way but it always shows zero ???
I have not included flighttime in the schedule so I simply made it a value * distance + reserve = fuel .
Remember that for short flights, fuel per mile will be higher than for long flights because of climb/cruise time, so you have to balance the number a bit.
that does not help really if you dont post how
Your query is wrong:
$fuelflow=“SELECT fuelflow FROM aircraft WHERE id $aircraft-schedule”;
Should be
$fuelflow="SELECT fuelflow FROM ".TABLE_PREFIX.“aircraft WHERE id $aircraft-schedule”;
Also, you didn’t actually runt he query, it would be (fill in the aircraft_id) variable
$sql ="SELECT fuelflow FROM ".TABLE_PREFIX.“aircraft WHERE id= {$aircraft_id}”;
$result = DB::get_row($sql);
$fuelflow = $result->fuelflow;
Ok here is an example of my solution:
<!-- Fuel -->
<tr style="background-color: #333; color: #FFF;">
<td colspan="2">Fuel</td>
</tr>
<tr>
<td colspan="2" style="padding: 6px;">
Estimated fuel for this flight including 1 hour of reserves: <B><?php
{
if($schedule->aircraft=='B737-X00')
{
$result = 5.8 * ($schedule->distance) + 2100;
}
elseif($schedule->aircraft=='B737-800')
{
$result = 4.0 * ($schedule->distance) + 2500;
}
elseif($schedule->aircraft=='MD80')
{
$result = 6.5 * ($schedule->distance) + 3000;
}
}
echo round ($result,-2);
echo ' kg';
?> </B><BR>
Remember this is only basic fuel estimate, for more precise fuelplanning use <a href="http://www.volny.cz/fs2002/B737FPL/B737FPL.htm" target="_frame">B737 fuelplanner</a> or Software like <a href="http://www.fsbuild.com" target="_frame">FSBUILD</a>
</td>
</tr>
If you include a trigger on short/long flight distances you could get it even more precise, but have not tried it yet. These figures above are where pesimistic and you should have plenty of fuel. These figures are for KG * KM + “KG for 1HR” It was based on our statistics, but need more tuning.
okay i have a lot of code but i dont get it in another way. thats how it works and if someone can put that into a modul or something, it would be nice. otherwise i will continue and use that. (the values below are only examples)
<?php
/**
*Fuelflow Table
*/
$fuelflowMD11 = 5500;
$fuelflowDC10 = 3500;
$fuelflowB732 = 3500;
$fuelflowB734 = 3500;
$fuelflowB738 = 3500;
$fuelflowB742 = 3500;
$fuelflowB744 = 3500;
$fuelflowA300 = 3500;
$fuelflowA310 = 3500;
$fuelflowE170 = 3500;
$fuelflowE190 = 3500;
/**
*Reserves Table
*/
$reservesMD11 = 2500;
$reservesDC10 = 3000;
$reservesB732 = 3000;
$reservesB734 = 3000;
$reservesB738 = 3000;
$reservesB742 = 3000;
$reservesB744 = 3000;
$reservesA300 = 3000;
$reservesA310 = 3000;
$reservesE170 = 3000;
$reservesE190 = 3000;
if($schedule->aircraft == ‘MD MD-11’)
{
$fuelflow = $fuelflowMD11;
$reserves = $reservesMD11;
}
elseif($schedule->aircraft == ‘MD DC-10’)
{
$fuelflow = $fuelflowDC10;
$reserves = $reservesDC10;
}
elseif($schedule->aircraft == ‘’)
{
$fuelflow = $fuelflowACCODE;
$reserves = $reservesACCODE;
}
elseif($schedule->aircraft == ‘’)
{
$fuelflow = $fuelflowACCODE;
$reserves = $reservesACCODE;
}
elseif($schedule->aircraft == ‘’)
{
$fuelflow = $fuelflowACCODE;
$reserves = $reservesACCODE;
}
elseif($schedule->aircraft == ‘’)
{
$fuelflow = $fuelflowACCODE;
$reserves = $reservesACCODE;
}
elseif($schedule->aircraft == ‘’)
{
$fuelflow = $fuelflowACCODE;
$reserves = $reservesACCODE;
}elseif($schedule->aircraft == ‘’)
{
$fuelflow = $fuelflowACCODE;
$reserves = $reservesACCODE;
}
elseif($schedule->aircraft == ‘’)
{
$fuelflow = $fuelflowACCODE;
$reserves = $reservesACCODE;
}
elseif($schedule->aircraft == ‘’)
{
$fuelflow = $fuelflowACCODE;
$reserves = $reservesACCODE;
}
$flighttime = explode(“.”, $schedule->flighttime);
$flmin = $flighttime[1] / 60;
$flhou = $flighttime[0];
$fuelhours = $fuelflow * $flhou;
$fuelminutes = $fuelflow * $flmin;
$result = $fuelhours + $fuelminutes + $reserves;
if($fuelflow == ‘0’)
{
echo ‘no fuel data available (no a/c fuelflow data)’;
}
elseif($schedule->flighttime == ‘0’)
{
echo ‘<b>’.‘no aircraft performance data available’.‘</b>’;
}
elseif($schedule->flighttime >=‘0.00001’)
{
if($result == ‘0’)
{
echo ‘<b>’.‘no aircraft performance data available’.‘</b>’;
}
else
{
echo round ($result,-2);
echo ’ kg - this includes ';
echo $reserves;
echo ’ kg for taxi and reserves’;
}
}
else
{
echo ‘fail’;
}
?>
hi guys i keep getting this error Warning : call_user_func_array() expects parameter 1 to be a valid callback, class ‘Operations’ does not have a method ‘aircraft’ in /home/jetvcom/public_html/en/core/classes/MainController.class.php on line 218
when i go to look at my fleet
any ideas what could be causeing this?