<%
Dim numberOfChapms
function NumberPostfix(iDay)
if (iDay = 11 or iDay = 12 or iDay = 13) then
NumberPostfix = "th"
else
iDay = iDay mod 10
select case iDay
case 1
NumberPostfix = "st"
case 2
NumberPostfix = "nd"
case 3
NumberPostfix = "rd"
case else
NumberPostfix = "th"
end select
end if
end function
function MonthName(iMonth)
select case iMonth
case 1
MonthName = "January"
case 2
MonthName = "February"
case 3
MonthName = "March"
case 4
MonthName = "April"
case 5
MonthName = "May"
case 6
MonthName = "June"
case 7
MonthName = "July"
case 8
MonthName = "August"
case 9
MonthName = "September"
case 10
MonthName = "October"
case 11
MonthName = "November"
case 12
MonthName = "December"
end select
end function
Public Sub getChamps
Set rsUsers = Server.CreateObject ("ADODB.Recordset")
rsUsers.Open "SELECT * FROM users WHERE (StartDate IS NOT NULL) ORDER BY CAST(NOKNUMBER AS real) DESC ", DB, adOpenDynamic, adLockOptimistic
for iChamps = 0 to 15
if not rsUsers.EOF then
numberOfChapms = numberOfChapms + 1
champArray(iChamps) = trim(rsUsers("USER_ID"))
noksArray(iChamps) = rsUsers("NOKNUMBER")
emailArray(iChamps) = "mailto: " & rsUsers("EMAIL")
rsUsers.movenext
end if
next
rsUsers.Close
End Sub
'''''''''''''''''''''''''' MAIN '''''''''''''''''''''''''''''''''''''''''
Dim DB, rsNoks,u_id ,iChamps, champArray(100),emailArray(100),rsUsers, noksArray(100), wd, strDate,dd
' Connect
Set DB = Connect
' get the details
getChamps
strDate = " " & MonthName(Month(Now)) & " " & Day(Now) & NumberPostfix(Day(Now)) & ", " & Year(Now)
%>
These are the World Best NOKKers, as of
<%=strDate %>
NOK
Champions are registered on every access to the trading market