<% ' ################################# Function CAL_EVENT_EDIT() dim sH : sH = "" dim SqlEvent dim StartDate dim EndDate dim SqlEventrec dim IDCat dim ViewTab dim EFIDRecur dim EFAction dim EFRecurentView dim dtText dim TimeFrom dim TimeTo dim Grouppublic dim Test dim strHEADER, Places, i, Selected, UnUsuallyVisibility, UnUsually_repeat, intIDCat, CatList strSQL = "SELECT * From wcal_events where IDEvent=" & request("IDEvent") set SqlEvent = Server.CreateObject("ADODB.Recordset") SqlEvent.CursorLocation = 3 SqlEvent.Open strSql, my_conn SqlEvent.CacheSize = 100 strSQL = "SELECT min(EventDate) as MinED From wcal_eventrec where IDEvent=" & request("IDEvent") StartDate = funcs.QryDate(my_conn.Execute (strSQL)("MinED")) strSQL = "SELECT max(EventDate) as MaxED From wcal_eventrec where IDEvent=" & request("IDEvent") EndDate = funcs.QryDate(my_conn.Execute (strSQL)("MaxED")) strSQL = "SELECT * From wcal_eventrec where EventDate=" & funcs.VDate(Request("Q_DATE")) & " and IDEvent=" & request("IDEvent") set SqlEventrec = Server.CreateObject("ADODB.Recordset") SqlEventrec.CursorLocation = 3 SqlEventrec.Open strSql, my_conn SqlEventrec.CacheSize = 100 IDCat = my_conn.Execute ("SELECT IDCat from wcal_eventcat where IDEvent = " & request("IDEvent"))("IDCat") ViewTab = True sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf dim strDISABLED if request("CHANGE")="EVENT_EDIT1" then strDISABLED = " DISABLED " strHEADER = strHEADER & application(session("LANG") & "_wcal31") & ": " & SqlEvent("EventName") & " ("& formatdatetime(request("Q_DATE"),vbLongDate) &")" & VbCrLf sH = sH & "
" & VbCrLf else strHEADER = strHEADER & application(session("LANG") & "_wcal31") & ": " & SqlEvent("EventName") & VbCrLf sH = sH & "" & VbCrLf end if sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf sH = sH & "
" & VbCrLf sH = sH & "
" & VbCrLf ' BASIC ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Basic texts

" & VbCrLf sH = sH & "" & VbCrLf ' NAME ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf ' DESCRIPTION ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf ' CATEGORY if NOT request("CHANGE")="EVENT_EDIT1" then ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf end if ' PLACE ' ********************************************************* if intUSERPERMISSION="1" then sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf end if StrSql = "SELECT distinct Location FROM wcal_Location where Client=" & session("CLIENT") & " AND Lang=" & session("LANG") & " ORDER BY Location ASC" set Places = my_conn.execute(strSQL) if NOT (Places.BOF or Places.EOF) then sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf end if set Places = nothing sH = sH & "
" & application(session("LANG") & "_wcal21") sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
" & application(session("LANG") & "_wcal25") sH = sH & " " & VbCrLf If IsMSIE then sH = sH & "" & VbCrLf sH = sH & "
" & VbCrLf sH = sH & SqlEvent("Description") sH = sH & VbCrLf sH = sH & "
" & VbCrLf else sH = sH & " " & VbCrLf end if sH = sH & "
" & VbCrLf sH = sH & " " &application(session("LANG") & "_wcal8") & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf sH = sH & "
" & application(session("LANG") & "_wcal28a") & "
" & application(session("LANG") & "_wcal28") & "" & VbCrLf sH = sH & " " sH = sH & "
" & VbCrLf sH = sH & "
" & VbCrLf ' TAB DATE&TIME ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Dates&Time

