Calculate equation-based box score totals

This commit is contained in:
Brian Miyaji
2016-11-03 13:17:12 +11:00
parent cd7d0c609a
commit 8179e54280
3 changed files with 5 additions and 37 deletions

View File

@@ -174,22 +174,6 @@ if ( ! isset( $subs ) ) $subs = array();
$i++;
endforeach;
if ( sizeof( $equations ) ):
// Prepare total values for equation calculation
$vars = $totals;
foreach ( $vars as $key => $var ):
if ( empty( $var ) ) $vars[ $key ] = 0;
endforeach;
$vars = array_merge( $vars, array( 'eventsplayed' => 1 ) );
// Calculate equation-based totals
foreach ( $equations as $key => $equation ):
$totals[ $key ] = sp_solve( $equation['equation'], $vars, $equation['precision'] );
endforeach;
endif;
?>
</tbody>
<?php endif; ?>