Jump to content

Average grade FOQA


eliezerazevedo

Recommended Posts

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 "%"?.; ?>

Edited by eliezerazevedo
Link to comment
Share on other sites

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

Edited by eliezerazevedo
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...