<% Dim Events, MyEvents Set Events = Server.CreateObject("ADODB.Recordset") Set MyEvents = Server.CreateObject("ADODB.Recordset") Set rsRecurs = Server.CreateObject("ADODB.Recordset") Public Sub ShowTime(strField) If Not IsNull(Events(strField)) Then Response.Write LCase(Replace(FormatDateTime(Events(strField), vbLongTime),":00 ","")) End if End Sub If Request.QueryString("AddNew") = "" Then If Request.QueryString("ID") <> "" Then Events.Open "SELECT * FROM Events WHERE ID=" & Request.QueryString("ID"), Database intThisMonth = DatePart("m",Events("Date")) intThisYear = DatePart("yyyy",Events("Date")) GetMonthlyUserUnits() Events.Close End If %>

UNITS: Assigned: <%= intAssigned %> | Used: <%= intUsed %> | Available: <%= intAvailable %>

<% End If %> <% If Request.QueryString("AddNew") <> "" Then If Request.Form("Transportation") Then isTransportation = True Else isTransportation = False End If Events.Open "SELECT * FROM Events WHERE ID=" & Request.QueryString("AddNew"), Database, 3, 3 If Events.EOF Then %>

This is not a valid event. Please go back to view the events.

<% Else MyEvents.Open "SELECT * FROM MyEvents WHERE UserID=" & Session("ID") & " AND EventID=" & Request.QueryString("AddNew"), Database, 3, 3 If Not MyEvents.EOF Then %>

You have already added this event.

Go to My Events to view your events, or Calendar to add events.

<% MyEvents.Close Else intThisMonth = DatePart("m",Events("Date")) intThisYear = DatePart("yyyy",Events("Date")) GetMonthlyUserUnits() If Request.Form("Recurring") <> "" Then rsRecurs.Open "SELECT * FROM Events WHERE MasterEventID = " & Events("MasterEventID") & " AND Date >= #" & Events("Date") & "#", Database Do Until rsRecurs.EOF intThisMonth = DatePart("m",rsRecurs("Date")) intThisYear = DatePart("yyyy",rsRecurs("Date")) GetMonthlyUserUnits() If Events("Units") < intAvailable Then sqlInsert = "INSERT INTO MyEvents (EventID, UserID, Transportation) VALUES (" & rsRecurs("ID") & "," & Session("ID") & "," & isTransportation & ")" ' Response.Write sqlInsert Database.Execute sqlInsert %>

You are now signed up for <%= rsRecurs("Date") %>.

<% Else %>

You do not have enough units to sign up for <%= rsRecurs("Date") %>.

<% End If rsRecurs.MoveNext Loop Else Database.Execute "INSERT INTO MyEvents (EventID, UserID) VALUES (" & Events("ID") & "," & Session("ID") & ")" %>

Great! You've added this activity to your schedule.

We'll see you there!

Click here to view your activities.

<% End If ' MyEvents.Open "SELECT * FROM MyEvents", Database, 3, 3 ' MyEvents.AddNew ' MyEvents("EventID") = Request.QueryString("AddNew") ' MyEvents.Update ' MyEvents("UserID") = Session("ID") ' MyEvents.Update MyEvents.Close End If End If Events.Close Else If Request.QueryString("ID") = "" Then %>

This is not a valid activity. Please go back to view the activities.

<% Else Events.Open "SELECT * FROM Events WHERE ID=" & Request.QueryString("ID"), Database, 3, 3 If Events.EOF Then %>

This is not a valid activity. Please go back to view the activities.

<% Else %>

Activity Details

<% If Events("Image") <> "" Then %> " width="450" style="float:right; clear:both; margin-left:18px;" /> <% End If %>

Activity: <%=Events("Name")%>
Location: <%=Events("Location")%>
Address: "><%= Events("Address") & ", " & Events("City") & ", " & Events("State") & " " & Events("ZIP") %>
Date: <%=Events("Date")%>
Time: <% ShowTime("StartTime") %> - <% ShowTime("EndTime") %>
Units needed to sign up: <%= Events("Units") %>

<%=Replace(Events("Description"), vbcrlf, "
")%>

Do you need directions?
Type your address, city and state, then click "go" ...
" />
<% If date > getDeadline(Events("Date")) Then %>

We're sorry. The deadline for signing up for this activity has passed.

<% Else If Session("User") Then intThisMonth = Month(Events("Date")) intThisYear = Year(Events("Date")) getMonthlyUserUnits() Set myEvent = Server.CreateObject("ADODB.RecordSet") myEvent.Open "SELECT * FROM UserEvents WHERE Username = '" & Session("Username") & "' AND Events.ID = " & Events("ID"), Database Set rsEvent = Server.CreateObject("ADODB.RecordSet") rsEvent.Open "SELECT * FROM MyEvents WHERE EventID = " & Events("ID"), Database, 3, 3 If rsEvent.RecordCount < Events("MaxSignups") OR Events("MaxSignups") = "" OR IsNull(Events("MaxSignups")) Then ifFull=True rsEvent.Close End If If Not myEvent.EOF Then %>

 

You have already signed up for this activity. Click here to view your activities.

<% ElseIf isFull Then %>

We're sorry, this event is full.

<% ElseIf intAvailable >= Events("Units") Then %>
" method="POST"> <% If Events("Recurring") Then %>

NOTE: This activity occurs every week until <%= Events("EndDate") %>

" /> I want to do this every week
<% End If %> checked<% End If %> /> I will need transportation
checked<% End If %> /> I am in a wheelchair
checked<% End If %> /> I am visually impaired

« return to main calendar

<% Else %>

You do not have enough units to sign up for this activity. You have <%= intAvailable %> and you need <%= Events("Units")%>.

<% End If Else %>

YES! I'd like to sign up for this activity!

If you have an account: LOG IN

If you don't, then: SIGN UP

<% End If End If End If End If End If %>