CPC900 Posted May 21, 2010 Report Posted May 21, 2010 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. Quote
CPC900 Posted May 21, 2010 Report Posted May 21, 2010 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>'; } ?> Quote
joshua.john Posted May 22, 2010 Report Posted May 22, 2010 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!!!!!!!! Quote
dimitris Posted June 12, 2010 Report Posted June 12, 2010 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'; } ?> Quote
dimitris Posted June 12, 2010 Report Posted June 12, 2010 ok i make it working with out errors (it was an extra "=") but now in the required fuel i m getting: "no aircraft performance data available" Quote
hjhjhgjgjh Posted June 12, 2010 Author Report Posted June 12, 2010 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 Quote
dimitris Posted June 12, 2010 Report Posted June 12, 2010 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'; } ?> Quote
hjhjhgjgjh Posted June 12, 2010 Author Report Posted June 12, 2010 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 ; Quote
dimitris Posted June 12, 2010 Report Posted June 12, 2010 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 Quote
CPC900 Posted June 13, 2010 Report Posted June 13, 2010 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?! Quote
hjhjhgjgjh Posted June 13, 2010 Author Report Posted June 13, 2010 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 Quote
CPC900 Posted June 13, 2010 Report Posted June 13, 2010 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. Quote
hjhjhgjgjh Posted June 13, 2010 Author Report Posted June 13, 2010 check if you have any spaces in your aircraft names. thats not allowed Quote
CPC900 Posted June 14, 2010 Report Posted June 14, 2010 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?!? Quote
hjhjhgjgjh Posted June 14, 2010 Author Report Posted June 14, 2010 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 Quote
CPC900 Posted June 14, 2010 Report Posted June 14, 2010 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. Quote
hjhjhgjgjh Posted June 14, 2010 Author Report Posted June 14, 2010 hmm i really do not know why.. i never coded something that calls for the airline in this script.. however you have a nice fleet Quote
CPC900 Posted June 14, 2010 Report Posted June 14, 2010 Thanks. Lots of retro I will keep trying to figure it out. It is a bit of a mystery. Quote
hjhjhgjgjh Posted June 14, 2010 Author Report Posted June 14, 2010 can you also make me a screenshot of how you configured the fuel.tpl? Quote
CPC900 Posted June 14, 2010 Report Posted June 14, 2010 Sure, will do when I get home much later tonight. Working right now Quote
CPC900 Posted June 15, 2010 Report Posted June 15, 2010 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>'; Quote
hjhjhgjgjh Posted June 15, 2010 Author Report Posted June 15, 2010 maybe your flights do not have a flighttime? Quote
CPC900 Posted June 15, 2010 Report Posted June 15, 2010 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. Quote
greertr Posted March 3, 2011 Report Posted March 3, 2011 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 Quote
airmermaid Posted March 17, 2011 Report Posted March 17, 2011 a question. What unit is used (kg, lb, liter etc.. )??? Quote
RogerB Posted March 29, 2011 Report Posted March 29, 2011 This is a great addon. Same question as above, how should we enter the initial values, standard or metric??? Quote
Cloudva Posted April 2, 2011 Report Posted April 2, 2011 thanks man, after a 15 minutes of tweeking I go it up and running! It's brilliant man thanks! :D:D Vincent, www.cloudvairlines.com Quote
RogerB Posted April 3, 2011 Report Posted April 3, 2011 I did some flights and compared the fuel usage to what this add on states, and it was spot on...Great add on!! airmermaid, I don't think it matters but I used standard. Quote
airmermaid Posted April 3, 2011 Report Posted April 3, 2011 Thanks Roger, I will give it a try tomorrow. Cheers, Arslan PS. I like your ICAO code, the team of my hometown Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.