<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="md6.asp"-->
<%Set rsa=Server.CreateObject("ADODB.Recordset")
sql="select * from fukuan where userid="&userid&""
rsa.open sql,conn,1,1
xibuzhifuid=rsa("xibuzhifuid")
wangyinzaixianid=rsa("wangyinzaixianid")
wangyinzaixianjiaoyanma=rsa("wangyinzaixianjiaoyanma")
%>
<%Set rsb=Server.CreateObject("ADODB.Recordset")
sql="select js from chanpin where id="&decode(shopnet("cpid"))&""
rsb.open sql,conn,1,1 
%>
<%
	t1		=	"https://www.alipay.com/payto:"	'支付接口
	t2		=	""&rsa("zhifubaoid")&""			'商户支付宝账户（改成您自己的）
	t3		=	""&rsa("zhifubaojiaoyanma")&""								'安全校验码（改成您自己的）		
	t4		=	"http://img.alipay.com/pimg/button_alipaybutton_o.gif"		'支付宝按钮图片
	t5		=	""						'按钮悬停说明
	s1		=	"0001"						'cmd			命令码
	s2		=	""&shopnet("mc")&""					'subject		商品名称
	s3		=	""&rsb("js")&""					'body			商品描述
	s4		=	""&bh&""				'order_no		商户订单号
	s5		=	""&shopnet("jg2")&""						'price			商品单价			0.01～50000.00
	s6		=	"http://"&my_url&"/merchandise.asp?id="&shopnet("cpid")&""	'url			商品展示网址
	s7		=	"1"							'type			支付类型			1：商品购买2：服务购买3：网络拍卖4：捐赠
	s8		=	""&num&""		'number	购买数量
	s9		=	""&feiyong&""				'transport 发货方式1：平邮2：快递3：虚拟物品
	s10		=	""&amount&""						'ordinary_fee	平邮运费
	s11		=	""&amount&""						'express_fee	快递运费
	s12		=	"true"						'readonly		交易信息是否只读
	s13		=	""&beizhu&""						'buyer_msg		买家给卖家的留言
	s14		=	""&mail&""							'buyer			买家Email
	s15		=	""&name&""						'buyer_name		买家姓名
	s16		=	""&dz&""						'buyer_address	买家地址
	s17		=	""&yb&""					'buyer_zipcode	买家邮编
	s18		=	""&tel&""					'buyer_tel		买家电话号码
	s19		=	""&shouji&""				'buyer_mobile	买家手机号码
	s20		=	"2088002062368412"							'partner		合作伙伴ID			保留字段

		'初始化各必要变量
		INTERFACE_URL	= t1+t2		'支付接口
		sellerEmail		= t2		'商户支付宝账户（改成您自己的）
		keyCode			= t3		'安全校验码（改成您自己的）
		imgsrc			= t4		'支付宝按钮图片
		imgtitle		= t5		'按钮悬停说明
		
		str2CreateAc	=	"cmd" & s1 & "subject" & s2
		str2CreateAc	=	str2CreateAc & "body" & s3
		str2CreateAc	=	str2CreateAc & "order_no" & s4
		str2CreateAc	=	str2CreateAc & "price" & s5
		str2CreateAc	=	str2CreateAc & "url" & s6
		str2CreateAc	=	str2CreateAc & "type" & s7
		str2CreateAc	=	str2CreateAc & "number" & s8
		str2CreateAc	=	str2CreateAc & "transport" & s9
		str2CreateAc	=	str2CreateAc & "ordinary_fee" & s10
		str2CreateAc	=	str2CreateAc & "express_fee" & s11
		str2CreateAc	=	str2CreateAc & "readonly" & s12
		str2CreateAc	=	str2CreateAc & "buyer_msg" & s13
		str2CreateAc	=	str2CreateAc & "seller" & sellerEmail
		str2CreateAc	=	str2CreateAc & "buyer" & s14
		str2CreateAc	=	str2CreateAc & "buyer_name" & s15
		str2CreateAc	=	str2CreateAc & "buyer_address" & s16
		str2CreateAc	=	str2CreateAc & "buyer_zipcode" & s17
		str2CreateAc	=	str2CreateAc & "buyer_tel" & s18
		str2CreateAc	=	str2CreateAc & "buyer_mobile" & s19
		str2CreateAc	=	str2CreateAc & "partner" & s20
		str2CreateAc	=	str2CreateAc & keyCode
   
acCode			= 	MD5(str2CreateAc)

		itemURL			= 	INTERFACE_URL & "?cmd=" & s1
		itemURL			= 	itemURL & "&subject=" & Server.HTMLEncode(s2)
		itemURL			= 	itemURL & "&body=" & Server.HTMLEncode(s3)
		itemURL			= 	itemURL & "&order_no=" & s4
		itemURL			= 	itemURL & "&price=" & s5
		itemURL			= 	itemURL & "&url=" & s6
		itemURL			= 	itemURL & "&type=" & s7
		itemURL			= 	itemURL & "&number=" & s8
		itemURL			= 	itemURL & "&transport=" & s9
		itemURL			= 	itemURL & "&ordinary_fee=" & s10
		itemURL			= 	itemURL & "&express_fee=" & s11
		itemURL			= 	itemURL & "&readonly=" & s12
		itemURL			= 	itemURL & "&buyer_msg=" & Server.HTMLEncode(s13)
		itemURL			= 	itemURL & "&buyer=" & Server.HTMLEncode(s14)
		itemURL			= 	itemURL & "&buyer_name=" & Server.HTMLEncode(s15)
		itemURL			= 	itemURL & "&buyer_address=" & Server.HTMLEncode(s16)
		itemURL			= 	itemURL & "&buyer_zipcode=" & s17
		itemURL			= 	itemURL & "&buyer_tel=" & s18
		itemURL			= 	itemURL & "&buyer_mobile=" & s19
		itemURL			= 	itemURL & "&partner=" & s20
		itemURL			= 	itemURL & "&ac=" & acCode


	'调用方法 DelStr(值)，防止SQL注入攻击
	Function DelStr(Str)
		If IsNull(Str) Or IsEmpty(Str) Then
			Str	= ""
		End If
		DelStr	= Replace(Str,";","")
		DelStr	= Replace(DelStr,"'","")
		DelStr	= Replace(DelStr,"&","")
'		DelStr	= Replace(DelStr," ","")
		DelStr	= Replace(DelStr,"　","")
		DelStr	= Replace(DelStr,"%20","")
		DelStr	= Replace(DelStr,"--","")
		DelStr	= Replace(DelStr,"==","")
		DelStr	= Replace(DelStr,"<","")
		DelStr	= Replace(DelStr,">","")
		DelStr	= Replace(DelStr,"%","")
		DelStr	= Replace(DelStr,"+","")
		DelStr	= Replace(DelStr,"顶级","DingJi")
	End Function

	rsa.close
	set rsa=nothing
    rsb.close
	set rsb=nothing
%>
