Count Lines in Pages

Contents of Page: mmmainold.asp Number of Lines: 251 Last Modified: 8/22/2018 1:32:55 PM
0001: <% @Language = "VBScript" %>
0002: <!-- #include FILE="include/adovbs.inc" -->
0003: <!-- #include FILE="include/constants.inc" -->
0004: <%
0005: 	Set rs = Server.CreateObject("ADODB.Recordset")
0006: 	sqlString = "SELECT * FROM mmEntries WHERE Season = " & season
0007: 	rs.Open sqlString, conn, adOpenStatic, adLockReadOnly, adCmdText
0008: 	totEntries = rs.RecordCount
0009: 	paidentries = 0
0010: 	totCost = 0
0011: 	totssCost = 0	
0012: 	pending = 0
0013: 	pendentries = 0
0014: 	totSEntries = 0
0015: 	NoS16Entry = 0
0016: 	Do Until Rs.EOF
0017: 	
0018: 	npks = Cint(rs("NumEntries").Value)
0019: 	If npks > 0 then
0020: 	totSEntries = totSEntries + 1
0021: 	End If
0022: 	If npks = 1 then
0023: 	NoS16Entry = NoS16Entry + 1
0024: 	End If	
0025: 	IF Season > 2006 Then
0026:     nsspks = Cint(rs("Num2ndEntries").Value)
0027:     End If
0028: 	paid = rs("PaidEntries").Value
0029: 	PayPalUsed = rs("PayPalUsed").Value	
0030: 	paid2nd = rs("Paid2ndEntries").Value
0031: 	BonusSS = npks - 1	
0032: 	If BonusSS < 0 Then BonusSS = 0
0033: 	TotBonusSS = TotBonusSS + BonusSS
0034: '	 Response.Write(totSEntries & "=" & TotBonusSS & "-" & BonusSS & "-" & npks & "-" & rs("EmailAddress").Value & "<br>")
0035: 	If paid <> "" Then paid = CInt(paid)
0036: 	totPicks = totPicks + npks
0037: 	tot2ndPicks = tot2ndPicks + nsspks
0038: 	If paid > 0 Then
0039: 	   paidentries = paidentries + paid
0040: 	Else
0041: 	   pendentries = pendentries + 1
0042: 	End If
0043: 	totsspks = totsspks + nsspks
0044: 	
0045: 	If PayPalUsed = True Then
0046:     	singlesscost = .30 + (( 20 * nsspks ) * .029 )
0047: 	    If Season < 2007 Then
0048: 	       singlecost = .30 + (( 20 + ( BonusSS * 15 )) * .029 )
0049: 	    Else
0050: 	       singlecost = .30 + (( 20 * npks ) * .029 )
0051: 	    End If
0052: 	    totCost = totCost + singlecost
0053: 	    totssCost = totssCost + singlesscost	
0054: 	End If
0055:     rs.MoveNext
0056: 		Loop
0057: 	rs.Close
0058: 	Set rs = Nothing
0059:    totCost = Cint(totCost)
0060:    totssCost = Cint(TotssCost)
0061:    BonusSSEntries = totPicks - totSEntries
0062: 
0063: 	
0064: '	 Response.Write(TotBonusSS & "-" & totSentries & "-" & totpicks & "<br>")
0065: 	pending =  totPicks - paidentries
0066: 	SSFund = TotBonusSS * 5 + ( totsspks * 10 ) 
0067: 	PrizeFund = ( totPicks * 10 ) - SSFund 
0068: 	PrizeFund = ( totSentries * 10 ) + ( ( totPicks - totSentries ) * 5 )
0069: 	PrizeFund =  Cint(PrizeFund)
0070: 	totAmount = totPicks * 10
0071: '	totAmount = totPicks * 15
0072: '	totAmount = totAmount + (totEntries * 5)
0073: '	totAmount = Cint(totAmount / 2)
0074: 	
0075: '	PendAmt = pending * 15
0076: '	PendAmt = PendAmt + (pendentries * 5)
0077: '	PendAmt = Cint(PendAmt / 2)
0078:    PendAmt = pending * 10
0079: 
0080: %>
0081: <html>
0082: 
0083: <head><script language="JavaScript">
0084: 		function COHThankYou()
0085: 		{
0086: 			x = 640;
0087: 			y = 850;
0088: 			var xpos = (screen.width - x)/2;
0089: 			var ypos = (screen.height - y)/2;
0090: 			var updateasp = "cohthankyou2006.htm";
0091: 			var w;
0092: 			w = window.open(updateasp,'update','width='+x+',height='+y+',top='+ypos+',left='+xpos);
0093: 		}	
0094: 	</script>
0095: 
0096: <title>Joe Toledo's March Madness Contest - Benefiting Charity</title>
0097: <base target="_self">
0098: </head>
0099: 
0100: <body bgcolor="#ffffff">
0101: <div align="center"><center>
0102: 
0103: <table cellspacing="0" border="1" cellpadding="5" width="100%" bordercolor="#FED87B"
0104: align="center" height="364">
0105:   <tr>
0106:     <td VALIGN="TOP" width="46%" height="16"><b><span style="font-family:Arial">
0107:     <font color="#FF0000" size="2">Total # of Entries to Date:</font><font color="#0000FF" size="3">&nbsp;<%= totPicks %>&nbsp;<font face="Arial" size="2"
0108:       color="#C0C0C0"></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
0109:     color="#0000FF" size="1"><a href="whoisin.asp">Who is in it?<br></a></font>
0110:     <font color="#ffffff"  size="2">Sweet 16 Contest: <font color="#ffffff"><% = BonusSSEntries %> + <%= tot2ndPicks %></font>&nbsp;&nbsp;&nbsp;&nbsp; </font></span></b></td>
0111:     <td VALIGN="TOP" width="515" height="16" colspan="3"><p align="right"><span
0112:     style="font-family:Arial"><b><font size="2" color="#009900">Funds Raised for Cancer
0113:     Research</font><font color="#009900" size="3">:</font><font color="#0000FF" size="3"> $<%= totAmount %>&nbsp;&nbsp;&nbsp;</font><font
0114:     size="2">(Pending:&nbsp;$<%= PendAmt %>)</font></b></span> </td>
0115:   </tr>
0116:   <tr bgcolor="#FFFAF0">
0117:     <td VALIGN="TOP" <% If user = "jt@folga.org" Then %> width="38%"  colspan="2" <% Else %>
0118:     width="100%"  colspan="4"<% End If %> height="16"><font style="font-size: 11pt"><span
0119:     style="font-family: Arial; font-style:italic; font-weight:700"><center>Welcome to the <%= Season %> March
0120:     Madness Contest!</center></span></font></td>
0121: <% If user = "jt@folga.org" Then %>
0122:     <td VALIGN="TOP" width="30%" height="16"><p align="right"><b><i><font face="Arial"
0123:     color="#009900" style="font-size: 9pt">Contest Prize Fund:</font><font face="Arial"
0124:     color="#FF0000" style="font-size: 9pt"><br>
0125: <%= PrizeFund %>    / <%= TotCost %></font></i></b></td>
0126:     <td VALIGN="TOP" width="30%" height="16"><p align="right"><i><b><font face="Arial"
0127:     color="#009900" style="font-size: 9pt">Sweet 16 Prize Fund:<br>
0128:     </font><font face="Arial" color="#FF0000" style="font-size: 9pt"><%= SSFund %> / <%= totssCost %></font></b> </i></td>
0129: <% End If %>
0130:   </tr>
0131:   <tr bgcolor="#FFFAF0">
0132:     <td VALIGN="TOP" colspan="4"><p class="MsoNormal"
0133:     style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Arial">This
0134:     contest allows you to enjoy the upcoming NCAA Men&#146;s Basketball Tournament and at the
0135:     same time raise funds to help our fight against cancer.&nbsp; <b><br>
0136:     <br>
0137:     </b>It only takes a <strong>$20 donation</strong> to participate, with <b>$10 </b>being
0138:     donated&nbsp; to the <strong>City of Hope</strong> Medical Center and Research Institute
0139:     and the remainder being distributed amongst the contest participants winners.&nbsp; This
0140:     contest rewards the top <strong>10%</strong>&nbsp;of all entries with prizes up to <strong>$500
0141:     or more.</strong></span><u2:p></p>
0142:     
0143: <% If RegOpen = "YES" Then %>    
0144:     <p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
0145:     style="font-family: Arial">Participants who submit multiple entries are
0146:     rewarded with a <i><b>free entry</b></i> into the <font color="#008000"><i><b>Sweet 16
0147:     Contest</b></i></font>.&nbsp;&nbsp; For more information on that, <a
0148:     href="sweet16details.asp">click here</a>.</span></p>
0149:     <p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
0150:     style="font-family:Arial"><font color="#FF0000"><b>Registration is now open</b></font>.&nbsp;
0151:     Click <a href="signup.asp"><blink><b>here</b></blink></a> to register. You can start
0152:     making your picks after the brackets are announced on <%= SelSunday %>.</span></p>
0153:     
0154: <% End If 
0155: If Reg2ndOpen = "YES" Then %>
0156:   <p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
0157:     style="font-family:Arial"><font color="#FF0000"><b>Registration for the <font
0158:     color="#008000">Sweet 16 Contest</font> is now open</b></font>.&nbsp;
0159:     Click <a href="signup.asp"><blink><b>here</b></blink></a> to register. You can start
0160:     making your picks after the field of 16 is set on <%= Sel2ndSunday %>.</span></p>  
0161:     
0162: <% End If %>     
0163:     <p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"
0164:     align="center"><span style="font-family:Arial"><b>&nbsp;</b><a href="cohthankyou.htm"
0165:     target="_blank">Click here for a copy of the &quot;thank you&quot; note from City of Hope.</a></span></td>
0166:   </tr>
0167:   <tr bgcolor="#FFFAF0">
0168:     <td VALIGN="TOP" width="722" height="44" colspan="4"><p align="center">&nbsp; <script
0169:     language="JavaScript1.2">
0170: 
0171: 
0172: 
0173: function setcountdown(theyear,themonth,theday){
0174: yr=theyear;mo=themonth;da=theday
0175: }
0176: 
0177: //////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
0178: 
0179: //STEP 1: Configure the countdown-to date, in the format year, month, day:
0180: setcountdown(2008,03,27)
0181: 
0182: //STEP 2: Change the two text below to reflect the occasion, and message to display on that occasion, respectively
0183: var occasion="<br>register for the contest and/or make your picks."
0184: var message_on_occasion="Good Luck!"
0185: 
0186: //STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countdown area
0187: var countdownwidth='518px'
0188: var countdownheight='20px'
0189: var countdownbgcolor='#FED87B'
0190: var opentags='<span style="font-family:Arial"><font size="3"><bold>'
0191: var closetags='</bold></span>'
0192: 
0193: //////////DO NOT EDIT PASS THIS LINE//////////////////
0194: 
0195: var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
0196: 
0197: 
0198: function start_countdown(){
0199: if (document.layers)
0200: document.countdownnsmain.visibility="show"
0201: countdown(2000,1,1)
0202: }
0203: 
0204: if (document.all)
0205: document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span>')
0206: 
0207: window.onload=start_countdown
0208: 
0209: 
0210: function countdown(){
0211: var today=new Date()
0212: var todayy=today.getYear()
0213: if (todayy < 1000)
0214: todayy+=1900
0215: var todaym=today.getMonth()
0216: var todayd=today.getDate()
0217: var todayh=today.getHours()
0218: var todaymin=today.getMinutes()
0219: var todaysec=today.getSeconds()
0220: var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
0221: futurestring=montharray[mo-1]+" "+da+", "+yr+" 16:00:00"
0222: dd=Date.parse(futurestring)-Date.parse(todaystring)
0223: dday=Math.floor(dd/(60*60*1000*24)*1)
0224: dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
0225: dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
0226: dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
0227: if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1){
0228: if (document.layers){
0229: document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
0230: document.countdownnsmain.document.countdownnssub.document.close()
0231: }
0232: else if (document.all)
0233: countdownie.innerHTML=opentags+message_on_occasion+closetags
0234: return
0235: }
0236: else{
0237: if (document.layers){
0238: document.countdownnsmain.document.countdownnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags)
0239: document.countdownnsmain.document.countdownnssub.document.close()
0240: }
0241: else if (document.all)
0242: countdownie.innerHTML=opentags+"You have "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left to"+occasion+closetags
0243: }
0244: setTimeout("countdown()",1000)
0245: }
0246: </script> <ilayer id="countdownnsmain" width="&amp;{countdownwidth};" height="&amp;{countdownheight};" bgColor="&amp;{countdownbgcolor};" visibility="hide"> <layer id="countdownnssub" width="&amp;{countdownwidth};" height="&amp;{countdownheight};" left="0" top="0"></layer></ilayer> </td>
0247:   </tr>
0248: </table>
0249: </center></div>
0250: </body>
0251: </html>