<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<!--#include file="FFunction.asp"-->
<!--#include file="FHeadTitle.asp"-->
<!--#include file="include/coding.asp "-->
<!--#include file="include/money.asp" -->
<!--#include file="include/jmail.asp" -->

<style type="text/css" media="screen">
@import url("home/css/global/v1.2.css@t=20060512.css");
@import url("home/css/component.php@t=20060315.css");
@import url("home/css/sys/detail.php@t=20060522.css");
</style>
<body class="<%= pagestyle%>">
<div class="HackBox"></div>
<%IsShowHotKey=False
IsShowChannel=False%>
<!--#include file="FHeadAll.asp"-->
<%If session("buy")<>shopnet("cpid") Then
response.Write("<Script>alert('请不要重复刷新表单，点击确定转向到商城首页！');window.location='index.asp';</script>")
Response.End
End if
'禁止网页缓存及涮新
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = -1 
Response.CacheControl = "no-cache"


If request("userid") ="" Then
response.write "<br>非常抱谦，参数错误。"
response.end
end if

'程序开始
hy "../user/login.asp"
if request("name")="" then 
response.write "<br><br><br><div align='center'>请留下您的真实姓名，谢谢！</div>"
response.end
end if
if request("dz")="" then 
response.write "<br><br><br><div align='center'>请留下您的联系地址，谢谢！</div>"
response.end
end if
if request("tel")="" then 
response.write "<br><br><br><div align='center'>请留下您的联系电话，谢谢！</div>"
response.end
end if
if Len(request("bz"))>500 then 
response.write "<br><br><br><div align='center'>错误提示:备注的内容不能大于500字!</div><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div align='center'><a href=# onclick='history.back()'>返回修改</a></div>"
response.end
end if
huiyuan=Request.Cookies(Rikee)("huiyuan")
userid = decode(shopnet("userid"))
name =shopnet("name")
yb = shopnet("yb")
cpid=decode(shopnet("cpid"))
beizhu = shopnet("beizhu")
tel = shopnet("tel")
num = CInt(request("num"))
mail = shopnet("mail")
dz= shopnet("dz")
feiyong = shopnet("feiyong")
pay=shopnet("pay")
amount=decode(request("amount4"))
tx = shopnet("tx")
allamount = decode(request("allamount"))
pay = shopnet("pay")
shouji = shopnet("shouji")
'产生订单号
yy=year(date)
mm=right("00"&month(date),2)
dd=right("00"&day(date),2)
riqi=yy & mm & dd
'生成订单号所有所需元素,格式为：小时，分钟，秒
xiaoshi=right("00"&hour(time),2)
fenzhong=right("00"&minute(time),2)
miao=right("00"&second(time),2)
'产生定单号
'商易仿淘宝4.0.1演示地址
'http://www.ftaobao.com
bh="R"&yy & mm & dd & xiaoshi & fenzhong & miao
%>

<%'生成订单
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from cart"
rs.open sql,conn,2,3
rs.addnew
rs("name")=name
rs("yb")=yb
rs("tel")=tel
rs("mail")=mail
rs("dz")=dz
rs("peisong_fs")=feiyong
rs("peisong_rmb")=amount
rs("bz")=pay
rs("tx")=tx
rs("cpid")=cpid
rs("je")=allamount
rs("userid")=userid
rs("bh")=bh
rs("huiyuan")=huiyuan
rs("num")=num
rs("beizhu")=beizhu
rs.update
rs.close
Set rs=nothing
%>
<%
'更新会员信息
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from huiyuan where huiyuan='"&huiyuan&"'"
rs.open sql,conn,2,3
rs("name")=name
rs("yb")=yb
rs("tel")=tel
rs("mail")=mail
rs("dz")=dz
rs("je")=rs("je")+allamount
rs("shouji")=shouji
rs.update
rs.close
Set rs=nothing
conn.execute("Insert into list(bh,username,userid,mail,buyxinyong,cpid,mc,sl,jg2,sellxinyong,huiyuan)values('"&bh&"','"&name&"','"&userid&"','"&mail&"',2,"&decode(shopnet("cpid"))&",'"&shopnet("mc")&"',"&num&","&shopnet("jg2")&",2,'"&huiyuan&"')")

