<% '----------------------确定是否有此权限---------------------- dim cls if session("admin")="" then Response.Redirect("index.asp?err=4") else if session("flag")<>"0" then cls = Instr(session("flag"), "partner") if cls <= 0 then %> <% end if end if end if '-----------------------结束----------------------------- %> 管理中心——>
当前位置: 网站管理中心---代理商管理---返回上一页
<% if request("gb")<>"" then gb=request("gb") end if action = request("action") if request("search") = "ok" then if request("online") <> "" then session("online") = request("online") else session("online") = "" end if else end if if action="" then %>
<% if session("gb1")<>"" then %> ';" value="简体中文版"> ';" value="英文版"> <% end if %>
<%'默认显示产品列表 dim rs,msg_per_page dim sql msg_per_page = 20 '定义每页显示记录条数 set rs = server.createobject("adodb.recordset") sql = "select * from techer where gb='"&gb&"' and Id is not null " sql= sql+" order by adddate desc" '按照添加日期显示 rs.cursorlocation = 3 '使用客户端游标,可以使效率提高 rs.pagesize = msg_per_page '定义分页记录集每页显示记录数 rs.open sql,conn,1,1 if err.number<>0 then '错误处理 response.write "


数据库操作失败:" & err.description err.clear else if not (rs.eof and rs.bof) then '检测记录集是否为空 totalrec = RS.RecordCount 'totalrec:总记录条数 if rs.recordcount mod msg_per_page = 0 then '计算总页数,recordcount:数据的总记录数 n = rs.recordcount\msg_per_page 'n:总页数 else n = rs.recordcount\msg_per_page+1 end if currentpage = request("page") 'currentpage:当前页 If currentpage <> "" then currentpage = cint(currentpage) if currentpage < 1 then currentpage = 1 end if if err.number <> 0 then err.clear currentpage = 1 end if else currentpage = 1 End if if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then currentPage=1 end if rs.absolutepage = currentpage 'absolutepage:设置指针指向某页开头 rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数 dim i dim k do while not rs.eof and rowcount>0 %> <%rowcount=rowcount-1 rs.movenext loop else response.write "" end if end if rs.close conn.close set rs=nothing set coon=nothing %>
编号 客户LOGO 公司名称 添加时间 操作
<%=rs("id")%> <% if rs("photo")<>"" then %> " width=60 > <%else%> 暂无图片 <%end if%>
<%=rs("name")%>
<%=rs("adddate")%> &gb=<%=gb%>>修改 | ')>删除

无满足条件商品

全选   

<% call listPages() else end if '删除产品 if action="del" then delid=replace(request("id"),"'","") call proddel() end if '删除产品 if action="tuijian" then id=replace(request("id"),"'","") call tuijian() end if if action="删除" then delid=replace(request("id")," ","") call proddel() end if if action="readd" then call prodadd() end if if action="newadd" then call prodnew() end if %>
<% sub listPages() if n <= 1 then exit sub if currentpage = 1 then %> 首页 <%else%>   ?page=1&gb=<%=gb%>"> 首页   ?page=<%=currentpage-1%>&gb=<%=gb%>">上一页 <%end if%> <%if currentpage = n then%>   下一页 <%else%>   ?page=<%=currentpage+1%>&gb=<%=gb%>">下一页   ?page=<%=n%>&gb=<%=gb%>">末页 <%end if%> 总:<%=currentpage%>/<%=n%>页  共计:<%=totalrec%>条信息 [<%=msg_per_page%>条/页] <%end sub%> <%sub proddel() if delid="" or isnull(delid) then Response.write "


操作失败,没有选择合适参数!点击返回

" else conn.execute("delete from techer where id in ("&delid&")") if err.number<>0 then '错误处理 response.write "数据库操作失败:" & err.description err.clear else conn.close set conn=nothing Response.write "


删除成功!点击返回

" end if end if end sub %> <% sub prodadd() reid=request("reid") dim tuijian if request("edit") ="ok" then Set rs=Server.CreateObject("ADODB.Recordset") sql="select * from techer where id="&reid&"" rs.open sql,conn,1,3 if err.number<>0 then '错误处理 response.write "数据库操作失败:" & err.description err.clear else rs("photo")=request("photo") rs("gb")=request("gbL") rs("name")=request("name") rs("adddate")=date() 'rs("place")=request("place") rs("note")=request("note") 'rs("age")=request("age") rs.update rs.close conn.close set rs=nothing set conn=nothing ' Response.Redirect"admin_partner.asp?action=detail&id="&request.form("ProdId") response.Write "" end if else reid=request("reid") Set rs=Server.CreateObject("ADODB.Recordset") sql="select * from techer where id="&reid&"" rs.open sql,conn,1,3 %>    数据表序列ID :<%=rs("id")%>
选择语言:
公司标志: ">
客户名称: " size="50">
    [返回上一页]
<%end if end sub%> <% sub prodnew() if request("add") ="ok" then if request("name")="" then response.write "" end if Set rs=Server.CreateObject("ADODB.Recordset") sql="select * from techer " rs.open sql,conn,1,3 if err.number<>0 then '错误处理 response.write "数据库操作失败:" & err.description err.clear else rs.addnew rs("photo")=request.form("photo") rs("gb")=request("gbL") rs("name")=request("name") 'rs("place")=request("place") rs("note")=request("note") 'rs("age")=request("age") rs.update rs.close conn.close set rs=nothing set conn=nothing ' Response.Redirect"admin_prod.asp?action=detail&id="&request.form("ProdId") response.Write "" end if else %>    newadd
选择语言:
公司标志: *如果没有可以不用填写
公司名称:   * 必填
备注
    [返回上一页]
<%end if end sub%> <% '处理数组函数 function checkreal(v) dim w if not isnull(v) then w=replace(v,",","|") w=replace(w," ","") checkreal=w end if end function function checkrea2(v) dim w if not isnull(v) then w=replace(v,":","") w=replace(w," ","") checkrea2=w end if end function function checkrea3(v) dim w if not isnull(v) then w=replace(v,"-","") w=replace(w," ","") checkrea3=w end if end function %>