<!--#include file = admin_chk.asp -->
<!--#include file="admin_conn.asp"-->
<%dim action,id
id=request.QueryString("id")
action=request.querystring("action")
select case action
'//添加新数据
case "add" 
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from menu",conn,1,3
rs.AddNew
rs("menuname")=request("menuname2")
rs("url")=request("url2")
rs("menuorder")=request("menuorder2")
if request("xx2")=1 then  '推荐
rs("xx")=1
else
rs("xx")=0
end if
'rs("fudongjia")=int(request("fudongjia2"))
'rs("pic")=trim(request("pic"))
'rs("sztys")=trim(request("sztys2"))
'rs("links")=trim(request("links2"))
'rs("spdlh")=trim(request("spdlh2"))
'rs("spdll")=trim(request("spdll2"))
rs.Update
rs.Close
set rs=nothing
response.Redirect "menu.asp"
'//修改数据
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from menu where id="&id,conn,1,3
rs("menuname")=request("menuname")
rs("url")=request("url")
rs("menuorder")=request("menuorder")
if request("xx")=1 then  '推荐
rs("xx")=1
else
rs("xx")=0
end if
'rs("fudongjia")=int(request("fudongjia"))
'rs("spdlh")=int(request("spdlh"))
'rs("spdll")=int(request("spdll"))
'rs("pic")=trim(request("pic"))
'rs("links")=trim(request("links"))
'rs("sztys")=trim(request("sztys"))
rs.Update
rs.Close
set rs=nothing
response.Redirect "menu.asp"
'//删除数据
case "del"
conn.execute ("delete from menu where id="&id)
'conn.execute ("delete from shop_nclass where anclassid="&anclassid)
'conn.execute ("delete from news where anclassid="&anclassid)
response.Redirect "menu.asp"
end select
%> 
