<!--#include file="conn.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 "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
end if
%>
<%dim action,url,i,abc,anclassid,anclass
anclassid=request("anclassid")
anclass=request.QueryString("anclass")
url="http://" & Request.ServerVariables("http_host") & finddir(Request.ServerVariables("url"))
action=request.QueryString("action")
'//添加新数据
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_nclass",conn,1,3
rs.AddNew
rs("nclass")=trim(request("nclass2"))
rs("nclassidorder")=int(request("nclassidorder2"))
rs("anclassid")=int(request("anclassid"))
rs("piccc")=trim(request("pic"))
rs("xsztys")=trim(request("xsztys2"))
rs("links")=trim(request("links2"))
rs("spxlh")=trim(request("spxlh2"))
rs("spxll")=trim(request("spxll2"))
rs.Update
rs.Close
set rs=nothing
response.redirect url&"nclass.asp?id="&anclassid&"&anclass="&anclass
'//修改数据
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_nclass where nclassid="&request.QueryString("id"),conn,1,3
rs("nclass")=trim(request("nclass"))
rs("nclassidorder")=int(request("nclassidorder"))
rs("piccc")=trim(request("pic"))
rs("links")=trim(request("links"))
rs("xsztys")=trim(request("xsztys"))
rs("spxlh")=int(request("spxlh"))
rs("spxll")=int(request("spxll"))
'rs("changyong")=int(request("changyong"))
rs.update
rs.close
set rs=nothing
response.redirect url&"nclass.asp?id="&anclassid&"&anclass="&anclass
'//删除数据
case "del"
anclassid=request.QueryString("anclassid")
conn.execute ("delete from shop_nclass where nclassid="&request.QueryString("id"))
conn.execute ("delete from shop_snsn where nclassid="&request.QueryString("id"))
response.redirect url&"nclass.asp?id="&anclassid&"&anclass="&anclass
end select
%>
<%
Function finddir(filepath)
	finddir=""
	for i=1 to len(filepath)
	if left(right(filepath,i),1)="/" or left(right(filepath,i),1)="\" then
	  abc=i
	  exit for
	end if
	next
	if abc <> 1 then
	finddir=left(filepath,len(filepath)-abc+1)
	end if
end Function
%>