How to make a FOQA system, eg if the pilot makes 10 legs and 5 is regeitada, so it will have a score of 50%.
Based on this code:
<? Php
$ Add = mysql_query ("SELECT SUM (landingrate) the landingrate FROM` phpvms_pireps` WHERE pilotid = $ userinfo-> pilotid ");
$ Total = mysql_fetch_array ($ total);
$ V_total = Total $ ['landingrate'];
$ Line = mysql_query ("SELECT * FROM` phpvms_pireps` WHERE pilotid = $ userinfo-> pilotid ");
$ Rate = mysql_num_rows ($ line);
$ V_taxa = $ rate;
if ($ v_taxa <= 0)
{$ V_media = 0; } Else {$ media = $ v_total / $ v_taxa; $ V_media = number_format ($ average, 0, '' '.'); }
?>
<? Php echo $ v_media "%"?.; ?>
I really can’t understand what are you attempting to do. What is regeitada?
If the pilot does ten flights and those ten flights only five for approving the pilot will have an equivalent rating 50%
It would be an average of accepted pireps.
forgiveness for my English
What is the above code for? Cause I saw that you are summing the landingrates..
The code would almost it!
Only instead to add the values, I want an average.
Ex:
Starts counting at 100%
Value 0 (Approval Pending): Does not diminish the count.
Value 1 (Approval Accepted): Increase count 1% up to the maximum value of 100%
Value 2 (Approval Rejected): Decrease the count in 5%
<?PHP $somar = mysql_query("SELECT SUM(accepted) as accepted FROM `phpvms_pireps` WHERE pilotid=$userinfo->pilotid");
$total = mysql_fetch_array($somar);
$v_total = $total['accepted'];
$linha = mysql_query("SELECT * FROM `phpvms_pireps` WHERE pilotid=$userinfo->pilotid");
$taxa = mysql_num_rows($linha);
$v_taxa = $taxa;
?>
<?php echo $taxa."%"; ?>
This item will be shown in profile main.tpl