<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/Lebi_Config.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_sh.asp
'* 最后更新 2013-05-16 by 56770.kingdge
'*****************************************
Dim admin_flag
admin_flag=",1.6,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_sh.inc"
include "lang/"& LangFilePath &"/lang_ship.inc"
include "lang/"& LangFilePath &"/lang_order.inc"
CurrentId = 2
CurrentUrl = "admin_sh.asp"
LB_Head()
LB_Menu()
action = request("action")
%>
<div class="tabmenu mainwidth">
      <ul>
        <li <%If action <> "add" Then Response.Write("class=""current""") End If%>><a href="admin_sh.asp"><span><%=Lang_Menu(99)%></span></a></li>
        <li <%If action = "add" Then Response.Write("class=""current""") End If%>><a href="?action=add"><span><%=Lang_Sh(15)%></span></a></li>
      </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
		adminflag()
Else
		If OutSubmit = 1 Then CheckOutSubmit()
		Select Case action
			   case"add" :add()
			   case"save" :save()
			   case"list": list()
			   case"del" : del()
			   case"update" :update()
			   Case Else
					main()
		End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub del
        If OnlyRead = 1 Then OnlyReadMessage()
		id=safereplace(request("id"))
		if id="" then
			   response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
			   response.end
		end if
		conn.execute("Delete from [Lebi_user_sh] where id in("&Request("id")&")")
		ManageLog Lang_Sh(1) &" ["& id &"]"
		Response.redirect "?page="& request("page") &"&pagenum="& request("pagenum") &"&keyword="& request("keyword") &"&DateFrom="& request("DateFrom") &"&DateTo="& request("DateTo")
End Sub

Sub update
        If OnlyRead = 1 Then OnlyReadMessage()
		id = CheckNum(request("id"),0)
		ps = CheckNum(request("ps"),0)
		s_order_number = safereplace(request("s_order_number"))
		s_name = safereplace(request("s_name"))
		s_no = safereplace(request("s_no"))
		s_fei1 = CheckNum(request("s_fei1"),0)
		s_fei2 = CheckNum(request("s_fei2"),0)
		s_user_id = safereplace(request("s_user_id"))
		s_user_name = safereplace(request("s_user_name"))
		Set rs = server.createobject("adodb.recordset")
		rs.open "select orderzt,id,LangTxt,from_mobile from [Lebi_Orders] where order_number = '"& s_order_number &"'",conn,1,3
		If Not rs.eof Then
			If ps = 1 Then 
				rs(0) = rs(0) &",3,"
				rs.update
				If Config_Lebi_Eshop(23) = 2 Then '发货后扣除库存 by 56770.kingdge 2012-05-16
					Set rsbasket = conn.execute("select id,basket_count,spvalue from [lebi_basket] where order_number = "& rs(1) &"")
					Do While Not rsbasket.eof 
					conn.execute("update [Lebi_product] set buys = buys + "& rsbasket("basket_count")&",kucun = kucun - "& rsbasket("basket_count") &",html = 0 where id = " & rsbasket("id") &"")
					conn.execute("update [Lebi_Product_Stock] set p_buys = p_buys + "& rsbasket("basket_count") &",p_stock = p_stock - "& rsbasket("basket_count") &" where p_id =" & rsbasket("id") &" and s_value"& rs(2) &" = '"& rsbasket("spvalue") &"'")
					rsbasket.movenext 
					Loop
					rsbasket.close : Set rsbasket = Nothing 
				End If 
				If SMS_State = "1" Then
						If CheckMobile(rs(3)) Then
								Dim LoadSMSInfo,SMSMsg
								LoadSMSInfo = LoadStyle(Eshop_url&"include/lebi_data/SMS"& rs(2) &".data")
								If InStr(","& SMS_SendMode &",",",3,") > 0 Then
										SMSMsg = splits(Split(LoadSMSInfo,"@@@")(2))
										ReplaceStyle "user_id",s_user_id,SMSMsg
										ReplaceStyle "user_name",s_user_name,SMSMsg
										ReplaceStyle "time",Now(),SMSMsg
										ReplaceStyle "order_number",s_order_number,SMSMsg
										ReplaceStyle "sendtype",s_name,SMSMsg
										ReplaceStyle "sendno",s_no,SMSMsg
										Call RedirectSendSMS(rs(3),SMSMsg,0,"",sms_sendtype)
								End If
						End If
				End If
			End If 
		End If
		rs.close : Set rs = Nothing
		Set rs = server.createobject("adodb.recordset")
		rs.open "select * from [Lebi_ShipMes] where s_id = "& id &"",conn,1,3
		If rs.eof Then
				rs.addnew
				rs("s_id") = id
				rs("s_date") = Date()
				If s_user_id <> "" And s_fei2 <> 0 Then
						conn.execute("update [Lebi_User] set usermoney = usermoney + "& s_fei2 &" where user_id = '"& s_user_id &"'")
						conn.execute("insert into [Lebi_money_log](m_user_id,m_order_num,m_sj,m_type,m_price,m_zt)values('"& s_user_id &"','"& s_order_number &"',"& sqlnowstring &",'["& Safereplace(Eshop_Lebi_name) &"]"& Lang_Ship(3) & formatnumber2(s_fei2) &"',"& s_fei2 &",1)")
				End If
		End If 
		rs("s_name") = s_name
		rs("s_no") = s_no
		rs("s_fei1") = s_fei1
		rs("s_fei2") = s_fei2
		rs("s_user_id") = s_user_id
		rs("s_user_name") = s_user_name
		rs("s_order_number") = s_order_number
		rs.update
		rs.close : Set rs = Nothing
		conn.execute("update [Lebi_user_sh] set ps="&ps&" where id="& id &"")
		ManageLog Lang_Sh(2) &" ["& orderid &"]"
		Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,"?action=list&id="& id,0,0,2,1)
