Count Lines in Pages

Contents of Page: DisplayWhoKnew.asp Number of Lines: 363 Last Modified: 3/21/2024 5:09:39 PM
0001: <% @Language = "VBScript" %>
0002: <!-- #include FILE="include/adovbs.inc" -->
0003: <!-- #include FILE="include/constants.inc" -->
0004: <!-- #include FILE="include/funcs.asp" -->
0005: <!-- #include FILE="include/ReturnPageSet.inc" -->	
0006: <%
0007: 	yr = Request.QueryString("yr")
0008: 	Thisyr = Request.QueryString("yr")
0009: 	RegNumber = Request.QueryString("RegNumber")
0010: 	MyChampion = Request.QueryString("Champion")
0011: 	ShowTop5 = Request.QueryString("Top5")
0012: 	ShowTop10 = Request.QueryString("Top10")
0013: 	MaxToShow = 0
0014: 	RealName = Request.QueryString("RealName")
0015: 	TotalMobileEntries = 0
0016: 
0017: G1 = Request.QueryString("G1")
0018: T1 = Request.QueryString("T1")
0019: G2 = Request.QueryString("G2")
0020: T2 = Request.QueryString("T2")
0021: 
0022: 
0023: 
0024: 
0025: 	If ShowTop5 = "Y" Then
0026: 	MaxToShow = 5
0027: 	End If
0028: 
0029: 	If yr <> "" Then
0030: 	yr = CInt(yr)
0031:     season = yr
0032: 	else	
0033: 	season = CInt(season)
0034: 	End if
0035: 
0036: 	Team1 = DisplayTeam(T1)
0037: Team2 = DisplayTeam(T2)
0038: 
0039: 
0040: 	MaxYearToShow = 2012
0041: 
0042: 	If yr = "" Then yr = season
0043: 
0044: 	If RealName <> "RealName" Then
0045: 	   RealName = "Name"
0046: 	End If
0047: 
0048: 
0049: 
0050: 		Set rsp = Server.CreateObject("ADODB.Recordset")
0051: 	sqlString = "SELECT * FROM mmPrizes " & _
0052: 			"WHERE Season = " & yr
0053: 	rsp.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0054: 
0055: 
0056: If yr < Season Then
0057: Future = "Y"
0058: NextYr = yr + 1
0059: End IF
0060: 
0061: LastYr = Yr - 1
0062: 
0063: '	If startmakepicks = "YES" Then
0064: 	user = Request.Cookies("user")
0065: 	If user = "" and startmakepicks = "YES" Then Response.Redirect("login.asp?from=standings.asp")
0066:  
0067:   	Set rsg = Server.CreateObject("ADODB.Recordset")
0068: 	sqlString = "SELECT * FROM mmEntries " & _
0069: 			"WHERE Season = " & yr & " " & _
0070: 			"AND EmailAddress = '" & user & "'"
0071: '	rsg.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0072:     rsg.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText	  
0073: 	
0074:     YrDiff = season - yr
0075:     If YrDiff <> 0 Then
0076:     ShowStand = True
0077:     Else
0078:     ShowStand = False
0079:     End If
0080:     	
0081: 	If rsg.EOF Then
0082: 	
0083:     Else	
0084: 	paid = rsg("PaidEntries").Value
0085:     Entries = rsg("NumEntries").Value
0086:     Num2ndEntries = rsg("Num2ndEntries").Value
0087: 	paid2nd = rsg("Paid2ndEntries").Value
0088: 	firstname = rsg("FirstName").Value
0089: 	ShowStand = rsg("ShowStandings").Value
0090: 	MyRegNumber = rsg("RegNumber").Value
0091: 	
0092: 	rsg.Close
0093: 	set rsg = Nothing
0094:     End If
0095: 
0096: 	
0097:     
0098: 
0099: 
0100:    
0101: '    End If
0102: 	
0103: 	sortStr = Request.QueryString("sort")
0104: 	If sortStr = "" Then sortStr = "Rank"
0105: 	Select Case sortStr
0106: 	Case "Pts"
0107: 			sortStr = sortStr & " DESC, Rank"
0108: 		Case "Final8"
0109: 			sortStr = sortStr & " DESC, Rank"
0110: Case "Round1"
0111: 			sortStr = sortStr & " DESC, Rank"
0112: Case "Sweet16"
0113: 			sortStr = sortStr & " DESC, Rank"
0114: 
0115: 		Case "Final4"
0116: 			sortStr = sortStr & " DESC, Rank"
0117: 		Case "Final2"
0118: 			sortStr = sortStr & " DESC, Rank"
0119: 		Case "Final1"
0120: 			sortStr = sortStr & " DESC, Rank"			
0121: 		Case "Champion"
0122: 			sortStr = sortStr & ", Rank"	
0123: 		Case "F4"
0124: 			sortStr = "Final4 DESC, Champion, RunnerUp, Rank"	
0125: 	End Select
0126: 
0127: 	If MyChampion <> "" Then
0128: 	   AddSel = " AND Champion = '" & MyChampion & "' "
0129:     End If
0130: 
0131: 
0132: 
0133: 			Set rst = Server.CreateObject("ADODB.Recordset")
0134: 	sqlString = "SELECT COUNT(Season) as RecordCount FROM mmStandings " & _
0135: 			"WHERE Season = " & yr 
0136: 	rst.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0137: 	
0138: totpicks = CInt(rst("RecordCount").Value)
0139: '	totpicks = rst.RecordCount
0140:  '  	tenpct = totpicks / 10
0141: 
0142: 
0143: 
0144: 	
0145: 		
0146: '	totpicks = rs.RecordCount
0147:    	tenpct = CInt(totpicks / 10)
0148: 
0149: 	If ShowTop10 = "Y" Then
0150: 	   MaxToShow = tenpct
0151: 	End If
0152: 
0153: 
0154:    	
0155: 
0156: 	Set rsSeasons = Server.CreateObject("ADODB.Recordset")
0157: 	sqlString = "SELECT DISTINCT Season FROM mmStandings " & _
0158: 			"ORDER BY Season DESC"
0159: 	rsSeasons.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0160: 
0161: 	
0162: %>
0163: <html>
0164: 
0165: <head>
0166: <title>March Madness - Standings</title>
0167: <meta name="viewport" content="width=device-width">
0168: <link href="mm.css" rel="stylesheet" type="text/css">
0169: <script language="JavaScript">
0170: 	
0171: 		function getData(form)	{
0172: 			var yr = form.SeasonYr.options[form.SeasonYr.selectedIndex].value
0173: 			if (yr != "")	{
0174: 				document.location.href = "standings.asp?yr="+yr
0175: 			}
0176: 		}
0177: 		
0178: 	</script>
0179: </head>
0180: 
0181: <body bgcolor="#ffffff" width="850">
0182: 
0183: 
0184: <table cellspacing="1" border="0" cellpadding="0" width="550" align="center">
0185: <% If Team1 <> Team2 Then %>
0186: <tr height="30" valign="center"><td class="norm" colspan="6">Season: <%= season %><br><big>Entries with the matchup: <font color="blue"><b><%= Team1 %></b><font> - <b><font color="blue"><%= Team2 %></b><br>&nbsp;</td>
0187: <% Else %>
0188: <tr height="30" valign="center"><td class="norm" colspan="6">Season: <%= season %><br><big>Entries who picked <b><%= Team2 %></b> to win it all.</td>
0189: <% End If %>
0190: <td colspan="7" align="right"><input type="button" value="Close Window" class="norm" onClick="window.close()"></td>
0191: </tr>
0192: 
0193:   <tr>
0194:     <td width="5%" height="1"><img src="clear.gif" width="1" height="1"></td>
0195:     <td width="20%"><img src="clear.gif" width="1" height="1"></td>
0196:     <td width="20%"><img src="clear.gif" width="1" height="1"></td>
0197:     <td width="5%"><img src="clear.gif" width="1" height="1"></td>
0198:     <td width="5%"><img src="clear.gif" width="1" height="1"></td>
0199:     <td width="10%"><img src="clear.gif" width="1" height="1"></td>
0200:     <td width="30%"><img src="clear.gif" width="1" height="1"></td>
0201: 
0202:   </tr>
0203: 
0204:  
0205:   <tr bgcolor="#577fbe">
0206:     <td class="small" align="center"><!a href="standings.asp?yr=<%= yr %>&sort=Rank" class="smallUndl">RNK</a></td>
0207:     <td class="small" align="center"><!a href="standings.asp?yr=<%= yr %>&sort=Name" class="smallUndl">Entry Name</a>
0208: 	&nbsp;&nbsp;/&nbsp;&nbsp;<!a href="standings.asp?yr=<%= yr %>&sort=RealName&RealName=RealName" class="smallUndl">Actual Name</a>
0209: 	</td>
0210:     <td class="small" align="center">FROM</td>
0211:     <td class="small" align="center"><!a href="standings.asp?yr=<%= yr %>&sort=Pts" class="smallUndl">PTS</a></td>
0212:     <td class="small" align="center">POSS<br>
0213:     PTS</td>
0214:     <td class="small" align="center"><!a href="standings.asp?yr=<%= yr %>&sort=Champion&RegNumber=<%= RegNumber %>&Top5=<%= ShowTop5 %>&Top10=<%= ShowTop10 %>" class="smallUndl">CHAMPION</a></td>
0215:     <td class="small" align="center">RUNNER-UP/<br>
0216:     <!a href="standings.asp?sort=F4" class="smallUndl">FINAL 4</a></td>
0217: 
0218:   </tr>
0219: <%	bgcolor = "#e8e8e8"
0220: 
0221: 
0222: PickIDS = "WHERE"
0223: 
0224: 	Set rsMUp = Server.CreateObject("ADODB.Recordset")
0225: 
0226: 
0227: 	    sqlString = "SELECT * FROM mmPicks " & _
0228: 							"WHERE Season = " & season & " " & _
0229: 							"AND " & G1 & " = '" & T1 & "' " & _
0230: 							"AND " & G2 & " = '" & T2 & "' " 
0231:  ' Response.Write("<BR>" & sqlString)
0232: 						
0233: 	rsMUp.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0234: 
0235:  Do Until RsMUp.EOF
0236: 
0237:  MUPicksID = RsMup("ID").Value
0238: 
0239: If PickIDs <> "WHERE" Then
0240:  PickIDS = PickIDS & " OR PicksID = '" & MUPicksID  & "' "
0241:  Else
0242:  PickIDS = PickIDS & " ( PicksID = '" & MUPicksID & "' "
0243: End If
0244: RsMup.Movenext
0245: Loop
0246: PickIDs = PickIDs & ") AND Season = " & season
0247: 
0248: 	Set rs = Server.CreateObject("ADODB.Recordset")
0249: '
0250: '
0251: '	sqlString = "SELECT * FROM mmStandings " & _
0252: '			"WHERE Season = " & yr & " " & _
0253: '			AddSel & _
0254: '			"ORDER BY " & sortStr
0255: 
0256: 
0257: 
0258:  	sqlString = "SELECT * FROM mmStandings " & PICKIDs & " ORDER BY RANK"
0259: 
0260: '	Response.Write("<BR>" & SqlString)
0261: 
0262: 	rs.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0263: 
0264: 	Do Until rs.EOF
0265: 
0266: ' "#FED87B"
0267: 	ThisRegNumber = rs("RegNumber").Value
0268: '		TextEmailAddress = rs("TextEmailAddress").Value
0269:           		UsedMobile = rs("UsedMobile").Value
0270: 		   ranking = rs("Rank").Value
0271: 		   NotPaid = rs("NotPaid").Value
0272: 		   TotalAmount = ""
0273: 
0274: If Ranking =< tenpct Then
0275: 
0276: If yr = Season Then
0277: 
0278:  TotalAmount = rsp("MTop10").Value
0279: 
0280:  
0281:  	Select Case Ranking
0282: 			Case 1
0283: 				TotalAmount = rsp("M1").Value
0284: 			Case 2
0285: 				TotalAmount = rsp("M2").Value
0286: 			Case 3
0287: 				TotalAmount = rsp("M3").Value
0288: 			Case 4
0289: 				TotalAmount = rsp("M4").Value
0290: 			Case 5
0291: 				TotalAmount = rsp("M5").Value
0292: 		End Select
0293: 
0294: End If
0295: End If
0296: 
0297: 		   IF ranking =< tenpct then
0298: 		      bgcolor = "#BCF5A9"
0299: 		   Else
0300: 			If bgcolor = "#e8e8e8" Then
0301: 				bgcolor = "#ffffff"
0302: 			Else
0303: 				bgcolor = "#e8e8e8"
0304: 			End If	
0305: 			End If
0306: 			If RegNumber = "" And ThisRegNumber = MyRegNumber Then
0307: 			 bgcolor = "#F5A9D0"
0308: 			End If
0309: 			If NotPaid <> "" And user = "jt@folga.org" Then
0310: 			bgcolor = "#ffcc00"
0311: 			End If
0312: 
0313: 
0314: 
0315: TotalMobileEntries = TotalMobileEntries + 1
0316: 
0317: 
0318: If RegNumber = "" Or ( RegNumber = ThisRegNumber OR ranking <= MaxtoShow ) Then
0319: 			%>
0320:   <tr bgcolor="<%= bgcolor %>" height="16">
0321: 
0322: 
0323: 
0324:     <td class="smalldark" align="center" bgcolor="<%= cell_color %>"><%= ranking %>
0325: 
0326: </td>
0327:     <td class="smalldark" align="left"><a
0328:     href="displaypicks3.asp?year=<%= yr %>&amp;pick=<%= rs("PicksId").Value %>"
0329:     class="normUndl"><%= rs(RealName).Value %></a></td>
0330:     <td class="smalldark" align="left"><%= rs("City").Value %>
0331: </td>
0332:     <td class="smalldark" align="center"><%= rs("Pts").Value %>
0333: </td>
0334:     <td class="smalldark" align="center"><%= rs("PossPts").Value %>
0335: </td>
0336:     <td class="smalldark" align="center">
0337: 
0338: <%= rs("Champion").Value %>
0339: 
0340: </td>
0341:     <td class="smalldark" align="left"><%= rs("RunnerUp").Value %>
0342: </td>
0343: 
0344: 
0345:   </tr>
0346: <%		
0347: 		End If
0348: 		rs.MoveNext
0349: 		Loop
0350: 		rs.Close
0351: 		Set rs = Nothing	
0352: 		
0353: If TotalMobileEntries > 0 Then
0354: 
0355: %>
0356: 
0357: <tr><td class="norm" colspan="4" height="40" valign="center">Total entries with this matchup: <b><font color="blue"><%= TotalMobileEntries %></td><td colspan="7" align="right"><input type="button" value="Close Window" class="norm" onClick="window.close()"></td></tr>
0358: 		
0359: 		
0360: <%  End If %>
0361: </table>
0362: </body>
0363: </html>