<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<!--#include file="../include/conn.asp"-->
<!--#include file="../include/money.asp"-->
<!--#include file="../include/md5.asp"-->
<!--#include file="../include/coding.asp "-->
<!--#include file="../include/jmail.asp"-->	
<script language="javascript">
function checkQtys(form){
		ads.style.display = "none";
  document.all.WebBrowser.ExecWB(6,6)
 }
</script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../include/css.css" rel="stylesheet" type="text/css">
<noscript>
<iframe src="*.htm"></iframe>
</noscript>
</head>
<BODY oncontextmenu=self.event.returnValue=false onkeypress=movefocus();>
<%hy "login.asp"
set rs = conn.execute("select * from cart where id="&shopnet("id")&"")
usernamm()
%>
<table width="650" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="35" align="center" valign="middle">订单号：<font color="#FF3300" size="3"><%=rs("bh")%></font></td>
  </tr>
  <tr> 
    <td align="center" valign="top"> <table width="600" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FF9900">
        <tr align="center" valign="middle" bgcolor="#FFFFE6"> 
          <td width="300" height="20">商品名称</td>
          <td width="75" height="20">价格</td>
          <td width="75" height="20">订购数量</td>
        </tr>
        <%
		set rs1 = conn.execute("select * from list where bh='"&rs("bh")&"' order by id desc")
		do while not rs1.eof
        shuliang=rs1("sl")
		cpid=rs1("cpid")
		pay=rs1("pay")
		mmc=rs1("mc")
		mjg=rs1("jg2")
		mpay=rs1("pay")
		%>
        <tr valign="middle" bgcolor="#FFFFE6"> 
          <td width="300" height="20"><%=rs1("mc")%></td>
          <td width="75" height="20" align="center"><%=rs1("jg2")%></td>
          <td width="75" height="20" align="center"><%=shuliang%></td>
        </tr>
        <%rs1.movenext
loop
rs1.close
set rs1=Nothing
yongfei=rs("peisong_rmb")
allmoney=rs("je")
mshopname=rs("name")
%>
        <tr align="right" valign="middle" bgcolor="#FFFFE6"> 
          <td height="20" colspan="3">运费：<%=rs("peisong_rmb")%>元&nbsp; 总计： <%=rs("je")%> 元 &nbsp;&nbsp;&nbsp; </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td valign="top"><br> 
      <table width="600" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#999999">
        <tr bgcolor="#FFFFFF"> 
          <td height="35" colspan="6" align="center">会员<font color="#FF3300" size="3"><%=rs("huiyuan")%></font>个人信息</td>
        </tr>
        <tr valign="middle" bgcolor="#FFFFFF"> 
          <td width="11%" height="20" align="center">姓名</td>
          <td width="11%" height="20"><%=rs("name")%></td>
          <td width="8%" height="20" align="center">邮编</td>
          <td width="12%" height="20" align="center"><%=rs("yb")%></td>
          <td width="14%" height="20" align="center">配送</td>
          <td width="44%" height="20"><%=rs("peisong_fs")%></td>
        </tr>
        <tr valign="middle" bgcolor="#FFFFFF">
          <td height="20" align="center">支付方式</td>
          <td height="20" colspan="3"><%=rs("bz")%></td>
          <td height="20" align="center">付款状态</td>
          <td height="20"><%if pay="0" then %>未付款<%else%>已付款<%end if%></td>
        </tr>
        <tr valign="middle" bgcolor="#FFFFFF"> 
          <td width="11%" height="20" align="center">电话</td>
          <td height="20" colspan="3"><%=rs("tel")%></td>
          <td width="14%" height="20" align="center">邮箱</td>
          <td width="44%" height="20"><a href=mailto:<%=rs("mail")%>><%=rs("mail")%></a></td>
        </tr>
        <tr valign="middle" bgcolor="#FFFFFF"> 
          <td height="20" align="center">地址</td>
          <td height="20" colspan="5"><%=rs("dz")%></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td><br>
      <table width="600" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="20" valign="middle">产品脱销方案：<%=rs("tx")%></td>
        </tr>
        <tr> 
          <td height="20" valign="middle">会员订单备注：<%=rs("beizhu")%></td>
        </tr>
      </table></td>
  </tr>
