Fernando Posted January 13, 2012 Report Share Posted January 13, 2012 This is a system that calculates the T/D pilot's average for its last flight. Pilots not flying Pilots with record flight Installation Manual 1° Download of the File (TouchdownStats) 2° Send the folder of the module to your website. within the system PHPVMS 3° Enter the code within the pages Profile_main.tpl and pilot_public_profile Download of the MODULE here Code to TPL <?php $somar = mysql_query("SELECT SUM(landingrate) as landingrate FROM `phpvms_pireps` WHERE pilotid=$userinfo->pilotid"); $total = mysql_fetch_array($somar); $v_total = $total['landingrate']; $linha = mysql_query("SELECT * FROM `phpvms_pireps` WHERE pilotid=$userinfo->pilotid"); $taxa = mysql_num_rows($linha); $v_taxa = $taxa; $media = $v_total/$v_taxa; $v_media = number_format($media, 0, '.', ''); ?> <?php echo $v_media." ft/min"; ?> Great flights to all. By. Fernando Quote Link to comment Share on other sites More sharing options...
mattia Posted January 24, 2012 Report Share Posted January 24, 2012 the download not work Quote Link to comment Share on other sites More sharing options...
Jeff Posted January 24, 2012 Report Share Posted January 24, 2012 You can also just use this code (without using this module) to display the Avg. Landing rate of all your flights. <strong><font color="#FF0000">Avg. Landing Rate: </font></strong><font color="green"><?php echo ''.round(TouchdownStatsData::pilot_average($userinfo->pilotid), 2); ?></font> This works in the profile_main.tpl as well as the pilot_public_profile.tpl Quote Link to comment Share on other sites More sharing options...
mattia Posted January 24, 2012 Report Share Posted January 24, 2012 hi jeff tried your code in profile_main.tpl but does not work this is my error Fatal error: Call to undefined method TouchdownStatsData::pilot_average() in /var/www/virtual/italianivolanti.it/htdocs/iv/core/templates/profile_main.tpl on line 308 Quote Link to comment Share on other sites More sharing options...
Jeff Posted January 24, 2012 Report Share Posted January 24, 2012 It should be working. Here it is in working form on my site. http://www.virtualflightzone.net/index.php/profile/view/1 Quote Link to comment Share on other sites More sharing options...
Jeff Posted January 24, 2012 Report Share Posted January 24, 2012 Try adding the Top Pilot module from Simpilot, then use the code I gave you. It might work then. Quote Link to comment Share on other sites More sharing options...
mattia Posted January 24, 2012 Report Share Posted January 24, 2012 yes, I have the module simpilot TouchdownStats and top pilot Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted January 25, 2012 Moderators Report Share Posted January 25, 2012 yes, I have the module simpilot TouchdownStats and top pilot Jeff's code is correct and working on my site too, make sure you installed Touch Down Stats correctly. Quote Link to comment Share on other sites More sharing options...
mattia Posted January 25, 2012 Report Share Posted January 25, 2012 ok i solved with this code <?php $somar = mysql_query("SELECT SUM(landingrate) as landingrate FROM `phpvms_pireps` WHERE pilotid=$userinfo->pilotid"); $total = mysql_fetch_array($somar); $v_total = $total['landingrate']; $linha = mysql_query("SELECT * FROM `phpvms_pireps` WHERE pilotid=$userinfo->pilotid"); $taxa = mysql_num_rows($linha); $v_taxa = $taxa; $media = $v_total/$v_taxa; $v_media = number_format($media, 0, '.', ''); ?> <?php echo $v_media." ft/min"; ?> but you can have a table to put our best 10? thanks for the help Quote Link to comment Share on other sites More sharing options...
Fernando Posted January 29, 2012 Author Report Share Posted January 29, 2012 Sorry the delay, I recommend using the module to not give errors, the link has been repaired can download. Quote Link to comment Share on other sites More sharing options...
Fernando Posted January 29, 2012 Author Report Share Posted January 29, 2012 ok i solved with this code <?php $somar = mysql_query("SELECT SUM(landingrate) as landingrate FROM `phpvms_pireps` WHERE pilotid=$userinfo->pilotid"); $total = mysql_fetch_array($somar); $v_total = $total['landingrate']; $linha = mysql_query("SELECT * FROM `phpvms_pireps` WHERE pilotid=$userinfo->pilotid"); $taxa = mysql_num_rows($linha); $v_taxa = $taxa; $media = $v_total/$v_taxa; $v_media = number_format($media, 0, '.', ''); ?> <?php echo $v_media." ft/min"; ?> but you can have a table to put our best 10? thanks for the help You demand the rank of the best? This http://www.voeazulvirtual.com/acars/index.php/TopPilot or this http://www.voeazulvirtual.com/acars/index.php/TouchdownStats By Fernando Quote Link to comment Share on other sites More sharing options...
mattia Posted January 29, 2012 Report Share Posted January 29, 2012 hi Fernando, I was wondering if you could create a ranking of the top 10 on average landings Quote Link to comment Share on other sites More sharing options...
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.