Count Lines in Pages

Contents of Page: picks2nd.asp Number of Lines: 240 Last Modified: 4/20/2025 9:27:47 AM
0001: <% @Language = "VBScript" %>
0002: <!-- #include FILE="include/adovbs.inc" -->
0003: <!-- #include FILE="include/constants.inc" -->
0004: <!-- #include FILE="include/funcs.asp" -->
0005: <%
0006: 	user = Request.Cookies("user")
0007: '	If user = "" Or (user <> "" And Session("loggedIn") = "") Then Response.Redirect("login.asp?from=picks.asp")
0008: 	If user = "" Then Response.Redirect("login.asp?from=picks2nd.asp")
0009: 	
0010:     If stop2ndmakepicks = "YES" Then
0011:     noMore2ndPicks = True
0012:     Else
0013:     noMore2ndPicks = False
0014:     End If
0015: 	
0016: 	If user = "jt@folga.org" Then noMore2ndPicks = False
0017:    If start2ndmakepicks <> "YES" Then
0018:       Response.Redirect("picks12nddemo.asp")
0019:    Else
0020: 	' delete all temporary picks for this user
0021: 	Set cn = Server.CreateObject("ADODB.Connection")
0022: 	cn.Open conn
0023: 	sqlString = "DELETE FROM mm2ndPicks " & _
0024: 							"WHERE EmailAddress = '" & user & "' " & _
0025: 							"AND Season = " & season & " " & _
0026: 							"AND Complete = 'No'"
0027: 	cn.Execute sqlString, lngRecs, adExecuteNoRecords
0028: 	cn.Close
0029: 	Set cn = Nothing
0030: 	
0031: 	' obtain the entry information
0032: 	Set rsEntry = Server.CreateObject("ADODB.Recordset")
0033: 	sqlString = "SELECT * FROM mmEntries " & _
0034: 							"WHERE EmailAddress = '" & user & "' " & _
0035: 							"AND Season = " & season
0036: 	rsEntry.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0037: 	TempssEntries = rsEntry("Num2ndEntries").Value 
0038: 	RegEntries = rsEntry("NumEntries").Value
0039: 
0040: 	If TempssEntries = 0 And RegEntries < 2 Then
0041: 	Response.Redirect("no2ndchancemessage.html")
0042: 	End If
0043: 	numssEntries = CInt(TempssEntries)	
0044: 	If numssEntries < 1 Then
0045: 	numssEntries = 0
0046: ' 	Else
0047: ' 	numssEntries = CInt(TempssEntries)
0048: 	End If
0049: '	numEntries = CInt(num2ndEntries)
0050: 	If RegEntries > "1" Then
0051: 		
0052: 	numEntries = ( RegEntries - 1 ) + numssEntries
0053: 	numEntries = RegEntries - 1
0054: 	numEntries = numEntries + numssEntries	
0055: ' Response.Write("1 RegEntries=" & RegEntries & 	"numEntries=" & numEntries & "Totpicks=" & totPicks & "NumssEntries=" & NumssEntries)		
0056: 
0057: 	Else	
0058: 	numEntries = numssEntries	
0059: ' Response.Write("2 RegEntries=" & RegEntries & 	"numEntries=" & numEntries & "Totpicks=" & totPicks & "NumssEntries=" & NumssEntries)		
0060: 	
0061: 	End If
0062: 	firstName = rsEntry("FirstName").Value
0063: 	name = rsEntry("Name").Value
0064: 	paid = rsEntry("Paid2ndEntries").Value
0065: 	totpaid = 0
0066: 	If paid <> "" Then totpaid = totpaid + CInt(paid)
0067: 	
0068: 	rsEntry.Close
0069: 	Set rsEntry = Nothing
0070: 
0071: 	' get all picks
0072: 
0073: 	Set rspc = Server.CreateObject("ADODB.Recordset")
0074: 	sqlString = "SELECT COUNT(Season) as RecordCount FROM mm2ndPicks " & _
0075: 							"WHERE EmailAddress = '" & user & "' " & _
0076: 							"AND Season = " & season & " " & _
0077: 							"AND Complete = 'Yes'"
0078: 	rspc.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0079: 
0080: 	totPicks = CInt(rspc("RecordCount").Value)
0081: 
0082: 		rspc.Close
0083: 	Set rspc = Nothing
0084: 
0085: 	Set rsPicks = Server.CreateObject("ADODB.Recordset")
0086: 	sqlString = "SELECT * FROM mm2ndPicks " & _
0087: 							"WHERE EmailAddress = '" & user & "' " & _
0088: 							"AND Season = " & season & " " & _
0089: 							"AND Complete = 'Yes'"
0090: 	rsPicks.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0091: 	
0092: 	If rsPicks.EOF And numEntries <> 0 And Not noMore2ndPicks Then
0093: 		rsPicks.Close
0094: 		Response.Redirect("picks12nd.asp?region=1")
0095: 	ElseIf totpaid > numEntries Then
0096: '		rsPicks.Close
0097: '		Response.Redirect("contactmm.asp?user=" & user)
0098: 	End If
0099: 
0100: '	totPicks = rsPicks.RecordCount
0101:    End If
0102: %>
0103: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
0104: <html>
0105: 
0106: <head>
0107: <title>March Madness - Sweet 16 Picks Screen</title>
0108: <link href="mm.css" rel="stylesheet" type="text/css">
0109: 	<link href="https://mychinodes.org/desb.css" rel="stylesheet" type="text/css">
0110: <script language="JavaScript" type="text/javascript">
0111: 		function deleteNode(id)	{
0112: 			if (!confirm("You are about to re-set your pick selections.  Continue?"))	{
0113: 				return;
0114: 			}
0115: 			window.location = "editPicks2nd.asp?pick="+id;
0116: 		}
0117: 		function deletefinals(id)	{
0118: 			if (!confirm("You are about to re-set your pick selections.  You will have to re-select the finalists and champion.  Continue?"))	{
0119: 				return;
0120: 			}
0121: 			window.location = "editPicks.asp?pick="+id+"&page=final";
0122: 		}
0123: 
0124: 	</script>
0125: </head>
0126: 
0127: <body bgcolor="#ffffff">
0128: 
0129: <table border="0" cellpadding="0" cellspacing="0" width="665" bgcolor="#FFCC66">
0130:   <tr>
0131:     <td class="bigblue" width="647" colspan="3"><p align="center">Make / Review Sweet 16
0132:     Contest Picks&nbsp;&nbsp;&nbsp;&nbsp;<%= user %> &nbsp;</td>
0133:   </tr>
0134:   <tr>
0135:     <td class="norm" colspan="4" width="665"><ol>
0136:       <li>To <b>display picks</b> already made, click on Entry Name.</li>
0137:       <li>To <b>change picks</b> on any given entry, click on <u>Change</u> for appropriate pick
0138:         selection.&nbsp; <span class="normred"><b><br>
0139:         WARNING:</b></span> You must re-post picks.</li>
0140:     </ol>
0141:     </td>
0142:   </tr>
0143:   <tr valign="top">
0144:     <td class="normbold" width="100" colspan="1">Player's Name:</td>
0145:     <td class="norm" width="493" align="left" colspan="1"><%= firstName %>&nbsp;<%= name %></td>
0146:   </tr>
0147: <% numleft =  numEntries - totPicks %>
0148: <%	If numEntries > 1 Then	%>
0149: <%		If numEntries > totPicks Then
0150:     		numLeft = numEntries - totPicks
0151:     	End If	%>
0152:   <tr valign="top">
0153:     <td class="normbold" width="154">Max Entries:&nbsp;&nbsp; <%= numEntries %></td>
0154:     <td class="normbold" width="247">&nbsp;<span class="normRed">&nbsp;(<%= numLeft %> left)</span>
0155:     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
0156:     <td class="normbold" width="246"></td>
0157:     <td class="norm" width="18"></td>
0158:   </tr>
0159: <% End If	%>
0160:   <tr>
0161:     <td colspan="4" class="space" width="665"></td>
0162:   </tr>
0163:   <tr>
0164:     <td colspan="4" width="665" bgcolor="#FFFFFF"><%	If Not rsPicks.EOF Then	%>
0165: <table border="0" cellpadding="0"
0166:     cellspacing="0" align="center">
0167:       <tr bgcolor="#FFFAF0">
0168:         <td class="normbold" width="150" align="left" height="20">Entry Name</td>
0169:         <td class="normbold" width="100" align="left">Champion</td>
0170:         <td class="normbold" width="100" align="left">2nd Place</td>
0171:         <td class="normbold" width="200" align="left">Semifinalists</td>
0172:         <td class="normbold" width="100" align="center"></td>
0173:       </tr>
0174:       <tr>
0175:         <td colspan="5" height="1" bgcolor="#000000"><spacer type="block"></td>
0176:       </tr>
0177: <%	End If
0178: 		back = "#f8f8f8"
0179: 		Do Until rsPicks.EOF
0180: 			P1 = rsPicks("A15").Value
0181: 			If P1 <> rsPicks("A13").Value Then
0182: 				P2 = rsPicks("A13").Value
0183: 			Else
0184: 				P2 = rsPicks("A14").Value
0185: 			End If
0186: 			RU = ""
0187: 			If rsPicks("A9").Value <> P1 And rsPicks("A9").Value <> P2 Then RU = AddToList(RU, rsPicks("A9").Value)
0188: 			If rsPicks("A10").Value <> P1 And rsPicks("A10").Value <> P2 Then RU = AddToList(RU, rsPicks("A10").Value)
0189: 			If rsPicks("A11").Value <> P1 And rsPicks("A11").Value <> P2 Then RU = AddToList(RU, rsPicks("A11").Value)
0190: 			If rsPicks("A12").Value <> P1 And rsPicks("A12").Value <> P2 Then RU = AddToList(RU, rsPicks("A12").Value)
0191: 			If back = "#f8f8f8" Then
0192: 				back = "#ffffff"
0193: 			Else
0194: 				back = "#f8f8f8"
0195: 			End If
0196: 			Dim RUarr
0197: 			RUarr = Split(RU, ",")
0198: %>
0199:       <tr bgcolor="<%= back %>">
0200:         <td class="norm"><a href="display2ndpicks.asp?pick=<%= rsPicks("ID").Value %>"
0201:         class="normUndl"><%= rsPicks("EntryName").Value %></a> &nbsp; </td>
0202:         <td class="norm" align="left"><%= displayTeam(P1) %>
0203: </td>
0204:         <td class="norm" align="left"><%= displayTeam(P2) %>
0205: </td>
0206:         <td class="norm" align="left"><%= displayTeam(RUarr(0)) %>,<%= displayTeam(RUarr(1)) %> </td>
0207:         <td align="left"><%		If noMore2ndPicks = False Then	%>
0208: <p>&nbsp;  <a href="javascript:deleteNode('<%= rsPicks("ID").Value %>')"
0209:         class="normUndl">Change</a> <%		End If	%> </td>
0210:       </tr>
0211: <%		rsPicks.MoveNext
0212: 		Loop
0213: 		rsPicks.Close
0214: 		Set rsPicks = Nothing	%>
0215:     </table>
0216:     </td>
0217:   </tr>
0218: <%	If numEntries > totPicks And Not noMore2ndPicks Then	%>
0219:   <tr>
0220:     <td colspan="4" class="space" width="665" bgcolor="#FFFFFF"></td>
0221:   </tr>
0222:   <tr align="center">
0223:     <td colspan="4" width="665" bgcolor="#FFFFFF"><br><input type="button"
0224:     value="Make Picks For A New Entry" class="button-40" onClick="window.location='picks12nd.asp?'"></td>
0225:   </tr>
0226: <% Else 
0227: ' Response.Write("RegEntries=" & RegEntries & 	"numEntries=" & numEntries & "Totpicks=" & totPicks & "noMore2ndPicks=" & noMore2ndPicks)		
0228: 	End If	%>
0229: 	
0230: </table>
0231: <table border="0" cellpadding="0" cellspacing="0" width="665">	
0232: 	
0233: <tr><td>&nbsp;</td></tr>
0234: <tr height="50" valign="center"><td colspan="10" align="center"> 
0235:  <button class="button-101" onclick="window.open('MakeAllPicks.asp','main');"><big>Return to Make All Picks</button>				
0236: </td></tr>
0237: 	
0238: </table>
0239: </body>
0240: </html>