End sub

Sub main
		page = checknum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		datefrom = safeReplace(request("datefrom"))
		dateto = safeReplace(request("dateto"))
		keyword = safereplace(Trim(request("keyword")))
		state = safeReplace(request("state"))
		Dim ors
		Set ors=new Cls_vbsPage
		Set ors.Conn=conn
		With ors
		.PageSize=pagenum
		.PageName="Page"
		If IsSqlDataBase = 0 Then
				.DbType="AC"
		Else
				.DbType="MSSQL"
		End If
		.RecType=-1
		.Pkey="id"
		.Field="id,bh,name,tel,sj,ps,dz"
		.Table="[Lebi_user_sh]"
		sql = "1=1"
		if keyword<>"" then sql=sql&" and (name like '%"&keyword&"%' or bh like '%"&keyword&"%' or dz like '%"&keyword&"%' or tel like '%"&keyword&"%')"
		If IsSqlDataBase = 1 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff(d,sj,'"& datefrom &"')<=0 and DateDiff(d,sj,'"& dateto &"')>=0"
		If IsSqlDataBase = 0 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff('d',sj,'"& datefrom &"')<=0 and DateDiff('d',sj,'"& dateto &"')>=0"
		If state <> "" Then sql = sql &" and ps = "& state
		.Condition=sql
		.OrderBy="id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script language="javascript" src="inc/js/MyCalendar.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<tr>
<form name="Lebi" method="get" action="?">
<td height="30" align="left" class="classhead">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="padding-left:5px;">
	<select name="state">
	<option value="">┌ <%=Lang_Sh(8)%></option>
	<option value="0"<%=judge2(0,state)%>>├ <%=Lang_Sh(12)%></option>
	<option value="1"<%=judge2(1,state)%>>├ <%=Lang_Sh(11)%></option>
	</select>
</td>
<td style="padding-left:5px;">
      <input type="text" name="dateFrom" value="<%=dateFrom%>" size="12" class="form_calendar" onclick="setday(this)" /> - <input type="text" name="dateTo" value="<%=dateTo%>" size="12" class="form_calendar" onclick="setday(this)" />
