<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr> 
    <td height=30></td>
 </tr>
<tr> <td>
      <table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" bgcolor="#cccccc">
           <tr  height="25" align="center"   BGCOLOR=#ffffff> 
            <td width="10%" ><FONT COLOR=#333333>编号</font></td>
            <td width="40%"><FONT COLOR=#333333>商 品 名 称</font></td>
            <td width="10%"><FONT COLOR=#333333>数量</font></td>
	    <td width="10%"><FONT COLOR=#333333>积分</font></td>
			 
	    <td width="10%"><FONT COLOR=#333333>邮费</font></td>
            <td width="10%"><FONT COLOR=#333333>您的价格</font></td>
	    <td width="10%"><FONT COLOR=#333333>总 计</font></td>
          </tr>
<%
Set rsCheck=Server.CreateObject("ADODB.RecordSet") 
strsql="select ID,Name,Score,Price2,price1,amount,VipPrice,Stock,solded from Product where ID in ("&Session("ProductList")&") order by ID"
rsCheck.open strsql,conn,1,3

Sum = 0
SumS = 0
SumFee = 0
Do While Not rsCheck.EOF
     Quatity = CInt( Request( "Q_" & rsCheck("ID")) )
     If Quatity <= 0 Then 
        Quatity = CInt( Session(rsCheck("ID")) )
        If Quatity <= 0 Then Quatity = 1
     End If
if len(Quatityt)=0 then
Quatityt=Quatity
else
Quatityt=Quatityt&","&Quatity
end if
strprice2 = Round(rsCheck("Price2"),2)
strvipprice = Round(rsCheck("VipPrice"),2)
ProScore = rsCheck("Score")
YourPrice = strprice2
YourPrice1= strprice2*LngDiscount
If rsCheck("amount") = 0 or LngUserID=0 or Lnggrpid = 4 Then
YourPricex = YourPrice
Else
YourPricex = YourPrice1
End If
YourPricex = Round(YourPricex,2) 
Session(rsCheck("ID")) = Quatity
Sum = Sum + (YourPricex + strvipprice)*Quatity
Sum=Round(Sum,2) 
SumS = SumS + ProScore*Quatity
%> 
          <tr bgcolor="#FFFFFF" height="25"align="center"> 
            <td><%=rsCheck("ID")%></td>
            <td align="left">&nbsp;<a href=product.asp?ID=<%=rsCheck("ID")%> target="_blank"><%=rsCheck("Name")%></a></td>
            <td><%=Quatity%> </td>
			<td><%=ProScore %></td>
			
			<td><%=strvipprice %></td>
			<td><%=YourPricex %></td>
			<td><%=Round((YourPricex + strvipprice)*Quatity,2) %></td>
          </tr>
          <%
Message=message &"<tr bgcolor=#FFFFFF height=25 align=center> "
Message=message &"<td>"& rsCheck("ID") &"</td>"
Message=message &"<td align=left><a href=http://"& weburl &"/product.asp?ID="& rsCheck("ID")&" target=_blank>"& rsCheck("Name") &"</a></td>"
Message=message &"<td>"& Quatity &"</td>"
Message=message &"<td>"&ProScore &"</td>"
Message=message &"<td>"& strvipprice &"</td>"
Message=message &"<td>"& YourPricex &"</td>"
Message=message &"<td>"& Round((YourPricex + strvipprice)*Quatity,0) &"</td>"
Message=message &"</tr>"

IF FormatSQL(SafeRequest("action",0)) = 3 Then 

rsCheck("Stock") = rsCheck("Stock") - Quatity
rsCheck("solded") = rsCheck("solded") + Quatity
rsCheck.Update

