<!-- #include file="conn.asp" -->
<!-- #include file="include.asp" -->
<% MaxPerPage=20
if not isempty(request("page")) then
currentPage=cint(request.querystring("page"))
else
currentPage=1
end if
id=request.QueryString("id")
offer_order=request.QueryString("offer_order") %>
<HTML>
<HEAD>
<TITLE>武汉电脑报价网-PCBaoJia.com</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
</HEAD>
<BODY BGCOLOR=#003060 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="images/bg.gif">
<%call head(1)%>
<table width="764" border="0" cellpadding="0" cellspacing="0" background="images/bg_body.gif" align="center">
  <tr>
    <td align="center"><table width="760" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="159" align="center" valign="top" bgcolor="3E93C9"><TABLE WIDTH=157 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
                <TD COLSPAN=3> <IMG SRC="images/login_t.gif" WIDTH=157 HEIGHT=38 ALT=""></TD>
              </TR>
              <TR>
                <TD> <IMG SRC="images/login_l.gif" WIDTH=9 HEIGHT=112 ALT=""></TD>
                <TD width="139" align="center" bgcolor="#FFFFFF"><%call login%></TD>
                <TD> <IMG SRC="images/login_r.gif" WIDTH=9 HEIGHT=112 ALT=""></TD>
              </TR>
              <TR>
                <TD COLSPAN=3> <IMG SRC="images/login_b.gif" WIDTH=157 HEIGHT=8 ALT=""></TD>
              </TR>
            </TABLE>
              <br>
              <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#2F75A6" bgcolor="2F75A6">
                <tr>
                  <td height="3" bgcolor="#3399CC"></td>
                </tr>
                <tr>
                  <td align="center" class="white_b_14">最新加盟经销商</td>
                </tr>
            </table>          </td>
          <td align="center" valign="top"><TABLE WIDTH=600 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
                <TD> <IMG SRC="images/body_l.gif" WIDTH=5 HEIGHT=10 ALT=""></TD>
                <TD></TD>
                <TD align="right"> <IMG SRC="images/body_r.gif" WIDTH=5 HEIGHT=10 ALT=""></TD>
              </TR>
            </TABLE>
              <%call search%>
              <IMG WIDTH=0 HEIGHT=10>
              <table width="578"  border="0" cellpadding="0" cellspacing="1" bgcolor="2F75A6">
                <tr>
                  <td bgcolor="FFFFFF"><table width="100%"  border="0" cellpadding="5" cellspacing="0">
                      <tr>
                        <td height="390" align="center" valign="top">
<table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td>『<a href="?offer_order=price_up&id=<%=id%>"><span class="orange">按价格由低到高排列</span></a>』</td>
    <td>『<a href="?offer_order=price_down&id=<%=id%>"><span class="orange">按价格由高到低排列</span></a>』</td>
	<td>『<a href="?offer_order=com&id=<%=id%>"><span class="orange">按报价单位排列</span></a>』</td>
    <td>『<a href="?offer_order=&id=<%=id%>"><span class="orange">按登记时间排列</span></a>』</td>
  </tr>
</table> 

                          <%
dim rs
dim sql
set rs=server.createobject("adodb.recordset")
sql = "select * from offer where pro_id="&id
select case offer_order
case "price_up"
sql = sql & " order by price asc"
case "price_down"
sql = sql & " order by price desc"
case "com"
sql = sql & " order by com_id desc"
case else
sql = sql & " order by idate desc"
end select
rs.open sql,conn,1,1 
if rs.eof and rs.bof then 
response.write "<p align='center'>对不起，没有相关的报价!</p>" 
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 totalput,MaxPerPage
showpage totalput,MaxPerPage,"list.asp"
else 
if (currentPage-1)*MaxPerPage<totalPut then 
rs.move (currentPage-1)*MaxPerPage 
dim bookmark 
bookmark=rs.bookmark 
showContent totalput,MaxPerPage
showpage totalput,MaxPerPage,"list.asp"
else 
currentPage=1 
showContent totalput,MaxPerPage
showpage totalput,MaxPerPage,"list.asp"
end if 
end if 
rs.close 
end if 
set rs=nothing
sub showContent (totalput,MaxPerPage)
set rs1=server.createobject("adodb.recordset")
sql1 = "select pro_name from products where pro_id="&rs("pro_id")
rs1.open sql1,conn,1,1
pro_name=rs1("pro_name")
rs1.close
set rs1=nothing
response.write "<div align=left>&nbsp;&nbsp;&nbsp;&nbsp;以下是 <span class=red>"&pro_name&"</span> 的报价：</div>"
%>
                                      <table width="100%"  border="1" cellpadding="3" cellspacing="0" bordercolor="eeeeee"  frame=hsides rules=rows>
                                        <tr align="center" bgcolor="#C7F3FF">
                                          <td width="50%">报价单位</td>
                                          <td width="30%">价格</td>
                                          <td width="20%">报价日期</td>
                                        </tr>
