}
$place = getPlace($userID, $leagueID);
getSuffix($place);
?>
<script>
jQuery(document).ready(function ()
{
jQuery('html').find('h1').html("	<h1 class=\"page-title\"><?php 
echo $teamDisplayName;
?>
</h1>");
});
</script>
<?php 
//echo displayResults(getReturnCode(0,"Notice: If you had a player on your roster who is no longer with his team, he has been removed."));
$totalPoints = getTotalPointsForUser($userID, $leagueID);
?>

<h3>You are in <?php 
echo getSuffix($place);
?>
 place with <?php 
echo $totalPoints;
?>
 points.</h3>
<h4>Current Roster</h4>

<?php 
$totalPointsEarned = getTotalPointsForUserByPlayer($userID, $leagueID, 0);
$pointsEarned30d = getTotalPointsForUserByPlayer($userID, $leagueID, 30);
$lastGameHash = getLastGameHash();
function getStandingsOld($leagueID)
{
    $season = getSeason();
    $sql = <<<SQL

select   rosters.userID, 
(select teamDisplayName from fch_league_membership where season = "{$season}" and leagueID = {$leagueID} and userID = rosters.userID and status = \\"active\\") as teamDisplayName,
 sum(results.totalPoints) as t from fch_rosters rosters, fch_consolidated_results results
where rosters.acquireDate < results.dateStamp and (rosters.releaseDate > results.dateStamp or rosters.releaseDate is null)
and results.playerID = rosters.playerID 
and rosters.season = "{$season}" 
and results.season = "{$season}" 
and rosters.leagueID = {$leagueID}
group by rosters.userID
order by t desc
SQL;
    $x = 1;
    debug("getStandings: " . $sql);
    $con = initializeDB();
    $result = $con->query($sql);
    //echo $sql;
    $out = "<table><thead><tr><th scope=\"col\">Place</th><th>Points</th><th scope=\"col\">Team</th></tr></thead>";
    if ($result->num_rows > 0) {
        // output data of each row
        while ($row = $result->fetch_assoc()) {
            debug($row["userID"] . "-" . $row["t"] . " " . $userID);
            $out .= "<tr><th scope=\"row\">" . $x . "</th><TD>" . getTotalPointsForUser($userID, $leagueID) . "</TD><td>" . $row['teamDisplayName'] . "</td></tr>";
            $x++;
        }
    } else {
        debug("No rows, returning null");
        return "No Standings to Display.";
    }
    $out .= "</table>";
    closeDB($con);
    debug("getStandings returning {$out}");
    return $out;
}