<%@language=vbscript codepage=936 %>
<!--#include file="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<%
Dim Rs
Dim IsN
Dim id 
Dim content 
Dim MobanName
If Request.QueryString("action")="save" Then
content = Trim(Request.Form("Content1"))
content = Replace(content,"'","''")
'content = Replace(content,chr(34),"""")
IsN = Trim(Request.Form("ziduan"))
id = Trim(Cint(Request.Form("id")))
Sql = "Update [JaHtml] Set "&IsN&" = '"&content&"' where id ="&id&""
Set Rs = Conn.ExeCute(Sql)
JaSys("管理员" & session("ManagerUser") & "<font color=red>模版ID为"&id&"的代码"&IsN&"修改成功</font>")
Response.write "<script language='javascript'>" & chr(13)
		response.write "alert('模版代码"&IsN&"修改成功！');" & Chr(13)
		response.write "window.document.location.href='Moban_Show.Asp?id="&id&"&name="&IsN&"';"&Chr(13)
		response.write "</script>" & Chr(13)

End If
If Request.QueryString("action")="add" Then
MobanName = Trim(Request.Form("MobanName"))
Conn.ExeCute("Insert Into [JaHtml](Ja_Name)values('"&MobanName&"')")
JaSys("管理员" & session("ManagerUser") & "<font color=red>模版"&MobanName&"添加成功</font>")
Response.write "<script language='javascript'>" & chr(13)
		response.write "alert('模版添加成功,转向编辑文件页！');" & Chr(13)
		response.write "window.document.location.href='Moban_Manage.asp';"&Chr(13)
		response.write "</script>" & Chr(13)

End If
If Request.QueryString("action")="del" Then
id = Request.QueryString("id")
Conn.ExeCute("Delete * From [JaHtml] Where id="&id&"")
JaSys("管理员" & session("ManagerUser") & "<font color=red>模版id为"&id&"删除成功</font>")
Response.write "<script language='javascript'>" & chr(13)
		response.write "alert('模版删除成功,转回编辑文件页！');" & Chr(13)
		response.write "window.document.location.href='Moban_Manage.asp';"&Chr(13)
		response.write "</script>" & Chr(13)

End If
If Request.QueryString("action")="up" Then
id = Request.Form("id")
MobanName = Trim(Request.Form("MobanName"))
Conn.ExeCute("Update [JaHtml] Set Ja_Name='"&MobanName&"' where id = "&id&"")
JaSys("管理员" & session("ManagerUser") & "<font color=red>修改模版id为"&id&"模版名称为"&MobanName&"</font>")
Response.write "<script language='javascript'>" & chr(13)
		response.write "alert('模版名称修改成功,转回编辑文件页！');" & Chr(13)
		response.write "window.document.location.href='Moban_Manage.asp';"&Chr(13)
		response.write "</script>" & Chr(13)

End If
If Request.QueryString("action")="Moban" Then
Moban = Cint(Request.Form("Moban"))
Conn.ExeCute("Update [Index] Set Moban="&Moban&" where id =1")
JaSys("管理员" & session("ManagerUser") & "<font color=red>修改当前使用模版ID为"&Moban&"</font>")
Response.write "<script language='javascript'>" & chr(13)
		response.write "alert('使用模版修改成功,转回编辑文件页！');" & Chr(13)
		response.write "window.document.location.href='Moban_Manage.asp';"&Chr(13)
		response.write "</script>" & Chr(13)

End If
%>
