<!--#include file="include/nowshop.asp" -->
<!--#include file="md5.asp" -->
<%
call aspsql()
call checklogin()
OrderNum=request("OrderNum")

dim jia
sqlinfo = "select A.ordertime,A.OrderNum,A.ProdId,A.BuyPrice,A.ProdUnit,A.PEI,A.FEI,B.memo,B.thiskou,B.Recname,B.RecPhone,B.CompPhone,B.Recmail,B.RecAddress,B.Zipcode,B.Paytype,B.Notes,C.ProdName "&_
  " from bOrder A,bOrderList B,bproduc C"&_
  " where b.del<>true and A.UserId='"&request.cookies("buyok")("userid")&"' and A.OrderNum='"&OrderNum&"' and A.OrderNum = B.OrderNum and A.ProdId=C.Prodid"
set rs=Server.Createobject("ADODB.RecordSet")
rs.Open sqlinfo,conn,1,1
if rs.eof and rs.bof  then

response.write "<script language='javascript'>"
response.write "alert('出错了，没有这个订单号，或者您无权查看此订单！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end

 else 
jia=csng(rs("fei"))
userkou=csng(rs("thiskou"))

%>

<%
Recname=rs("Recname")
Zipcode=rs("ZipCode")
RecPhone=rs("RecPhone")
Pay_Mode1=rs("Pay_Mode")
CompPhone=rs("CompPhone")
Recaddress=rs("Recaddress")
Province=rs("Province")
city=rs("city")
Fetch_Mode=rs("Fetch_Mode")
Recname2=rs("Recname2")
Province2=rs("Province2")
city2=rs("city2")
Recaddress2=rs("Recaddress2")
RecPhone2=rs("RecPhone2")
Recmail2=rs("Recmail2")
Zipcode2=rs("ZipCode2")
Recmail=rs("Recmail")
Notes=rs("Notes")
post=rs("post")
Gettime=rs("gettime")
inBillNo=rs("OrderNum")
pei=rs("pei")
fei=formatnum(rs("fei"),2)
pay1= rs("pay1")
payid=rs("payid")
paykey=rs("paykey")

%>


<HTML>
<HEAD>
<TITLE>查看订单-<%=sitename%>-<%=siteurl%></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="<%=sitedescription%>">
<meta name="keywords" content="<%=sitekeywords%>">
<LINK href="images/css.css" type=text/css rel=stylesheet>
<LINK href="list/newhead.css" type=text/css rel=stylesheet>
</HEAD>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<!--#include file="top.asp"-->
<table width="768" border="0" cellspacing="0" cellpadding="0">
  <tr> 

    <td width="186" align="center" valign="top" bgcolor="#f4f5fd"><!--#include file="zuo_member.asp"--></td>
    <td align="center" valign="top"> <TABLE width=560 border=0 cellPadding=0 cellSpacing=0 bordercolor="#587ad9">
        <TBODY>
          <TR> 
            <TD height=12><table>
                  <tr> 
                    <td align="center" valign="middle"><TABLE cellSpacing=0 cellPadding=0 width=547 border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
                        <TBODY>
                          <TR> 
                            <TD bgColor=#f4f5fd height=30><font color="#000000">　<B>定单明细查询</B></font></TD>
                          </TR>
                        </TBODY>
                      </TABLE></td>
                  </tr>
                  <tr> 
                    <td align="center" valign="middle"> <table width="547"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
                        <tr bgcolor="#FFFFFF"> 
                          <td colspan="4">订单号为<strong><font color=red> <%=rs("OrderNum")%> </font></strong>&nbsp;&nbsp;&nbsp;&nbsp;提交时间：<%=rs("ordertime")%><br> <br> 
                            <table border=0>
                              <tr> 
                                <td width=100 align=right>定 货 人：&nbsp;&nbsp;</td>
                                <td><%=rs("Recname")%></td>
                              </tr>
                              <tr> 
                                <td width=100 align=right>联系电话：&nbsp;&nbsp;</td>
                                <td><%=rs("RecPhone")%></td>
                              </tr>
                              <tr> 
                                <td width=100 align=right>电子邮箱：&nbsp;&nbsp;</td>
                                <td><%=rs("Recmail")%></td>
                              </tr>
                              <tr> 
                                <td width=100 align=right>收货地址：&nbsp;&nbsp;</td>
                                <td><%=rs("RecAddress")%></td>
                              </tr>
                              <tr> 
                                <td width=100 align=right>邮政编码：&nbsp;&nbsp;</td>
                                <td><%=rs("Zipcode")%></td>
                              </tr>
                              <tr> 
                                <td width=100 align=right>配送方式：&nbsp;&nbsp;</td>
                                <td><%=rs("pei")%></td>
                              </tr>
                              <tr> 
                                <td width=100 align=right>配送费用：&nbsp;&nbsp;</td>
                                <td><%=formatnum(rs("fei"),2)%></td>
                              </tr>
                              <tr> 
                                <td width=100 align=right>订单备注：&nbsp;&nbsp;</td>
                                <td><%=rs("Notes")%></td>
                              </tr>
                              <tr> 
                                <td width=100 align=right>客服处理：&nbsp;&nbsp;</td>
                                <td><font color=red><%=rs("memo")%></font></td>
                              </tr>
                            </table>
                        <tr bgcolor="#f4f5fd"> 
                          <td height="30" align="center">商品名称</td>
                          <td align="center" >购买数量</td>
                          <td align="center" >结算单价</td>
                          <td  align="center"><font color="B0266D">合 计</font></td>
                        </tr>
                        <%
 Total = 0
 do while not rs.eof 
 Sum = csng(rs("BuyPrice"))*csng(rs("ProdUnit"))*userkou/10
 Total = Sum + Total '计算总金额
