<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx3<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<%dim action,url,i,abc,anclassid,anclass,nclassid,nclass
anclassid=request("anclassid")
anclass=request.QueryString("anclass")
nclassid=request("nclassid")
nclass=request.QueryString("nclass")
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_xclass",conn,1,3
rs.AddNew
rs("xclass")=trim(request("xclass"))
rs("xpx")=int(request("xpx"))
rs("anclassid")=int(request("anclassid"))
rs("xpic")=trim(request("xpic"))
rs("nclassid")=trim(request("nclassid"))
rs("xurl")=trim(request("xurl"))
rs("xh")=trim(request("xh"))
rs("xl")=trim(request("xl"))
rs("xxs")=trim(request("xxs"))
rs.Update
rs.Close
set rs=nothing
response.redirect url&"xclass_manage.asp?id="&nclassid&"&nclass="&nclass&"&aid="&anclassid
'//修改数据
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_xclass where id="&request.QueryString("id"),conn,1,3
rs("xclass")=trim(request("xclass"))
rs("xpx")=int(request("xpx"))
rs("anclassid")=int(request("anclassid"))
rs("xpic")=trim(request("xpic"))
rs("nclassid")=trim(request("nclassid"))
rs("xurl")=trim(request("xurl"))
rs("xh")=trim(request("xh"))
rs("xl")=trim(request("xl"))
rs("xxs")=trim(request("xxs"))
rs.update
rs.close
set rs=nothing
'response.Write anclassid
'response.End
'response.Write "url&"nclass.asp?id="&anclassid&"&anclass="&anclass"
'response.End
response.redirect url&"xclass_manage.asp?id="&nclassid&"&nclass="&nclass&"&aid="&anclassid
'//删除数据
case "del"
anclassid=request.QueryString("anclassid")
nclassid=request.QueryString("nclassid")
conn.execute ("delete from shop_xclass where id="&request.QueryString("id"))
conn.execute ("delete from wygkcn_shop where xclassid="&request.QueryString("id"))
response.redirect url&"xclass_manage.asp?id="&nclassid&"&nclass="&nclass&"&aid="&anclassid
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
%>