Jump to content

Request: fuel calculation on pilot briefing


hjhjhgjgjh

Recommended Posts

  • Administrators

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;

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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';

                    }

               

?>

Link to comment
Share on other sites

  • 3 years later...

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?

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