<!--#include file = "tuzh_pri.asp"-->
<!--#include file ="../connadmin.asp"-->
<%action=request("action")
yiid=request("yiid")
select case action
    case "addnews"  call addnews()
	case "delenews" call delenews()
	case "modi" call modi()
end select

'***********************************************************
sub addnews()
kind=cint(request.form("kind"))
yiid=kind
title=request.form("txttitle")
For i = 1 To Request.Form("content").Count
  Content = Content & Request.Form("content")(i)
Next

set rs1=server.createobject("ADODB.recordset")
sql="select * from com"
rs1.open sql,conn,3,3
			rs1.addnew
			rs1("yiid") = kind
			rs1("title") = title
			rs1("content") = content
			rs1.update
rs1.close
response.Write("<font color=red>信息添加成功！</font>")
end sub
'***********************************************************
sub delenews()
delstyle=request("style")
deleid=cint(request("id"))
if delstyle="many" then
for i=1 to request.form("ArticleID").count
conn.execute("delete from com where id="&cint(request.form("ArticleID")(i)))
next

else
sql="delete from [com] where id="&deleid&""
conn.execute sql 
end if
response.Write("<font color=red>信息删除成功！</font>")
end sub
'***********************************************************
sub modi()
hidid=cint(request.form("hiddenid"))
kind=cint(request.form("kind"))
title=request.form("txttitle")
For i = 1 To Request.Form("content").Count
  Content = Content & Request.Form("content")(i)
Next
set rs=server.createobject("ADODB.recordset")
sql="select * from com where id="&hidid
rs.open sql,conn,1,3
			rs("yiid") = kind
			rs("title") = title
			rs("content") = content
rs.update
rs.close
response.Write("<font color=red>信息修改成功！</font>")
end sub
'***********************************************************
response.Redirect("com_manage.asp?yiid="&yiid)
conn.close
set conn=nothing%>