%>
                        <tr bgcolor="#FFFFFF"> 
                          <td height="30" align="center" ><a href="list.asp?ProdId=<%=rs("Prodid")%>" target="_blank"><%=rs("ProdName")%></a></td>
                          <td align="center" ><%=rs("ProdUnit")%></td>
                          <td align="center" ><%=formatnum(csng(rs("BuyPrice"))*userkou/10,2)%></td>
                          <td align="center" ><%=formatnum(sum,2)%></td>
                        </tr>
                        <%
rs.movenext
loop
end if
%>
                        <TR bgcolor="#FFFFFF"> 
                          <TD colspan="4"> &nbsp;&nbsp;商品总价：<%=formatnum(total,2)%><br> &nbsp;&nbsp;配送费用：<%=formatnum(jia,2)%><br> &nbsp;&nbsp;总计费用：<b><font color=red><%=formatnum((csng(total)+jia),2)%> 元</font></b></td>
                        </TR>
                        <%
rs.close
set rs=nothing
%>
                      </TABLE>
                      <%
set rs=conn.execute("select * from bOrderlist where ordernum='"&ordernum&"'")
if rs.eof and rs.bof then
response.write "<script language='javascript'>"
response.write "alert('出错了，没有这个订单号！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if

%> <br> <br>
                      <table width="547"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                        <tr align="center"> 
                          <td width="109" colspan="2" valign="middle"><table height="40" border="0" cellpadding="0" cellspacing="0">
                              <tr align="center"> 
                                <td width="150" align="center" valign="middle">
								<%

Set rs_x= conn.Execute("select * from pay") 

    
	 ' 支付提交表单的各项参数如下：

	 ' tid
	 '      商户唯一交易号,xpayconfig.asp文件里的tid替换为自己的商户号即可
	 ' bid
	 '      定单号，
	 ' prc
	 '      订单金额
	 ' card
	 '      默认支付方式
	 ' scard
	 '      支付的支付方式
	 ' actioncode
	 '      交易码	 
	 ' actionparameter 
	 '      业务代码
	 ' ver 
	 '      版本号
	 ' md
	 '      MD5加密串
	 ' url
	 '      商户自定义返回接收支付结果的页面
	 ' pdt
	 '      交易摘要或产品名称	 

	 '********以下几项数据可以不传**************
	 ' type 
	 '      交易类型或产品类型
	 ' username
	 '      购买用户	       
	 ' lang
	 '      语言	
	 ' remark1
	 '      备注
	 ' disableemail
	 '      是否隐藏email
	 ' sitename
	 '      商户网站名称
	 ' siteurl
	 '      商户网站域名



	bid=inBillNo
	prc=formatnum((csng(total)+jia),2)
	pdt=inBillNo& "号订单在线支付"
	username=Recname
	remark1=Notes
	card="bank"
    
    scard=""
    lang="gb2312"
'===============================================================
'  易付通支付接口2.0应用演示代码.  本演示代码仅作参考!              
'  详细请参考易付通商户接口规范2.0:                                                 
'  本页是设置易付通支付商户交易唯一号、交易密钥和其他配置信息  
'  测试商户交易号tid=86532211 交易密钥key=Lk3fGJb/EAU=                                   
'===============================================================
tid=rs_x("tid")       '商户交易唯一号号，即商户号，请改为你自己的商户号
key=rs_x("key")    '交易密钥，必须跟易付通商户后台设置的相同，否则会验证失败
actioncode="sell"     '交易码,用于标识交易,目前支持sell,custom 等于custom表示用户可以修改支付金额
actionParameter=""    '当 actioncode="sell"和"custom"时 ,此参数为空
ver="2.0"             '版本号,当前系统请使用2.0
sitename=""           '网站名称，多个网站商户使用，在支付网关页面显示，设置为空时读取在我们系统设置的网站名称
siteurl=""            '网站域名，多个网站域名商户使用，在支付网关页面显示，设置为空时读取在我们系统设置的网站域名
disableemail=""       '是否隐藏支付网关页面显示的填写email栏

