<%@ LANGUAGE="VBSCRIPT" %> <%Option Explicit %> Game Listing

Report a match



<% if Session("Player_ID") & "" <> "" then 'they are logged in. dim rst, sql, n, m, cnt, match_id, phase, same2, haveascore, scoretot phase = 1 cnt = Request("Player_Cnt") & "" if cnt <> "" then if isNumeric(cnt) then cnt = Clng(cnt) if cnt > 1 then phase = 2 else cnt = 0 else cnt = 0 end if else cnt = 0 end if same2 = 0 haveascore = 0 scoretot = 0 if phase = 2 then for n = 1 to cnt for m = n + 1 to cnt if request("Player_ID" & n) = request("Player_ID" & m) and request("Player_ID" & m) & "" <> "" then same2 = 1 next if Request("Score" & n) & "" <> "" then if IsNumeric(Request("Score" & n)) then haveascore = haveascore + 1 if CLNG(Request("Score" & n)) > 0 then scoretot = scoretot + CLNG(Request("Score" & n)) end if end if next end if response.write "same2: " & same2 & "
" response.write "have a score: " & haveascore & "
" response.write "score total: " & scoretot & "
" if same2 = 1 then response.write "

You must select a different player for each score.

" if haveascore = cnt and scoretot = 0 then response.write "

You may not report a game that has no frags.

" end if if same2 = 0 and scoretot > 0 and haveascore = cnt then phase = 3 if phase = 3 then match_id = New_Match(session("Player_ID"), Now(), request("Game_ID")) For n = 1 To cnt TheDB.Execute "Insert into Score(Match_ID, Player_ID, Score) " & _ "Values(" & Match_ID & ", " & request("Player_ID" & n) & ", " & Request("Score" & n) & ")" Next response.write "Processing Deathmatch.
" Process_A_Match Match_ID response.write "Done!
" else response.write "
" response.write "" if phase >= 1 then response.write "" response.write "" end if if phase = 1 then response.write "" response.write "" else response.write "" response.write "" end if sql = "Select Player_ID as StoredValue, Player_Name as DisplayedValue from Player order by Player_Name" for n = 1 to cnt response.write "" response.write "" 'response.write "" response.write "" next response.write "" response.write "
Select Game:
How many players:
How many players:" & WebSafe(Request("Player_Cnt")) & "
Player " & n & ":
" 'response.write "
Scored:
" end if else 'they are not logged in. response.write "Please login
" end if %> <% CleanupTheDB %> Return to Game list.
<% sub MakeList(sql, defl) dim lst set lst = GetRecordset(TheDB, sql) do until lst.eof response.write "" & chr(13) lst.movenext loop lst.close set lst = nothing end sub %>