Count Lines in Pages

Contents of Page: PropsUpdateStandings.asp Number of Lines: 211 Last Modified: 8/22/2018 1:33:12 PM
0001: <% @Language = "VBScript" %>
0002: 
0003: <!-- #include FILE="include/adovbs.inc" -->
0004: <!-- #include FILE="include/constants.inc" -->
0005: <!-- #include FILE="include/funcs.asp" -->
0006: 
0007: <%
0008: 
0009: 	Dim Bets(50,3)
0010: 	Kount = 0
0011: 	Set rsp = Server.CreateObject("ADODB.Recordset")
0012: 	sqlString = "SELECT * FROM PropBets WHERE Season = " & Season & " ORDER By DisplayOrder, ID"
0013: 	rsp.Open sqlString, conn3, adOpenStatic, adLockReadOnly, adCmdText
0014: 
0015: 	Kount = 0
0016: 	ResultsEntered = 0
0017: 	Do Until rsp.EOF
0018: 		Kount = Kount + 1
0019: 		WhoWon = Trim(rsp("WhoWon").Value)
0020: 		Bets(Kount,1) = WhoWon
0021: 		If WhoWon <> "" Then
0022: 			ResultsEntered = ResultsEntered +1
0023: 	    End If
0024: '		Response.Write(" Kount=" & Kount & " = " & Bets(Kount,1) & "-" & WhoWon)
0025: 	rsp.MoveNext
0026: 	Loop
0027: 
0028: 	rsp.Close
0029: 	Set rsp = Nothing
0030: 
0031: 	Dim MyPicks
0032: 
0033: 
0034: 		Set rsp = Server.CreateObject("ADODB.Recordset")
0035: 		sqlString = "SELECT * FROM PropPicks WHERE Season = " & Season 
0036:  rsp.Open sqlString, Conn3, adOpenDynamic, adLockOptimistic, adCmdText
0037: 
0038: 
0039: 
0040: 		Do Until rsp.Eof
0041: 
0042: 
0043: 		Correct = 0
0044: 
0045: MyResults = ""
0046: 
0047: 		MySelections = Trim(rsp("MySelections").Value)
0048: 		MyPicks = Split(MySelections,"-")
0049: 				K = 0
0050: 		Do Until K => Kount
0051: 		K = K + 1
0052: 
0053: 
0054: 		If MyPicks(k) = Bets(k,1) And MyPicks(k) <> "" Then
0055: 			MyResults = MyResults & "-1"
0056: 			Correct = Correct + 1
0057: 		Else
0058: 			MyResults = MyResults & "-0"
0059: 		End If
0060: ' Response.Write("<br>K=" & K & " MyPick(K)=" & MyPicks(K) & "Bets(k,1)= " & Bets(k,1) & " Correct=" & Correct)
0061:         loop
0062: 
0063:  'Response.Write("<Br>RegNumber=" & RegNumber & " = " & MyPicks & " " & FirstName)
0064: 		rsp("MyResults").Value = MyResults
0065: 		rsp("TotalPoints").Value = Correct
0066: 		rsp.Update
0067: 
0068: 
0069: 		
0070: 		rsp.MoveNext
0071: 		Loop
0072: 
0073: 	 rsp.Close
0074: 	Set rsp = Nothing
0075: 
0076: '	Set rs = Server.CreateObject("ADODB.Recordset")
0077: '	sqlString = "SELECT * FROM PropEntries WHERE EventID = " & EventID & " AND TieBreaker <> '' ORDER BY CorrectEntries DESC, TieBreaker DESC, LastName"
0078: ' '	rs.Open sqlString, conn3, adOpenStatic, adLockReadOnly, adCmdText
0079: '    rs.Open sqlString, conn3, adOpenDynamic, adLockOptimistic, adCmdText
0080: '	Rank = 0
0081: '	Do Until rs.eof
0082: '	Rank = Rank + 1
0083: '	rs("Rank").Value = Rank
0084: '	rs.update
0085: '	rs.MoveNext
0086: '	Loop
0087: '
0088: '	
0089: '	 rs.Close
0090: '	Set rs = Nothing
0091: '
0092: '
0093: '		Set rs = Server.CreateObject("ADODB.Recordset")
0094: '		sqlString = "SELECT * FROM mmConfig WHERE Element = 'PROPSTANDINGSUPDATED'" 
0095: '		rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0096: '		rs("Value").Value = Now()
0097: '		rs.update
0098: '		rs.Close
0099: '		Set rs = Nothing
0100: '
0101: '		Set rs = Server.CreateObject("ADODB.Recordset")
0102: '		sqlString = "SELECT * FROM mmConfig WHERE Element = 'PROPRESULTSENTERED'" 
0103: '		rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0104: '		rs("Value").Value = ResultsEntered
0105: '		rs.update
0106: '		rs.Close
0107: '		Set rs = Nothing
0108: 
0109: '	Response.Redirect("PropStandings.Asp?EventID=" & EventID)
0110: 
0111: 		Set cn = Server.CreateObject("ADODB.Connection")
0112: 		cn.Open conn
0113: 		sqlString = "DELETE FROM mmTop10 " & _
0114: 							"WHERE Season = " & season & " " & _
0115: 							"AND Contest = 'PP'"
0116: 
0117: Response.Write("<BR>" & sqlString & "<br>")
0118: 		cn.Execute sqlString, lngRecs, adExecuteNoRecords
0119: 		cn.Close
0120: 		Set cn = Nothing
0121: 
0122: 	Set rsp = Server.CreateObject("ADODB.Recordset")
0123: 	sqlString = "SELECT * FROM mmPrizes " & _
0124: 			"WHERE Season = " & season
0125: 	rsp.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0126: 
0127: 	If rsp.EOF Then
0128: 	Prize1 = 1
0129: 	Prize2 = 2
0130: 	Prize3 = 3
0131: 	Else
0132: 	Prize1 = rsp("P1").Value
0133: 	Prize2 = rsp("P2").Value
0134: 	Prize3 = rsp("P3").Value
0135: 	End if
0136: 
0137: 
0138: 
0139: 	Set rs = Server.CreateObject("ADODB.Recordset")
0140: 		sqlString = "SELECT * FROM PropPicks WHERE Season = " & Season & " ORDER BY TotalPoints DESC, MyResults DESC"
0141: 	       
0142: 	rs.Open sqlString, conn3, adOpenStatic, adLockReadOnly, adCmdText
0143: 
0144: 
0145: 
0146: 	
0147: Rank = 0 
0148: 
0149: Do Until rs.EOF	
0150: 
0151: EmailAddress = rs("EmailAddress").Value
0152: 			Set rsEntry = Server.CreateObject("ADODB.Recordset")
0153:     	sqlString = "SELECT * FROM mmEntries " & _
0154: 							"WHERE EmailAddress = '" & EmailAddress & "' " & _
0155: 							"AND Season = " & season
0156: 
0157: Response.write("<br>" & sqlstring)
0158: 	rsEntry.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0159: LastName = rsEntry("Name").Value
0160: FirstName = rsEntry("FirstName").Value
0161:        RegNumber = rsEntry("RegNumber").Value
0162: 	NameNew = FirstName & " " & LastName
0163: 
0164: Rank = Rank + 1
0165: 
0166: If Rank < 3 Then
0167: 
0168: 	Select Case Rank
0169: 			Case 1
0170: 				TotalAmount = Prize1
0171: 			Case 2
0172: 				TotalAmount = Prize2
0173: 			Case 3
0174: 				TotalAmount = Prize3
0175: 		End Select
0176: 		Set rstopten = Server.CreateObject("ADODB.Recordset")
0177: 		rstopten.Open "mmTop10", conn, adOpenDynamic, adLockOptimistic, adCmdTable
0178: 		rstopten.AddNew
0179: 		rstopten("Season").Value = Season
0180: 		rstopten("Rank").Value = Rank
0181: 		rstopten("Name").Value = Namenew
0182:         rstopten("RegNumber").Value = RegNumber
0183: '       rstopten("PicksID").Value = PicksID
0184: '       rstopten("City").Value = Citynew
0185: '       rstopten("PossPts").Value = PossPts
0186: '       rstopten("Top5Amt").Value = topfive
0187: '       rstopten("Top10Amt").Value = topten
0188:        rstopten("Contest").Value = "PP"
0189:        rstopten("TotalAmt").Value = TotalAmount
0190: 
0191:        rstopten.Update
0192:        rstopten.Close
0193:        Set rstopten = Nothing
0194:        End If
0195: 		rs.MoveNext
0196: 		Loop
0197: 		rs.Close
0198: 
0199: %>
0200: 
0201: <html>
0202: Biggest Loser, Sweet 16 & Prop Bets standings updated.<br><br>
0203: <a href="http://folga.org/ncaa/displaymenugen.asp?parent=40&title=March%20Madness%20-%20Scores / Standings Update">Return to menu</a>
0204: </html>
0205: 
0206: 
0207: 
0208: 
0209: 
0210: 
0211: