Count Lines in Pages

Contents of Page: standingsmybuddies_m.asp Number of Lines: 301 Last Modified: 4/20/2025 2:07:24 PM
0001: <% @Language = "VBScript" %>
0002: <!-- #include FILE="include/adovbs.inc" -->
0003: <!-- #include FILE="include/constants.inc" -->
0004: <!-- #include FILE="include/ReturnPageSet.inc" -->	
0005: <%
0006: 
0007: user = Request.Cookies("user")	
0008: 	If user = "" Then Response.Redirect("login.asp?from=standingsmybuddies_m.asp")
0009: 
0010: 	yr = Request.QueryString("yr")
0011: 	If yr = "" Then yr = season
0012: 	
0013: 			GroupNo = Request.QueryString("GroupNo")
0014: 		
0015: 		If GroupNo = "" Then GroupNo = 1
0016: 	
0017: 	sortStr = Request.QueryString("sort")
0018: 	If sortStr = "" Then sortStr = "Rank"
0019: 
0020: 	Select Case sortStr
0021: 		Case "Pts"
0022: 			sortStr = sortStr & " DESC"
0023: 		Case "Round1"
0024: 			sortStr = sortStr & " DESC"
0025: 		Case "Sweet16"
0026: 			sortStr = sortStr & " DESC"
0027: 		Case "Final8"
0028: 			sortStr = sortStr & " DESC"
0029: 		Case "Final4"
0030: 			sortStr = sortStr & " DESC"
0031: 		Case "Final2"
0032: 			sortStr = sortStr & " DESC"
0033: 		Case "Final1"
0034: 			sortStr = sortStr & " DESC"
0035: 		Case "Champion"
0036: 			sortStr = sortStr & ", Rank"			
0037: 	End Select
0038: 
0039: 
0040: 	yr = Request.QueryString("yr")
0041: 	If yr = "" Then yr = season
0042: 	
0043: 	LastYr = Yr - 1
0044: 	NextYr = Yr + 1
0045: 	
0046: 	Set rsg = Server.CreateObject("ADODB.Recordset")
0047: 	sqlString = "SELECT * FROM mmEntries " & _
0048: 			"WHERE Season = " & season & " " & _
0049: 			"AND EmailAddress = '" & user & "'"
0050: '	rsg.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0051: 	rsg.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0052:     
0053: 		BuddiesFieldName = "MyBuddies" & GroupNo
0054: 	
0055:    MyBuddies = rsg(BuddiesFieldName).Value
0056:    MyRegNumber = rsg("RegNumber").Value
0057:    
0058:    If MyBuddies = "" or IsNull(MyBuddies) = True or MyBuddies = "," Then	
0059: MyBuddies = "Group # " & GroupNo & "|" & MyRegNumber & "|"
0060: End If
0061: 
0062: ' Response.Write("<br>MyBuddies=" & MyBuddies)
0063:    
0064:    If MyBuddies <> "" Then
0065: 
0066:    
0067:    BuddyIDS = Split(MyBuddies,"|")
0068:    
0069:       
0070:    ThisGroupName = BuddyIDS(0)
0071:    
0072:    Done = ""
0073:    Loc = 0
0074:    Selection = "AND ( RegNumber = '" & MyRegNumber & "' "
0075:    
0076:    Do Until Done = "X"
0077:       Loc = Loc + 1
0078:    BuddyID = Trim(BuddyIDS(Loc))
0079:    If BuddyID = "" Then
0080:    Done = "X"
0081:    Else
0082: 
0083:    Selection = Selection & " OR Regnumber = '" & BuddyID & "' "
0084:   
0085:    End If
0086: 
0087:    Loop
0088:    
0089:       Selection = Selection & " )"
0090: 	  
0091:     Else
0092:    
0093:     Selection = "AND RegNumber = '" & MyRegNumber & "' "
0094:    
0095:    End If
0096: 
0097:     
0098:    group = groupname1 
0099: 	paid = rsg("PaidEntries").Value
0100:     Entries = rsg("NumEntries").Value
0101:     Num2ndEntries = rsg("Num2ndEntries").Value
0102: 	paid2nd = rsg("Paid2ndEntries").Value
0103: 	firstname = rsg("FirstName").Value
0104: 	ShowStand = rsg("ShowStandings").Value
0105: 	MyRegNumber = rsg("RegNumber").Value
0106: 		
0107: MyBuddies1 = rsg("MyBuddies1").Value
0108: MyBuddies2 = rsg("MyBuddies2").Value
0109: MyBuddies3 = rsg("MyBuddies3").Value
0110: 
0111: If MyBuddies1 = "" or IsNull(MyBuddies1) = True Then	
0112: MyBuddies1 = "Group #1|" & MyRegNumber & "|"
0113: End If
0114: If MyBuddies1 = "" or IsNull(MyBuddies2) = True Then
0115: MyBuddies2 = "Group #2|" & MyRegNumber & "|"
0116: End If
0117: If MyBuddies3 = "" or IsNull(MyBuddies3) = True Then
0118: MyBuddies3 = "Group #1|" & MyRegNumber & "|"
0119: End If
0120: 	
0121: 	rsg.Close
0122: 	set rsg = Nothing
0123: 
0124: 
0125:     If showstandingstounpaid <> "YES" Then
0126: 
0127: UnpaidEntries = Entries - Paid
0128: UnpaidEntries = UnpaidEntries + (num2ndEntries - Paid2nd)
0129: UnpaidEntries = CInt(UnpaidEntries)
0130:     
0131: 		If UnpaidEntries > 0 and ShowStand = False Then 
0132: 			Response.Redirect("notpaidyet.asp?name=" & firstname)
0133: 		Else
0134: 	'	Response.Write("paid=" & paid & " paid2nd=" & paid2nd & " ShowStand=" & ShowStand & " yr=" & Thisyr & " season=" & season & "YrDiff=" & YrDiff & "UndpaidEntries=" & UnpaidEntries)
0135: 		End If
0136: 
0137:     End If
0138: 		If GroupName <> "" Then
0139: 		  group = GroupName
0140: 	    End If
0141: 
0142: 	
0143: 		Set rst = Server.CreateObject("ADODB.Recordset")
0144: 	sqlString = "SELECT COUNT(Season) as RecordCount FROM mmStandings " & _
0145: 			"WHERE Season = " & yr 
0146: 	rst.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0147: 	
0148: totpicks = CInt(rst("RecordCount").Value)
0149: '	totpicks = rst.RecordCount
0150:    	tenpct = totpicks / 10
0151: 
0152: 		rst.Close
0153: 		Set rst = Nothing
0154: 
0155: 
0156: 			
0157: 				Set rs = Server.CreateObject("ADODB.Recordset")
0158: 	sqlString = "SELECT * FROM mmStandings " & _
0159: 			"WHERE Season = " & yr & " " & _
0160: 	
0161: 	        Selection & _
0162: 			"ORDER BY " & sortStr
0163: 
0164: '			Response.Write(sqlstring & "<br>")	
0165: 	rs.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0166: 	
0167: 
0168: 
0169: %>
0170: <html>
0171: 
0172: <head>
0173: <meta name="viewport" content="width=device-width">
0174: <title>March Madness - My Group Standings</title>
0175: <link href="mm.css" rel="stylesheet" type="text/css">
0176: 	<link href="https://mychinodes.org/desb.css" rel="stylesheet" type="text/css">
0177: <script language="JavaScript">
0178: 	
0179: 		function getData(form)	{
0180: 			var yr = form.SeasonYr.options[form.SeasonYr.selectedIndex].value
0181: 			if (yr != "")	{
0182: 				document.location.href = "standingsmygroup.asp?yr="+yr
0183: 			}
0184: 		}
0185: 		
0186: 	</script>
0187: </head>
0188: 
0189: <body bgcolor="#ffffff">
0190: 
0191: <table cellspacing="1" border="0" cellpadding="0" width="100%">
0192: 
0193: 	
0194: <tr>
0195: <tr><td colspan="4" align="right" class="norm">
0196: <% If GroupNo <> 1 Then %>
0197: <a href="standingsmybuddies_m.asp?Columns=<%= Columns %>&GroupNo=1&SortBy=<%= SortBy %>" class="button-40"><small>Group 1</a>&nbsp
0198: <% Else %>
0199: <b><big><%= GroupNamex %></b></big>
0200: <% End If %>
0201: <% If GroupNo <> 2 Then %>
0202: <a href="standingsmybuddies_m.asp?Columns=<%= Columns %>&GroupNo=2&SortBy=<%= SortBy %>" class="button-40"><small>Group 2</a>&nbsp;
0203: <% Else %>
0204: <b><big><%= GroupNamex %></b></big>
0205: <% End If %>
0206: <% If GroupNo <> 3 Then %>
0207: <a href="standingsmybuddies_m.asp?Columns=<%= Columns %>&GroupNo=3&SortBy=<%= SortBy %>" class="button-40"><small>Group 3</a>
0208: <% Else %>
0209: <b><big><%= GroupNamex %></b></big>
0210: <% End If %>
0211:  </tr>
0212:  
0213:   <tr>
0214:     <td class="bigblue" colspan="10" height="30" align="center">Standings for Group: <font color="red"><%= ThisGroupName %></td>
0215: </tr>
0216: 
0217:     <td width="5%" height="1"><img src="clear.gif" width="1" height="1"></td>
0218: 
0219:     <td width="45%"><img src="clear.gif" width="1" height="1"></td>
0220: 
0221:     <td width="5%"><img src="clear.gif" width="1" height="1"></td>
0222:     <td width="5%"><img src="clear.gif" width="1" height="1"></td>
0223:     <td width="40%"><img src="clear.gif" width="1" height="1"></td>
0224:     
0225:   </tr>
0226:  
0227: <td class="smalldark" colspan="8" align="right">
0228: 	  Last updated @  <font color="red"><%= STANDINGSUPDATED %></font> (PDT)
0229: </td></tr>
0230:   </tr>
0231:   <tr bgcolor="#577fbe">
0232:     <td class="small" align="center"><a
0233:     href="standingsmybuddies_m.asp?yr=<%= yr %>&sort=Rank&amp;GroupNo=<%= GroupNo %>" class="smallUndl">RNK</a></td>
0234: 
0235: 		    <td class="norm" align="center"><a
0236:     href="standingsmybuddies_m.asp?yr=<%= yr %>&sort=Name&amp;GroupNo=<%= GroupNo %>" class="smallUndl">Entry Name</a></td>
0237:   
0238:     <td class="small" align="center"><a
0239:     href="standingsmybuddies_m.asp?yr=<%= yr %>&sort=Pts&amp;GroupNo=<%= GroupNo %>" class="smallUndl">PTS</a></td>
0240:     <td class="small" align="center">POSS<br>
0241:     PTS</td>
0242:     <td class="small" align="center"><a
0243:     href="standingsmybuddies_m.asp?yr=<%= yr %>&sort=Champion&amp;GroupNo=<%= GroupNo %>" class="smallUndl">Champion / Runner Up</a></td>
0244: 
0245: </tr>
0246: <%	bgcolor = "#e8e8e8"
0247: 		Do Until rs.EOF
0248: 		   ranking = CInt(rs("Rank").Value)
0249: 		   IF ranking < tenpct then
0250: 		      bgcolor = "#BCF5A9"
0251: 		   Else
0252: 			If bgcolor = "#e8e8e8" Then
0253: 				bgcolor = "#ffffff"
0254: 			Else
0255: 				bgcolor = "#e8e8e8"
0256: 			End If	
0257: 			End If
0258: 			
0259: 			FullName = rs("RealName").Value 
0260: 			
0261: 			
0262: 			F4 = rs("RunnerUp").Value
0263: 			F4S = Split(F4,"/")
0264:             RunnerUp = F4S(0)
0265: 
0266: 			%>
0267:   <tr bgcolor="<%= bgcolor %>" height="18">
0268:     <td class="smalldark" align="center"><%= ranking %>
0269: </td>
0270: 
0271: 
0272: 
0273:     <td class="smalldark" align="left"><a
0274:     href="displaypicks3.asp?year=<%= yr %>&amp;pick=<%= rs("PicksId").Value %>"
0275:     class="normUndl"><%= rs("Name").Value %></a></td>
0276: 
0277: 
0278:     <td class="smalldark" align="center"><%= rs("Pts").Value %>
0279: </td>
0280:     <td class="smalldark" align="center"><%= rs("PossPts").Value %>
0281: </td>
0282:     <td class="smalldark" align="center"><%= rs("Champion").Value %> / <%= RunnerUp %>
0283: </td>
0284: 
0285: 
0286:   </tr>
0287: <%		rs.MoveNext
0288: 		Loop
0289: 		rs.Close
0290: 		Set rs = Nothing	%>
0291: </table>
0292: 
0293: <table cellspacing="1" border="0" cellpadding="0" width="300">
0294: <tr><td class="norm" align="center">
0295: <br><br><br><br><br><br>
0296: <a href="mmpickmybuddies.asp?Columns=3" class="button-40">Review/Change Groups</a>&nbsp;&nbsp;	  
0297: </td>
0298: </tr>
0299: </table>
0300: </body>
0301: </html>