Count Lines in Pages

Contents of Page: EarlyBirdDrawing.asp Number of Lines: 252 Last Modified: 3/7/2026 5:18:51 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: 
0008: 		Columns = Request.QueryString("Columns")	
0009: 		DrawNo = Request.QueryString("DrawNo")		
0010: 		Random1 = Cint(Request.QueryString("Random1"))
0011: 		Random2 = Cint(Request.QueryString("Random2"))
0012: 		Random3 = Cint(Request.QueryString("Random3"))
0013: 
0014:         If DrawNo = 9 then
0015: 		Session("Winner1") = ""
0016: 		Session("Winner2") = ""
0017: 		Session("Winner3") = ""
0018: 		End if
0019: 		
0020: 		Winner1 = Session("Winner1")
0021: 		Winner2 = Session("Winner2")
0022: 		Winner3 = Session("Winner3")
0023: 
0024: 		
0025:         If Columns = "" then Columns = 4	
0026: 		
0027: 		Columns = Cint(Columns)
0028: 		
0029: 		ColumnWidth = Int(100 / Columns)
0030: 		
0031: 		SortBy = Request.QueryString("SortBy")
0032: 		
0033: 		If SortBy = "" Then SortBy = "Name"
0034: 		
0035: 		If SortBy = "Name" Then
0036: 		SortBySel = "Name, FirstName"
0037: 		Letter = "L"
0038: 		ElseIf SortBy = "FirstName" Then
0039: 		SortBySel = "FirstName, Name"
0040: 		Letter = "F"
0041: 		End If
0042: 		
0043: 
0044: 	
0045: 	RegCount = TableCount("mmEntries",season) + 52
0046: 	
0047: 
0048: 	
0049: '	Response.Write("<br>RowsPerColumn=" & RowsPerColumn)
0050: 
0051: 	Set rsc = Server.CreateObject("ADODB.Recordset")
0052: 	sqlString = "SELECT SUM(NumEntries) as TotalEntries FROM mmEntries " & _
0053: 			"WHERE Season = " & season 
0054:  rsc.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0055:  'Response.Write(sqlString & "<br>")
0056:  
0057:  TotalEntries = Cint(rsc("TotalEntries").Value) - 1
0058: 	RowsPerColumn = Int(TotalEntries / Columns + .5) + 2
0059: 	
0060: 	Randomize
0061: min = 1
0062: max =  TotalEntries
0063: Number = Int((max - min + 1) * Rnd + min)
0064: 
0065: If DrawNo = 0 then
0066: Random0 = Number
0067: End If
0068: 	
0069: If DrawNo = 1 then
0070: Random1 = Number
0071: End If
0072: If DrawNo = 2  then
0073: Random2 = Number
0074: End If
0075: If DrawNo = 3 then
0076: Random3 = Number
0077: End If
0078: 
0079: 
0080: 		rsc.Close
0081: 		Set rsc = Nothing	
0082: 
0083: LastDigit = ""
0084: 
0085: %>
0086: <html>
0087: 
0088: <head>
0089: <meta name="viewport" content="width=device-width">
0090: <title>March Madness - Early Bird Drawing</title>
0091: <link href="mm.css" rel="stylesheet" type="text/css">
0092: 	<link href="https://mychinodes.org/desb.css" rel="stylesheet" type="text/css">
0093: </head>
0094: <body bgcolor="#ffffff">
0095: 
0096: <table cellspacing="1" border="0" cellpadding="0" width="100%">
0097: <tr>
0098: <td class="norm" >Total Entries: <%= TotalEntries %></td>
0099: <td class="norm" >
0100: <%
0101: If DrawN0 = 0 then
0102: %>
0103: <a href="EarlyBirdDrawing.asp?DrawNo=0">Sample Draw</a>
0104: &nbsp;&nbsp;<big><b>(<%= Random0 %>)</b></big>
0105: 
0106: &nbsp;&nbsp;&nbsp;&nbsp;<a href="EarlyBirdDrawing.asp?DrawNo=9"><big><b>Reset</a>
0107: <%
0108: End If
0109: %>
0110: </td>
0111: <td class="norm" >
0112: <a href="EarlyBirdDrawing.asp?DrawNo=1&Random1=<%= Random1 %>&Random2=<%= Random2 %>&Random3=<%= Random3 %>">Draw #1:</a> <b><big><%= Random1 %>
0113: </td>
0114: <td class="norm" >
0115: <a href="EarlyBirdDrawing.asp?DrawNo=2&Random1=<%= Random1 %>&Random2=<%= Random2 %>&Random3=<%= Random3 %>">Draw #2:</a> <b><big><%= Random2 %>
0116: </td>
0117: <td class="norm" >
0118: <a href="EarlyBirdDrawing.asp?DrawNo=3&Random1=<%= Random1 %>&Random2=<%= Random2 %>&Random3=<%= Random3 %>">Draw #3:</a> <b><big> <%= Random3 %></td>
0119: </table>
0120: <table cellspacing="1" border="0" cellpadding="0" width="100%">
0121: <tr height="2" bgcolor = "gray">
0122: <% 
0123:         sd = 0
0124: 		Columns = Cint(Columns)
0125: 		Do Until sd > Columns
0126: 		sd = sd + 1
0127: %>
0128: <td  width="<%= ColumnWidth %>%">
0129: <%
0130:        Loop
0131: %>	   
0132: 		
0133: 		
0134: 
0135:   <tr height="20" >
0136:   <td class="norm" valign="top">
0137:   
0138: 
0139: <%
0140: 
0141: 	Set rs = Server.CreateObject("ADODB.Recordset")
0142: 	sqlString = "SELECT * FROM mmEntries " & _
0143: 			"WHERE Season = " & season & " " & _
0144: 			" AND RegNumber <> '1382' " & _		
0145: 			" ORDER BY Name, FirstName"
0146:  'Response.Write(sqlString & "<br>")			
0147:  rs.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0148: 
0149: 
0150: Counter = 0
0151: LineCounter = 0
0152: 		Do Until rs.EOF
0153: 		
0154: '	Counter = Counter + 1
0155: 	
0156: 
0157: 	
0158: ID =  rs("ID").Value	
0159: RegNumber =  rs("RegNumber").Value	
0160: 
0161: 			Name = rs("Name").Value
0162: 			FullName = rs("FirstName").Value & " " & Name
0163: 			FirstName = rs("FirstName").Value
0164: 			NumEntries = rs("NumEntries").Value
0165: 			If Letter = "L" Then
0166: 				DisplayName = Name & ", " & "<small>" & FirstName & "</small>"
0167: 			Else
0168: 				DisplayName = FirstName & " " & "<small>" & Name & "</small>"
0169: 			End If
0170: 			
0171: 		
0172: 			Digit = Ucase(Left(DisplayName,1))
0173: 			
0174: 			If Digit <> LastDigit Then
0175: %>
0176: <b>&nbsp;&nbsp;&nbsp;<big><%= Digit %><br></b></big>
0177: <% LastDigit = Digit
0178: 	LCounter = LCounter + 1
0179: End If
0180: 
0181: XC = 0
0182: 
0183: Do Until XC = NumEntries
0184: XC = XC + 1
0185: Counter = Counter + 1
0186: LineCounter = LineCounter + 1
0187: 
0188: WinnerWinner = False
0189: 
0190: If Counter = Random1 then
0191: Session("Winner1") = RegNumber
0192: WinnerWinner = True
0193: End If
0194: If Counter = Random2 then
0195: Session("Winner2") = RegNumber
0196: WinnerWinner = True
0197: End If
0198: If Counter = Random3 then
0199: Session("Winner3") = RegNumber
0200: WinnerWinner = True
0201: End If
0202: 
0203: If WinnerWinner = True Then
0204: %>
0205: 
0206: 
0207: <b><mark><big><%= Counter %>&nbsp;&nbsp;-&nbsp;&nbsp; <%= DisplayName %></mark></b></big>
0208:  (<%= ID %>)</a>
0209: <br>
0210: <% 
0211: 
0212: Else
0213: 
0214: %>
0215: 
0216: <%= Counter %>&nbsp;&nbsp;-&nbsp;&nbsp; <%= DisplayName %><br>
0217: 
0218: <%
0219: 
0220: End If
0221: 
0222: If LineCounter >= RowsPerColumn then
0223: 
0224: %>
0225: </td>
0226: <td class="norm" valign="top">
0227: 
0228: <% LineCounter = 0
0229: 
0230: End If %>
0231: 
0232:  
0233: <%	
0234: 
0235: Loop   
0236: 
0237:       rs.MoveNext
0238: 		Loop
0239: 		rs.Close
0240: 		Set rs = Nothing	
0241: 
0242: 		
0243: 		%>
0244: </td></tr>
0245: </table>
0246: 
0247: 	  </td>
0248:     </tr>
0249: 	</form>
0250: </table>
0251: </body>
0252: </html>