<%do while not rs.eof%>
                                        <tr bgcolor="<%if i mod 2 then Response.Write("#F8F8F8") else Response.Write("#ffffff")%>" onMouseOver="this.style.backgroundColor='#EFFCFE'" onMouseOut="this.style.backgroundColor='<%if i mod 2 then Response.Write("#F8F8F8") else Response.Write("#ffffff")%>'">
                                          <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/icon_4.gif" width="6" height="11">
                                          <%
										 com_id=rs("com_id")
							  set rs2=server.createobject("adodb.recordset")
							  sql2 = "select company,vip from com_user where com_id="&com_id
							  rs2.open sql2,conn,1,1
							  com_name=rs2("company")
							  com_vip=rs2("vip")
							  rs2.close
							  set rs2=nothing
							  if com_vip=True then
							  Response.Write("<a href='shop.asp?id="&com_id&"'><font color=red>"&com_name&"</font></a>")
							  else
							  Response.Write("<a href='shop.asp?id="&com_id&"'>"&com_name&"</a>")
							  end if
							  %>                                          </td>
										  <td align="center"><% if session("com_id")<>"" then 
										  Response.Write("<span class='title'>"&rs("price")&"</span>/<span class='red'>"&rs("price_in")&"</span>")
										  else
										  Response.Write("<span class='title'>"&rs("price")&"</span>")
										  end if%>										  </td>
                                          <td align="center"><%=int(rs("idate"))%></td>
                                        </tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
                                      </table>
                                    <%
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 
if CurrentPage<2 then 
response.write "<table border=0 width=96% cellspacing=0 cellpadding=0>" 
response.write "<tr height=30>"
response.write "<td>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>页&nbsp;第<font color=#ff6600><b>"&CurrentPage&"</b></font>页&nbsp;共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条信息</td>" 
response.write "<td align=right>"
response.write "【最前页】【上一页】" 
else 
response.write "<table border=0 width=96% cellspacing=0 cellpadding=0>"
response.write "<tr height=30>"
response.write "<td>"
response.write "共<font color=#ff6600><b>"&n&"</b></font>页&nbsp;第<font color=#ff6600><b>"&CurrentPage&"</b></font>页&nbsp;共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条信息</td>"
response.write "<td align=right>"
response.write "【<a href="&filename&"?page=1&id="&id&"&offer_order="&offer_order&">最前页</a>】" 
response.write "【<a href="&filename&"?page="&CurrentPage-1&"&id="&id&"&offer_order="&offer_order&">上一页</a>】" 
end if 
if n-currentpage<1 then 
response.write "【下一页】【最后页】" 
else 
response.write "【<a href="&filename&"?page="&(CurrentPage+1)&"&id="&id&"&offer_order="&offer_order&">" 
response.write "下一页</a>】【<a href="&filename&"?page="&n&"&id="&id&"&offer_order="&offer_order&">最后页</a>】" 
end if 
response.write "</td>"
response.write "</tr>"
response.write "</table>"
response.write "</form>"
end function
%>
</td>
                      </tr>
                      <tr>
                        <td height="4" bgcolor="ADECF9"></td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
        </tr>
    </table></td>
  </tr>
</table>
<TABLE WIDTH=764 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
  <TR>
    <TD> <IMG SRC="images/foot_1.gif" WIDTH=4 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_2.gif" WIDTH=153 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_3.gif" WIDTH=3 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_4.gif" WIDTH=600 HEIGHT=8 ALT=""></TD>
    <TD> <IMG SRC="images/foot_5.gif" WIDTH=4 HEIGHT=8 ALT=""></TD>
  </TR>
</TABLE>
<!-- #include file="foot.asp" -->
</body>
</html>
