<!--#include file="../common/conn.asp"-->
<%
'检查用户权限
call checkuser(GetQueryString("WindowName"))
%>

<%
  Content=replace(trim(GetVariable("Content")),"'","''")
  Title=replace(trim(GetFormVariable("Title")),"'","''")
  newid=GetFormVariable("newid")

if newid="" then
	'添加信息
	strsql="Insert Into web_news(nTitle, nClass, nAuthor, nOriginal, nHtmlText, nTime, mn_id) values("
	strsql=strsql &	 "'" & GetFormVariable("title") & "', "
	strsql=strsql &	 "" & GetFormVariable("selClass") & ", "
	strsql=strsql &	 "'" & replace(trim(GetFormVariable("Author")),"'","''") & "', "
	strsql=strsql &	 "'" & replace(trim(GetFormVariable("Original")),"'","''") & "', "
	strsql=strsql &	 "'" & content & "', "
	strsql=strsql &	 "'" & date & "',"
	strsql=strsql &	 "" & GetQueryString("mnid") & ")"
else
	'修改信息
	strsql="update web_news set "
	strsql=strsql &	 "nTitle='" & GetFormVariable("title") & "', "
	strsql=strsql &	 "nAuthor='" & replace(trim(GetFormVariable("Author")),"'","''") & "', "
	strsql=strsql &	 "nOriginal='" & replace(trim(GetFormVariable("Original")),"'","''") & "', "
	strsql=strsql &	 "nHtmlText='" & content & "', "
	strsql=strsql &	 "nClass=" & GetFormVariable("selClass") & " "
	strsql=strsql &	" where ID=" & newid
end if

conn.execute strsql,0,1

  conn.close
  set conn=nothing 
%>
<body onLoad="window.parent.opener.parent.main.location=window.parent.opener.parent.main.location;alert('保存完毕!')"></body>