Count Lines in Pages

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