"; print "
Team Financial Stats - S".$SeasonNumber."

"; print "Game Stats Financial Stats

"; print ""; print ""; print "
"; $query = "SELECT * FROM Finances WHERE Season=$SeasonNumber ORDER BY (Start + ((RevPre + RevReg + RevPlf + RevAward + RevTrade) - (ExpFine + ExpFee + ExpSalPaid + ExpTrade))) DESC"; $result = mysql_query ($query, $connection); print ""; while ($row = mysql_fetch_array($result)) { $StartingBalance = $row["Start"]; $TotalRevenue = $row["RevPre"] + $row["RevReg"] + $row["RevPlf"] + $row["RevAward"] + $row["RevTrade"]; $TotalExpenses = $row["ExpFine"] + $row["ExpFee"] + $row["ExpSalPaid"] + $row["ExpTrade"]; $SeasonNet = $TotalRevenue - $TotalExpenses; $EndingBalance = $StartingBalance + $SeasonNet; $Team = $row["Team"]; print ""; print ""; } print "
Team Account Total
"; $query = "SELECT * FROM Teams WHERE TeamNum = $Team"; $teamres = @mysql_fetch_array(mysql_query($query,$connection)); // print $teamres["City"]; print $teamres["City"] . " " . $teamres["Club"]; print "$"; print number_format($EndingBalance, 2); print "
"; print "
"; $query = "SELECT * FROM Finances WHERE Season=$SeasonNumber ORDER BY ((RevPre + RevReg + RevPlf + RevAward + RevTrade) - (ExpFine + ExpFee + ExpSalPaid + ExpTrade)) DESC"; $result = mysql_query ($query, $connection); print ""; while ($row = mysql_fetch_array($result)) { $StartingBalance = $row["Start"]; $TotalRevenue = $row["RevPre"] + $row["RevReg"] + $row["RevPlf"] + $row["RevAward"] + $row["RevTrade"]; $TotalExpenses = $row["ExpFine"] + $row["ExpFee"] + $row["ExpSalPaid"] + $row["ExpTrade"]; $SeasonNet = $TotalRevenue - $TotalExpenses; $EndingBalance = $StartingBalance + $SeasonNet; $Team = $row["Team"]; print ""; print ""; } print "
Team Net Income
"; $query = "SELECT * FROM Teams WHERE TeamNum = $Team"; $teamres = @mysql_fetch_array(mysql_query($query,$connection)); // print $teamres["City"]; print $teamres["City"] . " " . $teamres["Club"]; print "$"; print number_format($SeasonNet, 2); print "
"; $query = "SELECT * FROM Finances WHERE Season=$SeasonNumber ORDER BY (RevPre + RevReg + RevPlf + RevAward + RevTrade) DESC"; $result = mysql_query ($query, $connection); print ""; while ($row = mysql_fetch_array($result)) { $TotalRevenue = $row["RevPre"] + $row["RevReg"] + $row["RevPlf"] + $row["RevAward"] + $row["RevTrade"]; $Team = $row["Team"]; print ""; print ""; } print "
Team Total Revenue
"; $query = "SELECT * FROM Teams WHERE TeamNum = $Team"; $teamres = @mysql_fetch_array(mysql_query($query,$connection)); // print $teamres["City"]; print $teamres["City"] . " " . $teamres["Club"]; print "$"; print number_format($TotalRevenue, 2); print "
"; print "
"; $query = "SELECT * FROM Finances WHERE Season=$SeasonNumber ORDER BY (ExpFine + ExpFee + ExpSalPaid + ExpTrade) DESC"; $result = mysql_query ($query, $connection); print ""; while ($row = mysql_fetch_array($result)) { $TotalExpenses = $row["ExpFine"] + $row["ExpFee"] + $row["ExpSalPaid"] + $row["ExpTrade"]; $Team = $row["Team"]; print ""; print ""; } print "
Team Total Expenses
"; $query = "SELECT * FROM Teams WHERE TeamNum = $Team"; $teamres = @mysql_fetch_array(mysql_query($query,$connection)); // print $teamres["City"]; print $teamres["City"] . " " . $teamres["Club"]; print "$"; print number_format($TotalExpenses, 2); print "
"; ?>