<%Option Explicit%> <%response.write setupClubName%> <% if request("kampid")<> "" then dim RS, SQL, strUID, strPWD, Username, Password set RS = server.createobject("ADODB.recordset") if request("action")<> "" then 'response.write request("plads") &"* *"&request("spiller") if session("UserID")<>""then SQL = "SELECT * FROM kampe WHERE kampid= " & request("kampid") RS.Open SQL,Conn,2,3 if not RS.eof then select case request("plads") case "spiller1" RS("spiller1") = request("spiller") case "spiller2" RS("spiller2") = request("spiller") case "spiller3" RS("spiller3") = request("spiller") case "spiller4" RS("spiller4") = request("spiller") case "spiller5" RS("spiller5") = request("spiller") case "spiller6" RS("spiller6") = request("spiller") case "spiller7" RS("spiller7") = request("spiller") case "spiller8" RS("spiller8") = request("spiller") case "spiller9" RS("spiller9") = request("spiller") case "spiller10" RS("spiller10") = request("spiller") case "spiller11" RS("spiller11") = request("spiller") case "spiller12" RS("spiller12") = request("spiller") case "spiller13" RS("spiller13") = request("spiller") case "spiller14" RS("spiller14") = request("spiller") end select RS.update end if RS.close SQL = "DELETE * FROM afbud WHERE afbudskampid= " & request("kampid")& " AND afbudsspillerid= " & request("spiller") RS.Open SQL,Conn,2,3 SQL = "DELETE * FROM kamptilmeldte WHERE kampid= " & request("kampid")& " AND spillerid= " & request("spiller") RS.Open SQL,Conn,2,3 end if end if if request("Tilmeld")<> "" then dim newTilmeld:newTilmeld = false if session("UserID")<>""then SQL = "SELECT * FROM kamptilmeldte WHERE kampid= " & request("kampid") & " AND spillerid= " & request("tilmeldspiller") RS.Open SQL,Conn,2,3 if not RS.eof then else newTilmeld = true end if RS.close if newTilmeld then SQL = "INSERT INTO kamptilmeldte (kampid,spillerid) VALUES ('"&request("kampid")&"','"&request("tilmeldspiller")&"')" RS.Open SQL,Conn,2,3 response.write removeFromSquad(request("kampid"),request("tilmeldspiller"),setupPlayersAmount) SQL = "DELETE * FROM afbud WHERE afbudskampid= " & request("kampid")& " AND afbudsspillerid= " & request("tilmeldspiller") RS.Open SQL,Conn,2,3 end if end if end if if request("Afbud")<> "" then dim newAfbud:newAfbud = false if session("UserID")<>""then SQL = "SELECT * FROM afbud WHERE afbudskampid= " & request("kampid") & " AND afbudsspillerid= " & request("afbudsspiller") RS.Open SQL,Conn,2,3 if not RS.eof then RS("afbudsgrund")=request("grund") RS.update else newAfbud = true end if RS.close if newAfbud then SQL = "INSERT INTO afbud (afbudskampid,afbudsspillerid,afbudsgrund) VALUES ('"&request("kampid")&"','"&request("afbudsspiller")&"','"&request("grund")&"')" RS.Open SQL,Conn,2,3 response.write removeFromSquad(request("kampid"),request("afbudsspiller"),setupPlayersAmount) SQL = "DELETE * FROM kamptilmeldte WHERE kampid= " & request("kampid")& " AND spillerid= " & request("afbudsspiller") RS.Open SQL,Conn,2,3 end if end if end if dim tactic(3), playerPos,i select case setupTactics case 1 tactic(0) = 3 tactic(1) = 3 tactic(2) = 0 tactic(3) = 3 case 2 tactic(0) = 2 tactic(1) = 3 tactic(2) = 1 tactic(3) = 3 case 3 tactic(0) = 3 tactic(1) = 2 tactic(2) = 1 tactic(3) = 3 end select playerPos = "Målmand" SQL = "SELECT * FROM kampe WHERE kampid= " & request("kampid") RS.Open SQL,Conn if not RS.eof then %> Holdet mod <%response.Write RS("modstander")%>:

