<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connnews.asp" -->
<%
action=request("action")
myid=request("myid")
httpurl=request("url")
if action="add" then 
   set rs=server.createobject("adodb.recordset")
	rs.open "select * from mynews",conn,3,2
	rs.addnew
	rs("stype")=request("mytype")
	rs("n_title")=request("n_title")
    rs("n_con")=request("n_con")
	rs("typeid")=myid
	rs("n_time")=request("n_time")
	rs("n_pic")=request("n_pic")
	rs("stype")=false
	rs("inpx")=request("inpx")
	rs("n_ck")=1
	rs.update
	response.redirect httpurl
end if

if action="edit" then 
id=request("id")
   set rs=server.createobject("adodb.recordset")
	rs.open "select * from mynews where id="&id,conn,3,2
	rs("n_title")=request("n_title")
    rs("n_con")=request("n_con")
	rs("n_time")=request("n_time")
	rs("n_pic")=request("n_pic")
	rs("inpx")=request("inpx")
	rs.update
	response.redirect httpurl
end if	
if action="del" then
    id=request("id")
	sql="delete from mynews where id= "&id&""
    set rs=conn.execute(sql)
	response.redirect httpurl
end if

if action="px" then 
id=request("id")
   set rs=server.createobject("adodb.recordset")
	rs.open "select * from mynews where id= "&id&"",conn,3,2
	rs("inpx")=px
	rs.update
	response.redirect httpurl
end if
%>