Count Lines in Pages

Contents of Page: bracketscoreupdatenew.asp Number of Lines: 259 Last Modified: 2/7/2026 10:27:31 AM
0001: <% @Language = "VBScript" %>
0002: 
0003: <!-- #include FILE="include/adovbs.inc" -->
0004: <!-- #include FILE="include/constants.inc" -->
0005: 
0006: <%
0007: 	team1 = Request.Form("team1")
0008: 	team2 = Request.Form("team2")
0009: 	teamName1 = Request.Form("teamName1")
0010: 	teamName2 = Request.Form("teamName2")	
0011: 
0012: 	score1 = Cint(Request.Form("score1"))
0013: 	score2 = Cint(Request.Form("score2"))
0014: 	ogscore1 = Cint(Request.Form("ogscore1"))
0015: 	ogscore2 = Cint(Request.Form("ogscore2"))	
0016: 	
0017: 	' Check for Expceptions
0018: 
0019: If Score1 = Score2 and ( score1 <> 0 and score2 <> 0 ) Then
0020: 
0021: ErrorMsg = "Scores Can't be the Same"
0022: 
0023: Response.Redirect("https://mychinodes.org/DESDisplayError.asp?ErrorMsg=" & ErrorMsg)	
0024: 
0025: End If
0026: 
0027: Response.Write("score1=" & score & " score2=" & score2)
0028: 
0029: If ( Score1 = 0 and Score2 <> 0 ) or ( score1 <> 0 and score2 = 0 ) Then
0030: 
0031: ErrorMsg = "A single score can't be 0"
0032: 
0033: Response.Redirect("https://mychinodes.org/DESDisplayError.asp?ErrorMsg=" & ErrorMsg)	
0034: 
0035: End If
0036: 	
0037: 
0038: 
0039: If score1 = 0 and score2 = 0 Then
0040: Reset = True
0041: Else
0042: Reset = False
0043: End If
0044: 	
0045: 	KRound = Request.Form("Round")
0046: 	
0047: 	If KRound < 5 Then
0048: 	GRegion = Left(team1,1)
0049: 	Else
0050: 	GRegion = "F4"
0051: 	End If
0052: 	
0053: 
0054: 	
0055: 	Response.Write("<BR>Region=" & GRegion & "<br>Round=" & KRound & "<br>")
0056: 	
0057: 	If Score1 > Score2 Then
0058: 	Winner = team1
0059: 	Loser = team2
0060: 	WinnerScore = score1
0061: 	LoserScore = score2
0062: 	Else
0063: 	Winner = team2
0064: 	Loser = team1
0065: 	WinnerScore = score2
0066: 	LoserScore = score1
0067: 	End if
0068: 
0069: 
0070: 	Dim Rounds(6)
0071: 	Dim Scores(6)
0072: 	Dim Points(6)
0073: 	Rounds(1) = "F32Pts"
0074: 	Rounds(2) = "F16Pts"
0075:   	Rounds(3) = "F8Pts"
0076: 	Rounds(4) = "F4Pts"
0077: 	Rounds(5) = "F2Pts"
0078: 	Rounds(6) = "F1Pts"
0079: 	Scores(1) = "F64Score"
0080: 	Scores(2) = "F32Score"
0081: 	Scores(3) = "F16Score"
0082: 	Scores(4) = "F8Score"
0083: 	Scores(5) = "F4Score"
0084: 	Scores(6) = "F2Score"
0085: 	Points(1) = 1
0086: 	Points(2) = 2
0087: 	Points(3) = 4
0088: 	Points(4) = 8
0089: 	Points(5) = 16
0090: 	Points(6) = 32
0091: 	
0092: 	If Reset = True Then
0093: 	Points(Kround) = 0
0094: 	LoserPts = 0
0095: 	Else
0096: 	LoserPts = 99
0097: 	End If
0098: 	
0099: 	
0100: 		If score1 <> ogscore1 or score2 <> ogscore2 Then ' no update
0101: 	
0102: 	Set rs = Server.CreateObject("ADODB.Recordset")
0103: 	sqlString = "SELECT * FROM mmResults " & _
0104: 			"WHERE Season = " & season & " " & _
0105: 			"AND ID = '" & winner & "' " 
0106: 			Response.Write(sqlString)
0107: 	rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText	
0108: 	
0109: 	ID = rs("ID").Value
0110: 	
0111: 	Response.Write("<br>Team1=" & Team1 & Scores(KRound) & "=" & score1)
0112: 	
0113: 		Response.Write("<br>Team2=" & Team2 & Scores(KRound) & "=" & score2)
0114: 	
0115: 	Response.Write("<BR>Winner=" & Winner)
0116: 	
0117: 	
0118: 	Response.Write("<br>" & Rounds(KRound) & "=" & Points(KRound))
0119: 	
0120: 	rs(Scores(KRound)).Value = Cint(WinnerScore)
0121: 	rs(Rounds(KRound)).Value = Points(KRound)
0122: 	
0123: 	If KRound < 6 then 
0124: 	RestOf = KRound + 1
0125: 	
0126: 	For Intr = RestOf to 6
0127: 		rs(Rounds(Intr)).Value = 0
0128: 		rs(Scores(Intr)).Value = 0
0129: 		Response.Write("<br>" & Rounds(Intr) & "=0")
0130: 		
0131: 'Intr = Intr + 1	
0132: 	Next
0133: 	
0134: 	End If
0135: 			rs.Update
0136: 			
0137: 	
0138: 			
0139: 			
0140: Set rs = Server.CreateObject("ADODB.Recordset")
0141: 	sqlString = "SELECT * FROM mmResults " & _
0142: 			"WHERE Season = " & season & " " & _
0143: 			"AND ID = '" & loser & "' " 
0144: 			Response.Write(sqlString)
0145: 	rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText	
0146: 	
0147: 		ID = rs("ID").Value
0148: 	
0149: '	Response.Write("<br>Team1=" & Team1 & Scores(KRound) & "=" & score1)
0150: 	
0151: '		Response.Write("<br>Team2=" & Team2 & Scores(KRound) & "=" & score2)
0152: 	
0153: '	Response.Write("<BR>Winner=" & Winner)
0154: 	
0155: 	
0156: 	Response.Write("<br>" & Rounds(KRound) & "=" & Points(KRound))
0157: 	
0158: 	rs(Scores(KRound)).Value = Cint(LoserScore)
0159: 	rs(Rounds(KRound)).Value = LoserPts
0160: 	
0161: 	If KRound < 6 then 
0162: 	RestOf = KRound + 1
0163: 	
0164: 	For Intr = RestOf to 6
0165: 		rs(Rounds(Intr)).Value = LoserPts
0166: 		rs(Scores(Intr)).Value = 0		
0167: 		Response.Write("<br>" & Rounds(Intr) & "=0")
0168: 		
0169: 'Intr = Intr + 1	
0170: 	Next
0171: 	
0172: 	End If
0173: 			rs.Update	
0174: 
0175: 		
0176: 	
0177: 		
0178: 	Response.Write("<BR>Loser=" & Loser)
0179: 	
0180: 	Response.Write("<br>" & Rounds(KRound) & "=" & LoserPts)
0181: 	
0182: 	If KRound < 6 then 
0183: 	RestOf = KRound + 1
0184: 	
0185: 	For Intr = RestOf to 6
0186: 	
0187: 		Response.Write("<br>" & Rounds(Intr) & "=" & LoserPts)
0188: 	'    Intr = Intr + 1	
0189: 	Next
0190: 	
0191: 	End If
0192: 	
0193: 	
0194: 
0195: 
0196: 	' TeamName = Request.Form("Name")
0197: 
0198: 		' Do Until rs.EOF
0199: 		' LastValue = 0
0200: 		' For IntR = 0 to 5
0201: 		' temp = Trim(Request.Form(Rounds(IntR)))
0202: 		' If LastValue = "99" Then
0203: 		' temp = "99"
0204: 		' End If
0205: 		' rs(Rounds(IntR)).Value = temp
0206: 		' LastValue = Temp
0207: 		' RoundScore = Trim(Request.Form(Scores(IntR)))
0208: 		' If RoundScore = "" Then
0209: 		   ' RoundScore = 0
0210: 		' End If
0211: 		' rs(Scores(IntR)).Value = RoundScore
0212: 		' Next
0213: 		' RoundScore = Trim(Request.Form(Scores(6)))
0214: 		' If RoundScore = "" Then
0215: 		   ' RoundScore = 0
0216: 		' End If
0217: 		' rs(Scores(6)).Value = RoundScore
0218: ' '		rs.Update
0219: 
0220:     	' rs.MoveNext
0221: 		' Loop
0222: 				' rs.Close
0223: 		' Set rs = Nothing
0224: 
0225: 
0226: 		' Set rs = Server.CreateObject("ADODB.Recordset")
0227: 		' sqlString = "SELECT * FROM mmConfig WHERE Element = 'SCORESUPDATED'" 
0228: 		' rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0229: 
0230: 		' rs("Value").Value = Now() & "</font>  (" & TeamName & ")"
0231: ' '		rs.update	BracketsResultsUpdate.asp
0232: 		' rs.Close
0233: 		' Set rs = Nothing
0234: 		' Response.Redirect("viewResultsTable.asp?ShowAll=" & ShowAll & "&Region=" & Region)	
0235: 	
0236: 	End If ' No update
0237: 	
0238: 			rs.Close
0239: 		Set rs = Nothing
0240: 	
0241: 	
0242: 		Set rs = Server.CreateObject("ADODB.Recordset")
0243: 		sqlString = "SELECT * FROM mmConfig WHERE Element = 'SCORESUPDATED'" 
0244: 		rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0245: 		
0246: 		NowTime = DateAdd("h",-2,Now())
0247: 
0248:         response.write("<br><b>" & "(" & TeamName1 & "-" & TeamName2 & ") </b><br>@ " & NowTime )
0249:      
0250: 		rs("Value").Value = "(<big>" & TeamName1 & "-" & TeamName2 & ")</big></b><br> @ " & NowTime 
0251: 		rs.update
0252: 		rs.Close
0253: 		Set rs = Nothing
0254: 	
0255: 		Response.Redirect("BracketsResultsUpdatenew.asp?Region=" & GRegion)
0256: 		
0257: 		%>
0258: 		<a href="BracketsResultsUpdatenew.asp?Region=<%= GRegion %>">Continue to BracketsResultsUpdate page</a>
0259: