<!--#include file="inc_top.asp" -->
<table width="762" bgcolor="#ffffff" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td height="40" align="center" valign="middle"><img src="image/lc2.gif" width="496" height="22"></td>
	</tr>
<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="500" border="0" align="center"><form action=pay.asp method="POST" name=form1>
          <% 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 %>
          <tr valign="middle" bgcolor="#ff6600"> 
            <td width="250" height="20" align="center"><font color="#FFFFFF">产 
              品 名 称</font></td>
            <td width="75" align="center"><font color="#FFFFFF">市场价</font></td>
            <td width="75" height="20" align="center"><font color="#FFFFFF">会员价</font></td>
            <td width="50" height="20" align="center"><font color="#FFFFFF">数 
              量</font></td>
            <td width="100" height="20" align="center"><font color="#FFFFFF">金 
              额</font></td>
          </tr>
          <%
   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 width="250" height="20"><%=rs("mc")%></td>
            <td width="75" align="center"><%=rs("jg1")%></td>
            <td width="75" height="20" align="center"><%=rs("jg2")%></td>
            <td width="50" height="20" align="center"> <%=rs("sl")%></td>
            <td width="100" height="20" align="center"> 
              <div align="center"><%=FormatNumber(csng(rs("jg2"))*rs("sl"),2)%></div></td>
          </tr>
          <%
     rs.MoveNext
     Wend
%>
          <tr valign="middle" bgcolor="#f7f7f7"> 
            <td height="20" colspan="5" align="right">市场价:<font color="#ff3333">￥<%=Sum1%>元</font>&nbsp;会员价:<font color="#ff3333">￥<%=Sum2%>元</font>&nbsp;立即节省:<font color="#ff3333">￥<%=js%>元&nbsp;</font></td>
          </tr>
        <%
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%>
          <tr>
            <td colspan=5 align="center"><br><a href="cart.asp">&gt;&gt;&nbsp;返回购物车调整商品</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="Submit3" type="submit" class="go-wenbenkuang" value="下一步 &gt;&gt;" onFocus="this.blur()"><br><br>
            </td>
          </tr></form>
        </table>
</td>
</tr>
</table>

<!--#include file="inc_end.asp" -->