<% Option Explicit %> <% sPageTitle = "Activity Details" %> <%=sTitle%> <% Dim nActivity Dim nReg Dim sCalType Dim canRegister Dim sRegisterMsg Dim sTooSoon sRegisterMsg = "" sTooSoon = False sCalType = Request("c") & "" If sCalType = "per" And Session("id") = "" Then Response.Redirect("/login.asp") End If nReg = Request.QueryString("rid") & "" nActivity = Request.QueryString("aid") & "" If nActivity = "" Then Response.Write("Please choose an activity") Else Call Activity_GetRecord(nActivity) Call Activity_GetActivityImages(nActivity) writeActivity End If ' Debugging 'Response.Write "

Session(login)=" & session("login") & ", " & "Session(id)=" & session("id") & ", " & "Session(member)=" & Session("member") & ", " & "Session(gender)=" & session("gender") & "
" '====================================================================================== ' ' writeActivity ' '====================================================================================== public Sub writeActivity %>
<%=Replace(sActivityName, VBCRLF, "
")%>
<%=AS_DateFormat(sActivityBeginDate)%> <% If DateDiff("d", sActivityBeginDate, sActivityEndDate) > 0 Then %> - <%=AS_DateFormat(sActivityEndDate)%> <% End If %>

<% If ActivityImageList(1) <> "" Then %> <% End If %> <% If nActivityStatus = ACT_STATUS_CANCELLED Then Response.Write("" & vbCRLF) End If If bActivityMembersOnly Then Response.Write("" & vbCRLF) End If If nActivityExpLevel <> "" Then %> <% End If %> <% 'CLS 6/15/05 - Show waiting list even if the capacity hasn't been specified (or is zero) 'If nAvailable = 0 And nActivityCapacity > 0 Then If nAvailable = 0 Then %> <% End If %> <% If bActivityMembersOnly And nActivityGuestsPerMember > 0 Then Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) End If %> <% If sActivityLocation <> "" Then %> <% End If %> <% If sActivityTransportation <> "" Then %> <% End If %> <% If sCalType <> "per" Then Dim sDisplayCosts sDisplayCosts = "" If numActivityBaseCosts = 1 Then If sActivityMemberCost <> "" Then If CInt(sActivityMemberCost) = 0 Then sDisplayCosts = "Free for Members" Else sDisplayCosts = FormatCurrency(sActivityMemberCost, 2) & " Member" End If End If If sActivityGuestCost <> "" Then If sDisplayCosts <> "" Then sDisplayCosts = sDisplayCosts & " / " End If If CInt(sActivityGuestCost) = 0 Then sDisplayCosts = sDisplayCosts & "Free for Non-Members" Else sDisplayCosts = sDisplayCosts & FormatCurrency(sActivityGuestCost, 2) & " Non-Member" End If End If End If If sDisplayCosts <> "" Then %> <% Else %> <% End If %> <% If ActivityImageList(2) <> "" Then %> <% End If %> <% If sActivityDescription2 <> "" Then %> <% End If %> <% If ActivityImageList(3) <> "" Then %> <% End If %> <% If sActivityDescription3 <> "" Then %> <% End If %> <% If ActivityImageList(4) <> "" Then %> <% End If %> <% If sActivityDescription4 <> "" Then %> <% End If %> <% If ActivityImageList(5) <> "" Then %> <% End If %> <% If sActivityPricingInclusion <> "" Then %> <% End If %> <% End If %>
This Activity Has Been Cancelled
Member Only Activity - Paid Membership Required
Experience: <%=sActivityLevelName%>
Limit: <% Dim nAvailable If nActivityCapacity = "" Then Response.Write("None") Else If nActivityCapacity > 0 Then Response.Write(nActivityCapacity & " people   ") End If nAvailable = 0 If nActivityCapacity > 0 Then nAvailable = nActivityCapacity - nActivityNumRegistered If nAvailable <= 0 Then Response.Write("This activity is full") Else ' Requirement 10-28-2004: Don't want to show "large" number of available spaces ' Requirement change 9-14-2005: Changed 2 spaces to 3 If nAvailable <= 3 Then Response.Write("" & nAvailable & " space(s) available") End If End If ElseIf nActivityCapacity = 0 Then Response.Write("This activity is full") End If End If %>
  If you would like to be placed on the waiting list, click here.
Guests:Members may bring " & nActivityGuestsPerMember & " guest" & iif(nActivityGuestsPerMember > 1, "s", "") & "
Time: <%=sActivityTime%>
Where: <%=sActivityLocation%>
Transportation: <%=sActivityTransportation%>  View Transportation
Cost: <%=sDisplayCosts%>  Sign Up Now
Costs: View Pricing
<%=Replace(sActivityDescription, vbCRLF, "
")%>
<%=Replace(sActivityDescription2, vbCRLF, "
")%>
<%=Replace(sActivityDescription3, vbCRLF, "
")%>
<%=Replace(sActivityDescription4, vbCRLF, "
")%>
*Pricing Includes: <%=Replace(sActivityPricingInclusion, vbCRLF, "
")%>
<% If sCalType = "per" Then 'Display guests the member may have signed up getGuests() 'Display member selected costs (paid) displaySelectedOptions() End If If sCalType <> "per" Then 'Display costs member is to select from 'Base costs 'activityBaseCosts() DisplayActivityCosts("B") 'CLS 1/26/05 - Since all activity costs are optional, we now make one call instead of two: 'Are there required and/or optional costs? 'activityCosts(1) 'activityCosts(0) DisplayActivityCosts("O") 'Is this a weekend trip which requires lodging? 'activityLodging DisplayActivityCosts("L") End If %> <% If sCalType = "per" Then %> <% If sActivityMeetingLoc <> "" Then %> <% End If %> <% If sActivityItinerary <> "" Then %> <% End If %> <% If sActivityRequiredItems <> "" Then %> <% End If %> <% If sActivityRecommendedItems <> "" Then %> <% End If %> <% End If %> <% If sCalType <> "per" Then %> <% End If %> <% If ActivityImageList(6) <> "" Then %> <% End If %> <% '8/29/05: Serena wants to show all policies at all times, regardless if the user is logged in or not. 'Don't display the policies unless user is logged in: 'If session("login") <> "" Then %> <% If sActivityRiskPolicy <> "" Or sActivityCancelPolicy <> "" Or sActivityWeatherPolicy <> "" Then %> <% End If %> <% If sActivityRiskPolicy <> "" Then %> <% End If %> <% If sActivityCancelPolicy <> "" Then %> <% End If %> <% If sActivityWeatherPolicy <> "" Then %> <% End If %> <% 'End If %>
Activity Leader
<%=sActivityLeaderName%>
Weekday Contact: <%=sActivityLeaderHomePhone%>
Weekend Contact: <%=sActivityLeaderMobilePhone%>
Meeting Location
<%=Replace(sActivityMeetingLoc, vbCRLF, "
")%>
Itinerary
<%=Replace(sActivityItinerary, vbCRLF, "
")%>
Packing List
<%=Replace(sActivityRequiredItems, vbCRLF, "
")%>
Other Recommendations
<%=Replace(sActivityRecommendedItems, vbCRLF, "
")%>
Sign Up For This Activity
<% If session("login") <> "" And Session("member") > 0 Then CheckIfAllowed() If canRegister Then %>
method="GET" if="form1"> " ID="Hidden1"> " ID="Hidden2"> " ID="Hidden3">

<% Else Response.Write("" & sRegisterMsg & "") If sTooSoon = True Then %>
" method="post" name="frmSignUp" id="frmSignUp">
<% End If End If Else %>


or

<% End If %>
Disclaimers & Policies
*ASSUMPTION OF RISK: <%=Replace(sActivityRiskPolicy, vbCRLF, "
")%>
*CANCELLATION POLICY: <%=Replace(sActivityCancelPolicy, vbCRLF, "
")%>
*WEATHER POLICY: <%=Replace(sActivityWeatherPolicy, vbCRLF, "
")%>
<% End Sub '====================================================================================== ' ' CheckIfAllowed ' '====================================================================================== Function CheckIfAllowed() Dim sSQL Dim dToday dToday = Now dbopen recordset.CursorLocation = adUseClient recordset.CursorType = adOpenStatic recordset.LockType = adLockOptimistic sSQL = "SELECT * FROM ActivityRoster" & _ " WHERE ActivityID = " & nActivity & " AND RosterUserID = " & Session("id") & _ " AND RosterStatus = " & ROSTER_STATUS_ACTIVE 'Response.Write ("sSQL: " & sSQL) recordset.Open sSQL, cn, adOpenStatic, adLockOptimistic If Not recordset.EOF Then canRegister = False sRegisterMsg = "You have already registered for this activity. If a friend would like to sign up " & _ "they will need to create a login. If they do not want to sign up for membership " & _ "they can create a " & chr(34) & "Non-Member" & chr(34) & " account at no charge and they will then pay the Non-Member price. " & _ "If this is a Members Only activity you will need to call the office to have your guests added. " & _ "*Note: you cannot add more guests than are allowed for each activity." Exit Function End If dbclose If nActivityStatus = ACT_STATUS_CANCELLED Then canRegister = False sRegisterMsg = "This Activity Has Been Cancelled" Exit Function End If If CDate(sActivityRegEndsDate) <= dToday Then canRegister = False sRegisterMsg = "Registration for this Activity is Closed" Exit Function End If If sActivityRegBeginsDate <> "" Then If CDate(sActivityRegBeginsDate) > dToday Then canRegister = False sRegisterMsg = "Registration for this Activity is not open yet" Exit Function End If End If If nActivityNumRegistered >= nActivityCapacity Then canRegister = False sRegisterMsg = "This Activity is Full" Exit Function End If If bActivityMembersOnly And Session("member") < 2 Then canRegister = False sRegisterMsg = "Member Only Activity - Paid Membership Required" Exit Function End If 'Non-paying members can not sign up until 14 days prior to the activity: 'CLS 1/5/05 - Per Serena, guests can sign up any time 'If Session("member") < 2 Then ' If DateDiff("d", Date, sActivityBeginDate) > 14 Then ' canRegister = False ' sRegisterMsg = "NON-MEMBERS MAY ONLY SIGN UP WITHIN 14 DAYS OF THE ACTIVITY DATE" ' sTooSoon = True ' Exit Function ' End If 'End If If Len(Session("InfoMissing")) > 0 Then canRegister = False 'sRegisterMsg = "To Sign Up For This Activity, You Must Complete Your Profile" sRegisterMsg = "
To Sign Up For This Activity, You Must Complete Your Profile

" & _ "" Exit Function End If If IsNull(nActivityFemaleLimit) Or nActivityFemaleLimit = "" Then canRegister = True Else dim genders, temp temp = getGenders 'Response.Write temp 'genders = split(temp,",") canRegister = True If UCase(session("gender")) = "F" Then If CInt(nActivityRegFemale) >= CInt(nActivityFemaleLimit) Then canRegister = False sRegisterMsg = "The maximum number of females for this activity has been reached" Exit Function End If End If End IF End Function '====================================================================================== ' ' getGuests ' '====================================================================================== Sub getGuests() Dim sName dbopen cmd.CommandText = "spGetActivityMemberGuests" cmd.CommandType = 4 cmd.Parameters("@RegID").value = nReg recordset.CursorLocation = adUseClient recordset.CursorType = adOpenStatic recordset.LockType = adLockReadOnly recordset.Open cmd If Not recordset.EOF Then %> Guests <% Do While Not recordset.EOF sName = "" If IsNull(recordset("RegGuestLastName")) And IsNull(recordset("RegGuestFirstName")) Then sName = " " Else If Len(recordset("RegGuestFirstName")) > 0 Then sName = sName & recordset("RegGuestFirstName") End If If Len(recordset("RegGuestLastName")) > 0 Then sName = sName & " " & recordset("RegGuestLastName") End If End If %> <%=sName%> <% recordset.MoveNext Loop %> <% End If dbclose End Sub '====================================================================================== ' ' getGenders ' '====================================================================================== Function getGenders Dim recordset1, cn1, cmd1, param1 Dim male, female male = 0 female = 0 Set recordset1 = Server.CreateObject("ADODB.Recordset") Set cn1 = Server.CreateObject("ADODB.Connection") Set cmd1 = Server.CreateObject("ADODB.Command") set param1 = server.CreateObject("ADODB.COMMAND") cn1.Open(connstr) cmd1.ActiveConnection = cn1 cmd1.CommandText = "spActivityGender" cmd1.CommandType = 4 'Response.Write cmd.Parameters(1).value = "11/1/2003" cmd1.Parameters("@aid").value = Request.QueryString("aid") set recordset1 = cmd1.Execute nActivityRegFemale = 0 nActivityRegMale = 0 If Not recordset1.EOF Then nActivityRegFemale = recordset1("NumRegFemales") nActivityRegMale = recordset1("NumRegMales") End If Set cn1 = nothing Set cmd1 = nothing Set recordset1 = nothing set param1 = nothing 'getGenders = female & "," & male End Function '====================================================================================== ' ' DisplayActivityCosts ' '====================================================================================== Sub DisplayActivityCosts(cCostType) Dim sHeading Dim sSaveCode, sSaveDescription Dim bSameCode Dim nDateCounter, nRows Dim arrRegBegins(), arrRegEnds() Dim arrMemPrice(), arrGuestPrice() dbopen cmd.CommandText = "spGetActivityCostsByType" cmd.CommandType = 4 cmd.Parameters("@activityID").value = Request.QueryString("aid") If cCostType = "" Then cmd.Parameters("@ctype").value = "B" Else cmd.Parameters("@ctype").value = cCostType End If Set recordset = cmd.Execute If Not recordset.EOF Then If cCostType = "L" Then sHeading = "Lodging Options" ElseIf cCostType = "O" Then sHeading = "Additional Cost Option(s)" Else 'sHeading = "Costs" sHeading = "Activity Cost Option(s)" End If %>  <%=sHeading%> <% sSaveCode = "" bSameCode = False nDateCounter = 0 nRows = 0 Do While Not recordset.EOF If Not bSameCode Then nDateCounter = 0 sSaveCode = recordset("CostCode") sSaveDescription = recordset("CostDescription") Else nDateCounter = nDateCounter + 1 End If ReDim Preserve arrRegBegins(nDateCounter) ReDim Preserve arrRegEnds(nDateCounter) ReDim Preserve arrMemPrice(nDateCounter) ReDim Preserve arrGuestPrice(nDateCounter) If Not IsNull(recordset("CostRegBegins")) Then arrRegBegins(nDateCounter) = recordset("CostRegBegins") Else arrRegBegins(nDateCounter) = sActivityRegBeginsDate End If If Not IsNull(recordset("CostRegEnds")) Then arrRegEnds(nDateCounter) = recordset("CostRegEnds") Else arrRegEnds(nDateCounter) = sActivityRegEndsDate End If arrMemPrice(nDateCounter) = recordset("CostMember") arrGuestPrice(nDateCounter) = recordset("CostNonMember") recordset.MoveNext If recordset.EOF Then bSameCode = False Else If recordset("CostCode") <> sSaveCode Then bSameCode = False Else bSameCode = True End If End If If Not bSameCode Then nRows = nRows + 1 Call ShowCostLine( _ sSaveCode, sSaveDescription, _ arrRegBegins, arrRegEnds, _ arrMemPrice, arrGuestPrice, iif(nRows > 1, False, True) ) Response.Write("" & vbCRLF) End If Loop %>
Description Pricing & Registration
<% End If dbclose End Sub '====================================================================================== ' ' ShowCostLine ' '====================================================================================== Sub ShowCostLine(sCode, sDescription, arrBeginDate, arrEndDate, arrMemPrice, arrGuestPrice, bShowHeading) Dim i 'For i = LBound(arrBeginDate) To UBound(arrBeginDate) ' Response.Write(i & ": BeginDt=" & arrBeginDate(i) & ", " & "EndDt=" & arrEndDate(i) & ", " & "MemPr=" & arrMemPrice(i) & ", " & "GuestPr=" & arrGuestPrice(i) & "
") 'Next ' Start ROW Response.Write(" " & vbCRLF) ' Code/Description Column Response.Write(" " & vbCRLF) If bShowHeading Then Response.Write("

") End If If sCode <> "" Then Response.Write("" & sCode & "") End If If sCode <> "" And sDescription <> "" Then Response.Write("
") End If If sDescription <> "" Then Response.Write(sDescription) End If Response.Write("" & vbCRLF) ' One or more date ranges should be specified (assume begin and end arrays are same size) If IsArray(arrBeginDate) And IsArray(arrMemPrice) Then Response.Write(" " & vbCRLF) ' Start container table Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) For i = LBound(arrBeginDate) To UBound(arrBeginDate) ' Start Date/Price column Response.Write(" " & vbCRLF) Next ' End container table Response.Write(" " & vbCRLF) Response.Write("
" & vbCRLF) ' Start inner table Response.Write(" " & vbCRLF) If bShowHeading Then Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) ' Start Price Response.Write(" " & vbCRLF) 'Response.Write(" ") End If Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) ' End inner table Response.Write("
") If arrBeginDate(i) & "" <> "" Then Response.Write( Month(arrBeginDate(i)) & "/" & Day(arrBeginDate(i)) & "/" & Right(Year(arrBeginDate(i)), 2) ) End If Response.Write(" to ") If Not IsNull(arrEndDate(i)) Then Response.Write( Month(arrEndDate(i)) & "/" & Day(arrEndDate(i)) & "/" & Right(Year(arrEndDate(i)), 2) ) End If ' End Date Response.Write("
Member / Non-Member
") If Not IsNull(arrMemPrice(i)) Then Response.Write( FormatCurrency(arrMemPrice(i), 2) ) End If Response.Write(" / ") If Not IsNull(arrGuestPrice(i)) Then Response.Write( FormatCurrency(arrGuestPrice(i), 2) ) End If ' End Date/Price column Response.Write(" 
" & vbCRLF) ' End Date/Price column Response.Write("
" & vbCRLF) Response.Write(" " & vbCRLF) Else Response.Write(" " & vbCRLF) Response.Write(" " & vbCRLF) End If ' End ROW Response.Write(" " & vbCRLF) End Sub '====================================================================================== ' ' activityCosts ' ' CLS 1/26/05 - All activity costs are optional, therefore this function has been ' replaced by DisplayActivityCosts(). ' '====================================================================================== Sub activityCosts(r) dbopen cmd.CommandText = "spGetActivityCosts" cmd.CommandType = 4 cmd.Parameters("@activityID").value = Request.QueryString("aid") cmd.Parameters("@required").value = r cmd.Parameters("@gender").value = Trim(Session("gender")) set recordset = cmd.Execute If Not recordset.EOF Then If r = 0 Then %> Extra Costs (Optional) <% Else %> Extra Costs (Required) <% End If %> <% Do While Not recordset.EOF %> <% recordset.MoveNext Loop %>
Description Member Non-Member
<% If recordset("CostCode") <> "" Then %> <%=recordset("CostCode")%> <% End If %> <% If recordset("CostCode") <> "" And recordset("CostDescription") <> "" Then %>
<% End If %> <% If recordset("CostDescription") <> "" Then %> <%=recordset("CostDescription")%> <% End If %>   
<%=FormatCurrency(recordset("CostMember"),2)%> <%=FormatCurrency(recordset("CostNonMember"),2)%>
<% End If dbclose End Sub '====================================================================================== ' ' displaySelectedOptions ' '====================================================================================== Sub displaySelectedOptions() dbopen cmd.CommandText = "spGetMemberRegistrationOptions" cmd.CommandType = 4 cmd.Parameters("@ActivityID").value = nActivity cmd.Parameters("@UserID").value = session("id") recordset.CursorLocation = adUseClient recordset.CursorType = adOpenStatic recordset.LockType = adLockReadOnly recordset.Open cmd If Not recordset.EOF Then %> Costs/Options <% Do While Not recordset.EOF %> <% If recordset("RegCostUserID") <> 0 Then Response.Write("" & vbCRLF) Else 'Guest of member Response.Write("" & vbCRLF) End If %> <% recordset.MoveNext Loop %>
Yourself:" & "" & recordset("FirstName") & " " & recordset("LastName") & ": <%=recordset("CostDescription")%> <%=FormatCurrency(recordset("RegCostAmount"), 2)%>
<% End If dbclose End Sub '====================================================================================== ' ' showGender ' '====================================================================================== Function showGender() Response.Write "Female Limit: " & nActivityFemaleLimit & ", " Response.Write "females: " & nActivityRegFemale & ", " Response.Write "males: " & nActivityRegMale & "
" End Function %>