% template LEADERBOARDSvc(starwave.webgames.services.UserInputSvc obj) %>
<%
inputs = obj.input
maxPeriods = 11
currentPeriod = 12 // last completed period
%>
WVGM Leaderboard
<% Header("LeaderboardSvc") %>
| Leaderboard |
| RK |
TEAM, OWNER |
<%
foreach (num in 1..maxPeriods)
{
if(num < currentPeriod)
{
'W' & num & ' | '
}
else
{
'W'&num&' | '
}
}
%>
TOTAL |
<%
if (obj.param0 == "-1")
{
targetFieldName = "nPoints"
}
else
{
targetFieldName = "nWeekTotal" & (obj.param0)
}
nullFormat("--")
currentRow = 0
nRank = -1
nLastTotal = -1
foreach (input in inputs)
{
nTotal = input[targetFieldName].asInteger
if (nTotal != nLastTotal)
{
nRank = currentRow + 1
nLastTotal = nTotal
}
''
'| ' & nRank & ' | '
'' & input["sLocation"] & ' ' input["sNickname"] & ', ' &
input["sFirstName"] & ' ' & input["sLastName"] & ' | '
foreach (num in 1..maxPeriods)
{
celldata = ""
week = "nWeekTotal" & num
if (num & "" == obj.param0)
{
celldata = celldata & ''
}
celldata = celldata & input[week]
''
if (celldata == "")
{
'--'
}
else
{
celldata
}
' | '
}
''
if (obj.param0 == "-1") { '' }
input["nPoints"]
' |
\n'
currentRow = currentRow + 1
}
%>
<% Footer("LEADERBOARDSvc") %>