strprice2 = rsCheck("Price2")
strvipprice = rsCheck("Vipprice")
YourPricep = round((strprice2+strvipprice)*Quatity,2)
YourPricep1=(strprice2*LngDiscount + strvipprice)*Quatity
If rsCheck("amount") = 0 or LngUserID=0 or Lnggrpid = 4 Then
YourPricepx = YourPricep
Else
YourPricepx=YourPricep1
End If
YourPricepx = Round(YourPricepx,2)
If LngUserID=0 Then
strUserName = Request.ServerVariables("REMOTE_ADDR")
End IF
set rs=server.CreateObject("adodb.recordset")  
rs.open "select * from orders",conn,1,3
rs.addnew
rs("username")=trim(strUserName)
rs("name")=rsCheck("name")
rs("price1")=rsCheck("price1")
rs("price2")=rsCheck("price2")
rs("vipprice")=rsCheck("vipprice")
rs("id")=rsCheck("ID")
rs("amount")=rsCheck("amount")
rs("actiondate")=Now()
rs("productnum")=Quatity
rs("state")=2
rs("goods")=goods
rs("postcode")=int(request.form("postcode"))
rs("receipt")=sqlCheckstr(request.form("receipt"))
rs("address")=sqlCheckstr(request.form("address"))
rs("comment")=sqlCheckstr(request.form("comment"))
rs("paymethord")=int(request.form("paymethord"))
rs("deliverymethord")=int(request.form("deliverymethord"))
rs("UserSex")=int(request.form("UserSex"))
rs("comments")=sqlCheckstr(trim(request.form("comments")))
rs("paid")=YourPricepx
rs("priced")=YourPricex
rs("realname")=sqlCheckstr(request.form("realname"))
rs("score")=ProScore*Quatity
rs("useremail")=sqlCheckstr(request.form("useremail"))
rs("usertel")=sqlCheckstr(request.form("usertel"))
rs("usermobile")=sqlCheckstr(request.form("usermobile"))
rs("userid")=LngUserID
rs.update
rs.close
End IF

     rsCheck.MoveNext
     Loop
rsCheck.close
set rsCheck=nothing
%> 
<tr bgcolor="#FFFFFF"> 
<td colspan="8" height="25">
您现在是：<font color="#930000"><%= strTitle %></font>&nbsp;
享受折扣：<font color="#930000"><% = LngDiscount*100&"%" %></font>&nbsp;
商品总计：<font color="#930000"><%=Sum  %></font>&nbsp;元&nbsp;
获得积分：<font color="#930000"><%=SumS %></font>&nbsp;分
            </td>
          </tr>
<% 
Message=message &"<tr bgcolor=#FFFFFF>"
Message=message &"<td colspan=8 height=25>"
Message=message &"您现在是：<font color=#930000>"& strTitle &"</font>"
Message=message &"享受折扣：<font color=#930000>"& LngDiscount*100&"%" &"</font>"
Message=message &"商品总计：<font color=#930000>"& Sum  &"</font>元"
Message=message &"获得积分：<font color=#930000>"& SumS &"</font>分"
Message=message &"</td>"
Message=message &"</tr>"

IF FormatSQL(SafeRequest("action",0)) = 3 Then 

rs.open "select * from delivery where deliveryid="&int(request.form("deliverymethord")),conn,1,1
	  if rs.eof and rs.bof then
	  strMth = "你选择的送货方式已经被删除"
	  LngMth = 0
	  else
	  strMth = rs("subject")
	  LngMth = rs("fee")
      end if
	  rs.close
	  %>
	  <%	IF Sum < webbj5  or webbj5=0 Then
		  strMian = ""
		  Sum = Sum +LngMth
                     else
                    strMian = "(购物满&nbsp;<font color=red>"&webbj5&"</font>&nbsp;元免附加邮费)"
                   Sum = Sum 
			End IF %>
<tr bgcolor="#FFFFFF"> 
<td colspan="8" height="25">
您选择的送货方式：<font color="#930000"><% = strMth %></font>&nbsp;附加邮费：<font color="#930000"><% = LngMth %></font>&nbsp;订单费用总计：<font color="#930000"><% = Sum %></font>&nbsp;<% = strMian %>

            </td>
          </tr>
<%
Message=message &"<tr bgcolor=#FFFFFF> "
Message=message &"<td colspan=8 height=25>"
Message=message &"您选择的送货方式：<font color=#930000>"& strMth &"</font>&nbsp;附加邮费：<font color=#930000>"& LngMth &"</font>&nbsp;订单费用总计：<font color=#930000>"& Sum &"</font>&nbsp;"& strMian &" "
Message=message &"</td>"
Message=message &"</tr>"
%>

		  <tr> 
