<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<%qx=3%>
<!--#includelude file="check.asp"-->
<!--#includelude file="../include/conn.asp"-->
<!--#includelude file="../up/fso.asp"-->
<!--#includelude file="../include/coding.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../include/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head><body>
<!--#includelude file="top.asp"--><br>
<table width="94%" align="center" cellpadding="0" cellspacing="1" bgcolor="#efefef">
  <tr> 
    <form name="form1" method="post" action="sp.asp">
      <td width="152" height="25" align="center" bgcolor="#FFFFFF"> 
        <input name="keywords" type="text" class="wenbenkuang" id="keywords" size="12" maxlength="15"> 
        <input name="Submit" type="submit" class="go-wenbenkuang" value="搜索">
      </td>
    </form><form name="form3" method="post" action="sp.asp">
      <td width="760" align="center" bgcolor="#FFFFFF">显示近 
        <input name="xs" type="text" class="wenbenkuang" id="xs" value="12" size="2" maxlength="3">
        天
        <input name="lx" type="radio" value="0" checked>所有产品
        <input type="radio" name="lx" value="1">已结束
        <input type="radio" name="lx" value="2">一口价
        <input type="radio" name="lx" value="3">拍卖 
        <input type="radio" name="lx" value="4">议价 
        <input type="radio" name="lx" value="5">隐藏
		<input type="radio" name="lx" value="6">推荐
<input name="Submit2" type="submit" class="go-wenbenkuang" value="显示"></td></form>
  </tr>
</table>
<%
id=clng(Request("id"))
page=clng(Request("page"))
if Request("y")="del" then
set rs = conn.execute("select xt,zt,dt,lbid,xlbid,slbid from chanpin where id="&id&"" )
if rs(0)<>"" and rs(0)<>"xt.gif" and rs(0)<>"zt.gif" then
wj="../../members/images/Rikeeupimages/"&rs(0)
del_wj_myfso wj
end if
if rs(1)<>"" and rs(1)<>"xt.gif" and rs(1)<>"zt.gif" then
wj="../../members/images/Rikeeupimages/"&rs(1)
del_wj_myfso wj
end if
if rs(2)<>"" and rs(2)<>"xt.gif" and rs(2)<>"zt.gif" then
wj="../../members/images/Rikeeupimages/"&rs(2)
del_wj_myfso wj
end if
conn.execute("Update lb set cp=cp-1 where lbid="&rs(3)&"")
conn.execute("Update xlb set cp=cp-1 where lbid="&rs(3)&" and xlbid="&rs(4)&"")
conn.execute("Update slb set cp=cp-1 where lbid="&rs(3)&" and xlbid="&rs(4)&" and slbid="&rs(5)&"")
rs.close
conn.execute("Delete * from chanpin where id="&id&"")
end if
if Request("y")="ok" then
tui=Request("tui")
if tui=1 then tui=0 else tui=1
set rs = conn.execute("select lbid,xlbid,slbid from chanpin where id="&id&"")
if tui=0 then
conn.execute("Update lb set cp=cp+1 where lbid="&rs(0)&"")
conn.execute("Update xlb set cp=cp+1 where lbid="&rs(0)&" and xlbid="&rs(1)&"")
conn.execute("Update slb set cp=cp+1 where lbid="&rs(0)&" and xlbid="&rs(1)&" and slbid="&rs(2)&"")
else
conn.execute("Update lb set cp=cp-1 where lbid="&rs(0)&"")
conn.execute("Update xlb set cp=cp-1 where lbid="&rs(0)&" and xlbid="&rs(1)&"")
conn.execute("Update slb set cp=cp-1 where lbid="&rs(0)&" and xlbid="&rs(1)&" and slbid="&rs(2)&"")
end if
rs.close
conn.execute("Update chanpin set tui ='"&tui&"' where id="&id&"")
end if%><!--#includelude file="../include/page.asp"--><%
keywords=shopnet("keywords")
if shopnet("xs")="" then xs=0 else xs=clng(shopnet("xs"))
if shopnet("lx")="" then lx=0 else lx=clng(shopnet("lx"))
Set rs=Server.CreateObject("ADODB.Recordset")
if xs<>0 and lx=0 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where datediff('d',sj,now())<"&xs&" order by tui desc,id desc"
elseif xs=0 and lx=1 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where sj2<now() order by tui desc,id desc"
elseif xs<>0 and lx=1 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where datediff('d',sj,now())<"&xs&" and sj2<now() order by tui desc,id desc"
elseif xs=0 and lx=2 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where fs=0 order by tui desc,id desc"
elseif xs<>0 and lx=2 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where datediff('d',sj,now())<"&xs&" and fs=0 order by tui desc,id desc"
elseif xs=0 and lx=3 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where fs<>0 order by tui desc,id desc"
elseif xs<>0 and lx=3 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where datediff('d',sj,now())<"&xs&" and fs=1 order by tui desc,id desc"
elseif xs=0 and lx=4 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where fs=2 order by tui desc,id desc"
elseif xs<>0 and lx=4 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where datediff('d',sj,now())<"&xs&" and fs=2 order by tui desc,id desc"
elseif xs=0 and lx=5 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where cang<>0 order by tui desc,id desc"
elseif xs<>0 and lx=5 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where datediff('d',sj,now())<"&xs&" and cang<>0 order by tui desc,id desc"
elseif xs<>0 and lx=6 then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where tuijian=1 order by id desc,id desc"
elseif keywords<>"" then
sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin where (mc like '%"&keywords&"%' or jp like '%"&keywords&"%'  or js like '%"&keywords&"%') order by tui desc,id desc "
else

