Count Lines in Pages

Contents of Page: whoisback.asp Number of Lines: 272 Last Modified: 3/16/2022 9:16:16 AM
0001: <% @Language = "VBScript" %>
0002: <!-- #include FILE="include/adovbs.inc" -->
0003: <!-- #include FILE="include/constants.inc" -->
0004: <%
0005: 
0006:             NumberofYears = Request.QueryString("NumberofYears")
0007: 
0008: 			If NumberOfYears = "" Then NumberOfYears = 1
0009: 
0010: 			NOY = CInt(NumberOfYears)
0011: 
0012: 		 	PriorYear = Request.QueryString("PriorYear")
0013: 
0014: 			If PriorYear = "" Then
0015: 			Prioryr = season - 1
0016: 			Else
0017: 			prioryr = CInt(PriorYear)
0018: 			End If
0019: 
0020: 	 	sortStr = Request.QueryString("sort")
0021: 	If sortStr = "" Then sortStr = "EmailAddress,Season"
0022: 	Select Case sortStr
0023: 		Case "Name,FirstName,City,State,EmailAddress"
0024: 			sortStr = sortStr 
0025: 		Case "NumEntries"
0026: 			sortStr = sortStr & " DESC "			
0027: 	End Select
0028: 
0029: 	Set rs = Server.CreateObject("ADODB.Recordset")
0030: '	sqlString = "SELECT * FROM mmEntries " & _
0031: '			"WHERE Season >= " & prioryr & " " & _
0032: '			"ORDER BY " & sortStr
0033: 
0034: 	sqlString = "SELECT * FROM mmEntries " & _
0035: 			"WHERE ( Season = " & prioryr & " OR Season = " & season & " ) " & _
0036: 			"ORDER BY " & sortStr
0037: 	rs.Open sqlString, conn, adOpenDynamic, adLockOptimistic, adCmdText
0038: 	totreg = 0
0039:    totentries = 0
0040:    totssentries = 0   
0041:    totpaid = 0
0042:    totmade = 0
0043:    tot2ndmade = 0
0044:    TotNOY = 0
0045: %>
0046: <html>
0047: 
0048: <head>
0049: <title>March Madness - Who is Back Analisys</title>
0050: <link href="mm.css" rel="stylesheet" type="text/css">
0051: <script language="JavaScript" type="text/javascript">
0052: 		function deleteNode(id)	{
0053: 			if (!confirm("Are you sure you want to delete this entry?"))	{
0054: 				return;
0055: 			}
0056: 			window.location = "mmEntryDelete.asp?id="+id;
0057: 		}
0058: 	</script>
0059: </head>
0060: 
0061: <body bgcolor="#ffffff">
0062: 
0063:     <td><table cellspacing="1" border="0" cellpadding="0" width="670" height="53">
0064: 
0065:       <tr>
0066:         <td width="100%" height="6" colspan="8"><p align="center"><font face="Arial" size="2"><img
0067:         src="clear.gif" width="1" height="4">Click on column heading to change
0068:         sort&nbsp;&nbsp;&nbsp;<% If user = "joe@lusogolf.org" Then %><a href="whoisdeadbeat.asp">Dead Beats</a><% End If %><img src="clear.gif"
0069:         width="1" height="4"></font></td>
0070:       </tr>
0071:       <tr>
0072:         <td width="30"></td>
0073:         <td width="90"><img src="clear.gif" width="1" height="2"></td>
0074:         <td width="110"><img src="clear.gif" width="1" height="2"></td>
0075:         <td width="130"><img src="clear.gif" width="1" height="2"></td>
0076:         <td width="20"><img src="clear.gif" width="1" height="2"></td>
0077:         <td width="150"><img src="clear.gif" width="1" height="2"></td>
0078:         <td width="30"><img src="clear.gif" width="1" height="2"></td>        
0079:         <td width="30"><img src="clear.gif" width="1" height="2"></td>
0080:         <td width="30"><img src="clear.gif" width="1" height="2"></td>
0081:         <td width="30"><img src="clear.gif" width="1" height="2"></td>
0082:         <td width="20"><img src="clear.gif" width="1" height="2"></td>
0083:       </tr>
0084:       <tr bgcolor="#577fbe">
0085:         <td class="small" align="center" height="19"></td>
0086:         <td class="small" align="center" height="19"><a href="whoisback.asp?sort=Name"
0087:         class="smallUndl">Last Name</a></td>
0088:         <td class="small" align="center" height="19"><a href="whoisback.asp?sort=FirstName"
0089:         class="smallUndl">First Name</a></td>
0090:         <td class="small" align="center" height="19"><a href="whoisback.asp?sort=City"
0091:         class="smallUndl">City</a></td>
0092:         <td class="small" align="center" height="19"><a href="whoisback.asp?sort=State"
0093:         class="smallUndl">St</a></td>
0094:         <td class="small" align="center" height="19"><a href="whoisback.asp?sort=State"
0095:         class="smallUndl">Email Address</a></td>
0096:         <td class="small" align="center" height="19"><a href="whoisback.asp?sort=NumEntries"
0097:         class="smallUndl"># Times</a></td>
0098:         <td class="small" align="center" height="19"><a href="whoisback.asp?sort=NumEntries"
0099:         class="smallUndl"><%= prioryr %></a></td>        
0100:         <td class="small" align="center" height="19"><a href="whoisback.asp?sort=Num2ndEntries"
0101:         class="smallUndl"><%= season %></a></td>
0102:         <td class="small" align="center" height="19">MIA</td>
0103: <% If NOY > 1 Then %>
0104:         <td class="small" align="center" height="19">> <%= NOY %></td>
0105: <% End If %>
0106:       </tr>
0107: <%	bgcolor = "#e8e8e8"
0108: lastemail = ""
0109: 		Do Until rs.EOF
0110: 		
0111: 			If bgcolor = "#e8e8e8" Then
0112: 				bgcolor = "#ffffff"
0113: 			Else
0114: 				bgcolor = "#e8e8e8"
0115: 			End If
0116: 
0117: 			emailaddr = rs("EmailAddress").Value
0118: 			Name = rs("Name").Value
0119: 			FirstName = rs("FirstName").Value
0120: 			City = rs("City").Value
0121: 			State = rs("State").Value
0122: 			If lastemail = "" Then
0123: 				lastemail = emailaddr
0124: 				lastName = Name
0125: 				lastFirstName = FirstName
0126: 				lastCity = City
0127: 				lastState = State
0128: 				lastyrval = 0
0129: 				currval = 0
0130:           End If
0131: 			If emailaddr <> lastemail Then
0132: If currval = 0 Then
0133: mia = lastyrval
0134: Else
0135: mia = 0
0136: End If
0137: totmia = totmia + mia
0138: 
0139: 			Set rsPYPicks = Server.CreateObject("ADODB.Recordset")
0140: '	sqlString = "SELECT COUNT(ID) as RegCount FROM mmEntries " & _
0141: '							"WHERE EmailAddress = '" & lastemail & "' " & _
0142: '							"AND Season < " & season & " " 
0143: 	sqlString = "SELECT COUNT(ID) as RegCount FROM mmEntries " & _
0144: 							"WHERE FirstName = '" & FirstName & "' " & _
0145:                              "AND Name = '" & Name & "' " & _
0146: 							"AND Season < " & season & " "
0147: 	rsPYPicks.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0148: 	
0149: 	
0150: 
0151: 	PYCount = rsPYPicks("RegCount").Value
0152:     rsPYPicks.Close
0153: 
0154: 
0155: 	%>
0156:       <tr bgcolor="<%= bgcolor %>">
0157:         <td class="smalldark" align="center" height="13"><%= totreg %>
0158: </td>
0159:         <td class="smalldark" align="left" height="13"><%= lastName %>
0160: </td>
0161:         <td class="smalldark" align="left" height="13"><%= lastFirstName %>
0162: </td>
0163:         <td class="smalldark" align="left" height="13"><%= lastCity %>
0164: </td>
0165:         <td class="smalldark" align="left" height="13"><%= lastState %>
0166: </td>
0167:         <td class="smalldark" align="left" height="13"><%= lastEmail %>
0168: </td>
0169:         <td class="smalldark" align="center" height="13"><%= PYCount %>
0170: </td>
0171:         <td class="smalldark" align="center" height="13"><%= lastyrval %>
0172: </td>
0173:         <td class="smalldark" align="center" height="13"><%= currval %>
0174: </td>
0175:         <td class="smalldark" align="center" height="13"><%= mia %>
0176: </td>
0177: <% If NOY > 1 Then %>
0178:         <td class="smalldark" align="center" height="13"><%= mia %>
0179: </td>
0180: <% End If %>
0181:       </tr>
0182: <%
0183: 
0184: 			totlast = totlast + lastyrval
0185: 			totcurr = totcurr + currval
0186: 				lastemail = emailaddr
0187: 				lastName = Name
0188: 				lastFirstName = FirstName
0189: 				lastCity = City
0190: 				lastState = State
0191: 				lastyrval = 0
0192: 				currval = 0
0193: 				
0194: 				
0195: 		 	End If
0196: 				val = rs("NumEntries").Value
0197: 				myseason = rs("Season").Value
0198: 				If myseason = prioryr Then
0199: 					lastyrval = val
0200: 				Else
0201: 					currval = val
0202: 				End If
0203: 
0204: 		rs.MoveNext
0205: 		Loop
0206: PYCount = CInt(PyCount)
0207: 		If PYCount > NOY Then
0208: 		TotNOY = TotNOY + lastyrval
0209: 		End If
0210: %>
0211:       <tr bgcolor="<%= bgcolor %>">
0212:         <td class="smalldark" align="center" height="13"><%= totreg %>
0213: </td>
0214:         <td class="smalldark" align="left" height="13"><%= lastName %>
0215: </td>
0216:         <td class="smalldark" align="left" height="13"><%= lastFirstName %>
0217: </td>
0218:         <td class="smalldark" align="left" height="13"><%= lastCity %>
0219: </td>
0220:         <td class="smalldark" align="left" height="13"><%= lastState %>
0221: </td>
0222:         <td class="smalldark" align="left" height="13"><%= lastEmail %>
0223: </td>
0224:         <td class="smalldark" align="center" height="13"><%= lastyrval %>
0225: </td>
0226:         <td class="smalldark" align="center" height="13"><%= currval %>
0227: </td>
0228:         <td class="smalldark" align="center" height="13"><%= mia %>
0229: </td>
0230:       </tr>
0231: <%
0232: 		If bgcolor = "#e8e8e8" Then
0233: 				bgcolor = "#ffffff"
0234: 			Else
0235: 				bgcolor = "#e8e8e8"
0236: 			End If
0237: 
0238: 		rs.Close
0239: 		Set rs = Nothing
0240: 			totlast = totlast + lastyrval
0241: 			totcurr = totcurr + currval
0242: 			TotNOY = TotNOY + NOYval
0243: 	%>
0244:       <tr bgcolor="<%= bgcolor %>">
0245:         <td class="smalldark" align="left" colspan="3" height="13"></td>
0246:         <td class="smalldark" align="left" colspan="3" height="13"><p align="right">Total Entries:</td>
0247:         <td></td>      
0248:         <td class="smalldark" align="center" height="13"><%= totlast %>
0249: </td>
0250:         <td class="smalldark" align="center" height="13"><%= totcurr %>
0251: </td>
0252:         <td class="smalldark" align="center" height="13"><%= totmia %>
0253: 
0254: </td>
0255:       </tr>
0256: 
0257: 
0258: <% TotPotential = totcurr + totmia 
0259:    NOYPotential = totcur + TotNOY
0260: 
0261: %>
0262: 
0263: <tr>
0264: <td class="smalldark" colspan="8" align="right">Total Potential:</td>
0265: <td class="norm" colspan="2" align="right"><%= TotPotential %></td></tr>
0266: <td class="norm" colspan="2" align="right"><%= TOYPotential %></td></tr>
0267:     </table>
0268:     </td>
0269:   </tr>
0270: </table>
0271: </body>
0272: </html>