<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<%qx=4%>
<!--#include file="top.asp"-->
<!--#include file="../leaguer/check.asp"-->
<!--#include file="../../include/conn.asp"-->
<!--#include file="../../include/jmail.asp"-->
<!--#include file="../../include/config.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../include/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center"> 

    
</div>
<br>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
  <tr valign="middle" bgcolor="#f1f1f1">
    <td height="25" colspan="9" align="center" background="../images/admin_bg_4.gif" bgcolor="#FFFFFF"><span style="color: #FFFFFF; font-weight: bold">店铺列表</span></td>
  </tr>
  <tr valign="middle" bgcolor="#f1f1f1"> 
    <td width="53" height="21" align="center" bgcolor="#FFFFFF">ID号</td>
    <td width="102" align="center" bgcolor="#FFFFFF">推荐该店铺</td>
    <td width="440" height="21" align="center" bgcolor="#FFFFFF">店铺名称/人气</td>
    <td width="84" align="center" bgcolor="#FFFFFF">收费状态</td>
    <td width="84" height="21" align="center" bgcolor="#FFFFFF">负责人</td>
    <td width="130" height="21" align="center" bgcolor="#FFFFFF">注册日期</td>
    <td width="69" height="21" align="center" bgcolor="#FFFFFF">状态</td>
    <td width="42" height="21" align="center" bgcolor="#FFFFFF">编辑</td>
    <td width="46" height="21" align="center" bgcolor="#FFFFFF">删除</td>
  </tr>
<%
xs=shopnet("xs")
txt=shopnet("txt")
if request("x")="del" then
set rs = conn.execute("select * from shop where id="&shopnet("id")&"")
If rs.eof Then
response.write("<script>alert(""该商铺不存在！"");window.history.go(-1);")
response.End 
End if

shopname=rs("name")
username=rs("name2")
rs.close
Set rs=nothing
conn.execute("Delete * from shop where id="&shopnet("id")&"")
conn.execute("Delete * from chanpin where userid="&shopnet("id")&"")

Response.redirect "index1.asp"
end if
Set rs=Server.CreateObject("ADODB.Recordset")
if txt<>"" then
sql="select id,name,name2,sj,zt,tui,js2,jishu,sl,tuijian_shop,fee,huiyuan from shop where  name like '%"&txt&"%' or name2 like '%"&txt&"%' or dz like '%"&txt&"%' or huiyuan like '%"&txt&"%' order by id desc"
elseif xs<>"" then
sql="select id,name,name2,sj,zt,tui,js2,jishu,sl,tuijian_shop,fee,huiyuan from shop where "&xs&" order by id desc"
else
sql="select id,name,name2,sj,zt,tui,js2,jishu,sl,tuijian_shop,fee,huiyuan from shop order by id desc"
end if
rs.open sql,conn,3,1 
  if rs.eof then
response.Write("<tr><td colspan=9 bgcolor=#ffffff align=center height=25>当前没有商铺！</td></tr>")
else
rs.pagesize = 12
if request("page")=""  or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then

Rs.Move Rs.PageSize*(page-1)
end if
i=1
do while not rs.eof and i<=rs.pagesize
%>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <td width="53" height="25" align="center" bgcolor="#FFFFFF"><%=rs("id")%></td>
    <td width="102" bgcolor="#FFFFFF">
	  <div align="center">
	    <%if rs("tuijian_shop")="0" Then %>
	        <a href="../tuijian_shop.asp?tuijian=yes&id=<%=rs("id")%>">推荐</a>
        <%else%>
	        <a href="../tuijian_shop.asp?tuijian=yes&id=<%=rs("id")%>">取消推荐</a>
        <%end if%>
    </div></td>
    <td width="440" height="25" bgcolor="#FFFFFF"><div align="center"><a href="shopedit.asp?xs=<%=request("xs")%>&txt=<%=request("txt")%>&page=<%=page%>&id=<%=rs("id")%>"><%=replace(rs("name"),"<","〈")%></a>&nbsp;/<%=rs("jishu")%></div></td>
    <td width="84" align="center" bgcolor="#FFFFFF"><%if rs("fee")=0 then response.write"免费" else response.write"收费" end if%></td>
    <td width="84" height="25" align="center" bgcolor="#FFFFFF"><%=replace(rs("name2"),"<","〈")%></td>
    <td width="130" height="25" align="center" bgcolor="#FFFFFF"><%=rs("sj")%></td>
    <td width="69" height="25" align="center" bgcolor="#FFFFFF"> <%Select case rs("zt")
   case "0"
        Response.Write("<font color=#ff0000>未审核</font>")
   case "1"
	    Response.Write("<font color=#ff6600>试营业</font>")
   case "2"
	    Response.Write("营业中")
   case "3"
	    Response.Write("<font color=#ff0000><del>已过期</font>")
   case "4"
	    Response.Write("<del>已作废")
