<!--#include file="checkUser_free.asp"-->
<!-- #include file="conn.asp"-->
<%
delid=request("del")
if delid<>"" then
set rs=server.createobject("adodb.recordset") 
sql="select * from buy_product where id="&delid
rs.open sql,conn,1,3
rs.delete
rs.update
rs.close

end if
%>
<link href="../css.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%lb=request("lb")
set rs=server.createobject("adodb.recordset")
sql="select * from buy_product where memberid='"& request.cookies("memberid") &"' order by id desc"
rs.open sql,conn,1

rs.pagesize=10 '每页显示多少条
pagecount=rs.pagecount '总页数
%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="25"> <div align="center"><font color="#000000"><strong>求购信息管理</strong></font>&nbsp;
		<a href="buy_add.asp">添加</a></div></td>
  </tr>
</table>
<table width="99%" border=0 align="center" cellpadding=0 cellspacing=0 style="BORDER-COLLAPSE: collapse">
  <tr> 
    <td height="20" colspan="2"><table width="492" height="14" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#ABABAB">
        <tr bgcolor="#dedede"> 
          <td width="48" height="30"> <div align="center">编号</div></td>
          <td width="175"> <div align="center">型号</div></td>
          <td width="74" height="30"> <div align="center">价格</div></td>
          <td width="119" height="30"> <div align="center">发布日期</div></td>
          <td width="70" height="30"> <div align="center">修改</div></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td colspan="2"> <div align=center> 
        <table width="492" height="18" border=0 align="center" cellpadding=0 cellspacing=0 class=table-xia>
          <% dim b
				  b=1
  if rs.bof and rs.eof then
  response.write "<a href=buy_add.asp ><font color=#FF0000>还没有发布过任何交易信息</a></font>"
  else
  
  page=clng(request.querystring("page"))
  if page<1 then page=1
  if page>rs.pagecount then page=rs.pagecount
  rs.absolutepage=page  '跳到多少页
  
  for i=1 to rs.pagesize
  %>
          <% if int(b/2)*2<>b then
				  response.Write"<TR> "
				  else
				  				  response.Write"<TR> "
								  end if %>
          <tr bgcolor="#FFFFFF"> 
            <td width="48" height="18" class=table-zuoyou><div align="center"> 
                <% =rs("id") %>
              </div></td>
            <td width="175" class=table-you><div align="center"> 
                <% =rs("carclass") %>
              </div></td>
            <td width="74" class=table-you> <div align="center"> 
                <% =rs("marketPrice") %>
                万元</div></td>
            <td width="119" class=table-you> <div align="center"><font color="#006600"><%=month(rs("fa_now"))%></font>月<font color="#006600"><%=day(rs("fa_now"))%></font>日<font color="#006600"><%=hour(rs("fa_now"))%></font>时</div></td>
            <td width="70" class=table-you> <div align="center"><a href="mybuy_x.asp?id=<%=rs("id")%>"><font color="#003399">修改</font></a></div></td>
          </tr>
          <% 
  rs.movenext
  b=b+1
  if rs.eof then exit for 
  next
  end if 
  %>
        </table>
      </div></td>
  </tr>
  <tr> 
    <td width="80%">　</td>
    <td width="20%">分页：&nbsp; 
      <%
	r=7
	 
	'总页数
	zys=round(clng(rs.pagecount)/r+0.5)
	
	'当前页数
	dqys=request.QueryString("dqys") 
	
	'开始页
	ksy=request.QueryString("ksy") 
	
	if dqys="" then dqys=1
	if ksy="" then ksy=1 
	 
	js=clng(dqys) * r '一个FOR语句结束
	if js > clng(rs.pagecount) then js=clng(rs.pagecount)
	
	newksy= clng(dqys)*r-(r-1) '一个FOR语句开始
		
if clng(dqys) >1 then response.write "<a href=?dqys="& dqys-1 &"&lb="& lb &">" &"上一页" &"</a>"

	  for t=newksy to js
	     response.write "<a href=?page=" &t&"&dqys="&dqys&"&lb="& lb &">" &t& "</a>&nbsp;"
	  next
	  

if cdbl(dqys)< zys then response.write "<a href=?dqys="& dqys+1 &"&lb="& lb &">" &"下一页" &"</a>"
%>
    </td>
  </tr>
  <tr> 
    <td height=2 colspan="2"></td>
  </tr>
</table>
