<% Dim types Dim calendarID,eventID,eventByMem calendarID = request.querystring("calendarID") types = request.querystring("types") eventID = request.querystring("eventID") Dim objCalendar,canSubscribeCalendar,isSubscribed, responseMsg,canDeleteEvent,isCalendarModerator,canDiscussEvent Dim eventSignupAble Set objCalendar = new calClass With objCalendar .calendarID = calendarID .eventID = eventID .mem = memID .getPermission() canSubscribeCalendar = .canSubscribeCalendar isSubscribed = .isSubscribed eventByMem = .eventByMem canDeleteEvent = .canDeleteEvent canDiscussEvent = .canDiscussEvent isCalendarModerator = .isCalendarModerator calendarID = .calendarID eventSignupAble = .eventSignupAble end with Set objCalendar = nothing 'response.write canSubscribeCalendar SELECT Case types Case "remsubscribe", "subscribe" Dim strSQL:strSQL = "" if canSubscribeCalendar then if types = "subscribe" and not isSubscribed then strSQL = "INSERT INTO pgd_calendarSubscription (calendarID, mem) VALUES ("&Clng(calendarID)&","&memID&")" elseif types = "remsubscribe" and isSubscribed then strSQL = "Delete pgd_calendarSubscription WHERE mem = "&memID&" and calendarID = "&Clng(calendarID) end if Dim objCon if len(strSQL)<>0 then SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQL, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing end if responseMsg = calSubsSuccessful else responseMsg = RightViolationMessage end if call Outputresponse(responseMsg) CASE "deleteevent" 'response.write "here" if (isCalendarModerator or (canDeleteEvent and eventByMem&"" = memID)) then SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute "delete pgd_events where eventID="&eventID, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing end if response.redirect("calendar.asp?calendarID="&calendarID&"&calDate="&request.querystring("calDate")) CASE "signup","designup" if types = "signup" then strSQL = "if not exists(SELECT * FROM pgd_eventSignups WHERE eventID= "&eventID&" and mem="&memID&") insert into pgd_eventSignups (eventID,mem) values("&eventID&","&memID&")" else strSQL = "DELETE pgd_eventSignups WHERE eventID= "&eventID&" and mem="&memID end if if eventSignupAble then SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQL, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing responseMsg = calSignUpSuccessful else responseMsg = RightViolationMessage end if call Outputresponse(responseMsg) CASE "viewsignup" if (isCalendarModerator or (eventByMem&"" = memID)) then strSQL = "SELECT E.mem, P.login FROM pgd_eventsignups E INNER JOIN pgd_members P on P.mem = E.mem WHERE E.eventID = "&eventID Dim objRS, arrAddresses, iAddress set objRS = server.createobject("adodb.recordset") with objRS .CacheSize = 150 .open strSQL, datastore, , , adCmdText If not (.EOF or .BOF) then arrAddresses = .getrows End if .close end with set objRS=nothing %> <%= Application(dbName&"forumtitle") %> <%= OutputCSS() %> >
<% if isArray(arrAddresses) then %> <% for iAddress = 0 to ubound(arrAddresses,2) %> <% next %> > <% else %> <% end if %>
<%= calSignupList %>
width="2%"> " name="addtolist" class="radiocheck"> class="c2"> <%= HTMLEncode(""&arrAddresses(1,iAddress)) %>
class="c2"> <%= calSigupListEmpty %>


<% end if CASE ELSE END SELECT %>