if request("mail")<>"" then
html="<html><head><title>感谢您在"&my_name&"购物</title><meta http-equiv=Content-Type content=text/html; charset=gb2312></head><body bgcolor=#FFFFFF text=#000000>"
html=html&"亲爱的"&Request.Cookies(Rikee)("huiyuan")&",您好！<br><br>　 欢迎您在<a href=""http://"&my_url&""" target=""_blank"">"&my_name&"</a>购物。您的订单已经成功提交，为了让您所订的货物能及时收到，请您尽快付款。如需要咨询，欢迎您与<a href=""http://"&my_url&""" target=""_blank"">我们</a>联系！您可随时通过会员中心查询您的订单处理状态。<br><br>"
html=html&"　 订单号："&bh&""
nr=html&"<br><br>"&email_bd&"</body></html>"
email =mail
bt = "订单提交成功"
if mailserver="0" then
smtp email,bt,nr
elseif mailserver="1" then
Call jmail1(email,bt,nr)
end if 
end if
'发送订单给店铺管理员
set rsuser = conn.execute("select mail,name,huiyuan from shop where id="&userid&"")
email=rsuser("mail")
html="<html><head><title>您有一个新的客户订单</title><meta http-equiv=Content-Type content=text/html; charset=gb2312></head><body bgcolor=#FFFFFF text=#000000>"
nr=html&"亲爱的"&rsuser("name")&",您好！<br><br>&nbsp;&nbsp;欢迎您使用<a href=""http://"&my_url&""" target=""_blank"">"&my_name&"</a>提供的电子商务技术平台。<br><br>&nbsp;&nbsp;您的店铺有一个新的订单产生，订单号: "&bh&"。请您进入会员中心的商城卖家管理中查看处理该订单。如需要咨询，欢迎您与<a href=""http://"&my_url&""" target=""_blank"">我们</a>联系！"&email_bd&"</body></html>"
bt="您有一个新的客户订单产生！"
if mailserver="0" then
smtp email,bt,nr
elseif mailserver="1" then
Call jmail1(email,bt,nr)
end if 
'发站内信到店铺管理员
conn.execute("Insert into duanxin(bt,nr,name1,name2,lx)values('您的店铺有一条新的客户订单产生！','您的店铺有一个新的订单产生，订单号: "&bh&"。<br>请您进入会员中心的商城卖家管理中查看处理该订单。','"&rsuser("huiyuan")&"','"&my_name&"',255)")
rsuser.close
set rsuser=nothing%>
  <table width="762" height="350" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="table-zuoyou">
    <tr> 
      <td height="350" valign="top" class="table-shang"><table width="760" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td height="30" valign="middle">&nbsp;您目前的位置：<a href="index.asp">首页</a> 
              -&gt; 购物订单已经生成！(购物系统采用了防涮新机制，请勿涮新本网页)</td>
          </tr>
        </table>
        <table width="98%" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td height="1"  colspan="6" background="/image/1x3.gif"></td>
          </tr>
        </table>
<br>
<table width=530 border=0 align=center cellpadding=5 cellspacing=1 bgcolor=#FF8A3C>
  <tr><td height=22 bgcolor=#FFEBDD>&nbsp;您的订单号码是: <font color=red><b><%=bh%></b></font> 号，请住记您的订单号以便查询，谢谢！</td>
</tr></table><br>
      <table width="96%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#efefef">
        <tr align="center" valign="middle" bgcolor="#FFFFE6"> 
            
          <td width="230" height="30" background="../image/bk3.jpg" bgcolor="#CCFFFF">商品名称</td>
            
          <td width="75" height="30" background="../image/bk3.jpg" bgcolor="#FFFFFF">运费</td>
            
          <td width="75" height="30" background="../image/bk3.jpg" bgcolor="#FFFFFF">会员价</td>
            
          <td width="75" height="30" background="../image/bk3.jpg" bgcolor="#FFFFFF">订购数量</td>
            
          <td width="75" height="30" background="../image/bk3.jpg" bgcolor="#FFFFFF">小计</td>
        </tr>
          <%set rs = conn.execute("select * from list where bh='"&bh&"' order by id desc")
		do while not rs.eof%>
          <tr valign="middle" bgcolor="#FFFFE6"> 
            
          <td width="230" height="25" bgcolor="#FFFFFF"><div align="center"><%=rs("mc")%></div></td>
            
          <td width="75" height="22" align="center" bgcolor="#FFFFFF"><%=amount%></td>
            
          <td width="75" height="22" align="center" bgcolor="#FFFFFF"><%=rs("jg2")%></td>
            
          <td width="75" height="22" align="center" bgcolor="#FFFFFF"><%=rs("sl")%></td>
            
          <td width="75" height="22" align="center" bgcolor="#FFFFFF"><%=allamount%></td>
          </tr>
