Jump to content

Recommended Posts

Posted

Here is what I used for the passenger flight reference:

<tr style="background-color: #333; color: #FFF;">

<td>Required Fuel</td>

<td>Type of Flight</td>

</tr>

<tr>

<td width="50%" >

<?php Template::Show('fuel.tpl'); ?>

</td>

<td width="50%" ><?php if($schedule->flighttype=='P')

{

echo 'Passenger <b>(P)</b>';

}

?>

</td>

I assume you could just add "elseif" statements for Charter or Cargo, or whatever.

Posted

By that I meant:

<td width="50%" ><?php if($schedule->flighttype=='P')

{

echo 'Passenger <b>(P)</b>';

} elseif($schedule->flighttype=='C')

{

echo 'Cargo <b>( C )</b>';

}

?>

Posted

Here is what I used for the passenger flight reference:

<tr style="background-color: #333; color: #FFF;">

<td>Required Fuel</td>

<td>Type of Flight</td>

</tr>

<tr>

<td width="50%" >

<?php Template::Show('fuel.tpl'); ?>

</td>

<td width="50%" ><?php if($schedule->flighttype=='P')

{

echo 'Passenger <b>(P)</b>';

}

?>

</td>

I assume you could just add "elseif" statements for Charter or Cargo, or whatever.

Thank you for posting that, i finally got it too work!!!!!!!! :D

  • 3 weeks later...
Posted

well nice mod but i can't make it to work ;(