sql="select id,mc,fs,sj,sj2,userid,tui,tuijian,cang from chanpin order by tui desc,id desc"
end if
rs.open sql,conn,1,1 
%>	
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#158ADB">
  <tr align="center" valign="middle"> 
    <td width="430" height="25" background="images/admin_bg_4.gif" bgcolor="#FFFFFF"><span class="STYLE1">产品名称</span></td>
    <td width="50" height="21" nowrap background="images/admin_bg_4.gif" bgcolor="#FFFFFF"><span class="STYLE1">销售方式</span></td>
    <td width="125" height="21" nowrap background="images/admin_bg_4.gif" bgcolor="#FFFFFF"><span class="STYLE1">加入日期</span></td>
    <td width="125" height="21" nowrap background="images/admin_bg_4.gif" bgcolor="#FFFFFF"><span class="STYLE1">结束时间</span></td>
    <td width="30" height="21" nowrap background="images/admin_bg_4.gif" bgcolor="#FFFFFF"><span class="STYLE1">审核</span></td>
    <td width="30" height="21" nowrap background="images/admin_bg_4.gif" bgcolor="#FFFFFF"><span class="STYLE1">删除</span></td>
  </tr>
<%
if rs.eof then
response.Write("<tr><td bgcolor=#ffffff colspan=6 height=25 align=center>当前没有商品信息！<td><tr> ")
else
rs.PageSize =20 '每页记录条数
			iCount=rs.RecordCount '记录总数
			iPageSize=rs.PageSize
    		maxpage=rs.PageCount 
    		page=request("page")
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
        if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
        rs.AbsolutePage=Page
	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
		For y=1 To x%>
  <tr valign="middle"> 
    <td width="430" height="25" bgcolor="#FFFFFF">[<%= rs("userid")%>]&nbsp; <%if rs("cang")<>0 then response.write "<font color=#ff6600>[隐藏]</font>"%> <a href="../../merchandise.asp?id=<%= encode(rs("id"))%>" target="_blank"><%= replace(rs("mc"),"<","〈")%></a> <%set rs1 = conn.execute("select zt from shop where id="&rs("userid")&"")
if not rs1.eof then
if rs1("zt")="1" then Response.Write "[试营业]"
end if
rs1.close%> 
    <%if rs("tuijian")=0 then%>
    &nbsp;&nbsp; <a href="goodstj.asp?tui=yes&id=<%=rs("id")%>"><font color="#ff6600">推荐该商品</font></a>
    <%else%>
    <a href="goodstj.asp?tui=no&id=<%=rs("id")%>"><font color="#3366CC">取消推荐</font>
    <%end if%></td>
    <td width="50" align="center" nowrap bgcolor="#FFFFFF">
<%Select case rs("fs")
case 0
response.write "一口价"
case 1
response.write "拍卖"
case 2
Response.Write("议价")
End Select%></td>
    <td width="125" align="center" nowrap bgcolor="#FFFFFF"><%= rs("sj") %></td>
    <td width="125" align="center" nowrap bgcolor="#FFFFFF"><%if rs("sj2")>now() then Response.Write rs("sj2") else Response.Write("<font color=red>时间已到</font>")%></td>
    <td width="30" align="center" nowrap bgcolor="#FFFFFF"><a href=?y=ok&keywords=<%=request("keywords")%>&xs=<%=request("xs")%>&lx=<%=request("lx")%>&id=<%=rs("id")%>&tui=<%if rs("tui")=0 then Response.Write 0 else Response.Write 1%>&page=<%=page%>>
    <%if rs("tui")=0 then response.write "已审" else response.write "<font color=#ff6600>未审</font>" end if %></a></td>
    <td width="30" align="center" nowrap bgcolor="#FFFFFF"><a href=?y=del&keywords=<%=keywords%>&xs=<%=request("xs")%>&lx=<%=request("lx")%>&id=<%=rs("id")%>&page=<%=page%>>删除</a></td>
  </tr>
<%x=y+1
rs.MoveNext                                              
next
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
%>
  <tr align="center" valign="middle"> 
      <td height="21" colspan="6" bgcolor="#FFFFFF"> 
    <%
rs.close
set rs=nothing
conn.close
set conn=nothing
%></td>
  </tr><%end if%>
</table>
<br>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>注：如果是拍卖产品，点击销售方式中的“拍卖”可以看到参与拍卖的现状或已成功竞标的结果。</td>
  </tr>
</table><br>
</body>
</html>