<!--#include file="../include/nowshop.asp"-->
<!--#include file="../md5.asp"-->
<!--#include file="checkadmin.asp"-->
  <%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("04")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<%
action=request("action")
if action="print" then
call order_print()
else
call order()
end if


sub order_print()
OrderNum=request("ID")
set rs=conn.execute("select A.ordertime,b.ordersum,A.Userid,A.OrderNum,A.PEI,A.FEI,A.ProdId,A.BuyPrice,A.ProdUnit,B.thiskou,B.Memo,B.Status,B.Recname,B.Recname2,B.RecPhone,B.RecPhone2,B.Recmail,B.Recmail2,B.RecAddress,B.RecAddress2,B.Zipcode,B.Zipcode2,B.Province,B.Province2,B.city,B.city2,B.Fetch_Mode,B.Paytype,B.Notes,B.Compphone,B.gettime,C.ProdName from bOrder A,bOrderList B,bproduc C where A.OrderNum='"&OrderNum&"' and A.OrderNum = B.OrderNum and A.ProdId=C.Prodid")
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
set rs2 = conn.Execute("select * from type where Status='"&rs("Status")&"'")
fei=rs("fei")
%>
<table width="98%" border="1"style="border-collapse: collapse; border-style: dotted; border-width: 0px"bordercolor="#333333" cellspacing="0" cellpadding="2">
<tr><td colspan=2 height=40 align=center><b><%=sitename%> 打印订单 </b>&nbsp; &nbsp;&nbsp; &nbsp;打印时间：<%=now()%></td></tr>
	<INPUT TYPE="hidden" name=edit value=ok>
	<INPUT TYPE="hidden" name=Id value=<%=rs("OrderNum")%>>	
	<tr><td align='right' width=20%>订单时间：</td><td><%=rs("Ordertime")%></td></tr>
	<tr><td align='right'>订单金额：</td><td><%=formatnumber(rs("Ordersum"),2)%></td></tr>
	<tr><td align='right'>订 单 号：</td><td><%=rs("OrderNum")%></td></tr>
	<tr><td align='right'>会员ID：</td><td><%=rs("userid")%></td></tr>
	<tr><td align='right'>配送方式：</td><td><%=rs("pei")%></td></tr>	
	<tr><td align='right'>收货姓名：</td><td><%=rs("Recname")%></td></tr>
	<tr><td align='right'>联系电话：</td><td><%=rs("RecPhone")%></td></tr>
	<tr><td align='right'>移动电话：</td><td><%=rs("CompPhone")%></td></tr>
	<tr><td align='right'>电子邮箱：</td><td><%=rs("Recmail")%></td></tr>
	<tr><td align='right'>邮政编码：</td><td><%=rs("Zipcode")%></td></tr>
	<tr><td align='right'>收货地址：</td><td><%=rs("RecAddress")%></td></tr>
		<% if rs("Fetch_Mode")=1 then %>
    <tr bgcolor="#FFFFFF">
      <td align='right'><font color="#FF0000">定货人送给：</font></td>
      <td><%=rs("Recname2")%></td>
    </tr>
	    <tr bgcolor="#FFFFFF">
      <td align='right'><font color="#FF0000">省份：</font></td>
      <td><%=rs("Province2")%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align='right'><font color="#FF0000">城市：</font></td>
      <td><%=rs("city2")%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align='right'><font color="#FF0000">地址：</font></td>
      <td><%=rs("RecAddress2")%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align='right'><font color="#FF0000">邮政编码：</font></td>
      <td><%=rs("Zipcode2")%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align='right'><font color="#FF0000">电话：</font></td>
      <td><%=rs("RecPhone2")%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td align='right'><font color="#FF0000">电子邮箱：</font></td>
      <td><%=rs("Recmail2")%></td>
    </tr>

	<% end if %>

	<tr><td align='right'>送货时间：</td><td><%=rs("gettime")%></td></tr>
	<tr><td align='right'>顾客说明：</td><td><%=rs("Notes")%></td></tr>
	<tr><td align='right'>订单处理：</td><td><%=rs("Memo")%></td></tr>
	<tr><td align='right' height=30>订单状态：</td><td><%=rs2("StatusDefine")%></select></td></tr>

<tr><td align=right>购物清单：</td><td>
<table width="100%" border="1" style="border-collapse: collapse; border-style: dotted; border-width: 0px"bordercolor="#333333" cellspacing="0" cellpadding="3">
	<tr><td>商品编号</td><td>商品名称</td><td>购买数量</td><td>结算单价</td><td>金额</td></tr>
<%
	Total = 0
	do while not rs.eof 
	Sum = rs("ProdUnit")* csng(rs("BuyPrice")) * csng(rs("thiskou"))/10
	Sum = FormatNumber(Sum,2) 
	Total = Sum + Total
	
	response.write "<tr><td>"&rs("ProdId")&"</td><td>"&rs("ProdName")&"</td>"
	response.write "<td>"&rs("ProdUnit")&"</td>"
	response.write "<td>"&FormatNumber(csng(rs("BuyPrice")) * csng(rs("thiskou"))/10,2)&"</td>"
	response.write "<td>"&Sum&"</td></tr>"

	rs.movenext
	loop

%>
<TR><TD colspan='5'>
商品总价：<%=FormatNumber(Total,2)%><br>
配送费用：<%=formatnum(fei,2)%><br>
总计费用：<font color=red><b><%=FormatNumber((Total+fei),2)%></b></font> 元
</td></TR></table>

</td></tr>
<tr><td colspan=2>
	<input type='button' name='pnt' value='打印订单' onclick="javascript:window.print();">
</td></tr>
</table>

<%
set rs=nothing
set rs2=nothing
end sub


sub order()
%>
<body bgcolor="#D9EAFC">
<table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% 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><font color="#FF0000">&nbsp;订单打印</font></B></font></TD>
              </TR>
            </TBODY>
          </TABLE>
		  <table height="5"><tr><td></td></tr></table>

<table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
  <form action=order4.asp?action=print method=post>
    <tr bgcolor="#FFFFFF">
      <td align='center'>请填订单号：</td>
      <td><input type="text" name="id" style="overflow:auto;" size=30 maxlength=15></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan=2 height=25><input type='submit' name='action' value='生成打印件'></td>
    </tr>
  </form>
</table>
<table width="95%" border="0">
  <tr> 
    <td height="60"><font color="#FF0000">我们将为购买正版NowShop商城系统者免费设计全套广告图片；提供免费安装调试；免费送1%网银接口、支付宝接口；免费提供技术支持；免费提供系统升级；免费提供系统模板更换；免费代办网站ICP备案；使您的网店更具吸引力！</font></td>
  </tr>
  <tr> 
    <td><p>购买咨询或技术支持，请在周一至周五8：00-18：00间联系<br>
        Email / MSN：shop@nowshop.com.cn<br>
        电话：0551-5123308&nbsp;&nbsp;13965090551<br>
        QQ：2055008<br>
        网站：<a href="http://www.nowshop.com.cn" target="_blank">http://www.nowshop.com.cn</a><br>
        演示：<a href="http://ys.nowshop.com.cn" target="_blank">http://ys.nowshop.com.cn</a><br>
      </p>
      <p>Powerd By：NowShop商城系统 V3.5</p></td>
  </tr>
</table>
</body>
<%
end sub
%>

