<!--#include file="inc_top.asp" -->
<table width="762" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff" class="pian">
<tr><td>
<%
'如果会员未登陆，转到会员登陆页面
if session("huiyuan")="" then
Response.redirect "cart-login.asp"
end if
set rs1 = conn.execute("select * from ls_userid where sessionid="&session.sessionid&"")
'如果session为空，转入错误界面
if rs1.eof then
Response.redirect "nothing.asp"
end if

do while not rs1.eof
'显示购物车内产品
set rs = conn.execute("select * from ls_cart where sessionid="&session.sessionid&" and userid="&rs1("userid")&"")
%>
<table width="0" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>	
<table width="760" border="0" align="center">
          <% If rs1.RecordCount>1 Then
		  set rs2 = conn.execute("select name from user_name where id="&rs1("userid")&"")
           username=rs2("name")
          rs2.close
          set rs2=nothing
		  Response.Write("<tr><td colspan=5><input name=userid type=radio value="&rs1("userid")&" checked>我要先结算<font color=#ff3300>"&username&"</font>的商品</td></tr>")
          else
		  Response.Write("<input name=userid type=hidden id=userid value="&rs1("userid")&">")
		   End If %>
          
          <%
   On Error Resume Next
   Sum1 = 0
   Sum2 = 0
   While Not rs.EOF
     Sum1 = Sum1 + csng(rs("jg1")) * rs("sl")
     Sum2 = Sum2 + csng(rs("jg2")) * rs("sl")
     Sum1=FormatNumber(Sum1,2) 
     Sum2=FormatNumber(Sum2,2) 
	 js=Sum1-Sum2
%>
          <tr valign="middle" bgcolor="#f7f7f7"> 
            <td height="20">
              <form method="post" action="checkpay.asp" name="E_FORM">
                <p><table width="100%" cellspacing="1">
      <tr> 
        <td width="20%" align="right"> 商品名称 </td>
        <td width="80%">
            <input name="v_rcvname" type="text" value="<%=rs("mc")%>" size="50">
        </td>
      </tr>
      <tr> 
        <td align="right">总金额（元） </td>
        <td><input name="v_amount" type=text onKeyUp="if(isNaN(value))execCommand('undo')" value="<%=rs("jg2")%>" size="50" onafterpaste="if(isNaN(value))execCommand('undo')"> 
         </td>
      </tr>
      <tr><% set rs = conn.execute("select * from huiyuan where huiyuan='"&session("huiyuan")&"'") %>
        <td align="right">付款人地址付款</td>
        <td>          <input name="shouhuorendizhi" type="text" value="<%=rs("dz")%>" size="50"></td>
      </tr>
      <tr> 
        <td align="right"> 付款人电话</td>
        <td> <div align="left"> 
            <input name="shouhuorendianhua" type="text" value="<%=rs("tel")%>" size="50">
          </div></td>
      </tr>
      <tr> 
        <td align="right"> 付款人邮编</td>
        <td> 
            <input name="shouhuorenyoubian" type="text" value="<%=rs("yb")%>" size="50">
         </td>
      </tr>
      <tr> 
        <td align="right"> 付款人ID号</td>
        <td> 
            <input name="dinghuorenxingming" type="text" value="<%=session("huiyuan")%>" size="50">
            <span class="style1">您的商家或会员登陆帐号</span>         </td>
      </tr>
      <tr> 
        <td align="right">&nbsp;</td>
        <td>&nbsp;          </td>
      </tr>
    </table>
                </p>
                <p align="center"><input type=submit name=v_action value="确认提交" onClick="MM_validateForm('document.E_FORM.v_rcvname','document.E_FORM.v_rcvname','R','document.E_FORM.shouhuorendizhi','document.E_FORM.shouhuorendizhi','R','document.E_FORM.shouhuorendianhua','document.E_FORM.shouhuorendianhua','R','document.E_FORM.shouhuorenyoubian','document.E_FORM.shouhuorenyoubian','RisNum','document.E_FORM.dinghuorenxingming','document.E_FORM.dinghuorenxingming','R');return document.MM_returnValue"></p>
              </form>  
            <div align="center"></div></td>
          </tr>
          <%
     rs.MoveNext
     Wend
%>
        <%
rs1.movenext
loop
If rs1.RecordCount>1 Then
Response.Write("<script language=javascript>alert('您订购的是不同商家的产品，请分别下单。')</script>")
end if
rs.close
rs1.close
set rs=nothing
set rs1=nothing%>
        </table>
</td>
</tr>
</table>
<!--#include file="inc_end.asp" -->
</body>
</html>