" & VbCrLf sH = sH & "" & VbCrLf ' Start date ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf ' END DATE ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " "& VbCrLf sH = sH & "" & VbCrLf ' IGNORE PAST ' ********************************************************* if NOT request("CHANGE")="EVENT_EDIT1" then sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf end if ' START TIME ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf ' Repeating ' ********************************************************* if NOT request("CHANGE")="EVENT_EDIT1" then dim RecurentVal : RecurentVal=0 dim RecurentValArray : RecurentValArray="" dim DAILY_repeat : DAILY_repeat=1 dim WEEKLY_repeat : WEEKLY_repeat=1 dim WEEKLY_DAY : WEEKLY_DAY="" dim MONTHLY_repeat1 : MONTHLY_repeat1=1 dim MONTHLY_DAY1 : MONTHLY_DAY1=1 dim MONTHLY_repeat2 : MONTHLY_repeat2=1 dim MONTHLY_DAY2 : MONTHLY_DAY2="" dim MONTHLY_DAYrepeat2 : MONTHLY_DAYrepeat2 =1 dim MONTHLY_SELtype : MONTHLY_SELtype= "EVERY" dim NoVisibilite : NoVisibilite="" dim DailyVisibility : DailyVisibility="" dim WeeklyVisibility : WeeklyVisibility="" dim MonthlyVisibility : MonthlyVisibility="" dim YearlyVisibility : YearlyVisibility="" dim Yearly_MonthRepeat1 : Yearly_MonthRepeat1=1 dim Yearly_MonthRepeat2 : Yearly_MonthRepeat1=1 dim Yearly_DayRepeat1 : Yearly_DayRepeat1=1 dim Yearly_DayRepeat2 : Yearly_DayRepeat2=1 dim Yearly_DAY2 : Yearly_DAY2="" dim SelType RecurentVal = SqlEvent("RecurentVal") RecurentValArray = split(RecurentVal,";") dim RepType if RecurentVal<>"" AND InStr(1, RecurentVal, ";")<>0 then SelType = RecurentValArray(0) else SelType = 0 end if select case SelType case 1 DAILY_repeat = RecurentValArray(1) DailyVisibility=" tdefault " case 2 WEEKLY_repeat = RecurentValArray(1) WEEKLY_DAY = RecurentValArray(2) WeeklyVisibility=" tdefault " case 3 MONTHLY_SELtype = RecurentValArray(1) MonthlyVisibility=" tdefault " select case MONTHLY_SELtype case "EVERY" MONTHLY_repeat1 = RecurentValArray(2) MONTHLY_DAY1 = RecurentValArray(3) case else MONTHLY_repeat2 = RecurentValArray(2) MONTHLY_DAY2 = RecurentValArray(3) MONTHLY_DAYrepeat2 = RecurentValArray(4) end select case 4 ' YearlyVisibility=" tdefault " YEARLY_SELtype = RecurentValArray(1) select case YEARLY_SELtype case "EVERY" YEARLY_DAYrepeat1 = RecurentValArray(2) YEARLY_MONTHrepeat1 = RecurentValArray(3) case else YEARLY_DAYrepeat2 = RecurentValArray(2) YEARLY_MONTHrepeat2 = RecurentValArray(3) YEARLY_DAY2 = RecurentValArray(4) end select case 5 'UnUsually UnUsuallyVisibility=" tdefault " UnUsually_repeat = RecurentValArray(1) case ELSE ' NoVisibilite=" tdefault " end select sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf sH = sH & " " sH = sH & "
" & application(session("LANG") & "_wcal22") & "" & VbCrLf if request("CHANGE")="EVENT_EDIT1" then sH = sH & " "& VbCrLf else sH = sH & " "& VbCrLf sH = sH & "
"& VbCrLf end if sH = sH & "
" & application(session("LANG") & "_wcal23") & "" & VbCrLf if request("CHANGE")="EVENT_EDIT1" then sH = sH & " "& VbCrLf else sH = sH & " "& VbCrLf sH = sH & "
"& VbCrLf end if sH = sH & "
" & VbCrLf sH = sH & " " & application(session("LANG") & "_wcal30_a2") & VbCrLf sH = sH & "
" & VbCrLf sH = sH & " " & application(session("LANG") & "_wcal26") & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & CAL_TimeINPUT(intTimeFormat, intTimeStep, "StartTime", formatdatetime(SqlEventrec("StartTime"),VBLongTime)) & VbCrLf ' END TIME ' ********************************************************* sH = sH & " " & CAL_TimeINPUT(intTimeFormat, intTimeStep, "EndTime", formatdatetime(SqlEventrec("EndTime"),VBLongTime)) & VbCrLf sH = sH & "
" sH = sH & "

Select repaeting options

" & VbCrLf sH = sH & "
" & VbCrLf ' Rep. NONE ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Not repated

" & VbCrLf sH = sH & "
This event will not be repeated.
" & VbCrLf sH = sH & "
" & VbCrLf ' Rep. Daily ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Daily

" & VbCrLf sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf sH = sH & "
Repeats every day
" & VbCrLf sH = sH & "
" & VbCrLf ' Rep. Weekly ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Weekly

" & VbCrLf sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf sH = sH & "
Repeats every   week on " & VbCrLf sH = sH & " " & VbCrLf for i = 1 to 7 selected="" if InStr(1,WEEKLY_DAY,cstr(i))>0 then selected=" checked " sH = sH & " " & weekdayname(i, true, FirstDayOfWeek) & vbcrlf next sH = sH & "
" & VbCrLf sH = sH & "
" & VbCrLf ' Rep. Monthly ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Monthly