</td>
<td style="padding-left:5px;"><input name="keyword" type="text" title="<%=Lang_Sh(3)%>" class="form_query" size="15"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
</tr>
</table>
</td>
</form>
<td align="right" class="classhead">
<%=QuickMenu("Admin_buy.asp|"& Lang_Menu(98) &"","Admin_payment_inform.asp|"& Lang_Menu(55) &"")%>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="list" class="classtable2">
<tbody>
<form name="Lebi" method="post" action="?action=del">
<tr>
<td height="30" class="classhead" align="left" colspan="2">
<input type="image" name="Submit" title=" <%=Lang_sys(15)%> " onClick="return confirm('<%=Lang_sys(64)%>')" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
<input type="image" title=" <%=Lang_sys(5)%> " onclick="location.href='?action=add';return false;" src="lang/<%=LangFilePath%>/images/bt_add.gif" align="absmiddle">
<input type="hidden" name="page" value="<%=page%>">
<input type="hidden" name="keyword" value="<%=keyword%>">
<input type="hidden" name="dateFrom" value="<%=dateFrom%>">
<input type="hidden" name="dateTo" value="<%=dateTo%>">
<input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
<td height="30" class="classhead" align="right" colspan="6"><%=ors.ShowPageHead(page)%></td>
</tr>
  <tr>
     <td width="5%" height="30" class="classtop" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
     <td width="15%" class="classtop"><%=Lang_Sh(7)%></td>
     <td width="15%" class="classtop"><%=Lang_Sh(4)%></td>
     <td width="10%" class="classtop"><%=Lang_Sh(5)%></td>
	 <td width="15%" class="classtop"><%=Lang_Sh(6)%></td>
	 <td width="24%" class="classtop"><%=Lang_Sh(40)%></td>
     <td width="10%" class="classtop"><%=Lang_Sh(8)%></td>
     <td width="6%" class="classtop"><%=Lang_Sh(9)%></td>
  </tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
  <tr class="classrow">
    <td height="30" class="classrow"><input type="checkbox" name="id" value="<%=DataList(0,i)%>"></td>
    <td class="classrow"><%=DataList(4,i)%></td>
    <td class="classrow"><a href="?action=list&id=<%=DataList(0,i)%>"><%=DataList(1,i)%></a></td>
	<td class="classrow"><%=DataList(2,i)%>&nbsp;</td>
	<td class="classrow"><%=DataList(3,i)%>&nbsp;</td>
	<td class="classrow"><%=DataList(6,i)%>&nbsp;</td>
    <td class="classrow"><%If DataList(5,i)="1" Then response.write"<a href='?action=update&ps=1&orderid="&DataList(0,i)&"&backurl=admin_sh.asp?page="&page&"&back_url=?' title='"& Lang_Sh(10) &"'><font color=red>"& Lang_Sh(11) &"</font></a>" Else response.write"<a href='?action=update&ps=0&orderid="&DataList(0,i)&"&backurl=admin_sh.asp?page="&page&"&back_url=?' title='"& Lang_Sh(10) &"'>"& Lang_Sh(12) &"</a>" End if%>
	</td>
	<td class="classrow"><a href="?action=list&id=<%=DataList(0,i)%>"><img src="images/icon_edit.gif" width="16" height="16" title="<%=Lang_sys(51)%>" border="0"></a></td>
  </tr>
<%
        Next
