<% if not Session("DiaryAdmin") then Response.Redirect("login.asp?go=diary_EditE.asp?" & Request.QueryString()) End If Response.ExpiresAbsolute = dateadd("d", -5, date()) Response.Expires = -10 set objCon= Server.CreateObject("ADODB.Connection") set objRs = Server.CreateObject("ADODB.Recordset") objCon.Open strCon function ChkStr(strT) if strT = "" then strT = " " strT = Replace(strT, "'", "''") strT = Replace(strT, "|", "/") ChkStr = strT End Function %> Diary Manager <% select case Request.QueryString("mode") case "Edit" SQL = "SELECT * FROM diary_categorys where cat_id =" & Request.QueryString("id") objRs.Open SQL, objCon %>
Edit Diary Category
Close
"> <% case "Add" %>
Category Name ">
Text Colour " style="BACKGROUND-COLOR:<%=objRs("colour")%>;">
Back Colour " style="BACKGROUND-COLOR:<%=objRs("bgcolour")%>;">
Delete Category
 Example Text 
<% case "DoADD" ErrMsg = "" if Request.Form("cat_name") = "" then ErrMsg = "You Must Enter a Name for the Category
" if Request.Form("TCol") = "" then ErrMsg=ErrMsg & "You Must Select a text Colour
" if Request.Form("bCol") = "" then ErrMsg=ErrMsg & "You Must Select a text Colour
" if len(ErrMsg) > 0 then Response.Write "" Else SQL = "INSERT INTO diary_categorys (category, colour, bgcolour) VALUES ('" & _ ChkStr(Request.Form("cat_name")) & "', '" & _ Request.Form("Tcol") & "', '" & _ Request.Form("Bcol") & "')" objCon.Execute SQL Response.Write "
Added Category
" End If case "DoEdit" if Request.Form("Del") = "on" then SQL = "DELETE * from diary_categorys WHERE Cat_id = " & Request.Form("ID") objCon.Execute SQL Response.Write "
Deleted Category
" Else ErrMsg = "" if Request.Form("cat_name") = "" then ErrMsg = "You Must Enter a Name for the Category
" if Request.Form("TCol") = "" then ErrMsg=ErrMsg & "You Must Select a text Colour
" if Request.Form("bCol") = "" then ErrMsg=ErrMsg & "You Must Select a text Colour
" if len(ErrMsg) > 0 then Response.Write "" Else SQL = "UPDATE diary_categorys SET category = '" & ChkStr(Request.Form("cat_name")) & _ "', colour = '" & Request.Form("TCol") & "', BgColour = '" & Request.Form("Bcol") & "' " & _ " WHERE Cat_id = " & Request.Form("ID") objCon.Execute SQL Response.Write "
Updated Category
" End If End If Case Else Response.Write "*********************" End Select %>
Category Name
Text Colour
Back Colour
 Example Text 
There were problems with your edits:
" Response.Write "
" & ErrMsg & "
" Response.Write "" Response.Write "
Back
There were problems with your edits:
" Response.Write "
" & ErrMsg & "
" Response.Write "" Response.Write "
Back