" & VbCrLf sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf selected="" if MONTHLY_SELtype="EVERY" then selected=" checked " sH = sH & " " & VbCrLf selected="" if MONTHLY_SELtype="EACH" then selected=" checked " sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf sH = sH & "
Repeats every " & VbCrLf sH = sH & " day in each" & VbCrLf sH = sH & " month
Each" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " for i = 1 to 7 selected="" if InStr(1, MONTHLY_DAY2, cstr(i))>0 then selected=" checked " sH = sH & " " & weekdayname(i, true, FirstDayOfWeek) & vbcrlf next sH = sH & " in every month
" & VbCrLf sH = sH & "
" & VbCrLf ' Rep. Yearly ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Yearly

" & VbCrLf sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf sH = sH & "
Day " & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
Each " & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf for i = 1 to 7 selected="" if InStr(1, YEARLY_DAY2, cstr(i))>0 then selected=" checked " sH = sH & " " & weekdayname(i, true, FirstDayOfWeek) & vbcrlf next sH = sH & " " & VbCrLf sH = sH & " of " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
" & VbCrLf sH = sH & "
" & VbCrLf ' Unusually ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Unusually

" & VbCrLf sH = sH & "
" sH = sH & " Enter specific dates in MM/DD/YYYY format separated by ENTER" & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
" & VbCrLf sH = sH & "
" & VbCrLf end if sH = sH & "
" & VbCrLf sH = sH & "
" & VbCrLf ' Misc. ' ********************************************************* sH = sH & "
" & VbCrLf sH = sH & "

Misc.

" & VbCrLf sH = sH & "" & VbCrLf ' URL Desc sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf ' URL ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf ' Email Desc ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf ' Email ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf ' Ignore conflicts ' ********************************************************* sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "" & VbCrLf ' User public ' ********************************************************* if NOT request("CHANGE")="EVENT_EDIT1" then sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf end if sH = sH & "
" & VbCrLf sH = sH & " " & application(session("LANG") & "_wcal29") & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
" & VbCrLf sH = sH & " " & application(session("LANG") & "_wcal30") & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
" & VbCrLf sH = sH & " " & application(session("LANG") & "_wcal101") & VbCrLf sH = sH & "" & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
" & VbCrLf sH = sH & " " & application(session("LANG") & "_wcal100") & VbCrLf sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
" & VbCrLf dim strCHECKED if blCheckForColisions then strCHECKED= " CHECKED " sH = sH & " " & application(session("LANG") & "_wcal30_a") & "" & VbCrLf if blALLOWEXCLUDES then sH = sH & " " & application(session("LANG") & "_wcal30_a1") : sH = sH & " " & VbCrLf sH = sH & " " & VbCrLf dtText ="" set CatList = nothing sH = sH & dtText else sH = sH & "" end if sH = sH & "
0 then sH = sH & " checked " sH = sH & "> " & application(session("LANG") & "_wcal30_b") sH = sH & "
" & VbCrLf sH = sH & "
" & VbCrLf ' Cust Fields ' ********************************************************* if UseCustFields then sH = sH & "
" & VbCrLf sH = sH & "

Cust

