Count Lines in Pages

Contents of Page: DraftStandings.asp Number of Lines: 256 Last Modified: 3/20/2024 2:57:21 PM
0001: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
0002: 
0003: <!-- #include FILE="include/adovbs.inc" -->
0004: <!-- #include FILE="include/constants.inc" -->
0005: <!-- #include FILE="include/funcs.asp" -->
0006: <%
0007: '
0008: ' Remove Old Results
0009: '
0010: GroupID = Request.Querystring("GroupID")
0011: Yr = Request.Querystring("Year")
0012: 
0013: If Yr <> "" Then
0014: season = Yr
0015: End If
0016: 
0017: If GroupID = "" Then GroupID = 1
0018: 
0019: F64Wins = 0
0020: F32Wins = 0
0021: F16Wins = 0
0022: F8Wins = 0
0023: F4Wins = 0
0024: F2Wins = 0
0025: 
0026: 
0027: '==============================================================
0028: 
0029: Dim Regions(5)
0030: 
0031: Set rs = Server.CreateObject("ADODB.Recordset")
0032: 	sqlString = "SELECT * FROM mmRegionals WHERE Season = " & Season & " ORDER BY Region"
0033: 	rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0034: 	
0035: 	R = 1
0036: 	DO Until rs.EOF
0037: 	Regions(R) = rs("RegionName").Value
0038: 	R = R + 1
0039: 	rs.MoveNext
0040: 	Loop
0041: 	
0042: 	
0043: '--------------------------------------------------------------	
0044: 
0045: 
0046: %>
0047: 
0048: <html>
0049: 
0050: <head>
0051: <meta name="viewport" content="width=device-width">
0052: <link href="mm.css" rel="stylesheet" type="text/css">
0053: <title>March Madness - Draft Standings</title>
0054: <base target="_self">
0055: </head>
0056: <table cellspacing="1" border="0" cellpadding="2" width="600" >
0057: <tr><td class="norm" colspan="3"><%= Season %> - <%= GroupID %></b></td>
0058: <td class="smalldark" colspan="8" align="right">	  
0059: 	  Last updated @  <font color="red"><%= STANDINGSUPDATED %></font> (Central Time)
0060: </tr>
0061: <tr bgcolor="#ff9933">
0062: <td class="norm" width="25%">Name</td>
0063: <td class="norm" align="center" width="7%">Total<br>Wins</td>
0064: <td class="norm" align="center" width="7%">Total<br>Points</td>
0065: <td class="norm" align="center" width="7%"><small>Region</td>
0066: <td class="norm" width="20%">Team Name</td>
0067: <td class="norm" align="center" width="6%">RD1</td>
0068: <td class="norm" align="center" width="6%">RD2</td>
0069: <td class="norm" align="center" width="6%">S16</td>
0070: <td class="norm" align="center" width="6%">F8</td>
0071: <td class="norm" align="center" width="6%">F4</td>
0072: <td class="norm" align="center" width="6%">F2</td>
0073: <%
0074: 
0075: 		Set rsd = Server.CreateObject("ADODB.Recordset")
0076: 
0077:     	sqlString = "SELECT * FROM mmdraft WHERE Season = " & season & " AND GroupID = '" & GroupID & "' ORDER BY TotalWins DESC, TotalPoints DESC, LastName"				
0078: 							
0079: 		rsd.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0080: 
0081: 		Do Until rsd.EOF
0082: 		
0083: 		
0084: 			TotalWins = 0
0085: 			TotalPoints = 0
0086: 		
0087: 			RegNumber = rsd("RegNumber").Value
0088: 			DraftOrder = rsd("DraftOrder").Value
0089: 			TotalWins = rsd("TotalWins").Value
0090: 			TotalPoints = rsd("TotalPoints").Value
0091: 
0092: 			Set rsm = Server.CreateObject("ADODB.Recordset")
0093: 
0094:     		sqlString = "SELECT * FROM MY4_Master WHERE RegNumber = '" & RegNumber & "'"				
0095: 							
0096: 			rsm.Open sqlString, conn2, adOpenStatic, adLockReadOnly, adCmdText	
0097: 
0098: 			LastName = rsm("LastName").Value
0099: 			FirstName = rsm	("FirstName").Value
0100: 
0101: 			rsm.Close
0102: 
0103: %>
0104: <tr>
0105: <td class="norm"><big><%= FirstName %>&nbsp;<%= LastName %> <i><small>(<%= DraftOrder %>)</td>
0106: <td class="norm" align="center"><big><b><%= TotalWins %></td>
0107: <td class="norm" align="center"><big><b><%= TotalPoints %></td>
0108: <%
0109: 
0110: 			Set rs = Server.CreateObject("ADODB.Recordset")
0111: 
0112:     		sqlString = "SELECT * FROM mmdraftpicks WHERE  Season = " & season & " AND GroupID = " & GroupID & " AND RegNumber = '" & RegNumber & "' ORDER BY TeamID"
0113: 							
0114: 			rs.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0115: 
0116: 			Do Until rs.EOF
0117: 			
0118: 				TeamID = rs("TeamID").Value
0119: 				Seed = rs("Seed").Value
0120: 				TeamName = rs("TeamName").Value
0121: 				PickNumber = rs("PickNumber").Value
0122: 			TeamRegion = left(TeamID,1)
0123: 			If TeamRegion = "A" Then
0124: 			RegionKey = Regions(1)
0125: 			ElseIf TeamRegion = "B" Then
0126: 			RegionKey = Regions(2)
0127: 			ElseIf TeamRegion = "C" Then
0128: 			RegionKey = Regions(3)
0129: 			ElseIf TeamRegion = "D" Then
0130: 			RegionKey = Regions(4)
0131: 			End If
0132: 
0133: 				Set rsr = Server.CreateObject("ADODB.Recordset")
0134: 
0135:     			sqlString = "SELECT * FROM mmresults WHERE Season = " & Season & " " & _
0136: 				             "AND ID = '" & TeamID & "' "
0137: 				
0138: 				'Response.Write("<BR>" & sqlString)						
0139: 				rsr.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0140: 
0141: 				F32Pts = rsr("F32Pts").Value
0142: 				F16Pts = rsr("F16Pts").Value
0143: 				F8Pts = rsr("F8Pts").Value
0144: 				F4Pts = rsr("F4Pts").Value
0145: 				F2Pts = rsr("F2Pts").Value
0146: 				F1Pts = rsr("F1Pts").Value
0147: 
0148: 				F64Score = rsr("F64Score").Value
0149: 				F32Score = rsr("F32Score").Value
0150: 				F16Score = rsr("F16Score").Value
0151: 				F8Score = rsr("F8Score").Value
0152: 				F4Score = rsr("F4Score").Value
0153: 				F2Score = rsr("F2Score").Value
0154: 
0155: 				If F32Pts = 99 Or F32Pts = 0 Then
0156: 				   F64Score = ""
0157: 				Else
0158: 					If F64Score > 0 Then
0159: 						F64Wins = F64Wins + 1
0160: 					End If
0161: 				End If
0162: 				If F16Pts = 99 Or F16Pts = 0 Then
0163: 				   F32Score = ""
0164: 				Else
0165: 					If F32Score > 0 Then
0166: 						F32Wins = F32Wins + 1
0167: 					End If
0168: 				End If
0169: 				If F8Pts = 99 Or F8Pts = 0 Then
0170: 				   F16Score = ""
0171: 				Else
0172: 					If F16Score > 0 Then
0173: 						F16Wins = F16Wins + 1
0174: 					End If
0175: 				End If
0176: 				If F4Pts = 99 Or F4Pts = 0 Then
0177: 				   F8Score = ""
0178: 				Else
0179: 					If F8Score > 0 Then
0180: 						F8Wins = F8Wins + 1
0181: 					End If
0182: 				End If
0183: 				If F2Pts = 99 Or F2Pts = 0 Then
0184: 				   F4Score = ""
0185: 				Else
0186: 					If F4Score > 0 Then
0187: 						F4Wins = F4Wins + 1
0188: 					End If
0189: 				End If
0190: 				If F1Pts = 99 Or F1Pts = 0 Then
0191: 				   F2Score = ""
0192: 				Else
0193: 					If F2Score > 0 Then
0194: 						F2Wins = F2Wins + 1
0195: 					End If
0196: 				End If
0197: Strike = ""
0198: Bold = ""
0199: 	If F1Pts = "99" Then
0200: 		FontColor = "#FF0000"
0201: 		Strike = "<strike>"
0202: 		EndStrike = "</strike>"
0203: 
0204: 	Else
0205: 		FontColor = "#008000"
0206: 	Bold = "<b>"
0207: 	End If
0208: 
0209: %>
0210: <td class="normbold" align="center"><%= Left(RegionKey,1) %></td>
0211: <td class="norm" align="left"><Font color="<%= FontColor %>"><%= Strike %><%= bold %><%= TeamName %> </b><small>(<%= Seed %>)</td>
0212: <td class="norm" align="center"><%= F64Score %></td>
0213: <td class="norm" align="center"><%= F32Score %></td>
0214: <td class="norm" align="center"><%= F16Score %></td>
0215: <td class="norm" align="center"><%= F8Score %></td>
0216: <td class="norm" align="center"><%= F4Score %></td>
0217: <td class="norm" align="center"><%= F2Score %></td>
0218: 
0219: <%
0220: '					End If
0221: 
0222: %>
0223: </tr>
0224: <tr><td colspan="3"></td>
0225: 
0226: <%
0227: 
0228: 			rs.MoveNext
0229: 			Loop
0230: %>
0231: 
0232: </tr>
0233: 
0234: <%
0235: 
0236: 		rsd.MoveNext
0237: 		Loop
0238: %>
0239: <tr><td colspan="5" class="norm" align="right"><br>Games played per round:</td>
0240: <td class="norm" align="center">---<br><%= F64Wins %></td>
0241: <td class="norm" align="center">---<br><%= F32Wins %></td>
0242: <td class="norm" align="center">---<br><%= F16Wins %></td>
0243: <td class="norm" align="center">---<br><%= F8Wins %></td>
0244: <td class="norm" align="center">---<br><%= F4Wins %></td>
0245: <td class="norm" align="center">---<br><%= F2Wins %></td>
0246: </tr>
0247: <%
0248: 
0249: '		Response.Write("Draft Standings Updated for GroupID " & GroupID & ", RoundNo " & RoundNo )
0250: 		
0251: %>		
0252: 		</table>
0253: </html>
0254: 
0255: 
0256: