%
if session("admin")="" then
conn.close
set conn = nothing
response.Write ""
response.End
end if
%>
管理商品
<%
dim key,bigclass,smallclass
key=trim(request.form(trim("key")))
bigclass=trim(request("pid"))
smallclass=request.form("sortsid")
selectid=request("selectid")
categoryid=request("categoryid")
sortsid=request("sortsid")
if selectid<>"" then
'------删除文件
set rsd=server.CreateObject("adodb.recordset")
rsd.open "select * from product2 where id in ("&selectid&")",conn,1,3
while not rsd.eof
did="/"&rsd("categoryid")&"/"&rsd(0)&".html"
Dim varFSO
Set varFSO = CreateObject("Scripting.FileSystemObject")
if did<> ""then
If varFSO.FileExists(server.MapPath(did)) then
varFSO.DeleteFile(server.MapPath(did))
end if
end if
rsd.movenext
wend
Set varFSO=nothing
rsd.close
'---------------------------
conn.execute "delete from product2 where id in ("&selectid&")"
response.Redirect "product.asp?pid="&FormatSQL(SafeRequest("pid",0))&"&title="&FormatSQL(SafeRequest("title",0))
response.End
end if
call flagstr("产品管理","../error.htm")
set rs=conn.execute("select max(topid) as a from product2")
if not rs.eof then
topid=rs(0)
end if
rs.close
set rs=nothing
if request("action")="top" then
conn.execute("update product2 set topid=topid+1 where id="&request("id"))
end if
if request("action")="down" then
conn.execute("update product2 set topid=topid-1 where id="&request("id"))
end if
%>