url=rs_x("url")

    md=md5(key&":"&prc&","&bid&","&tid&","&card&","&scard&","&actioncode&","&actionparameter&","&ver)
                                                            'md为加密数据，加密顺序必须严格按此顺序
%>
 
                                  <form name=confirm action="http://pay.xpay.cn/pay.aspx" method=post target="_blank">
                                    <INPUT TYPE="hidden" name="RecName" value="<%=Recname%>">
                                    <INPUT TYPE="hidden" name="RecPhone" value="<%=RecPhone%>">
                                    <INPUT TYPE="hidden" name="CompPhone" value="<%=CompPhone%>">
                                    <INPUT TYPE="hidden" name="RecAddress" value="<%=RecAddress%>">
                                    <INPUT TYPE="hidden" name="Gettime" value="<%=gettime%>">
                                    <INPUT TYPE="hidden" name="Recmail" value="<%=Recmail%>">
                                    <INPUT TYPE="hidden" name="Zipcode" value="<%=Zipcode%>">
                                    <INPUT TYPE="hidden" name="Province" value="<%=Province%>">
                                    <INPUT TYPE="hidden" name="city" value="<%=city%>">
                                    <INPUT TYPE="hidden" name="Fetch_Mode" value="<%=Fetch_Mode%>">
                                    <INPUT TYPE="hidden" name="RecName2" value="<%=Recname2%>">
                                    <INPUT TYPE="hidden" name="Province2" value="<%=Province2%>">
                                    <INPUT TYPE="hidden" name="city2" value="<%=city2%>">
                                    <INPUT TYPE="hidden" name="RecAddress2" value="<%=Recaddress2%>">
                                    <INPUT TYPE="hidden" name="Zipcode2" value="<%=Zipcode2%>">
                                    <INPUT TYPE="hidden" name="RecPhone2" value="<%=RecPhone2%>">
                                    <INPUT TYPE="hidden" name="Recmail2" value="<%=Recmail2%>">
                                    <INPUT TYPE="hidden" name="Notes" value="<%=Notes%>">
                                    <INPUT TYPE="hidden" name="pei" value="<%=pei%>">
                                    <INPUT TYPE="hidden" name="fei" value="<%=fei%>">
                                    <INPUT TYPE="hidden" name="sum" value="<%=sum%>">
                                    <INPUT TYPE="hidden" name="buylist" value="<%=buylist%>">
                                    <input type=HIDDEN name="tid" 	value="<%=tid%>">
                                    <input type=HIDDEN name="bid"   value="<%=bid%>">
                                    <input type=HIDDEN name="prc"    value="<%=prc%>">
                                    <input type=HIDDEN name="card" value="<%=card%>">
                                    <input type=HIDDEN name="scard" value="<%=scard%>" >
                                    <input type=HIDDEN name="actioncode" value="<%=actioncode%>">
                                    <input type=HIDDEN name="actionparameter"  value="<%=actionparameter%>">
                                    <input type=HIDDEN name="ver"  value="<%=ver%>">
                                    <input type=HIDDEN name="md"  value="<%=md%>">
                                    <input type=HIDDEN name="url"  value="<%=url%>">
                                    <input type=HIDDEN name="pdt"  value="<%=pdt%>">
                                    <input type=HIDDEN name="username"  value="<%=username%>">
                                    <input type=HIDDEN name="type"  value="<%=pdttype%>">
                                    <input type=HIDDEN name="lang"  value="<%=lang%>">
                                    <input type=HIDDEN name="remark1"  value="<%=remark1%>">
                                    <input type=HIDDEN name="disableemail"  value="<%=disableemail%>">
                                    <input type=HIDDEN name="sitename"  value="<%=sitename%>">
                                    <input type=HIDDEN name="siteurl"  value="<%=siteurl%>">
                                    <input name="image" type="image" src="order/gouwuche/car_zaixian.gif" alt="" width="110" height="40">
                                  </form></td>
			  <% set rs_pay=conn.execute("select * from pay") 
			  payid=rs_pay("payid")
              paykey=rs_pay("paykey")

			  if rs_pay("pay1")<>"0" then%>

              <td width="150" align="center" valign="middle">

