<% dim DSNdatabase, conn, rs, strSQL dim intNumberOfMessages, x, y, xx, blnKnop dim strPage, strAction, strTeam, strLastTeam, strUrl, strOmsch, strStand, blnFirstline, arrStanden(25), arrEvenementen dim strPoule, strweeknr, blnJeugd, blnCloseTable, Aantalstanden, strSelected dim krantid, strWanneer, strWaar, strKop, strTekst, TotalRecs dim verslagType, strVerslagid, uploadprefix dim Key, strId, strvalue, strOldScoreThuis, strOldScoreUit, strNewScoreThuis, strNewScoreUit dim strPagenr, arrBerichten, strBericht dim arrCorrecties(20) dim arr2Month, arr2Days intNumberOfMessages = 10 If LCase(Request.ServerVariables("SERVER_NAME")) = "localhost" then DSNdatabase = DSNtemp & "lpd_data_local.mdb" else DSNdatabase = DSNtemp & "lpd_data.mdb" end if uploadprefix = "upload/" verslagType = "C" arr2Month = array("", "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December") Function ShowDatum(strDate) ShowDatum = cstr(Day(strDate) & " " & arr2Month(Month(strDate)) & " " & Year(strDate)) End Function Function FirstUcase(strString) FirstUcase = ucase(left(strString,1))&mid(strString,2) End Function Sub RssLog dim rss_SessionID, rss_UserIP, rss_FirstPage, rss_Cookie, rss_Referer, rss_Browser, rss_Language dim rss_log, rss_conn, rss_rs, rss_strSQL rss_log = DSNtemp & "rsslog.mdb" rss_SessionID = Trim(Session.SessionID) rss_UserIP = Trim(Request.ServerVariables("REMOTE_HOST")) rss_Referer = Trim(Request.ServerVariables("HTTP_REFERER")) rss_FirstPage = Trim(Request.ServerVariables("Script_Name")) If rss_Referer = "" Then rss_Referer = "None" End If rss_Browser = Trim(Request.ServerVariables("HTTP_USER_AGENT")) rss_Language = Trim(Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")) If rss_Language = "" Then rss_Language = "UnKnown" End If rss_Cookie = Request.Cookies("LPD") If rss_Cookie = "" Then rss_Cookie = "None" End If On Error Resume Next Set rss_conn = server.createobject("adodb.connection") rss_conn.Open rss_log rss_strSQL = "SELECT * FROM PageLog WHERE 1=2" Set rss_rs = Server.CreateObject("ADODB.RecordSet") rss_rs.Open rss_strSQL, rss_conn, 3, 3 'adOpenStatic, adLockOptimistic rss_rs.AddNew rss_rs("SessionID") = Session.SessionID rss_rs("Date") = Date() rss_rs("Time") = Time() rss_rs("UserIP") = rss_UserIP rss_rs("Cookie") = rss_Cookie rss_rs("Referer") = rss_Referer rss_rs("Browser") = rss_Browser rss_rs("Language") = rss_Language rss_rs("HitPage") = rss_FirstPage rss_rs.Update rss_rs.Close Set rss_rs = Nothing rss_conn.Close set rss_conn = nothing On Error Goto 0 End Sub sub menu_line (link, tekst, klass) %><% =tekst %> <% end sub strPage = LCase(Trim(Request.Form("page"))) If strPage = "" then strPage = LCase(Trim(Request.QueryString("page"))) end if If strPage = "" then strPage = "competitie" RssLog end if strAction = LCase(Trim(Request.Form("action"))) If strAction = "" then strAction = LCase(Trim(Request.QueryString("action"))) end if ' pda_pagina_header ' pda_pagina_begin "" 'start de pagina zonder header %>
<% if 1=2 then %>

<% =strPage %>


<% %>

<% =strAction %>


<% end if menu_line "competitie", "Home", "competitie" %> <% select case strPage case "teams" strTeam = Request.QueryString("team") If strTeam = "" then strAction = "overzicht" End If strTeam = LCase(Trim(strTeam)) '==================================================================== ' Show overzicht '==================================================================== Set conn = server.createobject("adodb.connection") conn.Open DSNdatabase if strAction = "overzicht" then Set rs = Server.CreateObject("ADODB.Recordset") strSQL = "select * from teams order by TeamSenioren, TeamJunioren, Id, TeamNaam" rs.Open strSQL, conn, adOpenForwardOnly, adLockReadOnly Do While Not rs.EOF menu_line "teams&action=teams&team=" & cstr(rs.Fields("Id").value), cstr(rs.Fields("teamnaam").value)&" ("&cstr(rs.Fields("teampoule").value)&")", strPage rs.MoveNext Loop rs.Close Set rs = Nothing else Set rs = Server.CreateObject("ADODB.RecordSet") strSQL = "select teamleden.*, teams.teampoule as teampoule from teamleden inner join teams on teamleden.teamid = teams.id where teamleden.teamid = " & strTeam rs.Open strSQL, conn, adOpenForwardOnly, adLockReadOnly strLastTeam = "" if Not rs.EOF then strLastTeam = rs.Fields("teamnaam").value strUrl = rs.Fields("teamfotourl").value %>"><% =rs.Fields("teamnaam").value & " (" & rs.Fields("teampoule").value & ")" %> 
<% %>
<% %>

<% =strLastTeam %>

<% %><% Do While Not rs.EOF 'Display team member values %><% rs.MoveNext Loop if not isnull(strurl) then %><% end if %>
<% =rs.Fields("naam").value %>
<% =strLastTeam %>
 <% %>
<% end if rs.Close Set rs = Nothing end if conn.Close set conn = nothing case "competitie" strPoule = LCase(Trim(Request.Form("poule"))) If strPoule = "" then strPoule = LCase(Trim(Request.QueryString("poule"))) end if If strPoule = "" then strAction = "keuze" End If '==================================================================== ' Show overzicht '==================================================================== if strAction = "update" then strAction = "competitie" Set conn = server.createobject("adodb.connection") If LCase(Request.ServerVariables("SERVER_NAME")) = "localhost" then conn.Open DSNtemp & "competitie_local.mdb" else conn.Open DSNtemp & "competitie.mdb" end if Set rs = Server.CreateObject("ADODB.Recordset") strWeeknr = Request.Form("Weeknr") For Each Key In Request.Form if left(Key,6) = "stand_" then strId = right(Key, len(Key)-instr(Key,"_")) strValue = Request.Form(Key) strSQL = "SELECT * FROM Speelschema WHERE ID = " & strId & " and Weeknr= " & strWeeknr rs.Open strSQL, conn, adOpenStatic, adLockOptimistic strOldScoreThuis = rs.Fields("ScoreThuis").Value strOldScoreUit = rs.Fields("ScoreUit").Value if isnull(strOldScoreThuis) then strOldScoreThuis = "--" end if if isnull(strOldScoreUit) then strOldScoreUit = "--" end if if strValue > "00" and strValue <= "99" then if strValue = "50" then rs.Fields("ScoreThuis").Value = "5" rs.Fields("ScoreUit").Value = "-5" elseif strValue = "05" then rs.Fields("ScoreThuis").Value = "-5" rs.Fields("ScoreUit").Value = "5" else rs.Fields("ScoreThuis").Value = left(strValue, 1) rs.Fields("ScoreUit").Value = right(strValue, 1) end if end if if strValue = "00" then rs.Fields("ScoreThuis").Value = null rs.Fields("ScoreUit").Value = null end if strNewScoreThuis = rs.Fields("ScoreThuis").Value strNewScoreUit = rs.Fields("ScoreUit").Value if isnull(strNewScoreThuis) then strNewScoreThuis = "--" end if if isnull(strNewScoreUit) then strNewScoreUit = "--" end if if strOldScoreThuis <> strNewScoreThuis or strOldScoreUit <> strNewScoreUit then rs.Fields("Changed").Value = NOW() end if rs.Update rs.Close end if Next set rs = nothing conn.Close set conn = nothing end if select case strAction case "keuze" Set conn = server.createobject("adodb.connection") conn.Open DSNdatabase Set rs = Server.CreateObject("ADODB.Recordset") strSQL = "select * from teams order by TeamSenioren, TeamJunioren, Id, TeamNaam" rs.Open strSQL, conn, adOpenForwardOnly, adLockReadOnly strLastTeam = "" Do While Not rs.EOF menu_line "competitie&action=competitie&poule=" & cstr(rs.Fields("teampoule").value), cstr(rs.Fields("teamnaam").value)&" ("&cstr(rs.Fields("teampoule").value)&")", strPage if strPoule = rs.Fields("teampoule").value then strLastTeam = rs.Fields("teamnaam").value end if rs.MoveNext Loop rs.Close Set rs = Nothing conn.Close set conn = nothing case "competitie" Set conn = server.createobject("adodb.connection") conn.Open DSNdatabase Set rs = Server.CreateObject("ADODB.Recordset") strSQL = "select * from teams where teampoule = '" & strPoule & "'" rs.Open strSQL, conn, adOpenForwardOnly, adLockReadOnly if Not rs.EOF then %>"><% =rs.Fields("teamnaam").value & " (" & rs.Fields("teampoule").value & ")" %> <% strLastTeam = rs.Fields("teamnaam").value end if rs.Close Set rs = Nothing conn.Close set conn = nothing '==================================================================== Set conn = server.createobject("adodb.connection") If LCase(Request.ServerVariables("SERVER_NAME")) = "localhost" then conn.Open DSNtemp & "competitie_local.mdb" else conn.Open DSNtemp & "competitie.mdb" end if strSQL = "select * from SpeelschemaTeams where poule = '" & strPoule & "'" 'alleeen vorige, deze en komende week Set rs = Server.CreateObject("ADODB.RecordSet") rs.Open strSQL, conn, AdOpenForwardOnly, adLockReadOnly xx = 0 strweeknr = 0 blnCloseTable = False blnKnop = false if rs.EOF then %>

Er zijn geen standen voor dit team beschikbaar.

<% else %>
<% %>

<% =strLastTeam %>

<% Do While Not rs.EOF if strweeknr <> rs.Fields("Weeknr").value then strweeknr = rs.Fields("Weeknr").value blnCloseTable = True if strweeknr = 1 then ' xx =xx + 1 'als eerste week, dan beginnen bij "deze week" end if xx =xx + 1 select case xx case 1 response.write "Vorige week
" case 2 response.write "Deze week
" case 3 response.write "Volgende week
" end select %> <% end if %> <% if isnull(rs.Fields("ScoreThuis").value) then %> <% else %> <% end if rs.MoveNext if blnCloseTable then if rs.EOF then blnKnop = true elseif strweeknr <> rs.Fields("Weeknr").value then blnKnop = true end if if blnKnop then if xx < 3 then %><% end if blnKnop = false end if if rs.EOF then %>
Weeknr : <% =rs.Fields("Weeknr").value %> (<% =ShowDatum(rs.Fields("Datum").value) %><% if not blnJeugd then %> - <% =ShowDatum(dateadd("d",4,rs.Fields("datum").value)) %><% end if %>)
Thuis team Uit team Stand
<% =rs.Fields("TeamThuis").value %> <% =rs.Fields("TeamUit").value %><% =rs.Fields("TeamAvond").value %>
<% =rs.Fields("ScoreThuis").value %> - <% =rs.Fields("ScoreUit").value %>
<% %>
<% %><% %><% %><% %><% if blnJeugd and (strweeknr > 100) then %><% end if if not blnJeugd and (strweeknr < 100) then %><% end if %>
<% %>
 <% blnCloseTable = False elseif strweeknr <> rs.Fields("Weeknr").value then %>
<% blnCloseTable = False end if end if Loop rs.Close Set rs = Nothing 'lees alle correcties in strSQL = "select * from Teams where poule = '" & strPoule & "' order by TeamNaam" Set rs = Server.CreateObject("ADODB.RecordSet") rs.Open strSQL, conn, AdOpenForwardOnly, adLockReadOnly 'adOpenStatic, adLockOptimistic Aantalstanden = 0 Do While Not rs.EOF Aantalstanden = Aantalstanden + 1 arrCorrecties(Aantalstanden) = Array(rs.Fields("TeamNaam").value, rs.Fields("TeamCorrecties").value) rs.MoveNext Loop rs.Close Set rs = Nothing strSQL = "select * from TotaalScore where poule = '" & strPoule & "'" Set rs = Server.CreateObject("ADODB.RecordSet") rs.Open strSQL, conn, AdOpenForwardOnly, adLockReadOnly %> <% xx = 1 Do While Not rs.EOF y = 0 for x = 1 to Aantalstanden if cstr(rs.Fields("TeamNaam").value) = cstr(arrCorrecties(x)(0)) then y =arrCorrecties(x)(1) end if next %> class="alt"<% end if %>> <% rs.MoveNext xx = xx + 1 Loop %>
Teamnaam Punt Winst Uit Gem. Corr.
<% =rs.Fields("TeamNaam").value %> <% =rs.Fields("TotaalScore").value-y %> <% =rs.Fields("Winst").value %> <% =rs.Fields("AantalWedstrijden").value %> <% =left(rs.Fields("Gemiddelde").value,4) %> <% if y<>0 then %><% =abs(y) %><% else %> <% end if %>
  <% %>
<% end if rs.Close Set rs = Nothing conn.Close set conn = nothing case "week_invoer" ' strPoule = UCase(Trim(Request.QueryString("poule"))) strWeeknr = LCase(Trim(Request.QueryString("weeknr"))) Set conn = server.createobject("adodb.connection") conn.Open DSNdatabase Set rs = Server.CreateObject("ADODB.Recordset") strSQL = "select * from teams where teampoule = '" & strPoule & "'" rs.Open strSQL, conn, adOpenForwardOnly, adLockReadOnly if Not rs.EOF then %><% =rs.Fields("teamnaam").value & " (" & rs.Fields("teampoule").value & ")" %> <% strLastTeam = rs.Fields("teamnaam").value end if rs.Close Set rs = Nothing conn.Close set conn = nothing '==================================================================== Set conn = server.createobject("adodb.connection") If LCase(Request.ServerVariables("SERVER_NAME")) = "localhost" then conn.Open DSNtemp & "competitie_local.mdb" else conn.Open DSNtemp & "competitie.mdb" end if Set rs = Server.CreateObject("ADODB.Recordset") strSQL = "select * from KiesStand" rs.Open strSQL, conn, AdOpenForwardOnly, adLockReadOnly Aantalstanden = -1 Do While Not rs.EOF Aantalstanden = Aantalstanden + 1 arrStanden(Aantalstanden) = Array(rs.Fields("Id").value, rs.Fields("ThuisTekst").value, rs.Fields("UitTekst").value, rs.Fields("ThuisPunt").value, rs.Fields("UitPunt").value) rs.MoveNext Loop rs.Close Set rs = Nothing if session("editsystem") then strSQL = "select * from SpeelschemaTeamsAlleWeken where weeknr = " & strweeknr & " and poule = '" & strPoule & "'" 'alle weken. else strSQL = "select * from SpeelschemaTeams where weeknr = " & strweeknr & " and poule = '" & strPoule & "'" 'alleen vorige week en deze week. end if Set rs = Server.CreateObject("ADODB.RecordSet") rs.Open strSQL, conn, AdOpenForwardOnly, adLockReadOnly 'adOpenStatic, adLockOptimistic if rs.EOF then %>
Niet juist weeknummer gekozen.
<% else %>
<% %>

<% =strLastTeam %>

<% %>
"> <% y = 1 Do While Not rs.EOF %> class="alt"<% end if %>> <% rs.MoveNext y = y + 1 Loop %>
Weeknr : <%=rs.Fields("Weeknr").value%> (<%=ShowDatum(rs.Fields("Datum").value)%><% if not blnJeugd then %> - <%=ShowDatum(dateadd("d",4,rs.Fields("datum").value))%><% end if %>)
<%=rs.Fields("TeamThuis").value%> - <%=rs.Fields("TeamUit").value%>
<% strSelected = "00" if not isnull(rs.Fields("ScoreThuis").value) and not isnull(rs.Fields("ScoreUit").value) then strSelected = cstr(rs.Fields("ScoreThuis").value) + cstr(rs.Fields("ScoreUit").value) strSelected = replace(strSelected,"-5","0") end if %>
<% end if rs.Close Set rs = Nothing conn.Close set conn = nothing end select case "menu" 'nothing to do case else %>

Onbekende pagina.

<% %>Page : <% =strPage %>/<% =strAction %><% end select %> <% pda_pagina_eind %>