<%if tactic(0) > 0 then%> <%end if%> <%for i = 2 to (1+tactic(0)) playerPos = "Forsvar"%> <%next%> <%if tactic(1) > 0 then%> <%end if%> <% for i = i to (1+tactic(0)+tactic(1)) playerPos = "Midtbane"%> <%next%> <%if tactic(2) > 0 then%> <%end if%> <% for i = i to (1+tactic(0)+tactic(1)+tactic(2)) playerPos = "Angreb"%> <%next%> <% for i = i to (1+tactic(0)+tactic(1)+tactic(2)+tactic(3)) playerPos = "Reserve"%> <%next%>
1. <% if RS("spiller1") > 0 then response.Write getPlayerName(RS("spiller1")) else if session("UserID")<>"" then %><%=playerPos%> ? <%else%> <%=playerPos%> ? <%end if end if %>
 
<%=i%>. <% if RS("spiller"&i) > 0 then response.Write getPlayerName(RS("spiller"&i)) else if session("UserID")<>"" then %><%=playerPos%> ? <%else%> <%=playerPos%> ? <%end if end if %>
 
<%=i%>. <% if RS("spiller"&i) > 0 then response.Write getPlayerName(RS("spiller"&i)) else if session("UserID")<>"" then %><%=playerPos%> ? <%else%> <%=playerPos%> ? <%end if end if %>
 
<%=i%>. <% if RS("spiller"&i) > 0 then response.Write getPlayerName(RS("spiller"&i)) else if session("UserID")<>"" then %><%=playerPos%> ? <%else%> <%=playerPos%> ? <%end if end if %>
 
<%=i%>. <% if RS("spiller"&i) > 0 then response.Write getPlayerName(RS("spiller"&i)) else if session("UserID")<>"" then %><%=playerPos%> ? <%else%> <%=playerPos%> ? <%end if end if %>
 

Ekstra tilmeldinger:
<% rs.close SQL = "SELECT * FROM Kamptilmeldte WHERE kampid = " & request("kampid") RS.Open SQL,Conn if not RS.eof then%> <% do until rs.eof response.write getPlayerName(RS("spillerid")) RS.movenext if not rs.eof then response.write ", " end if loop%> <%else%> Ingen ekstra tilmeldte. <%end if rs.close %>

<% dim arrAfbud, arrCount SQL = "SELECT * FROM Afbud WHERE afbudskampid = " & request("kampid") RS.Open SQL,Conn if not RS.eof then arrAfbud = RS.getRows() arrCount = ubound(arrAfbud,2)+1 end if RS.close if arrCount > 0 then%>

<%else%> Ingen afbud
<%end if%>

<%if session("UserID")<>"" then%>

  • Tilmeld dig som ekstra:
  • Meld afbud til kampen:
  • <% end if%>

    <%end if set RS=nothing end if %> <% function getAfbudByName(kampid) dim result, RS, SQL result = "" if kampid <> "" then set RS = server.createobject("ADODB.recordset") SQL = "SELECT * FROM Afbud WHERE afbudskampid = " & kampid RS.Open SQL,Conn if not RS.eof then do until RS.EOF result = result & "- " & getPlayerName(RS("afbudsspillerid")) if trim(RS("afbudsgrund"))<>"" then result = result & " (" & RS("afbudsgrund") & ")" end if result = result & "
    " RS.MoveNext loop else result = "Ingen afbud" end if RS.close set RS = nothing end if getAfbudByName = result end function function removeFromSquad(kampid, spillerid, setupPlayersAmount) dim RS, SQL, i, spiller, spillernr if kampid <> "" then set RS = server.createobject("ADODB.recordset") SQL = "SELECT * FROM kampe WHERE kampid = " & kampid &" AND (" for i = 1 to setupPlayersAmount SQL = SQL & "spiller"&i& "=" & spillerid & " OR " next SQL = SQL & "1=2)" RS.Open SQL,Conn,2,3 if not RS.eof then for i = 1 to setupPlayersAmount spiller = "spiller" & i if cint(RS(spiller)) = cint(spillerid) then spillernr = spiller end if next end if if spillernr <> "" then rs(spillernr) = 0 rs.update end if rs.close set RS = nothing end if removeFromSquad = "" end function closeconn() %>