</table><%If shopnet("type")<>"" And shopnet("id")<>"" Then%>
<CENTER><input name="button" type=button class="go-wenbenkuang" value=关闭窗口 onClick="javascript:self.close();"></CENTER>
<%else%>
<%if rs("cl")="0" and rs("cl")<>"2" then%><CENTER><INPUT TYPE="submit" class="go-wenbenkuang" value="受理该订单" onClick="location.href='?je=<%=rs("je")%>&x=shouli&id=<%=request("id")%>&memail=<%=rs("mail")%>&mname=<%=rs("name")%>&mmc=<%=mmc%>&mshopname=<%=mshopname%>&mshuliang=<%=shuliang%>&mjg=<%=mjg%>&yongfei=<%=yongei%>&zffs=<%=rs("bz")%>&allmony=<%=allmony%>&mpay=<%=mpay%>&allmony=<%=allmony%>'"></CENTER><%end if%>
<table width="650" height="50" border="0" align="center" cellpadding="0" cellspacing="0" id=ads style="DISPLAY: ">
  <form name="form2" method="post" action=?je=<%=rs("je")%>&x=yes&sl=<%=shuliang%>>
    <tr> 
      <td align="center" valign="middle"><input name="id" type="hidden" id="id" value="<%=request("id")%>"> <input name="cpid" type="hidden" id="cpid" value="<%=cpid%>"> 
	  <input name="memail" type="hidden" id="memail" value="<%=rs("mail")%>">
	  <input name="mname" type="hidden" id="mname" value="<%=name%>">
	  <input name="mshopname" type="hidden" id="mshopname" value="<%=mshopname%>">
	  <input name="mmc" type="hidden" id="mmc" value="<%=mmc%>">
	  <input name="mshuliang" type="hidden" id="mshuliang" value="<%=shuliang%>">
	  <input name="mjg" type="hidden" id="mjg" value="<%=mjg%>">
	  <input name="yongfei" type="hidden" id="yongfei" value="<%=yongfei%>">
	  <input name="allmoney" type="hidden" id="allmoney" value="<%=allmoney%>">
        <OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0>
        </OBJECT>
   
	       <%if rs("cl")<>"1" then%> <input name="button3" type=submit class="go-wenbenkuang"  onClick="javascript:window.history.go(-1)" value=OK，发货><%End If%>
        <input type=button class="go-wenbenkuang" onClick="return checkQtys(this.form);" value=订单打印> 
        <input type=button class="go-wenbenkuang" onclick=document.all.WebBrowser.ExecWB(8,1) value=页面设置> 
        <input type=button class="go-wenbenkuang" onclick=document.all.WebBrowser.ExecWB(7,1) value=打印预览> 
        <input name="button" type=button class="go-wenbenkuang" value=关闭窗口 onClick="javascript:self.close();">
        <input name="button2" type=button class="go-wenbenkuang" value=站内信联系订购会员 onClick="javascript:void window.showModelessDialog('../../zhanneixin/fa.asp?huiyuan=<%=rs("huiyuan")%>','','scroll:0;status:0;help:0;resizable:0;dialogWidth:420px;dialogHeight:280px')">      </td>
    </tr>
  </form>
</table>
</body>
</html>
<%rs.close
set rs=nothing
if request("x")="yes" and request("id")<>"" Then
id=shopnet("cpid")
sl=shopnet("sl")
conn.execute("Update huiyuan set je2=je2+("&shopnet("je")&"*"&my_je07&") where huiyuan=(select huiyuan from cart where id="&shopnet("id")&")")
conn.execute("Update chanpin set [number]=number-"&sl&" where id="&id)
conn.execute("Update cart set cl = 1 where id="&shopnet("id")&"")

'发信
usershopid=Request.Cookies(Rikee)("myuserid")
Set emrs1=conn.execute("select mail from shop where id="&usershopid&"")
If Not emrs1.eof Then
mfemail1=emrs1("mail")
End If
emrs1.close
Set emrs1=Nothing

email=shopnet("memail")

html="<html><head><title>感谢您的参与</title><meta http-equiv=Content-Type content=text/html;charset=gb2312></head><body bgcolor=#FFFFFF text=#000000>"
html=html&"亲爱的"&shopnet("mname")&",您好！<br><br>　 您在<a href=http://"&my_url&" target=_bland>"&my_name&"</a>上"&shopnet("mshopname")&"（店铺）所购买的"&shopnet("mshuliang")&"(件)"&shopnet("mmc")&"（商品）卖已发货，请注意查收！<br>"
html=html&"&nbsp;&nbsp;&nbsp;&nbsp;如有需要请发邮件至"&mfemail1&"与卖方联系！<br>"
nr=html&"<a href=http://"&my_url&" target=_bland>"&my_name&"</a><br><br>"&email_bd&"</body></html>"
bt= ""&my_name&"订单发货系统邮件通知"

if mailserver="0" then
smtp email,bt,nr
elseif mailserver="1" then
Call jmail1(email,bt,nr)

end if 





Response.Write("<script>alert(""订单处理成功！"");window.opener.location.href=""dingdan.asp"";self.close();</script>")
end if
if request("x")="shouli" and request("id")<>"" then
usershopid=Request.Cookies(Rikee)("myuserid")
Set emrs2=conn.execute("select mail from shop where id="&usershopid&"")
If Not emrs2.eof Then
mfemail2=emrs2("mail")
End If
emrs2.close
Set emrs2=nothing


Set zfrs=conn.execute("select * from fukuan where userid="&usershopid&"")
If Not zfrs.eof Then