Parse error: syntax error, unexpected '=' in /home/greeceai/public_html/fss/core/templates/fuel.tpl on line 6

		<?php
               /**
	*Fuelflow Table
	*/

       $fuelflowB737-400 = 2800 ;
       $fuelflowB737-700 = 2900 ;
       $fuelflowB737-600 = 2600 ;
       $fuelflowATR 72-500 = 0760 ;
       $fuelflowE145 = 0810 ;

       /**
	*Reserves Table
	*/

       $reservesB737-400 = 3000;
       $reservesB737-700 = 3000;
       $reservesB737-600 = 3000;
       $reservesATR 72-500 = 2500;
       $reservesE145 = 1800;

       if($schedule->aircraft == 'B737-700')
       {
           $fuelflow = $fuelflowB737;
           $reserves = $reservesB737;

       }
        elseif($schedule->aircraft == 'B737-400')
        {
        	$fuelflow = $fuelflowB734;
           $reserves = $reservesB734;

        }
        elseif($schedule->aircraft == 'B737-600')
        {
        	$fuelflow = $fuelflowB736;
           $reserves = $reservesB736;

        }
        elseif($schedule->aircraft == 'ATR 72-500')
        {
        	$fuelflow = $fuelflowATR ;
           $reserves = $reservesATR ;

        }
        elseif($schedule->aircraft == 'E145')
        {
        	$fuelflow = $fuelflowE145;
           $reserves = $reservesE145;

        }

       $fltime = explode(".", $schedule->flighttime);
	$flmin = $fltime[1] / 60;
       $flhou = $fltime[0];
       $fuelhours = $fuelflow * $flhou;
       $fuelminutes1 = $fuelflow * $flmin;
       $fuelminutes = $fuelminutes1 * 1;
       $result = $fuelhours + $fuelminutes;
       $mrreserves = 600;
       $lrreserves = 1500;
       $mr = $mrreserves + $reserves;
       $lr = $lrreserves + $reserves;
       $mlf = $fuelflow * 0.45;

           if($fuelflow == '0')
           	{
               	echo 'no fuel data available (no a/c fuelflow data)';
               }
          	elseif($schedule->flighttime == '0')
               {
                       echo '<b>'.'no aircraft performance data available <br />(missing flight duration)'.'</b>';
               }
   	    elseif($schedule->flighttime >='0.00001')
           			{
                       if($result == '0')
                       {
         	              echo '<b>'.'no aircraft performance data available'.'</b>';
                       }
                       else
               		{

                         if($schedule->distance <= '501')
                           {
                           	$result1 = $result + $reserves + $mlf;
                               echo '<b>Total: </b>';
                               echo round ($result1,-2);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result1 * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo 'Trip: ';
                               echo round ($result,-2);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Taxi + Reserves: ';
                               echo $reserves;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($reserves * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Minimum Landing: ';
                               echo $mlf;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($mlf * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo '<font color="#FF0000">Caution</font>: Please doublecheck calculation before use !';                                  
                           }
                       		elseif($schedule->distance <= '1601')
                           {
                               $result3 = $result + $mrreserves + $reserves + $mlf;
                               echo '<b>Total: </b>';
                               echo round ($result3,-1);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result3 * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo 'Trip: ';
                               echo round ($result,-1);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Taxi + Reserves: ';
                               echo $mr;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($mr * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Minimum Landing: ';
                               echo $mlf;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.$mlf * 2.2.'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo '<font color="#FF0000">Caution</font>: Please doublecheck calculation before use !';     

                           }
                       		elseif($schedule->distance >= '1602')
                           {
                               $result4 = $result + $lrreserves + $reserves + $mlf;
                               echo '<b>Total: </b>';
                               echo round ($result4,-1);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result4 * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo 'Trip: ';
                               echo round ($result,-1);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Taxi + Reserves: ';
                               echo $lr;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($lr * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Minimum Landing: ';
                               echo $mlf;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($mlf * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo '<font color="#FF0000">Caution</font>: Please doublecheck calculation before use !'; 
                           }
               		}
               	}

       	        else
                   {
                       echo 'fail';
                   }

		?>

Posted

i see at least one mistake

$reservesATR 72-500 = 2500;

you cannot write variables with spaces in it. also i would recommend you to avoid using "-" in variables if possible

"no aircraft performance data available" only comes when the script cannot recognize your aircraft or there is no aircraft in the file which has the same code

Posted

i see at least one mistake

$reservesATR 72-500 = 2500;

you cannot write variables with spaces in it. also i would recommend you to avoid using "-" in variables if possible

Copy already corrected (also in admin center to avoid conflick)

"no aircraft performance data available" only comes when the script cannot recognize your aircraft or there is no aircraft in the file which has the same code

yes but my flight have an aircraft... here my new fuel.tpl:

		<?php
               /**
	*Fuelflow Table
	*/

       $fuelflowB737400 = 2800 ;
       $fuelflowB737700 = 2900 ;
       $fuelflowB737600 = 2600 ;
       $fuelflowATR72500 = 0760 ;
       $fuelflowE145 = 0810 ;

       /**
	*Reserves Table
	*/

       $reservesB737400 = 3000;
       $reservesB737700 = 3000;
       $reservesB737600 = 3000;
       $reservesATR72500 = 2500;
       $reservesE145 = 1800;

       if($schedule->aircraft == 'B737700')
       {
           $fuelflow = $fuelflowB737;
           $reserves = $reservesB737;

       }
        else if($schedule->aircraft == 'B737400')
        {
        	$fuelflow = $fuelflowB734;
           $reserves = $reservesB734;

        }
        else if($schedule->aircraft == 'B737600')
        {
        	$fuelflow = $fuelflowB736;
           $reserves = $reservesB736;

        }
        else if($schedule->aircraft == 'ATR72500')
        {
        	$fuelflow = $fuelflowATR ;
           $reserves = $reservesATR ;

        }
        else if($schedule->aircraft == 'E145')
        {
        	$fuelflow = $fuelflowE145;
           $reserves = $reservesE145;

        }

       $fltime = explode(".", $schedule->flighttime);
	$flmin = $fltime[1] / 60;
       $flhou = $fltime[0];
       $fuelhours = $fuelflow * $flhou;
       $fuelminutes1 = $fuelflow * $flmin;
       $fuelminutes = $fuelminutes1 * 1;
       $result = $fuelhours + $fuelminutes;
       $mrreserves = 600;
       $lrreserves = 1500;
       $mr = $mrreserves + $reserves;
       $lr = $lrreserves + $reserves;
       $mlf = $fuelflow * 0.45;

           if($fuelflow == '0')
           	{
               	echo 'no fuel data available (no a/c fuelflow data)';
               }
          	else if($schedule->flighttime == '0')
               {
                       echo '<b>'.'no aircraft performance data available <br />(missing flight duration)'.'</b>';
               }
   	    else if($schedule->flighttime >='0.00001')
           			{
                       if($result == '0')
                       {
         	              echo '<b>'.'no aircraft performance data available'.'</b>';
                       }
                       else
               		{

                         if($schedule->distance <= '501')
                           {
                           	$result1 = $result + $reserves + $mlf;
                               echo '<b>Total: </b>';
                               echo round ($result1,-2);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result1 * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo 'Trip: ';
                               echo round ($result,-2);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Taxi + Reserves: ';
                               echo $reserves;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($reserves * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Minimum Landing: ';
                               echo $mlf;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($mlf * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo '<font color="#FF0000">Caution</font>: Please doublecheck calculation before use !';                                  
                           }
                       		else if($schedule->distance <= '1601')
                           {
                               $result3 = $result + $mrreserves + $reserves + $mlf;
                               echo '<b>Total: </b>';
                               echo round ($result3,-1);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result3 * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo 'Trip: ';
                               echo round ($result,-1);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Taxi + Reserves: ';
                               echo $mr;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($mr * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Minimum Landing: ';
                               echo $mlf;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.$mlf * 2.2.'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo '<font color="#FF0000">Caution</font>: Please doublecheck calculation before use !';     

                           }
                       		else if($schedule->distance >= '1602')
                           {
                               $result4 = $result + $lrreserves + $reserves + $mlf;
                               echo '<b>Total: </b>';
                               echo round ($result4,-1);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result4 * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo 'Trip: ';
                               echo round ($result,-1);
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($result * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Taxi + Reserves: ';
                               echo $lr;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($lr * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo 'Minimum Landing: ';
                               echo $mlf;
                               echo ' kg';
                               echo ' - ';
                               echo '<b>'.round ($mlf * 2.2,-1).'</b>';
                               echo ' lbs';
                               echo '<br>';
                               echo '<hr>';
                               echo '<font color="#FF0000">Caution</font>: Please doublecheck calculation before use !'; 
                           }
               		}
               	}

       	        else
                   {
                       echo 'fail';
                   }

		?>

Posted

if($schedule->aircraft == 'B737700')

{

$fuelflow = $fuelflowB737; <-

$reserves = $reservesB737; <- those both variables have to be changed as well for example this one would be $reservesB737700

}

also do not add leading zero´s like you have here:

$fuelflowATR72500 = 0760 ;

$fuelflowE145 = 0810 ;

Posted

if($schedule->aircraft == 'B737700')

{

$fuelflow = $fuelflowB737; <-

$reserves = $reservesB737; <- those both variables have to be changed as well for example this one would be $reservesB737700

}

also do not add leading zero´s like you have here:

$fuelflowATR72500 = 0760 ;

$fuelflowE145 = 0810 ;

Thank you so much!!!! Working Fine! realy good add on!

Regards Dimitris

p.s. keep up the good work

Posted

I am getting the "no aircraft performance data available" on mine. But it works 100% for the main airline. The other 2 airlines under the same site have different codes and scedules etc., but they get the error. Everything pulls from the same sql database, so not sure why this happens, or how to fix it?!

Posted

I am getting the "no aircraft performance data available" on mine. But it works 100% for the main airline. The other 2 airlines under the same site have different codes and scedules etc., but they get the error. Everything pulls from the same sql database, so not sure why this happens, or how to fix it?!

hmm check all your variables and check the names of the aircrafts. maybe there is something wrong because it should always work, no matter how much airlines you have there

Posted

Yeah, I did that. It does not seem to like aircraft I add since the original VA was started. I must be missing something outside of your module?! I will keep looking.

Posted

No, no spaces. The only thing I can think of, sort of, is that, when I added the new aircraft to the sql database, they start at ID#1 obviously for the first one, then when it gets to the newer aircraft, it jumps from ID#111 to ID#148 and again from ID#155 to ID#195. Now, I didn't think that would matter. I basically left room between the VA's for future aircraft additions(that's just my way). :) But, maybe that is causing odd happennings?!?

Posted

hmm no it shouldnt, the script is not accessing this part of the table, but just a short question. could you make a screenshot of your phpvms_aircrafts and a screenshot of how you configured the script? then i may find the problem

Posted

First off, my database is not phpvms_aircraft, it is cpc_aircraft(phpvms_ is replaced with cpc_ in all the databases). Keep in mind everything else works great. If I assign a different aircraft ID# to the schedule, then it works fine. It just seems to be the ones associated with a different airline code. All schedules fall under cpc_schedules. That includes 3 airlines (CPC, EPA and WDA). All aircraft fall under cpc_aircraft (includes the same CPC, EPA and WDA aircraft). So it seems the other schedules that have the EPA and WDA airlines have an issue.

sql.jpg

fuel.jpg

Posted

What do you want a screenshot of, exactly??? Do you want me to show the whole fuel.tpl?

Here is the error I get:

'no aircraft performance data available'

Only see just that error here:

elseif($schedule->flighttime >='0.00001')

{

if($result == '0')

{

echo '<b>'.'no aircraft performance data available'.'</b>';

Posted

Ok, it is ONLY the B732, on the "EPA" company, that does not show fuel. I missed the HS748 in the fuel.tpl, so that is fine now, but it is that B732 that is weird. But for whatever reason. it shows the fuel details for the B732, except EPA's?! I have checked the database and it is basically the same details. I am probably just missing something obvious.

  • 8 months later...
Posted

Ok, it is ONLY the B732, on the "EPA" company, that does not show fuel. I missed the HS748 in the fuel.tpl, so that is fine now, but it is that B732 that is weird. But for whatever reason. it shows the fuel details for the B732, except EPA's?! I have checked the database and it is basically the same details. I am probably just missing something obvious.

After I tweaked my aircraft naming, it worked great for me, tyvm :)

  • 2 weeks later...
  • 2 weeks later...
Posted

I did some flights and compared the fuel usage to what this add on states, and it was spot on...Great add on!! :D airmermaid, I don't think it matters but I used standard.

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