Example #1
0
function outputStats($title, $type)
{
    global $playerStats;
    echo "<b>{$title}</b><br />";
    $table = new playerStatTable($type, array('doTotals' => true, 'tableFormat' => 'width="100%"'));
    foreach ((array) $playerStats[$type] as $stats) {
        $table->addPlayer($stats);
    }
    $table->outputTable();
    echo '<br />';
    $table = null;
    unset($table);
}
Example #2
0
function doPlayerStats($type, $title, $team1, $team2, $gameId, $orderBy)
{
    echo "<tr valign=\"top\"><td>\r\n<b>{$team1->teamName} {$title}</b><br />\r\n";
    global $dm;
    $table = new playerStatTable($type);
    foreach ((array) $dm->PlayerStat()->getTeamStats($team1->teamId, $gameId, $type, $orderBy) as $stats) {
        $table->addPlayer($stats);
    }
    $table->outputTable();
    echo "</td><td width=\"10\"></td><td>\r\n<b>{$team2->teamName} {$title}</b><br />\r\n";
    $table = new playerStatTable($type);
    foreach ((array) $dm->PlayerStat()->getTeamStats($team2->teamId, $gameId, $type, $orderBy) as $stats) {
        $table->addPlayer($stats);
    }
    $table->outputTable();
    $table = null;
    unset($table);
    echo "</td></tr>\r\n";
    echo "<tr><td height=\"15\"></td></tr>\r\n";
}
Example #3
0
function outputStats($title, $type, $extra_options = array())
{
    global $playerStats;
    echo "<b>{$title}</b><br />";
    $options = array('doTeamNames' => true, 'doFullStats' => true, 'doSortable' => true, 'doNumbers' => true, 'tableFormat' => 'width="100%"', 'numberStart' => PER_PAGE * (PAGE - 1) + 1);
    $options = array_merge($options, $extra_options);
    if ($_GET['week']) {
        $options['doOpponents'] = true;
    }
    if ($_GET['week'] == -1) {
        $options['doWeeks'] = true;
    }
    $table = new playerStatTable($type, $options);
    $count = 1;
    $results = 0;
    foreach ((array) $playerStats[$type] as $stats) {
        $add = true;
        if (SEARCH_TERM) {
            $add = false;
            if (stripos($stats->playerName, SEARCH_TERM) !== false || stripos($stats->teamName, SEARCH_TERM) !== false) {
                $add = true;
                $results++;
            }
        }
        if ($add) {
            $table->addPlayer($stats, $count);
        }
        $count++;
    }
    if (SEARCH_TERM) {
        echo "Searching for \"" . SEARCH_TERM . "\". {$results} results found.<br /><br />";
    }
    $table->outputTable();
    echo '<br />';
    $table = null;
    unset($table);
}