End Select
%></td>
    <td width="42" height="25" align="center" bgcolor="#FFFFFF"><a href="shopedit.asp?xs=<%=request("xs")%>&txt=<%=request("txt")%>&page=<%=page%>&id=<%=rs("id")%>">编缉</a></td>
    <td width="46" height="25" align="center" bgcolor="#FFFFFF"><a href="?x=del&xs=<%=request("xs")%>&txt=<%=request("txt")%>&page=<%=page%>&id=<%=rs("id")%>">删除</a></td>
  </tr>
  <%
i=i+1
 rs.MoveNext                                              
 loop 
%>
  <tr valign="middle" bgcolor="#FFFFFF"> 
    <form name=form method=post action=?xs=<%=request("xs")%>&txt=<%=request("txt")%>>
      <td height="21" colspan="9" align="center" bgcolor="#FFFFFF"> <%
if rs.recordcount<>0 then
if page-1 mod 10=0 then
		p=(page-1) \ 10
	else
		p=(page-1) \ 10
	end if

	response.write "页次："& page &"/"& rs.pagecount &"页 每页"& rs.pagesize &" 共"& rs.recordcount &"条记录"&_
					" 分页："
        if rs.pagecount>1 and page<>1 then response.write "<a href=?xs="&request("xs")&"&txt="&request("txt")&"&page=1 title='首页'>[|<]</a> "
	if p*10>0 then response.write "<a href='?xs="&request("xs")&"&txt="&request("txt")&"&page="&p*10&"' title=上十页>[&lt;&lt;]</a>   "
    uming_i=1
	for ii=p*10+1 to P*10+10
		   if ii=page then
	          response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
		   else
		      response.write "<a href='?xs="&request("xs")&"&txt="&request("txt")&"&page="&ii&"'>["+Cstr(ii)+"]</a>   "
		   end if
		if ii=rs.pagecount then exit for
		 uming_i=uming_i+1
	next
	if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?xs="&request("xs")&"&txt="&request("txt")&"&page="&ii&"' title=下十页>[&gt;&gt;]</a>   "
        if rs.pagecount>1 and page<>rs.pagecount then response.write "<a href=?xs="&request("xs")&"&txt="&request("txt")&"&page="& rs.pagecount &" title='尾页'>[>|]</a>"
response.write(" 　跳页：<input type=text name=page size=2 maxlength=3 class=wenbenkuang> <input type=submit name=Submit value=Go class=go-wenbenkuang>")
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%></td>
    </form>
  </tr>
  <%end if%>
</table>
<table width="650" align="center">
  <tr valign="middle"> 
    <td width="497" height="40" align="center" nowrap><a href="index1.asp">全部</a>—<a href="?xs=zt=0">未审核</a>—<a href="?xs=zt=1">试营业</a>—<a href="?xs=zt=2">营业中</a>—<a href="?xs=zt=3">已过期</a>—<a href="?xs=zt=4">已作废</a>-<a href="../tuijian_shop.asp">推荐店铺</a></td>
        <form name="form1" method="post" action=?sou=yes>
          <td width="141" height="40" align="center"> 
            <input name="txt" type="text" class="wenbenkuang" id="txt" size="10">
            <input name="Submit" type="submit" class="go-wenbenkuang" value="搜索">
          </td> </form>
  </tr>
</table>
<br>
*收费类型如果是非免费的店铺.请自行联系掌柜收取费用!
</body>

</html>
