<!--#include file="ljconn.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>1 then
response.Write "<p align=center><font color=red>您没有此项目管理权限！</font></p>"
response.End
end if
end if
%>
<%dim action,anclassid
anclassid=request.QueryString("id")
action=request.querystring("action")
select case action
'//添加新数据
case "add" 
if request("anclass2")="" then
response.Write("<script laguage='javascript'>alert('名称不能为空');history.go(-1);</script>")
response.end()
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_anclass",conn,3,3
rs.AddNew
rs("anclass")=trim(request("anclass2"))
rs("anclassidorder")=int(request("anclassidorder2"))
'rs("fudongjia")=int(request("fudongjia2"))
rs.Update
rs.Close
set rs=nothing
response.Redirect "anclass.asp"
'//修改数据
case "edit"
if request("anclass")="" then
response.Write("<script laguage='javascript'>alert('名称不能为空');location.href='anclass.asp';</script>")
response.end()
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_anclass where anclassid="&anclassid,conn,3,3
rs("anclass")=trim(request("anclass"))
rs("anclassidorder")=int(request("anclassidorder"))
'rs("fudongjia")=int(request("fudongjia"))
rs.Update
rs.Close
set rs=nothing
response.Redirect "anclass.asp"
'//删除数据
case "del"
conn.execute ("delete from shop_anclass where anclassid="&anclassid)
conn.execute ("delete from shop_nclass where anclassid="&anclassid)
'conn.execute ("delete from product where anclassid="&anclassid)
response.Redirect "anclass.asp"
end select
%>
