Count Lines in Pages

Contents of Page: pickso.asp Number of Lines: 181 Last Modified: 8/22/2018 1:33:07 PM
0001: <% @Language = "VBScript" %>
0002: 
0003: <!-- #include FILE="include/adovbs.inc" -->
0004: <!-- #include FILE="include/constants.inc" -->
0005: <!-- #include FILE="include/funcs.asp" -->
0006: 
0007: <%
0008: 	user = Request.Cookies("user")
0009: 	If user = "" Or (user <> "" And Session("loggedIn") = "") Then Response.Redirect("login.asp?from=picks.asp")
0010: 	If user = "joe@lusogolf.org" Or user = "skesic@bridgesolutions.com" Then noMorePicks = False
0011:    If startmakepicks = "no" Then
0012:       Response.Redirect("picks1demo.asp")
0013:    Else
0014: 	' delete all temporary picks for this user
0015: 	Set cn = Server.CreateObject("ADODB.Connection")
0016: 	cn.Open conn
0017: 	sqlString = "DELETE FROM mmPicks " & _
0018: 							"WHERE EmailAddress = '" & user & "' " & _
0019: 							"AND Season = " & season & " " & _
0020: 							"AND Complete = 'No'"
0021: 	cn.Execute sqlString, lngRecs, adExecuteNoRecords
0022: 	cn.Close
0023: 	Set cn = Nothing
0024: 	
0025: 	' obtain the entry information
0026: 	Set rsEntry = Server.CreateObject("ADODB.Recordset")
0027: 	sqlString = "SELECT * FROM mmEntries " & _
0028: 							"WHERE EmailAddress = '" & user & "' " & _
0029: 							"AND Season = " & season
0030: 	rsEntry.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0031: 	numEntries = CInt(rsEntry("NumEntries").Value)
0032: 	firstName = rsEntry("FirstName").Value
0033: 	name = rsEntry("Name").Value
0034: 	rsEntry.Close
0035: 	Set rsEntry = Nothing
0036: 
0037: 	' get all picks
0038: 	Set rsPicks = Server.CreateObject("ADODB.Recordset")
0039: 	sqlString = "SELECT * FROM mmPicks " & _
0040: 							"WHERE EmailAddress = '" & user & "' " & _
0041: 							"AND Season = " & season & " " & _
0042: 							"AND Complete = 'Yes'"
0043: 	rsPicks.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0044: 	
0045: 	If rsPicks.EOF And numEntries <> 0 And Not noMorePicks Then
0046: 		rsPicks.Close
0047: 		Response.Redirect("picks1.asp?region=1")
0048: 	ElseIf numEntries = 0 Then
0049: 		rsPicks.Close
0050: 		Response.Redirect("contactmm.asp?user=" & user)
0051: 	End If
0052: 
0053: 	totPicks = rsPicks.RecordCount
0054:    End If
0055: %>
0056: 
0057: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
0058: 
0059: <html>
0060: <head>
0061: 	<title>March Madness - Picks Screen</title>
0062: 	<link href="mm.css" rel="stylesheet" type="text/css">
0063: </head>
0064: 
0065: <body bgcolor="#ffffff">
0066: 
0067: 	<table border="0" cellpadding="0" cellspacing="0" align="center" width="651">
0068: 		<tr>
0069: 			<td class="bigblue" width="438">Step #3: Make / Review Picks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
0070: 			<td class="bigblue" width="205">&nbsp;User: <%= user %>
0071: 			
0072:               &nbsp;</td>
0073: 		</tr>
0074: 		<tr>
0075: 			<td class="norm" colspan="3" width="648">
0076: 				<ol>
0077: 					<li>To <b>review picks</b> already made, click on Entry Name.</li>
0078: 					<li>To <b>change picks</b> on any given entry, click <b>Picks</b> in the Change column.&nbsp; <span class="normred"><b><br>
0079:                       WARNING:</b></span> You must complete all screens.</li>
0080: 					<li>To <b>change</b> just the <b>finalists</b> on any given entry, click <b>Finalists</b> in the Change column.&nbsp; <span class="normred"><b><br>
0081:                       WARNING:</b></span> You must complete this screen.</li>
0082: 					<li>Click on <img src="images/post.gif" border="0" align="absmiddle"> to change your Entry Name.</li>
0083: 				</ol>
0084: 			</td>
0085: 		</tr>
0086: 		<tr valign="top">
0087: 			<td class="normbold" width="643" colspan="2">Player's Name:</td>
0088: 			<td class="norm" width="4" align="left">
0089: 				<%= firstName %>&nbsp;<%= name %>
0090: 			</td>
0091: 		</tr>
0092: <%	If numEntries > 1 Then	%>
0093: 			<tr valign="top">
0094: 				<td class="normbold" width="209">Max Entries:</td>
0095: 				<td class="normbold" width="434">
0096: 				&nbsp;<span class="normRed">(<%= numLeft %> left)</span>
0097:                   &nbsp;</td>
0098: 				<td class="norm" width="4"><%= numEntries %>
0099: <%		If numEntries > totPicks Then
0100: 				numLeft = numEntries - totPicks	%>
0101:                   <%		End If	%>
0102: 				</td>
0103: 			</tr>
0104: <%	End If	%>
0105: 		<tr><td colspan="3" class="space" width="648">&nbsp;</td></tr>
0106: 		<tr>
0107: 			<td colspan="3" width="648">
0108: <%	If Not rsPicks.EOF Then	%>
0109: 					<table border="0" cellpadding="0" cellspacing="0" align="center">
0110: 						<tr bgcolor="#FFFAF0">
0111: 							<td class="normbold" width="150" align="left" height="20">Entry Name</td>
0112: 							<td class="normbold" width="100" align="left">Champion</td>
0113: 							<td class="normbold" width="100" align="left">2nd Place</td>
0114: 							<td class="normbold" width="200" align="left">Semifinalists</td>
0115: 							<td class="normbold" width="100" align="center">Change</td>
0116: 						</tr>
0117: 						<tr><td colspan="5" height="1" bgcolor="#000000"><spacer type="block"></td></tr>
0118: <%	End If
0119: 		back = "#f8f8f8"
0120: 		Do Until rsPicks.EOF
0121: 			P1 = rsPicks("F1").Value
0122: 			If P1 <> rsPicks("S1").Value Then
0123: 				P2 = rsPicks("S1").Value
0124: 			Else
0125: 				P2 = rsPicks("S2").Value
0126: 			End If
0127: 			RU = ""
0128: 			If rsPicks("A15").Value <> P1 And rsPicks("A15").Value <> P2 Then RU = AddToList(RU, rsPicks("A15").Value)
0129: 			If rsPicks("B15").Value <> P1 And rsPicks("B15").Value <> P2 Then RU = AddToList(RU, rsPicks("B15").Value)
0130: 			If rsPicks("C15").Value <> P1 And rsPicks("C15").Value <> P2 Then RU = AddToList(RU, rsPicks("C15").Value)
0131: 			If rsPicks("D15").Value <> P1 And rsPicks("D15").Value <> P2 Then RU = AddToList(RU, rsPicks("D15").Value)
0132: 			If back = "#f8f8f8" Then
0133: 				back = "#ffffff"
0134: 			Else
0135: 				back = "#f8f8f8"
0136: 			End If
0137: 			Dim RUarr
0138: 			RUarr = Split(RU, ",")
0139: %>
0140: 						<tr bgcolor="<%= back %>">
0141: 							<td class="norm">
0142: 								<a href="displaypicks.asp?pick=<%= rsPicks("ID").Value %>" class="normUndl"><%= rsPicks("EntryName").Value %></a>
0143: 								&nbsp;
0144: 								<a href="nameChange.asp?pick=<%= rsPicks("ID").Value %>" class="normUndl">
0145: 									<img src="images/post.gif" alt="Change entry name" border="0" align="absmiddle">
0146: 								</a>
0147: 							</td>
0148: 							<td class="norm" align="left"><%= displayTeam(P1) %></td>
0149: 							<td class="norm" align="left"><%= displayTeam(P2) %></td>
0150: 							<td class="norm" align="left">
0151: 								<%= displayTeam(RUarr(0)) %>,&nbsp;<%= displayTeam(RUarr(1)) %>
0152: 							</td>
0153: 							<td align="left">
0154: <%		If noMorePicks Then	%>
0155: 									&nbsp;
0156: <%		Else	%>
0157: 									<a href="editPicks.asp?pick=<%= rsPicks("ID").Value %>&page=region" class="normUndl">Picks</a>
0158: 									&nbsp;&nbsp;
0159: 									<a href="editPicks.asp?pick=<%= rsPicks("ID").Value %>&page=final" class="normUndl">Finalists</a>
0160: <%		End If	%>
0161: 							</td>
0162: 						</tr>
0163: <%		rsPicks.MoveNext
0164: 		Loop
0165: 		rsPicks.Close
0166: 		Set rsPicks = Nothing	%>
0167: 				</table>
0168: 			</td>
0169: 		</tr>
0170: <%	If numEntries > totPicks And Not noMorePicks Then	%>
0171: 		<tr><td colspan="3" class="space" width="648">&nbsp;</td></tr>
0172: 		<tr align="center">
0173: 			<td colspan="3" width="648">
0174: 				<input type="button" value="Make Picks For A New Entry" class="norm" onClick="window.location='picks1.asp?region=1'"></td>
0175: 		</tr>
0176: <%	End If	%>
0177: 	</table>
0178: 
0179: 
0180: </body>
0181: </html>