" & VbCrLf sH = sH & "" & VbCrLf if strCust1<>"" then sH = sH & "" & VbCrLf else sH = sH & "" & VbCrLf end if if strCust2<>"" then sH = sH & "" & VbCrLf else sH = sH & "" & VbCrLf end if if strCust3<>"" then sH = sH & "" & VbCrLf else sH = sH & "" & VbCrLf end if if strCust4<>"" then sH = sH & "" & VbCrLf else sH = sH & "" & VbCrLf end if if strCust5<>"" then sH = sH & "" & VbCrLf else sH = sH & "" & VbCrLf end if sH = sH & "
" & strCust1 & "
" & strCust2 & "
" & strCust3 & "
" & strCust4 & "
" & strCust5 & "
" & VbCrLf sH = sH & "
" & VbCrLf end if sH = sH & "" & VbCrLf if NOT request("CHANGE")="EVENT_EDIT1" then sH = sH & "" & VbCrLf sH = sH & "" & VbCrLf end if sH = sH & "
" & VbCrLf sH = sH & " " & VbCrLf sH = sH & "
" & VbCrLf sH = sH & "" & VbCrLf sH = sH & "
" & VbCrLf SqlEvent.close set SqlEvent = Nothing SqlEventrec.Close set SqlEventrec = Nothing CAL_EVENT_EDIT = funcs.BOXCreator(strHEADER, sH, strDEFTHEME, "", "99%") End Function ' ################################# public function CAL_EVENT_EDITEXE() dim AletrTEXT ' We will check Time format and validity if TimeCheck(AletrTEXT) then CAL_EVENT_EDITEXE = funcs.ShowMessage(application(session("LANG") & "_wcal70") & VbCrLf & AletrTEXT) exit function end if session("COUNT_EVENT")=0 if CAL_ColissionCheck(AletrTEXT) then CAL_EVENT_EDITEXE= funcs.ShowMessage(application(session("LANG") & "_wcal58") & VbCrLf & AletrTEXT) exit function end if if session("COUNT_EVENT")>intMaxEventsPosted then dim strMESSAGE strMESSAGE = application(session("LANG") & "_wcal58a") & VbCrLf & replace(application(session("LANG") & "_wcal58b"), "XXX", intMaxEventsPosted) strMESSAGE = replace(strMESSAGE, "YYY", session("COUNT_EVENT")) session("COUNT_EVENT")="" CAL_EVENT_EDITEXE = funcs.ShowMessage(strMESSAGE) exit function end if if request("CHANGE")="EVENT_EDITEXE1" then strSQL="UPDATE wcal_eventrec set StartTime='" & request("StartTime") & "', EndTime='" & request("EndTime") & "', Description='" & funcs.SQLEncode(request("BodyText")) & "' where EventDate=" & funcs.VDate(request("Q_DATE")) & " AND IDEvent=" & request("IDEvent") my_conn.execute(strSQL) CAL_EVENT_EDITEXE=funcs.ShowMessage(application(session("LANG") & "_wcal45a")) 'Event has been modified else ' We will check Date format and validity if DatesCheck(AletrTEXT) then CAL_EVENT_EDITEXE = funcs.ShowMessage(application(session("LANG") & "_wcal69") & VbCrLf & AletrTEXT) exit function end if if request("Save")<>0 then call CAL_EVENT_ADDEXE() else my_conn.execute("DELETE from wcal_eventrec where IDEvent="&request("IDEvent")) my_conn.execute("DELETE from wcal_eventcat where IDEvent="&request("IDEvent")) dim strPLACE ' we will add new location into DB if request.form("NEWPLACE")<>"" then strPLACE = request.form("NEWPLACE") strSQL= "INSERT INTO wcal_location (Location, CLient, Lang) values ("&_ "'" & funcs.sqlencode(request.form("NEWPLACE")) & "', " &_ "" & session("Client") & ", " &_ "" & session("Lang") & ") " my_conn.execute(strSQL) else strPLACE = request.form("PLACE") end if ' Create SQL string to add new event strSql = "update wcal_events set " &_ "EventName='" & funcs.SQLEncode(request("EventName")) & "', " &_ "Description='" & funcs.SQLEncode(request("BodyText")) & "', " &_ "Cust1='" & funcs.SQLEncode(request("Cust1")) & "', " &_ "Cust2='" & funcs.SQLEncode(request("Cust2")) & "', " &_ "Cust3='" & funcs.SQLEncode(request("Cust3")) & "', " &_ "Cust4='" & funcs.SQLEncode(request("Cust4")) & "', " &_ "Cust5='" & funcs.SQLEncode(request("Cust5")) & "', " &_ "Place='" & funcs.SQLEncode(strPLACE) & "', " &_ "UrlName='" & funcs.SQLEncode(request("URLName")) & "', " &_ "URLLink='" & request("URL") & "', " &_ "ContactEmail='" & request("Email") & "', " &_ "ContactEmailDesc='" & request("ContactEmailDesc") & "', " &_ "Recurentval='" & CAL_RecVal() & "', " &_ "ExcludeConflict=" & clng(request("ExcludeConflict")) & " " &_ "where IDEvent=" & request("IDEvent") my_conn.execute(strsql) ' Repeat event call CAL_RepeatEvent(request("IDEvent")) ' Update descriptions in repeating strSQL="UPDATE wcal_eventrec set Description='" & funcs.SQLEncode(request("BodyText")) & "'where IDEvent=" & request("IDEvent") my_conn.execute(strSQL) ' Inser into category for each value in request("wcal_category") CatType = my_conn.execute("SELECT CatType from wcal_category where IDCat=" & value)("CatType") my_conn.execute("INSERT INTO wcal_eventcat (IDEvent, IDCat, CatType) values (" & request("IDEvent") & ", " & value & "," & CatType & ")") next CAL_EVENT_EDITEXE=funcs.ShowMessage(application(session("LANG") & "_wcal45a")) 'Event has been modified end if ' END: SAVE AS NEW end if ' END: UPDATE THIS OCCASSION end function %>