<%
	alipay_name=inBillNo & "号订单在线支付"
	alipay_body="以下金额（"& formatnum((csng(total)+jia),2) & "元）已包含配送费用"

        s1           =        "0001"		  '命令码
        s2           =        alipay_name	  '商品名称
        s21          =        alipay_body	  '商品描述
        s3           =        inBillNo		  '订单号
        s4           =        formatnum((csng(total)+jia),2)	  '金额
        s5           =        "1"		  '支付类型
        s6           =        "1"		  '购买数量
        s7           =        "1"		  '发货方式
        s8           =        "0.00"        	  '邮费
        s9           =        "0.00"        	  '邮费
        s10          =        "true"        	  '只读
        s11          =        notes		  '买家留言
        s12          =        ""		  '买家Email
        s13          =        ucase(RecName)	  '买家姓名
        s14          =        RecAddress	  '买家地址
        s15          =        Zipcode		  '买家邮编
        s16          =        RecPhone		  '买家电话
        s17          =        CompPhone		  '买家手机
        sellerEmail  =        payid		  '卖家EMAIL
	s18    	     =        "2088002028987185"  'partner
        key          =        paykey
	str2CreateAc = "cmd" & s1 & "subject" & s2
	str2CreateAc = str2CreateAc & "body" & s21
	str2CreateAc = str2CreateAc & "order_no" & s3
	str2CreateAc = str2CreateAc & "price" & s4
	str2CreateAc = str2CreateAc & "type" & s5
	str2CreateAc = str2CreateAc & "number" & s6
	str2CreateAc = str2CreateAc & "transport" & s7
	str2CreateAc = str2CreateAc & "ordinary_fee" & s8
	str2CreateAc = str2CreateAc & "express_fee" & s9
	str2CreateAc = str2CreateAc & "readonly" & s10
	str2CreateAc = str2CreateAc & "buyer_msg" & s11
	str2CreateAc = str2CreateAc & "seller" & sellerEmail
	str2CreateAc = str2CreateAc & "buyer" & s12
	str2CreateAc = str2CreateAc & "buyer_name" & s13
	str2CreateAc = str2CreateAc & "buyer_address" & s14
	str2CreateAc = str2CreateAc & "buyer_zipcode" & s15
	str2CreateAc = str2CreateAc & "buyer_tel" & s16
	str2CreateAc = str2CreateAc & "buyer_mobile" & s17
	str2CreateAc = str2CreateAc & "partner" & s18
	str2CreateAc = str2CreateAc & key
	itemURL = "https://www.alipay.com/payto:" & sellerEmail & "?cmd=" & s1
	itemURL = itemURL & "&subject=" & Server.URLEncode(s2)
	itemURL = itemURL & "&body=" & Server.URLEncode(s21)
	itemURL = itemURL & "&order_no=" & s3
	itemURL = itemURL & "&price=" & s4
	itemURL = itemURL & "&type=" & s5
	itemURL = itemURL & "&number=" & s6
	itemURL = itemURL & "&transport=" & s7
	itemURL = itemURL & "&ordinary_fee=" & s8
	itemURL = itemURL & "&express_fee=" & s9
	itemURL = itemURL & "&readonly=" & s10
	itemURL = itemURL & "&buyer_msg=" & s11
	itemURL = itemURL & "&buyer=" & s12
	itemURL = itemURL & "&buyer_name=" & s13
	itemURL = itemURL & "&buyer_address=" & s14
	itemURL = itemURL & "&buyer_zipcode=" & s15
	itemURL = itemURL & "&buyer_tel=" & s16
	itemURL = itemURL & "&buyer_mobile=" & s17
	itemURL = itemURL & "&partner=" & s18
	itemURL = itemURL & "&ac=" & MD5(str2CreateAc)
%>

<form name=confirm1 action="<%=itemURL%>" method=post target="_blank">
<input type="image" src="order/gouwuche/car_zhifubao.gif" width="110" height="40" alt=""> 
<INPUT type=hidden size=8 name=inBillNo value="<%=inBillNo%>">
</form>
</td>
<%end if%>
                                <td width="150" align="center" valign="middle"> 
                                  <form name=confirm2 action="fukuan.asp" method=post target="_blank">
                                    <input name="image" type="image" src="order/gouwuche/car_qita.gif" alt="" width="110" height="40">
                                  </form></td>
                              </tr>
                            </table>
                            <INPUT type=hidden size=8 name=inBillNo value="<%=inBillNo%>"></td>
                        </tr>
                      </table> </td>
                  </tr>
                </table></TD>
          </TR>
        </TBODY>
      </TABLE>
      
    </td>
  </tr>
</table>
<!--#include file="down.asp"-->
</center>
</body>
</html>
<%
conn.close
set conn=nothing
%>