<td colspan="8" bgcolor=#ffffff>
<FONT color=#000000>订单号：<% = goods %></FONT><br>
<FONT color=#000000>收货人姓名：<%response.Write sqlCheckstr(request.form("receipt"))
    if request.form("UserSex")=0 then
    response.Write "&nbsp;(先生)"
	strMale = "&nbsp;(先生)"
    else
    response.Write "&nbsp;(女士)"
	strMale = "&nbsp;(女士)"
    end if 
	Message=message &"<tr>"
	Message=message &"<td colspan=8 BGCOLOR=#ffffff>"
	Message=message &"订单号："& goods &"<br> "
	Message=message &"收货人姓名："& sqlCheckstr(request.form("receipt")) &" "& strMale &" <br>"
	%>
	<br><FONT color=#000000>详细地址：<% = sqlCheckstr(request.form("address")) %></FONT>
	<br><FONT color=#000000>邮政编码：<% = sqlCheckstr(request.form("postcode")) %></FONT>
	<br><FONT color=#000000>联系电话：<% = sqlCheckstr(request.form("usertel")) %></FONT>
	<br><FONT color=#000000>电子邮件：<% = sqlCheckstr(request.form("useremail")) %></FONT>
	<%
	Message=message &"详细地址："& sqlCheckstr(request.form("address")) &" <br>"
	Message=message &"邮政编码："& sqlCheckstr(request.form("postcode")) &" <br>"
	Message=message &"联系电话："& sqlCheckstr(request.form("usertel")) &" <br>"
	Message=message &"电子邮件："& sqlCheckstr(request.form("useremail")) &" <br>"
	%>
	<br><FONT color=#000000>送货方式：<% 
	rs.open "select * from delivery where deliveryid="&int(request.form("deliverymethord")),conn,1,1
	  if rs.eof and rs.bof then
	  response.write "方式已经被删除"
	   Message=message &"送货方式：方式已经被删除<br>"
	  else
      response.Write trim(rs("subject"))&"("
	  response.Write (rs("fee"))&"元)"
	  Message=message &"送货方式："& rs("subject") &" ("
	  Message=message &" "& rs("fee") &") <br>"
      end if
	  rs.close %>
	<br><FONT color=#000000>汇款方式：</FONT><% 
	  rs.open "select * from delivery where deliveryid="&int(request.form("paymethord")),conn,1,1
	  if rs.eof and rs.bof then
	  response.write "方式已经被删除"
	  Message=message &"汇款方式：方式已经被删除<br>"
	  else
      response.Write trim(rs("subject"))
	  Message=message &"汇款方式："& rs("subject") &"<br> "
      end if
	  rs.close
	  
	  
	 
     set rs=nothing
      %>
	<br><FONT color=#000000>您的留言：<% = sqlCheckstr(request.form("comment")) %></FONT>
	<br><FONT color=#000000><% = strtxtdeposit %></FONT>
		<%
	Message=message &"您的留言："& sqlCheckstr(request.form("comment")) &" <br>"
	Message=message &" "& strtxtdeposit &" "
	Message=message &"</tr>"
	Message=message &"</table>"
	%>
	
      </td></tr>
<tr bgcolor="#FFFFFF"> 
  <td colspan="8" BGCOLOR="#f2f2f2" height="25" style='PADDING-LEFT: 6px'>
   <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#f1f1f1">

     <tr BGCOLOR="#f1f1f1"> 
        <td align="center" height="30" background="images/goods_bg.gif">
         <font color="#ffffff"><b>如果想马上付款可以选择下面方式支付</b></font>
        </td>
     </tr>
<% if LngUserID <>0  then  %>
     <tr BGCOLOR="#f9f9f9"> 
        <td align="center" height="35">
         <b>1.预付款支付</b>(你现在帐户上有预存款&nbsp;<font color="#930000"><%=LngDeposit%></font>&nbsp;元)
        </td>
     </tr>
       <% if LngDeposit >= sum  then %>
        <tr BGCOLOR="#ffffff">
           <form action="saveDeposit.asp?paygoods=<%=goods%>&action=pay&username=<%=strusername%>" method="post" name="payDeposit"> 
          <td align="center" height="30">
          
         
                 <input type="hidden" name="paysum" id="paysum" size="40" value="<%= sum %>">
                 <input type="hidden" name="paysums" id="paysums" size="40" value="<%= sums %>">

                 <input class=shopinput1 type="submit" name="Submit" value="用预付款支付" >

        </td>
           </form>    
     </tr> 
 <% else   %>
     <tr BGCOLOR="#ffffff"> 
        <td align="center" height="30">
          
         你帐户里的预存款不足以支付这次购买价格，请先到<A HREF="profile.asp?action=profile" target="_blank"><font color="#930000"><b>会员中心充值入款</b></font></a>！
          
   
        </td>
     </tr> 
     <% end if   %>