Select Case shopnet("zffs")
Case "支付宝"
mjfs="支付宝帐号:"&zfrs("zhifubaoid")&"&nbsp;&nbsp;校验码:"&zfrs("zhifubaojiaoyanma")&""
Case "网银在线"
mjfs="网银在线支付ID:"&zfrs("wangyinzaixianid")&"&nbsp;&nbsp;网银在线校验码:"&zfrs("wangyinzaixianjiaoyanma")&""
Case "E-gold"
mjfs="E-gold Account:"&zfrs("egoldaccount")&"&nbsp;&nbsp;Account Name:"&zfrs("egoldname")&""
Case "邮局汇款"
mjfs="汇款地址:"&zfrs("huikuandizhi")&"&nbsp;&nbsp;收款人姓名:"&zfrs("huikuanname")&"&nbsp;&nbsp;邮编:"&zfrs("youbian")&""
Case "交通银行"
mjfs="银行帐号:"&zfrs("jiaotongyinhangid")&"&nbsp;&nbsp;收款人姓名:"&zfrs("jiaotongyinhangname")&"&nbsp;&nbsp;银行所在地:"&zfrs("jiaotongyinhangdizhi")&""
Case "招商银行"
mjfs="银行帐号:"&zfrs("zhaoshangyinhangid")&"&nbsp;&nbsp;收款人姓名:"&zfrs("zhaoshangyinhangname")&"&nbsp;&nbsp;银行所在地:"&zfrs("zhaoshangyinhangdizhi")&""
Case "中国银行"
mjfs="银行帐号:"&zfrs("zhongguoyinhangid")&"&nbsp;&nbsp;收款人姓名:"&zfrs("zhongguoyinhangname")&"&nbsp;&nbsp;银行所在地:"&zfrs("zhongguoyinhangdizhi")&""
Case "建设银行"
mjfs="银行帐号:"&zfrs("jiansheyinhangid")&"&nbsp;&nbsp;收款人姓名:"&zfrs("jiansheyinhangname")&"&nbsp;&nbsp;银行所在地:"&zfrs("jiansheyinhangdizhi")&""
Case "农业银行"
mjfs="银行帐号:"&zfrs("nongyeyinhangid")&"&nbsp;&nbsp;收款人姓名:"&zfrs("nongyeyinhangname")&"&nbsp;&nbsp;银行所在地:"&zfrs("nongyeyinhangdizhi")&""
Case "工商银行"
mjfs="银行帐号:"&zfrs("gongshangyinhangid")&"&nbsp;&nbsp;收款人姓名:"&zfrs("gongshangyinhangname")&"&nbsp;&nbsp;银行所在地:"&zfrs("gongshangyinhangdizhi")&""
Case "VISA"
mjfs="银行帐号:"&zfrs("visaid")&"&nbsp;&nbsp;收款人姓名:"&zfrs("visaname")&"&nbsp;&nbsp;银行所在地:"&zfrs("visadizhi")&""
Case Else
mjfs="不祥，请与卖家联系"
End select


End If
zfrs.close
Set zfrs=nothing



'conn.execute("Update huiyuan set je2=je2+("&shopnet("je")&"*"&my_je07&") where huiyuan=(select huiyuan from cart where id="&shopnet("id")&")")
conn.execute("Update cart set cl = 2 where id="&shopnet("id")&"")
'发信


email=shopnet("memail")
If shopnet("mpay")="0" Then
mpay="<br>您还没有付款，请尽快付款!"
Else
mpay="<br>"
End if
html="<html><head><title>感谢您的参与</title><meta http-equiv=Content-Type content=text/html;charset=gb2312></head><body bgcolor=#FFFFFF text=#000000>"
html=html&"亲爱的"&shopnet("mname")&",您好！<br><br>　 您在<a href=http://"&my_url&" target=_bland>"&my_name&"</a>上<font color=red>"&shopnet("mshopname")&"</font>（店铺）购买<font color=red>"&shopnet("mmc")&"</font>（商品）的订单，卖方已受理！<br>"
html=html&"&nbsp;&nbsp;&nbsp;&nbsp;单价：<font color=blue>"&mjg&"</font>&nbsp;&nbsp;数量：<font color=blue>"&shopnet("mshuliang")&"</font>&nbsp;&nbsp;运费<font color=blue>"&yongfei&"</font>&nbsp;&nbsp;总额：<font color=red>"&allmoney&"</font>！<br>"&mpay&""
html=html&"&nbsp;&nbsp;您选择的支付方式为:<font color=red>"&shopnet("zffs")&"</font>&nbsp;&nbsp;&nbsp;&nbsp;卖家帐号祥情如下:<br>"
html=html&"&nbsp;&nbsp;"&mjfs&"<br>"
html=html&"&nbsp;&nbsp;&nbsp;&nbsp;如有需要请发邮件至<font color=red>"&mfemail2&"</font>与卖方联系！<br>"
nr=html&"<a href=http://"&my_url&" target=_bland>"&my_name&"</a><br><br>"&email_bd&"</body></html>"
bt= ""&my_name&"订单受理系统邮件通知"

if mailserver="0" then
smtp email,bt,nr
elseif mailserver="1" then
Call jmail1(email,bt,nr)

end if 


Response.Write("<script>alert(""订单已经受理成功"");window.opener.location.href=""dingdan.asp"";self.close();</script>")
end if
conn.close
set conn=Nothing
End if
%>