End If
%>
</form>
<tr>
	<td height="30" class="classfooter" colspan="2"><%=GetPageNum(15,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="6"><%=ors.ShowPageFoot(page)%></td>
</tr>
</tbody>
</table>
<script>tdshow("list");</script>
<%
End Sub
Select case Request("x")
	   case "a"
			conn.execute("Delete from [Lebi_user_sh] where id="& CheckNum(Request("id"),0) &"")
			Response.redirect "user_sh_add1.asp?id="&session("id")&""
	   case "b"
			conn.execute("Delete from [Lebi_user_sh_sj] where id="& CheckNum(Request("id"),0) &"")
			Response.redirect "?page="&Request("page")&""
End Select

Sub add()
		yy=year(date)
		mm=right("00"&month(date),2)
		dd=right("00"&day(date),2)
%>
		<script language="JavaScript">
		function CheckForm()
		{
			if (CheckEmpty('sj')){ShowMessage('sj','<%=Lang_Sh(13)%>');return false;}
			if (CheckEmpty('bh')){ShowMessage('bh','<%=Lang_Sh(14)%>');return false;}
		}
		</script>
		<script language="javascript" type="text/javascript" src="inc/js/MyCalendar.js"></script>
         <table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable" id="add">
		   <form method="post" action="admin_sh.asp" onSubmit="return CheckForm();">
            <tr>
              <td class="classhead" height="30" align="left">
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
			</td>
			<td class="classhead" align="right">
			<%=QuickMenu("","")%>
			</td>
           </tr>
            <tr>
              <td class="classtop" colspan="2" height="30"><%=Lang_Sh(15)%></td>
           </tr>
           <tr class="classrow">
              <td width="15%" height="30" class="classrow"><%=Lang_Sh(16)%></td>
              <td width="85%" class="classrow">
                <input id="sj" name="sj" type="text" value="<%=date()%>" size="20" class="calendar" onclick="setday(this)" /> <span id="mes_sj"></span>
             </td>
            </tr>
		   <tr class="classrow">
              <td height="30" class="classrow"><%=Lang_Sh(17)%></td>
              <td class="classrow">
                  <input name="bh" type="text" class="form" id="bh" size="20" maxlength="20"> <span id="mes_bh"></span>
                  <!--<input name="lx" type="checkbox" id="lx" value="1"><font color="#FF3333">电话订单</font>-->
             </td>
            </tr>
            <tr>
              <td colspan="2" height="30" align="left" class="classfooter">
                <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
                <input name="action" type="hidden" value="save">
				<input name="s_type" type="hidden" value="0">
              </td>
            </tr>
         </form>
		 <!--
        <tr>
           <td height="30" colspan="11" class="classfaq">
		  <div class="faq_main">
		  <p class="faq_title"><%=Lang_sys(49)%></p>
		  如果是电话订单 请选择 <input type="checkbox" checked><font color="#FF3333">电话订单</font>。
		  </div>
		  </td>
        </tr>
		-->
        </table>
		<script>tdshow("add");</script>
<%
End Sub

Sub save()
       sj=safereplace(request("sj"))
	   s_type = request("s_type")
       if safereplace(request("bh"))<>"" Then
	          Set rss=Server.CreateObject("ADODB.Recordset")
			  sql="select bh from [Lebi_user_sh] where bh='"& safereplace(request("bh")) &"'"
			  rss.open sql,conn,1,1
			  If not rss.eof Then
			          If s_type = 0 Then
                              response.write "<script language='javascript'>alert('"& Lang_Sh(18) &"');history.back();</script>"
					  Else
                              response.write "<script language='javascript'>alert('"& Lang_Sh(18) &"');window.close();</script>"
					  End If
					  response.End
			  Else
	                 if request("lx")<>"" then
	                        lx=1
	                        set rs = conn.execute("select * from [Lebi_ordertel] where t_id="& safereplace(request("bh")) &"")
                                   if rs.eof Then
                                          If s_type = 0 Then
    	                                          response.write "<script language='javascript'>alert('"& Lang_Sh(19) &"');history.back();</script>"
										  Else
    	                                          response.write "<script language='javascript'>alert('"& Lang_Sh(19) &"');window.close();</script>"
										  End If
								          response.end
                                   else
	                                      conn.execute("Insert into [Lebi_user_sh] (bh,lx,dz,name,tel,bz,sj)values("&rs("t_id")&","&lx&",'"&rs("t_add")&"','"&rs("t_name")&"','"&rs("t_tel")&"','"&rs("t_biaozhi")&"','"&sj&"')")
                                   end If
                            rs.close:Set rs=nothing
	                 else
                            sql="select * from [Lebi_orders] where order_number='"& safereplace(request("bh")) &"'"
                            Set rs = conn.execute(sql)
                            if rs.eof Then
                                   If s_type = 0 Then
                                           response.write "<script language='javascript'>alert('"& Lang_Sh(19) &"');history.back();</script>"
								   Else
                                           response.write "<script language='javascript'>alert('"& Lang_Sh(19) &"');window.close();</script>"
								   End If
						       	   response.end
                            Else
								   If sys_soft = 0 Then
										conn.execute("Insert into [Lebi_user_sh] (bh,dz,name,tel,bz,sj)values("&rs("order_number")&",'"&rs("to_adds")&"','"&rs("to_name")&"','"&rs("to_tel")&"','"&rs("to_other")&"','"&sj&"')")
								   Else
										conn.execute("Insert into [Lebi_user_sh] (bh,dz,name,tel,bz,sj)values("&rs("order_number")&",'"&rs("from_adds")&"','"&rs("from_name")&"','"&rs("from_tel")&"','"&rs("from_other")&"','"&sj&"')")
								   End If 
                            end If
                            rs.close:Set rs=nothing
                     end If
              End If
			  rss.close:Set rss=nothing
			  ManageLog Lang_Sh(20) &" ["& safereplace(request("bh")) &"]"
       Else
              response.write"<script language='javascript'>alert('"& Lang_Sh(14) &"');javascript:history.back();</script>"
			  response.End
	   End If
	   If s_type = 0 Then
              response.redirect"?"
	   Else
              response.write "<script language='javascript'>alert('"& Lang_Sh(21) &"');window.close();</script>"
	   End If
	   response.end
End Sub

Sub list()
id = CheckNum(request("id"),0)
set rs = conn.execute("select bh,lx,ps,sj from [Lebi_user_sh] where id="& id &"")
%>
<script type="text/javascript">
function CheckForm(theform)
{
	if (Empty(theform.s_name))
	{
		EinnerHTML(theform.s_name,C_s_name,'<%=Lang_Ship(30)%>');return false;
	}else{
	    SinnerHTML(theform.s_name,C_s_name,'');
	}
	if (Empty(theform.s_no))
	{
		EinnerHTML(theform.s_no,C_s_no,'<%=Lang_Ship(31)%>');return false;
	}else{
	    SinnerHTML(theform.s_no,C_s_no,'');
	}
	if (Empty(theform.s_fei1) || checknum(theform.s_fei1.value) == 0)
	{
		EinnerHTML(theform.s_fei1,C_s_fei1,'<%=Lang_Ship(32)%>');
		theform.s_fei1.value = ''
		return false;
	}else{
	    SinnerHTML(theform.s_fei1,C_s_fei1,'');
	}
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="info" class="classtable-top">
   <tr>
      <td align="right" height="30" colspan="4" class="classhead">
      <%=QuickMenu("","")%>
      </td>
    </tr>
  <tr>
 <td height="30" class="classtop" colspan="4"><%=Lang_Sh(22)%></td>
</tr>
<%
If rs.eof then
       response.write"<tr><td colspan='2' align='center' height='30' bgcolor='#FFFFFF'>"& Lang_Sh(23) &"</td></tr>"
Else
set rsorder = conn.execute("select * from [Lebi_orders] where order_number='"&rs("bh")&"'")
If Not rsorder.eof Then 
to_name=rsorder("to_name")
to_zip=rsorder("to_zip")
to_tel=rsorder("to_tel")
to_tel2=rsorder("to_tel2")
to_adds=rsorder("to_adds")
to_other=rsorder("to_other")
to_mobile=rsorder("to_mobile")
from_name=rsorder("from_name")
from_zip=rsorder("from_zip")
from_tel=rsorder("from_tel")
from_adds=rsorder("from_adds")
from_adds2=rsorder("from_adds2")
from_other=rsorder("from_other")
from_email=rsorder("from_email")
from_mobile=rsorder("from_mobile")
from_city=rsorder("from_city")
from_state=rsorder("from_state")
from_country=checknum(rsorder("from_country"),0)
fuyan=rsorder("fuyan")
iffapiao=rsorder("iffapiao")
fapiao_money = rsorder("fapiao_money")
fapiao_company=rsorder("fapiao_company")
fapiao_adds=rsorder("fapiao_adds")
fapiao_zip=rsorder("fapiao_zip")
End If 
rsorder.close
set rsorder=Nothing
%>
<tr class="classrow">
  <td width="15%" height="30" class="classrow"><%=Lang_Sh(17)%></td>
  <td class="classrow"><%=rs("bh")%> <%if rs("lx")=1 then Response.Write ("["& Lang_Sh(24) &"]")%></td>
	<td width="15%" height="30" class="classrow"><%=Lang_Sh(16)%></td>
	<td width="35%" class="classrow"><%=rs("sj")%>&nbsp;</td>
</tr>
<%If sys_soft = 0 Then%>
<tr class="classrow">
<td height="30" colspan="4" class="classtop"><%=Lang_Order(20)%></td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Order(54)%></td>
<td width="35%" class="classrow"><%=to_name%>&nbsp;</td>
<td width="15%" height="30" class="classrow"><%=Lang_Order(120)%></td>
<td width="35%" class="classrow"><%=to_mobile%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" width="15%" align="left" class="classrow"><%=Lang_Order(9)%></td>
<td class="classrow"><%=to_tel%>&nbsp;</td>
<td width="15%" height="30" class="classrow"><%=Lang_Order(56)%></td>
<td class="classrow"><%=to_tel2%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" width="15%" align="left" class="classrow"><%=Lang_Order(12)%></td>
<td class="classrow"><%=to_zip%>&nbsp;</td>
<td width="15%" height="30" class="classrow"><%=Lang_Order(11)%></td>
<td class="classrow"><%=to_adds%>&nbsp;</td>
</tr>
<%if to_other<>"" Then%>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Order(55)%></td>
<td colspan="3" class="classrow"><%=to_other%>&nbsp;</td>
</tr>
<%End If%>
<%Else
If InStr(from_tel,",") = 0 Then from_tel = from_tel &",,"
%>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Order(54)%></td>
<td width="35%" class="classrow"><%=from_name%>&nbsp;</td>
<td width="15%" height="30" class="classrow"><%=Lang_Order(120)%></td>
<td width="35%" class="classrow"><%=from_mobile%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" width="15%" align="left" class="classrow"><%=Lang_Order(9)%></td>
<td class="classrow">(<%=Trim(split(from_tel,",")(0))%>).<%=Trim(split(from_tel,",")(1))%>.<%=Trim(split(from_tel,",")(2))%></td>
<td width="15%" height="30" class="classrow"><%=Lang_Order(10)%></td>
<td class="classrow"><%=from_email%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" width="15%" align="left" class="classrow"><%=Lang_Order(11)%></td>
<td class="classrow"><%=from_adds%>&nbsp;&nbsp;<%=from_adds2%></td>
<td height="30" width="15%" align="left" class="classrow"><%=Lang_Order(186)%></td>
<td class="classrow"><%=from_city%>&nbsp;</td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Order(187)%></td>
<td class="classrow"><%=from_state%>&nbsp;</td>
<td height="30" width="15%" align="left" class="classrow"><%=Lang_Order(12)%></td>
<td class="classrow"><%=from_zip%>&nbsp;</td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Order(188)%></td>
<td colspan="3" class="classrow">
<%
Set country = conn.execute("Select area_name from [lebi_deliver_area] where id = "& from_country &"")
If Not country.eof Then
	response.write(Country(0))
End If
country.close : Set country = Nothing
%>&nbsp;
</td>
</tr>
<%if to_other<>"" Then%>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Order(55)%></td>
<td colspan="3" class="classrow"><%=from_other%>&nbsp;</td>
</tr>
<%End If%>
<%End If%>
<%if fapiao_company <> "" then%>
<tr>
<td colspan="4" height="30" class="classtop"><%=Lang_Order(62)%></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Order(64)%></td>
<td class="classrow"><%=fapiao_company%></td>
<td height="30" class="classrow"><%=Lang_Order(65)%></td>
<td class="classrow"><%=fapiao_adds%></td>
</tr>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Order(12)%></td>
<td colspan=3 class="classrow"><%=fapiao_zip%></td>
</tr>
<%end if%>
<%if fuyan <> "" then%>
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_Order(143)%></td>
<td colspan=3 class="classrow"><%=fuyan%></td>
</tr>
<%end if%>
</table>
<%
Set rsship = conn.execute("select * from [Lebi_ShipMes] where s_order_number = '"& rs("bh") &"'")
If Not rsship.eof Then
s_name = rsship("s_name")
s_no = rsship("s_no")
s_fei1 = rsship("s_fei1")
s_fei2 = rsship("s_fei2")
s_user_name = rsship("s_user_name")
s_user_id = rsship("s_user_id")
Else
	    set rsorder = conn.execute("select sendtype,fei,from_name,user_id from [Lebi_orders] where order_number='"&rs("bh")&"'")
		If Not rsorder.eof Then
                s_name = rsorder("sendtype")
				s_fei1 = rsorder("fei")
				s_user_name = rsorder("from_name")
				s_user_id = rsorder("user_id")
		End If
        rsorder.close:set rsorder=Nothing
End If 
rsship.close : Set rsship = Nothing
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="update" class="classtable">
<form name="update" method="post" action="?action=update" onSubmit="return CheckForm(this);">
<tr>
	<td height="30" class="classhead" colspan="2"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"><input type="hidden" name="id" value="<%= id %>"><input type="hidden" name="s_order_number" value="<%= rs("bh") %>"><input type="hidden" name="s_user_name" value="<%= s_user_name %>"><input type="hidden" name="s_user_id" value="<%= s_user_id %>"></td>
</tr>
<tr>
 <td height="30" class="classtop" colspan="2"><%=Lang_Sh(10)%></td>
</tr>
<tr class="classrow">
  <td height="30" class="classrow"><%=Lang_Sh(25)%></td>
  <td class="classrow"><input type="radio" name="ps" value="0" <%=judge(rs("ps"),0)%>> <%=Lang_Sh(12)%>
  <input type="radio" name="ps" value="1" <%=judge(rs("ps"),1)%>> <%=Lang_Sh(11)%>
  </td>
</tr>
<tr class="classrow">
	<td width="15%" height="30" class="classrow"><%=Lang_Ship(19)%></td>
	<td class="classrow"><input type="text" name="s_name" value="<%= s_name %>" size="40" class="form"> <span id="C_s_name"><%=Lang_Ship(18)%></span></td>
</tr>
<tr class="classrow">
	<td height="30" class="classrow"><%=Lang_Ship(20)%></td>
	<td class="classrow"><input type="text" name="s_no" value="<%= s_no %>" size="40" class="form"> <span id="C_s_no"><%=Lang_Ship(18)%></span></td>
</tr>
<tr class="classrow">
	<td height="30" class="classrow"><%=Lang_Ship(21)%></td>
	<td class="classrow"><input type="text" name="s_fei1" value="<%= s_fei1 %>" size="10" class="form"> <span id="C_s_fei1"><%=Lang_Ship(18)%></span></td>
</tr>
<tr class="classrow">
	<td height="30" class="classrow"><%=Lang_Ship(22)%></td>
	<td class="classrow"><input type="text" name="s_fei2" value="<%= s_fei2 %>" size="10" class="form"> </td>
</tr>
</form>
</table>
<script>tdshow("info");tdshow("update");</script>
<%
	set rss = conn.execute("select id,order_time from [Lebi_orders] where order_number='"&rs("bh")&"'")
	If rss.eof Then
			conn.execute("delete from [Lebi_user_sh] where id="&request("id")&"")
			Response.Write("<script>alert("""& Lang_Sh(31) &""");window.history.go(-1);</script>")
			Response.End
			orderid=0
	Else
			orderid=rss("id")
			order_time=rss("order_time")
	End If
	rss.close:set rss=Nothing
	Set rscart = conn.execute("select * from [Lebi_basket] where order_number="&orderid&" and father=1 and isgift=0")
	If Not rscart.eof Then
%>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" id="product" class="classtable2">
          <tr class="classtop">
	         <td width="15%" height="30" class="classtop"><%=Lang_Sh(32)%></td>
	         <td width="65%" class="classtop"><%=Lang_Sh(33)%></td>
	         <td width="10%" class="classtop"><%=Lang_Sh(36)%></td>
	         <td width="10%" class="classtop"><%=Lang_Sh(37)%></td>
          </tr>
<%
       DO While NOT rscart.EOF
			If rscart("product_type") = "unite" Then	'WangLei 2008-1-15
				pName = "<img src=""images/unite.gif"" title="""& Lang_Sh(38) &""" border=""0"">"&rscart("product_name")&"("&getUniteChild(rscart("id"),0,"&nbsp;|&nbsp;")&")"
			Else
				pName = rscart("product_name")
				If rscart("spname") <> "" Then 
						spstr = ""
						If InStr(rscart("spname"),",") > 0 Then 
								arr_spname = Split(rscart("spname"),",")
								arr_spvalue = Split(rscart("spvalue"),",")
								For s = 0 To UBound(arr_spname)
										spstr = spstr & arr_spname(s) &"："& arr_spvalue(s)
										If s < UBound(arr_spname) Then spstr = spstr & "&nbsp;&nbsp;"
								Next 
						Else
								spstr = rscart("spname") &"："& rscart("spvalue")
						End If 
						pName = pName &"<br/><em>"& spstr &"</em>"
				End If
			End If
%>
           <tr class="classrow">
	         <td height="30" class="classrow"><%=rscart("bianhao")%></td>
	         <td class="classrow"><%=pName%></td>
	         <td class="classrow"><%=FormatNumber2(rscart("price"))%></td>
	         <td class="classrow"><%=rscart("basket_count")%></td>
	       </tr>
<%
        set rss = conn.execute("select * from [Lebi_basket] where order_number="&orderid&" and id="&rscart("id")&" and father=0 order by basket_id asc")
        do while not rss.eof
%>
        <tr class="classrow">
          <td height="30" class="classrow">--</td>
          <td height="30" class="classrow">--</td>
          <td class="classrow"><%=Replace(FormatNumber(rss("price"),2),",","")%></td>
          <td class="classrow"><%=rss("basket_count")%></td>
        </tr>
<%
        rss.movenext
        loop
    rscart.MoveNext
    Loop
    rscart.close:Set rscart=Nothing
	%></table>
	<script>tdshow("product");</script>
	<%
	End If
        sqlcart="select * from [Lebi_basket] where order_number="&orderid&" and isgift=1"
        Set rscart = conn.execute (sqlcart)
		If Not rscart.eof Then
%>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" id="gift" class="classtable" style="margin-top:5px;">
          <tr>
	         <td width="90%" height="30" class="classtop"><%=Lang_Sh(39)%></td>
	         <td width="10%" class="classtop"><%=Lang_Sh(37)%></td>
          </tr>
<%
       DO While NOT rscart.EOF
%>
           <tr class="classrow">
	         <td height="30" class="classrow"><%=rscart("product_name")%></td>
	         <td class="classrow"><%=rscart("basket_count")%></td>
	       </tr>
<%
    rscart.MoveNext
    Loop
    rscart.close:Set rscart=Nothing
	%></table>
	<script>tdshow("gift");</script>
	<%
	End If
End If
rs.close:Set rs=Nothing
%>
<%End sub%>