<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% data_path="../" 'ACC连接数据库路径，对SQL无效 %>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<style type="text/css">
<!--
.STYLE1 {
	font-size: 14px;
	font-weight: bold;
}
body,td,th {
	font-size: 9pt;
}
a:link,a:visited{text-decoration:none; color:#3399CC;}
a:hover{text-decoration:underline; color:#660000;}
-->
</style>
</head>

<body>
<%
if issession=0 then
if request.Cookies("Yxmemberid")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login/login1.asp';</SCRIPT>"
response.end
end if
username=Replace_Text(request.Cookies("Yxmember"))
gsid=Replace_Text(request.Cookies("Yxmemberid"))
else
if session("id")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login/login1.asp';</SCRIPT>"
response.end
end if
username=session("user")
gsid=session("id")
end if

set rs=server.CreateObject("adodb.recordset")
sql="select * from yixiang_fq_order where buycom="&gsid&" and buyshow=1"
rs.open sql,conn,1,1
msg_per_page=10 '定义每页显示记录条数
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #3399CC;">
  <tr>
  

    <td><form id="form1" name="form1" method="post" action="">
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="30" colspan="6" align="center"><span class="STYLE1">发起订单--买家管理</span></td>
        </tr>		
		<%
		 if rs.eof then
		 	response.Write"<tr><td align=center>暂无订单</td></tr>"
			response.End
		 end if
		 OCount=rs.recordcount
		
		 '-----------------------
		 set rsno=server.CreateObject("adodb.recordset")
		 sqlno="select id from yixiang_fq_order where buycom="&gsid&" and viewkey=1 and buyshow=1"
		 rsno.open sqlno,conn,1,1
		 YCount=rsno.recordcount
		 NCount=OCount-YCount
'		 
'		set rsfq=server.CreateObject("adodb.recordset")
'		 sqlfq="select id from yixiang_fq_order where buycom="&gsid&""
'		 rsfq.open sqlfq,conn,1,1
'		 FCount=rsfq.recordcount		 
		 
		%>
				<!--#include file="../inc/headpage.asp"-->
        <tr>
          <td height="25" colspan="7" align="center"><strong>共收到货单<font color="red"><%=OCount%></font>笔</strong><strong>，</strong><strong>已查看<font color="red"><%=YCount%></font>笔，尚未查看<font color="red"><%=NCount%></font>笔 (<a href="mybuy.asp">查看所有订单</a>) </strong></td>
        </tr>
        <tr>
          <td width="15%" height="25" align="center" bgcolor="#6DA4E4">订单号</td>
		  <td width="15%" height="25" align="center" bgcolor="#6DA4E4">产品名称</td>
          <td width="14%" height="25" align="center" bgcolor="#6DA4E4">购买数量</td>
          <td width="11%" height="25" align="center" bgcolor="#6DA4E4">运费方式</td>
		  <td width="15%" height="25" align="center" bgcolor="#6DA4E4">发起买家</td>
          <td width="17%" height="25" align="center" bgcolor="#6DA4E4">处理状态</td>
          <td width="16%" height="25" align="center" bgcolor="#6DA4E4">操作</td>
        </tr>
		<%
			do while not rs.eof
			if rs("viewkey")=0 then
				tade="未查看"
			else
				tade="已查看"
			end if
			fqcom=rs("fqcom")
			set rscom=server.CreateObject("adodb.recordset")
		    sqlcom="select [user] from yixiang_corporation where id="&fqcom&""
		    rscom.open sqlcom,conn,1,1
			IF  rscom.EOF then
			response.write "<script>alert('无信息')</script>"
			response.end()
			else
			Nfqcom=rscom("user")
			end if 
		%>
        <tr onMouseOver="this.style.backgroundColor='#D7E3F3'" onMouseOut="this.style.backgroundColor='#ffffff'">
          <td height="25" align="center" style="border-bottom:1px solid #3399CC;"><%=rs("billno")%></td>
		  <td height="25" align="center" style="border-bottom:1px solid #3399CC; border-left:1px solid #3399CC;"><%=left(rs("hpmc"),6)%></td>
          <td height="25" align="center" style="border-bottom:1px solid #3399CC; border-left:1px solid #3399CC;"><%=rs("gmsl")%></td>
          <td height="25" align="center" style="border-bottom:1px solid #3399CC; border-left:1px solid #3399CC;"><%=rs("yunf")%></td>
		     <td height="25" align="center" style="border-bottom:1px solid #3399CC; border-left:1px solid #3399CC;"><%=Nfqcom%></td>
          <td height="25" align="center" style="border-bottom:1px solid #3399CC; border-left:1px solid #3399CC;"><%=tade%></td>
          <td height="25" align="center" style="border-bottom:1px solid #3399CC; border-left:1px solid #3399CC;"><a href=# onclick=javascript:window.open('fq_buyview.asp?id=<%=rs("id")%>&comid=<%=fqcom%>','','top=50,left=120,width=457,height=450,scrollbars=yes')>查看</a> | <a href="orderdel.asp?ty=fqb&id=<%=rs("id")%>">删除</a></td>
        </tr>
		<%
			rs.movenext
			loop
		%>
		 <tr>
          <td colspan="7" align="center"><br /><b><%=listPages("fq_buy_list.asp")%></b></td>          
        </tr>
      </table>
<%
rscom.close
rsno.close
rs.close
%>
        </form>
    </td>
  </tr>
</table>
</body>
</html>
