<% 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 %> &title=<%=FormatSQL(SafeRequest("title",0))%>" method="post" name="myform" id="myform">
<%=request("title")%>信息查询
<% dim count set rs=server.createobject("adodb.recordset") rs.open "select * from sorts order by sortsorder ",conn,1,1%> <% set rsc=server.CreateObject("adodb.recordset") rsc.open "select * from category2 where categoryid="&SafeRequest("pid",1)&" order by categoryorder ",conn,1,1 if rsc.eof and rsc.bof then response.write "请先添加产品类别" response.end else %>

  信息查看与修改

<% Const MaxPerPage=20 dim totalPut dim CurrentPage dim TotalPages dim j dim sql if Not isempty(SafeRequest("page",1)) then currentPage=Cint(SafeRequest("page",1)) else currentPage=1 end if set rs=server.CreateObject("adodb.recordset") sql= "select * from product2 where categoryid="&bigclass&" order by topid desc,id desc" if smallclass<>""then sql= "select * from product2 where sortsid="&smallclass&" order by topid desc, id desc" end if 'response.write sql rs.open sql,conn,1,1 if err.number<>0 then response.write "数据库中暂时无数据" end if if rs.eof And rs.bof then Response.Write "

数据库中暂时无数据!

" else totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showContent showpage totalput,MaxPerPage,"product.asp" else if (currentPage-1)*MaxPerPage

 

<% do while not rs.eof %> <%i=i+1 if i>=MaxPerPage then Exit Do rs.movenext loop rs.close set rs=nothing%>
ID 排序 信息标题 所属类别 推荐首页 添加时间 选 择
<% =rs(0)%> <% =rs("topid")%>  &pid=<%=FormatSQL(SafeRequest("pid",0))%>&title=<%=FormatSQL(SafeRequest("title",0))%>> <% =rs("name")%> /<%=rs(0)%>.html" target="_blank">[浏览]" style="color:red;">[顶↑]" style="color:red;">[降↓] <%=ProductSmallClassName(rs("sortsid"))%> <%if rs("flag")=1 then response.Write("取消推荐") else response.write("推荐首页") end if%> <%=FormatDatetime(rs("addtime"),2)%> ">
全选     


<% End Sub Function showpage(totalnumber,maxperpage,filename) Dim n If totalnumber Mod maxperpage=0 Then n= totalnumber \ maxperpage Else n= totalnumber \ maxperpage+1 End If Response.Write "" Response.Write "

" If CurrentPage<2 Then Response.Write "首 页 上一页 " Else Response.Write "首 页 " Response.Write "上一页 " End If If n-currentpage<1 Then Response.Write "下一页 末 页" Else Response.Write "" Response.Write "下一页 末 页" End If Response.Write " 页次:"&CurrentPage&"/"&n&"页 " Response.Write " 共有"&totalnumber&"条信息 " Response.Write "转到第:页" Response.Write " " End Function %>

 


powered by <%=CompanyUrl%>, you can contact us.