<% end if   %>
    <tr BGCOLOR="#f9f9f9"> 
        <td align="center" height="30">
         <b>2.使用在线支付</b>
        </td>
     </tr>
     <%
       set rspay=server.CreateObject("adodb.recordset")
       rspay.open "select opayid,opaysername,opayname,opaypassword,opayurl,opayon,opaytop,opaypic from sdx_opay where opayon=1 order by opaytop asc",conn,1,1  
				if err.number<>0 then
				end if
				if rspay.eof And rspay.bof then
  			   else

       %>
      <%do while not rspay.eof%>
     <tr bgcolor="#FFFFFF"> 
        <td align="center"  height="50">
         <A HREF="opay/<%=rspay("opayurl")%>?action=1&paygood=<%=goods%>&paysum=<%=sum%>" target="_blank">
<% if rspay("opaypic") <> ""  then %>
 <IMG src="<%=rspay("opaypic")%>" border=0 alt=<%=rspay("opaysername")%>>
<% else  %>
<p align="center" height="40"  width="100"  class=shopinput3><b><%=rspay("opaysername")%></b></p>
<% end if   %>
</a>
        </td>
     </tr>

       
      <%rspay.MoveNext
          loop
          end if%>
      <tr BGCOLOR="#f1f1f1"> 
        <td align="center" height="30" background="images/goods_bg.gif">
         <font color="#ffffff"><b>如果想通过网上银行或到银行柜台汇款请选择下列银行帐户</b></font>
        </td>
     </tr>
     <tr BGCOLOR="#f9f9f9"> 
        <td align="center" height="30">
         <TABLE WIDTH="100%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="1" class=table-zuoyou BGCOLOR="#f1f1f1">
	<tr height="30" BGCOLOR="#f9f9f9" align="center">
         
            <td width="25%">开户行名称</td> 
             <td width="10%">姓名</td>
            <td width="25%">帐户号码</td>
           
            <td width="40%">登陆网上银行</td>
           
          
          </tr>
         
      </TABLE>
        </td>
     </tr>
     <%
       set rsbank=server.CreateObject("adodb.recordset")
       rsbank.open "select bankid,bankname,payname,paynumber,bankurl,bankon,banktop from sdx_bank where bankon=1 order by banktop asc",conn,1,1  
				if err.number<>0 then
				end if
				if rsbank.eof And rsbank.bof then
  			   else

       %>
      <%do while not rsbank.eof%>
     <tr bgcolor="#FFFFFF"> 
        <td align="center"  height="30">

    <TABLE WIDTH="100%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="1" class=table-zuoyou BGCOLOR="#f1f1f1">
	<tr height="30" bgcolor="#FFFFFF" align="center">
         
            <td width="25%"><%=rsbank("bankname")%></td> 
             <td width="10%"><%=rsbank("payname")%></td>
            <td width="25%"><%=rsbank("paynumber")%></td>
           
            <td width="40%"><A HREF="<%=rsbank("bankurl")%>" target="_blank"><%=rsbank("bankurl")%></a></td>
           
          
          </tr>
         
      </TABLE>
        

        </td>
     </tr>

       
      <%rsbank.MoveNext
          loop
          end if%>
   </table> 

  </td>
</tr>
<tr bgcolor="#FFFFFF"> 
  <td colspan="8" BGCOLOR="#f2f2f2" height="25" style='PADDING-LEFT: 6px'>
<br><br><div align="center"><a href="index.asp"><FONT color=#000000>继续购物</FONT></a>&nbsp;&nbsp;<a href="JavaScript:onClick=window.close();"><FONT color=#000000>关闭窗口</FONT></a></div>
      </td></tr>
<% 
End IF %>
      </table>
 </td>
</tr>
      </table>