Count Lines in Pages

Contents of Page: mmpickmybuddies.asp Number of Lines: 217 Last Modified: 3/22/2025 9:04:33 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: 		MyEMail = Request.Cookies("user")
0008: 	If MyEMail = "" Then Response.Redirect("login_m.asp?from=mmpickmybuddies.asp")
0009: 	
0010: 		GroupNo = Request.QueryString("GroupNo")
0011: 		Columns = Request.QueryString("Columns")	
0012:         If Columns = "" then Columns = 3	
0013: 		
0014: 		ColumnWidth = Int(100 / Columns)
0015: 		
0016: 		SortBy = Request.QueryString("SortBy")
0017: 		
0018: 		If SortBy = "" Then SortBy = "Name"
0019: 		
0020: 		If SortBy = "Name" Then
0021: 		SortBySel = "Name, FirstName"
0022: 		Letter = "L"
0023: 		ElseIf SortBy = "FirstName" Then
0024: 		SortBySel = "FirstName, Name"
0025: 		Letter = "F"
0026: 		End If
0027: 		
0028: 		If GroupNo = "" Then GroupNo = 1
0029: 
0030: 	Set rs = Server.CreateObject("ADODB.Recordset")
0031:   
0032: 	sqlString = "SELECT * FROM mmEntries " & _
0033: 			"WHERE Season = " & season & " " & _
0034: 			"AND EmailAddress = '" & MyEMail & "'"
0035: 	rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0036: 	
0037: 	If rs.EOF Then
0038: 		Response.Redirect("login.asp?from=mmpickmybuddies.asp")
0039:     End If
0040: 	
0041: 	GroupName = ""
0042: 	
0043: 	BuddiesFieldName = "MyBuddies" & GroupNo
0044: 		
0045:         MyBuddies = rs(BuddiesFieldName).Value
0046: '	Response.Write("<br>" & MyBuddies)	
0047: 		If MyBuddies <> "" Then
0048: 		
0049: 		Temp = Split(MyBuddies,"|")
0050: 		
0051: 		GroupNameX = Temp(0)
0052: 		Else
0053: 		GroupNameX = "Group # " & GroupNo
0054: 		End If
0055: 		
0056: 		Name = rs("Name").Value
0057: 		FirstName = rs("FirstName").Value
0058: 		ID = rs("ID").Value
0059: 
0060: 	
0061: 	RegCount = TableCount("mmEntries",season) + 26
0062: 	
0063: 	RowsPerColumn = Int(RegCount / Columns + .5)
0064: 	
0065: '	Response.Write("<br>RowsPerColumn=" & RowsPerColumn)
0066: 
0067: 	Set rs = Server.CreateObject("ADODB.Recordset")
0068: 	sqlString = "SELECT * FROM mmEntries " & _
0069: 			"WHERE Season = " & season & " ORDER BY " & SortBySel
0070:  rs.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0071: ' Response.Write(sqlString & "<br>")
0072: 
0073: LastDigit = ""
0074: 
0075: %>
0076: <html>
0077: 
0078: <head>
0079: <meta name="viewport" content="width=device-width">
0080: <title>March Madness - Pick My Buddies</title>
0081: <link href="mm.css" rel="stylesheet" type="text/css">
0082: 	<link href="https://mychinodes.org/desb.css" rel="stylesheet" type="text/css">
0083: </head>
0084: <body bgcolor="#ffffff">
0085: 
0086: <table cellspacing="1" border="0" cellpadding="0" width="100%">
0087: <tr><td class="norm" colspan="1">
0088: <% If Letter = "L"  Then %>
0089: <a href="mmpickmybuddies.asp?Columns=<%= Columns %>&GroupNo=<%= GroupNo %>&SortBy=FirstName" class="button-40"><small>Sorty By<br>First Name</a>&nbsp;
0090: <% Else %>
0091: <a href="mmpickmybuddies.asp?Columns=<%= Columns %>&GroupNo=<%= GroupNo %>&SortBy=Name" class="button-40"><small>Sorty By<br>Last Name</a>&nbsp;
0092: <% End If %>
0093: 
0094: <form method="post" action="mmpickmybuddiespost.asp?Columns=<%= Columns %>&ID=<%= ID %>&GroupNo=<%= GroupNo %>" name="node"">  
0095: </td>
0096: <tr><td colspan="4" align="right" class="norm">
0097: <% If GroupNo <> 1 Then %>
0098: <a href="mmpickmybuddies.asp?Columns=<%= Columns %>&GroupNo=1&SortBy=<%= SortBy %>" class="button-40"><small>Group 1</a></small>&nbsp
0099: <% Else %>
0100: <b><big><%= GroupNamex %></b></big>
0101: <% End If %>
0102: <% If GroupNo <> 2 Then %>
0103: <a href="mmpickmybuddies.asp?Columns=<%= Columns %>&GroupNo=2&SortBy=<%= SortBy %>" class="button-40"><small>Group 2</a></small>&nbsp;
0104: <% Else %>
0105: <b><big><%= GroupNamex %></b></big>
0106: <% End If %>
0107: <% If GroupNo <> 3 Then %>
0108: <a href="mmpickmybuddies.asp?Columns=<%= Columns %>&GroupNo=3&SortBy=<%= SortBy %>" class="button-40"><small>Group 3</a></small>
0109: <% Else %>
0110: <b><big><%= GroupNamex %></b></big>
0111: <% End If %>
0112: 
0113: </table>
0114: <table cellspacing="1" border="0" cellpadding="0" width="100%">
0115: <tr height="2" bgcolor = "gray">
0116: <% 
0117:         sd = 0
0118: 		Columns = Cint(Columns)
0119: 		Do Until sd > Columns
0120: 		sd = sd + 1
0121: %>
0122: <td  width="<%= ColumnWidth %>%">
0123: <%
0124:        Loop
0125: %>	   
0126: 		
0127: 		
0128: 
0129:   <tr height="20" >
0130:   <td class="norm" valign="top">
0131:   
0132: 
0133: <%
0134: 
0135: Counter = 0
0136: 		Do Until rs.EOF
0137: 		
0138: 	Counter = Counter + 1
0139: 	
0140: 
0141: 	
0142: 
0143: RegNumber =  rs("RegNumber").Value	
0144: SearchFor = "|" & RegNumber & "|"
0145: 
0146: 			Name = rs("Name").Value
0147: 			FullName = rs("FirstName").Value & " " & Name
0148: 			FirstName = rs("FirstName").Value
0149: 			
0150: 			If Letter = "L" Then
0151: 				DisplayName = Name & ", " & "<small>" & FirstName & "</small>"
0152: 			Else
0153: 				DisplayName = FirstName & " " & "<small>" & Name & "</small>"
0154: 			End If
0155: 			
0156: 			x = InStr(MyBuddies,SearchFor)
0157: 			If x > 0 Then
0158: 			IamChecked = "checked"
0159: 			Else
0160: 			IamChecked = ""
0161: 			ENd If
0162: 			
0163: 			Digit = Ucase(Left(DisplayName,1))
0164: 			
0165: 			If Digit <> LastDigit Then
0166: %>
0167: <b>&nbsp;&nbsp;&nbsp;<big><%= Digit %><br></b></big>
0168: <% LastDigit = Digit
0169: '	Counter = Counter + 1
0170: End If
0171: %>
0172: <input type="checkbox" Name="Pick<%= Counter %>" Value="<%= RegNumber %>" <%= IamChecked %>><%= DisplayName %><br>
0173: <% 
0174: 
0175: Remainder = Counter Mod RowsPerColumn
0176: If Remainder = 0 Then %>
0177: </td>
0178: <td class="norm" valign="top">
0179: 
0180: <% End If %>
0181: 
0182:  
0183: <%	   
0184: 
0185:       rs.MoveNext
0186: 		Loop
0187: 		rs.Close
0188: 		Set rs = Nothing	
0189: 		ButtonTitle = "Update Group " & GroupNo & ": (" & GroupNameX & ")"
0190: 		
0191: 		%>
0192: </td></tr>
0193: </table>
0194: <table cellspacing="1" border="0" cellpadding="0" width="100%" align="left">
0195: <tr><td class="norm" colspan="4">
0196: <br><br><big><b>Group Name:</b></big><input type="text" name="GroupName" value="<%= GroupNameX %>" class="bigblue" required size="10"><small>
0197: 
0198:  
0199: <input type="submit" value="Update Group"  class="button-40"> &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;
0200: 
0201: <% If Columns = 3 Then %>
0202: <br>
0203: <br>
0204: <br>
0205: <% End If %>
0206: 
0207: <% If Columns <> 3 Then %>		  
0208: 		  <a href="standingsmybuddies.asp" class="button-40"><small>My Group Standings</a>
0209: <% Else %>		  
0210: 		  <a href="standingsmybuddies_m.asp" class="button-40"><small>My Group Standings</a>	
0211: <% End If %>	  
0212: 	  </td>
0213:     </tr>
0214: 	</form>
0215: </table>
0216: </body>
0217: </html>