% ' ################################# 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 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 %>