"
strHEADER = "Additional text for categories"
select case UCASE(request("CHANGE"))
case "AREAADDNEW" sH = sH & CAL_AreaAdd
case "AREAADDNEWEXE" sH = sH & CAL_AreaAddExe
sH = sH & CAL_AreaLIST()
case "AREAEDIT" sH = sH & CAL_AreaEdit
case "AREAEDITEXE" sH = sH & CAL_AreaEditExe
sH = sH & CAL_AreaLIST()
case "AREADELETE" sH = sH & CAL_AreaDeleteExe
sH = sH & CAL_AreaLIST()
case else sH = sH & CAL_AreaLIST()
end select
CAL_AREA= funcs.BOXCreator(strHEADER, sH, strDEFTHEME, "", "100%")
end function
' #################################
public function CAL_AreaLIST
dim sH : sH = ""
dim strHEADER
if request("CHANGE") = "CatSelect" then intIDCAT = request("wcal_category")
if intIDCAT="" then
strSQL = "SELECT *, wcal_areas.IDCat from wcal_areas left join wcal_category ON wcal_areas.IDCat=wcal_category.IDCat order by wcal_category.Name ASC"
else
strSQL = "SELECT *, wcal_areas.IDCat from wcal_areas where IDCat=" & intIDCAT
end if
set AREAS = Server.CreateObject("ADODB.Recordset")
AREAS.CursorLocation = 3
AREAS.Open strSql, my_conn
AREAS.CacheSize = 100
if NOT (AREAS.BOF or AREAS.EOF) then
strHEADER = "AREAS LIST"
sH = sH & "
"
sH = sH & "
"
sH = sH & "
Category
"
sH = sH & "
Area 1
"
sH = sH & "
Area 2
"
sH = sH & "
"
do until AREAS.EOF
if AREAS("wcal_areas.IDCat")=0 then
strNAME = "Default"
else
strNAME = my_conn.Execute ("SELECT Name from wcal_category where IDCat= " & AREAS("wcal_areas.IDCat"))("Name")
end if
sH = sH & "
"
sH = sH & "
" & strNAME & "
"
sH = sH & "
" & AREAS("Area1") & "
"
sH = sH & "
" & AREAS("Area2") & "
"
sH = sH & "
"
sH = sH & "Edit | "
sH = sH & "Delete"
sH = sH & "
"
AREAS.MoveNext
Loop
sH = sH & "
"
else
sH = sH & "No areas defined!"
end if
AREAS.Close
SET AREAS = nothing
CAL_AreaLIST= funcs.BOXCreator(strHEADER, sH, strDEFTHEME, "", "80%")
end function
' #################################
public function CAL_AreaAdd
dim sH : sH = ""
sH = sH & "
"
sH = sH & ""
sH = sH & "
"
CAL_AreaAdd= funcs.BOXCreator("Add new area", sH, strDEFTHEME, "", "80%")
end function
' #################################
public function CAL_AreaAddExe
dim sH : sH = ""
IDCat = request("wcal_category")
If IDCat="ALL" or IDCat="" then IDCat=0
if Not IsNumeric(IDCat) then IDCat=my_conn.execute("SELECT IDCat from wcal_category where name='" & request("wcal_category") & "'")("IDCat")
strSQL = "delete from wcal_areas where "
strSQL = strSQL & "IDCat=" & IDCat
my_conn.execute(strSQL)
strSQL = "INSERT INTO wcal_areas (Area1, Area2, IDCat) values ("
strSQL = strSQL & "'" & funcs.SQLEncode(request("Area1")) & "', "
strSQL = strSQL & "'" & funcs.SQLEncode(request("Area2")) & "', "
strSQL = strSQL & "" & IDCat & ") "
my_conn.execute(strSQL)
CAL_AreaAddExe= sH
end function
' #################################
public function CAL_AreaEdit
dim sH : sH = ""
dim strHEADER, AREAS
strHEADER = "Edit area"
strSQL = "SELECT * from wcal_areas where IDArea=" & request("IDArea")
set AREAS = Server.CreateObject("ADODB.Recordset")
AREAS.CursorLocation = 3
AREAS.Open strSql, my_conn
AREAS.CacheSize = 100
sH = sH & "
"
sH = sH & ""
sH = sH & "
"
AREAS.Close
set AREAS = Nothing
CAL_AreaEdit= funcs.BOXCreator(strHEADER, sH, strDEFTHEME, "", "80%")
end function
' #################################
public function CAL_AreaEditExe
dim sH : sH = ""
call CAL_AreaAddExe
rem IDCat = request("wcal_category")
rem If IDCat="" then IDCat=0
rem strSQL = "UPDATE wcal_areas SET "
rem strSQL = strSQL & "Area1='" & funcs.SQLEncode(request("Area1")) & "', "
rem strSQL = strSQL & "Area2='" & funcs.SQLEncode(request("Area2")) & "', "
rem strSQL = strSQL & "IDCat=" & IDCat & " where "
rem strSQL = strSQL & "IDArea=" & request("IDArea")
rem my_conn.execute(strSQL)
CAL_AreaEditExe= sH
end function
' #################################
public function CAL_AreaDeleteExe
dim sH : sH = ""
strSQL = "delete from wcal_areas where "
strSQL = strSQL & "IDArea=" & request("IDArea")
my_conn.execute(strSQL)
CAL_AreaDeleteExe= sH
end function
' #################################
public Function CAL_CategoryMenuAREA(dtSelected)
' Drop down category select for filtering
' #################################
dim sH : sH = ""
dim dtSelectedH
dim CatList
dim Selected
dtSelectedH = dtSelected
if request("CHANGE")="CatSelect" then dtSelectedH=request.form("wcal_category")
sH ="" & VbCrLf
CatList.Close
set CatList = nothing
CAL_CategoryMenuAREA = sH
End Function
%>