<%rs.movenext
loop
rs.close
set rs=nothing%>
<tr align="right" valign="middle"> 

        
          <td height="25" colspan="5" bgcolor="#FFFFFF"><div align="left">
            <p>配送方式：<%=feiyong%><br>
              支付方式：<%=pay%>&nbsp;</p>
            <p class="FormLiteInline">姓名：<%=shopnet("name")%>
              <br />
              邮箱：<%=shopnet("mail")%><br />
            电话：<%=shopnet("tel")%><br />
            手机：<%=shopnet("shouji")%><br />
            邮编：<%=shopnet("yb")%></p>
            </div></td>
        </tr>
        </table>
        <div align="center"><br> 
		<!--#include file="include/zfb.asp"-->
        <%Select case request("pay")
case "支付宝"
response.write "您选择的是支付宝支付方式,<a href="&itemURL&" target=_blank>请点击这里在线付款</a>"
case "网银在线"
response.write "您选择的是网银在线支付,请点击按钮进行付款 <form action='user/wangyinzaixiansend.asp' method='post'><input name='userid' type='hidden' id='userid' value="&request("userid")&"><input name='wangyinzaixianjiaoyanma' type='hidden' value='"&wangyinzaixianjiaoyanma&"'><input name='wangyinzaixianid' type='hidden' value='"&wangyinzaixianid&"'><input name='name' type='hidden' value='"&request("name")&"'><input name='dz' type='hidden' value='"&request("dz")&"'><input name='yb' type='hidden' value='"&request("yb")&"'><input name='tel' type='hidden' value='"&request("tel")&"'><input name='mail' type='hidden' value='"&request("mail")&"'><input name='allamount' type='hidden' value='"&allamount&"'><input name='num' type='hidden' value="&shopnet("number")&"><input name='cpid' type='hidden' value='"&decode(shopnet("cpid"))&"'><input name='mc' type='hidden' value='"&shopnet("mc")&"'><input type='image' src='zf.gif'  border='0' name='submit' alt='现在支付'></form>"
case "西部支付"
response.write "您选择的是西部支付(易宝支付)方式<form action='https://www.yeepay.com/app-merchant-proxy/node' method='post'><input type='hidden' name='p0_Cmd'  value='Buy'><input type='hidden' name='p1_MerId'  value='"&xibuzhifuid&"'><input type='hidden' name='p3_Amt'  value='"&shopnet("allamount")&"'><input type='hidden' name='p4_Cur'  value='RMB'><input type='hidden' name='p5_Pid'    value='"&shopnet("mc")&"'><input type='hidden' name='p6_Pcat'   value='　'><input type='hidden' name='p7_Pdesc'  value='　'><input type='hidden' name='p8_Url'  value='http://www.zj168.net/payend.asp'><input type='hidden' name='p9_SAF'  value='1'><input type='hidden' name='pa_MP'  value=''><input type='hidden' name='hmac'  value='3c1dd2d86a56b34c43da3f40e1e70385'><input type='image' src='http://www.yeepay.com/images/ann_zf.gif'  border='0' name='submit' alt='支付'></form>"
case "E-gold"
response.write "您选择的是E-GOLD支付,请点击这里进行付款"
End Select
 %>   
        <br>
        </div>
        <table width="530" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor=#FF8A3C>
          <tr> 
            <td height="30" align="center" valign="top"   bgcolor=#FFEBDD> 
              如果您想知道自己的订单被处理的情况，<br>
            可随时进入“<a href="user/myshangpin.asp">我的账户</a>”查询</td>
          </tr>
      </table><br><br></td>
    </tr>
  </table><%session("buy")=""%>
<!--#include file="bottom.asp" -->
