";
echo ($statDisplayType == 'total') ?
"Total |" :
"
Total |",
($statDisplayType == 'pergame') ?
" Per game average |" :
"
Per game average |",
($statDisplayType == 'pertime') ?
" Per time average" :
"
Per time average";
echo "
";
}
function columnSortLinks (&$COLUMNS) {
##############################################################################
# $COLUMNS is an hash of columns, each has a hash of config values
# $COLUMNS['goals']['label'] = 'Goals';
# 'label' is the text displayed for the link
# This should NOT be the SQL Column name, but rather the SQL alias that you
# use. SELECT SQLColumn as alias FROM ....
# This lets you sort using GROUP BY functions SUM(), COUNT(), etc...
#
# $COLUMNS is passed as a reference, and 'url' is added as the column url.
##############################################################################
global $PHP_SELF;
global $sortColumn;
global $sortDirection;
# We need to make the query URL in canonical form so that we can do a
# preg_replace to create each new URL. We do this by removing the variable
# an just leaving the 'name=' string. If the variable wasn't passed we just
# append 'varname=' to the end of the URL.
if ($_SERVER['QUERY_STRING'] == '') {
$COLUMN_URL = "$PHP_SELF?sortColumn=&sortDirection=";
} else {
$COLUMN_URL = "$PHP_SELF?" . $_SERVER['QUERY_STRING'];
if (isset($_REQUEST['sortColumn'])) {
$COLUMN_URL = preg_replace("/sortColumn=$sortColumn/",
'sortColumn=',$COLUMN_URL);
} else {
$COLUMN_URL .= '&sortColumn=';
}
if (isset($_REQUEST['sortDirection'])) {
$COLUMN_URL = preg_replace("/sortDirection=($sortDirection)/",
'sortDirection=',$COLUMN_URL);
} else {
$COLUMN_URL .= '&sortDirection=';
}
}
foreach ($COLUMNS as $columnName => $OPTIONS) {
$TEMP_URL = "