%
If objFile.FolderExists(Server.Mappath("innova")) then
%>
<%
End If
ne = objConn.Execute("SELECT noexp FROM " & tablPfx & "Config;")(0)
If Not session("admin_loggedin" & strSUnique) = Session.SessionID And Not Request.Cookies("admin_loggedin" & strSUnique) = ne then Response.Redirect "admin_logon.asp"
If Request.Cookies("admin_loggedin" & strSUnique) = ne then session("admin_loggedin" & strSUnique) = Session.SessionID: Session("RTE_Admin") = True
Session("CSS_FOR_RTE") = web_site & dstyle
Dim title, subject, body, ID, isWY, showWY, tid
Dim noRTE
If Request.Querystring.Count = 1 then
showTempl = Request.Querystring.Item(1)
End If
Select Case Request.Form("Flag")
Case 1
Select Case Request.Form("SF")
Case "Save Template"
ID = CLng(Request.Form("ID"))
title = sq(Request.Form("title"))
name = Request.Form("name")
subject = sq(Request.Form("S1"))
body = sq(Request.Form("T1"))
If subject = Empty Or body = Empty then
Response.Write "
Cannot Save! Subject or Body is Empty."
Else
strSQL = "UPDATE " & tablPfx & "Template SET "
strSQL = strSQL & "title = '" & title & "', "
strSQL = strSQL & "subject = '" & subject & "', "
strSQL = strSQL & "body = '" & body & "' WHERE ID=" & ID & ";"
objConn.Execute(strSQL)
Response.Redirect "admin_template.asp?id=" & Server.URLEncode(name)
End If
Case "Delete"
ID = CLng(Request.Form("ID"))
strTempl = "SELECT " & tablPfx & "Template.* from " & tablPfx & "Template WHERE ID=" & ID & ";"
rs.LockType = 3
rs.Open strTempl, strConn
If not rs.EOF then
rs.Delete
End If
rs.Close
Response.Redirect "admin_template.asp"
End Select
Case 2
ttype = CLng(Request.Form("NT5"))
iname = sq(Request.Form("NT1"))
title = sq(Request.Form("NT2"))
subject = sq(Request.Form("NT3"))
body = sq(Request.Form("NT4"))
strTempl = "SELECT " & tablPfx & "Template.tname FROM " & tablPfx & "Template WHERE tname='" & iname & "';"
Set rs = objConn.Execute(strTempl)
If rs.EOF then
rs.close
objConn.Execute("INSERT INTO " & tablPfx & "Template(tname, title, subject, body, type) VALUES('" & iname & "','" & title & "','" & subject & "','" & body & "'," & ttype & ");")
Response.Redirect "admin_template.asp?id=" & Server.URLEncode(iname)
Else
rs.close
retmsg = "Template with this name already exists in database."
retname = iname
rettitle = title
rettype = ttype
retsubject = subject
retbody = body
showTempl = ""
retstyle = "style=""color: red;"""
End If
End Select
strTempl = "SELECT " & tablPfx & "Template.* from " & tablPfx & "Template ORDER BY type, tname;"
rs.CursorType = 3
rs.Open strTempl, strConn
Do while not rs.EOF
template = rs("tname")
tid = CLng(rs("type"))
Select Case tid
Case 1: style = "style=""color: red;"""
Case 2: style = "style=""color: blue;"""
Case 0: style = "style=""color: black;"""
End Select
Select Case showTempl
Case ""
showTempl = template
getTheRest
strTemplate = ""
Case else
If showTempl = template then
getTheRest
strTemplate = strTemplate & ""
Else: strTemplate = strTemplate & ""
End If
End Select
rs.MoveNext
Loop
rs.close
Sub getTheRest()
title = rs("title")
subject = rs("subject")
body = rs("body")
ID = rs("ID")
isWY = CLng(rs("type"))
If Not isWY = 0 and Application("WYSIWYG" & strUnique) = "1" then
showWY = True
Else: showWY = False
End If
End Sub
Dim isMozilla
If Wysiwyg_type = 1 AND NOT isCompatible then showWY = False: Wysiwyg_type = 0
If showWY then
Select Case Wysiwyg_type
Case 0
%>
<%
Case 1
If isMozilla then
Response.Write ""
mozpath = "moz/"
Else: Response.Write ""
End If
End Select
End If
%>
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||