<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../Include/Lebi_config.asp"-->
<!--#include file="../union/config.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_orders.asp
'* 最后更新 2013-6-14 by 56770.kingdge
'*****************************************
Dim admin_flag
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_order.inc"
include "lang/"& LangFilePath &"/lang_user.inc"
CurrentId = 2
CurrentUrl = "admin_orders.asp"
LB_Head()
LB_Menu()
user_id = SafeReplace(request("user_id"))
%>
<div class="tabmenu mainwidth">
      <ul>
	  <%If user_id = "" Or request("submit.x") = "0" Then%>
			<li <%If request("orderzt") = "" And request("is_booking") = "" And request("action") = "" Then Response.Write("class=""current""") End If%>><a href="admin_orders.asp"><span><%=Lang_Menu(89)%></span></a></li>
			<li <%If request("orderzt") = "0" Then Response.Write("class=""current""") End If%>><a href="Admin_orders.asp?orderzt=0"><span><%=Lang_Menu(91)%></span></a></li>
			<li <%If request("orderzt") = "1" Then Response.Write("class=""current""") End If%>><a href="Admin_orders.asp?orderzt=1"><span><%=Lang_Menu(92)%></span></a></li>
			<li <%If request("orderzt") = "2" Then Response.Write("class=""current""") End If%>><a href="Admin_orders.asp?orderzt=2"><span><%=Lang_Menu(93)%></span></a></li>
			<li <%If request("orderzt") = "3" Then Response.Write("class=""current""") End If%>><a href="Admin_orders.asp?orderzt=3"><span><%=Lang_Menu(94)%></span></a></li>
			<li <%If request("orderzt") = "4" Then Response.Write("class=""current""") End If%>><a href="Admin_orders.asp?orderzt=4"><span><%=Lang_Menu(95)%></span></a></li>
			<li <%If request("orderzt") = "5" Then Response.Write("class=""current""") End If%>><a href="Admin_orders.asp?orderzt=5"><span><%=Lang_Menu(96)%></span></a></li>
			<li <%If request("is_booking") = "1" Then Response.Write("class=""current""") End If%>><a href="Admin_orders.asp?is_booking=1"><span><%=Lang_Menu(90)%></span></a></li>
			<li <%If request("action") = "moveorder" Or request("action") = "moveorder_ok" Then Response.Write("class=""current""") End If%>><a href="#"><span><%=Lang_Order(207)%></span></a></li>
	  <%Else%>
			<li><a href="admin_user.asp"><span><%=Lang_Menu(56)%></span></a></li>
			<li><a href="Admin_user.asp?action=view&user_id=<%=server.urlencode(user_id)%>"><span><%=user_id%></span></a></li>
			<li class="current"><a href="Admin_orders.asp?user_id=<%=user_id%>"><span><%=Lang_User(58)%></span></a></li>
			<li><a href="Admin_user_log.asp?user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(59)%></span></a></li>
			<li><a href="Admin_user_account.asp?user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(154)%></span></a></li>
			<li><a href="Admin_msg.asp?action=add&user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(47)%></span></a></li>
	  <%End If%>
      </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If OutSubmit = 1 Then CheckOutSubmit()
Select Case Request("action")
	   Case "del" : del()
	   Case "delhg" : delhg()
	   case "viewuser" : viewuser()
	   Case "getNewOrders" : getNewOrders() '顶部最新订单提示
	   Case "moveorder" : moveorder()
	   Case "moveorder_ok" : moveorder_ok()
	   Case Else
			list()
End Select
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub del 'WangLei 2008-1-20  增加捆绑促销产品库存更新
        If OnlyRead = 1 Then OnlyReadMessage()
		admin_flag=",1.2,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		End If
        on error resume Next
        idn=safereplace(request("idn"))
        if idn="" Then
                response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
                response.end
        end If
        page=CheckNum(request("page"),1)
		Set rs = server.CreateObject("adodb.recordset")
		rs.open "select id,orderzt,order_number,LangTxt from [Lebi_orders] where id in (" & idn&")",conn,1,3
		Do While Not rs.eof
				Set brs = server.CreateObject("adodb.recordset")
				brs.open "select product_type,basket_count,id,spvalue from [Lebi_basket] where order_number="& rs(0) &"",conn,1,3
				If Not brs.eof Then
						Do While Not brs.eof
						If Config_Lebi_Eshop(23) = 0 And InStr(rs(1),"2") = 0 Then 
								If brs("product_type") = "unite" Then
										conn.execute("update [Lebi_product_unite] set kucun=kucun+"&brs("basket_count")&",buys=buys-"&brs("basket_count")&" where id="&brs("id")&"")
								ElseIf brs("product_type") = "groupon" Then
										conn.execute("update [Lebi_groupon_product] set kucun=kucun+"&brs("basket_count")&",buys=buys-"&brs("basket_count")&" where id="&brs("id")&"")
								Else
										conn.execute("update [Lebi_product] set kucun=kucun+"&brs("basket_count")&",buys=buys-"&brs("basket_count")&" where id="&brs("id")&"")
										conn.execute("update [Lebi_Product_Stock] set p_buys = p_buys - "&brs("basket_count")&",p_stock = p_stock + "&brs("basket_count")&" where p_id = " &brs("id")&" and s_value"& rs("LangTxt") &" = '"& brs("spvalue") &"'")
								End If
						End If 
						brs.delete
						brs.update
						brs.movenext
						Loop
				End If
				brs.close:Set brs=Nothing
				If UnionApi = "1" Then
						conn.execute("delete from [Lebi_union_log] where order_number = "& rs(2) &"")
				End If 
				conn.execute("delete from [Lebi_payment_inform] where orders_id = "& rs(2) &"")
				conn.execute("delete from [Lebi_user_sh] where bh = "& rs(2) &"")
				conn.execute("delete from [Lebi_ShipMes] where s_order_number = "& rs(2) &"")
				conn.execute("delete from [Lebi_Invoice] where i_order_number = "& rs(2) &"")
				conn.execute("delete from [Lebi_Orders_Log] where l_order_number = "& rs(2) &"")
				conn.execute("delete from [Lebi_Orders_Paylog] where oid = "& rs(0) &"")
				rs.delete
				rs.update
		rs.movenext
		Loop
		rs.close : Set rs = Nothing
		ManageLog Lang_Order(109) &" [" & idn &"]"
        url="Admin_orders.asp?page=" & page&"&s_order_number="&request("s_order_number")&"&s_dateFrom="&request("s_dateFrom")&"&s_dateTo="&request("s_dateTo")&"&s_product_name="&request("s_product_name")&"&s_product_bianhao="&request("s_product_bianhao")&"&user_id="&request("user_id")&"&s_user_name="&request("s_user_name")&"&s_user_tel="&request("s_user_tel")&"&s_user_email="&request("s_user_email")&"&s_user_zip="&request("s_user_zip")&"&s_user_adds="&request("s_user_adds")&"&orderzt="&request("orderzt")&"&pagenum="& request("pagenum")
        response.redirect url
		response.End
End Sub

Sub delhg
        If OnlyRead = 1 Then OnlyReadMessage()
		admin_flag=",1.2,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		End If
		page=CheckNum(request("page"),1)
		conn.execute "delete from [Lebi_orders] where order_number=" & CheckNum(request("order_number"),0) &""
		conn.execute "delete from [Lebi_jbasket] where order_number=" & CheckNum(request("order_number"),0) &""
		url="Admin_orders.asp?page=" & page
		response.redirect url
end Sub

Sub moveorder_ok()
		id = safereplace(Trim(request("id")))
		user_id = safereplace(Trim(request("user_id")))
		re_user_id = safereplace(Trim(request("re_user_id")))
		If user_id <> "" And CStr(user_id) <> CStr(re_user_id) Then 
			Call Up_mes(Lang_Order(207),"·"& Lang_Order(212),0,"javascript:history.back()",0,0,2,0)
		End If 
		Set rs = conn.execute("Select user_id from [lebi_user] where user_id = '"& user_id &"'")
		If rs.eof Then 
			Call Up_mes(Lang_Order(207),"·"& Lang_Order(213),0,"javascript:history.back()",0,0,2,0)
		End If 
		rs.close : Set rs = Nothing 
		Set rs = conn.execute("select id,order_number from [lebi_orders] where id in ("& id &")")
		If Not rs.eof Then 
			Do While Not rs.eof 
				order_number = order_number & rs(1) &","
				conn.execute("update [Lebi_orders] set user_id = '"& user_id &"' where id = "& rs(0) &"")
				conn.execute("update [Lebi_basket] set user_id = '"& user_id &"' where order_number = "& rs(0) &"")
			rs.movenext 
			Loop 
		End If 
		rs.close : Set rs = Nothing 
		m_u=CheckUrl(request("ref"))
		If Right(order_number,1) = "," Then order_number = Left(order_number,Len(order_number)-1)
		ManageLog Lang_Order(207) &" ["&order_number&"]"
		Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,m_u,0,0,2,1)
End Sub 

Sub list
		admin_flag=",1.1,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		End If
		user_id = safereplace(Trim(request("user_id")))
		s_order_number = safereplace(Trim(request("s_order_number")))
		orderzt = Safereplace(request("orderzt"))
		s_product_name = safereplace(Trim(request("s_product_name")))
		s_product_bianhao = safereplace(Trim(request("s_product_bianhao")))
		s_user_name = safereplace(Trim(request("s_user_name")))
		s_user_tel = safereplace(Trim(request("s_user_tel")))
		s_user_email = safereplace(Trim(request("s_user_email")))
		s_user_zip = safereplace(Trim(request("s_user_zip")))
		s_user_adds = safereplace(Trim(request("s_user_adds")))
		s_datefrom = safereplace(Trim(request("s_datefrom")))
		s_dateto = safereplace(Trim(request("s_dateto")))
		is_booking = CheckNum(request("is_booking"),0)
		infotype = Safereplace(request("infotype"))
		mark = Safereplace(request("mark"))
		page=checknum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		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,mark,remark,order_number,to_name,user_id,dis_sum,fei,packing_price,fapiao_money,coupon_price,paymenttype,order_time,orderzt,is_booking,paidmoney,is_pay_advance,from_name"
		.Table="[Lebi_orders]"
		sql = "1=1"
        if user_id<>"" then sql=sql + " and user_id='"& user_id &"'"
		rem 混合查询开始 2006-3-10 by 56770.kingdge
        if s_order_number<>"" then sql=sql + " and (order_number like '%"&s_order_number&"%' or paymenttype like '%"&s_order_number&"%' or sendtype like '%"&s_order_number&"%' or to_name like '%"&s_order_number&"%' or user_id like '%"&s_order_number&"%')"
		if s_product_name<>"" then sql=sql + " and id in (select order_number from [Lebi_basket] where product_name like  '%"&s_product_name&"%') "
		if s_product_bianhao<>"" then sql=sql + " and id in (select order_number from [Lebi_basket] where bianhao like  '%"&s_product_bianhao&"%') "
		if s_user_name<>"" And InStr(infotype,"0")>0 And InStr(infotype,"1")<0 then sql=sql + " and from_name like '%"&s_user_name&"%' "
		if s_user_name<>"" And InStr(infotype,"1")>0 And InStr(infotype,"0")<0 then sql=sql + " and to_name like '%"&s_user_name&"%' "
		if s_user_name<>"" And InStr(infotype,"0")>0 And InStr(infotype,"1")>0 then sql=sql + " and (from_name like '%"&s_user_name&"%' or to_name like '%"&s_user_name&"%') "
		if s_user_tel<>"" And InStr(infotype,"0")>0 And InStr(infotype,"1")<0 then sql=sql + " and from_tel like '%"&s_user_tel&"%' "
		if s_user_tel<>"" And InStr(infotype,"1")>0 And InStr(infotype,"0")<0 then sql=sql + " and (to_tel like '%"&s_user_tel&"%' or to_tel2 like '%"&s_user_tel&"%') "
		if s_user_tel<>"" And InStr(infotype,"1")>0 And InStr(infotype,"0")>0 then sql=sql + " and (from_tel like '%"&s_user_tel&"%' or to_tel like '%"&s_user_tel&"%' or to_tel2 like '%"&s_user_tel&"%') "
		if s_user_email<>"" then sql=sql + " and from_email like '%"&s_user_email&"%' "
		if s_user_zip<>"" And InStr(infotype,"0")>0 And InStr(infotype,"1")<0 then sql=sql + " and from_zip like '%"&s_user_zip&"%' "
		if s_user_zip<>"" And InStr(infotype,"1")>0 And InStr(infotype,"0")<0 then sql=sql + " and to_zip like '%"&s_user_zip&"%' "
		if s_user_zip<>"" And InStr(infotype,"0")>0 And InStr(infotype,"1")>0 then sql=sql + " and (from_zip like '%"&s_user_zip&"%' or to_zip like '%"&s_user_zip&"%') "
		if s_user_adds<>"" And InStr(infotype,"0")>0 And InStr(infotype,"1")<0 then sql=sql + " and from_adds like '%"&s_user_adds&"%' "
		if s_user_adds<>"" And InStr(infotype,"1")>0 And InStr(infotype,"0")<0 then sql=sql + " and to_adds like '%"&s_user_adds&"%' "
		if s_user_adds<>"" And InStr(infotype,"0")>0 And InStr(infotype,"1")>0 then sql=sql + " and (from_adds like '%"&s_user_adds&"%' or to_adds like '%"&s_user_adds&"%')"
		If IsSqlDataBase = 1 And s_datefrom<>"" And s_dateto<>"" Then sql=sql + " and DateDiff(d,order_time,'"& s_datefrom &"')<=0 and DateDiff(d,order_time,'"& s_dateto &"')>=0"
		If IsSqlDataBase = 0 And s_datefrom<>"" And s_dateto<>"" Then sql=sql + " and DateDiff('d',order_time,'"& s_datefrom &"')<=0 and DateDiff('d',order_time,'"& s_dateto &"')>=0"
		rem	<-{ 2008-3-19 订单预订 by 56770.WangLei
		If is_booking="1" Then sql=sql & " and is_booking=1 "
		rem	}->
		rem	<-{ 2008-8-27 订单备注 by 56770.Kingdge
		If InStr(mark,",")>0 Then
				sql = sql &" and ("
				For i = 0 To UBound(Split(mark,","))
				sql = sql &" mark = "& Split(mark,",")(i) &""
				If i < UBound(Split(mark,",")) Then sql = sql &" or"
				Next
				sql = sql &" )"
		ElseIf mark <> "" Then
				sql = sql &" and mark = "& mark &""
		End If
		rem	}->
		rem	<-{ 2009-1-10 订单状态 by 56770.Kingdge
		If InStr(orderzt,",")>0 Then
				sql = sql &" and ("
				For i = 0 To UBound(Split(orderzt,","))
				If IsSqlDataBase = 1 Then sql = sql &" charindex('"& Split(orderzt,",")(i) &"',orderzt)>0"
				If IsSqlDataBase = 0 Then sql = sql &" instr(orderzt,'"& Split(orderzt,",")(i) &"')>0"
				If i < UBound(Split(orderzt,",")) Then sql = sql &" or"
				Next
				sql = sql &" )"
				If InStr(orderzt,"2")>0 Then sql =sql &" or is_pay_advance = 1"
		ElseIf orderzt <> "" Then
				If IsSqlDataBase = 1 Then sql = sql &" and charindex('"& orderzt &"',orderzt)>0"
				If IsSqlDataBase = 0 Then sql = sql &" and instr(orderzt,'"& orderzt &"')>0"
				If orderzt = 2 Then sql = sql &" or is_pay_advance = 1"
		End If
		rem	}->
		.Condition=sql
		.OrderBy="order_time desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script language="javascript" src="inc/js/MyCalendar.js"></script>
<script language="javascript" type="text/javascript">
function tomove()
{   
   var i = 0;   
   var chkArr = document.getElementsByName("idn");   
   var ref = document.getElementById("ref").value;
   var param = "";   
   for (i=0;i<chkArr.length;i++)   
   if (chkArr[i].checked)   
   param+=chkArr[i].value +",";   
   if (param.length == 0)
   {
       alert("<%=Lang_Order(206)%>");
   }else{
       var url="?action=moveorder&id="+param+"&ref="+ref;   
       location.href=url;
   }
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<form name="forms" action="?" method="get">
<tr>
<td height="30" align="left" class="classhead">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<input type="checkbox" name="is_booking" value="1"<%=judge(1,is_booking)%>> <%=Lang_Order(13)%>
<input type="checkbox" name="mark" value="1"<%=judge(1,mark)%>> <img src="images/mark/1.gif" title="" border="0" align="absmiddle" height="18">
<input type="checkbox" name="mark" value="2"<%=judge(2,mark)%>> <img src="images/mark/2.gif" title="" border="0" align="absmiddle" height="18">
<input type="checkbox" name="mark" value="3"<%=judge(3,mark)%>> <img src="images/mark/3.gif" title="" border="0" align="absmiddle" height="18">
<input type="checkbox" name="mark" value="4"<%=judge(4,mark)%>> <img src="images/mark/4.gif" title="" border="0" align="absmiddle" height="18">
<input type="checkbox" name="mark" value="5"<%=judge(5,mark)%>> <img src="images/mark/5.gif" title="" border="0" align="absmiddle" height="18">
</td>
<td style="padding-left:5px;">
<select name="orderzt">
<option value="">┌ <%=Lang_Order(86)%></option>
<option value="0"<%=judge2(0,orderzt)%>>├ <%=Lang_Order(110)%></option>
<option value="1"<%=judge2(1,orderzt)%>>├ <%=Lang_Order(14)%></option>
<option value="2"<%=judge2(2,orderzt)%>>├ <%=Lang_Order(15)%></option>
<option value="3"<%=judge2(3,orderzt)%>>├ <%=Lang_Order(16)%></option>
<option value="4"<%=judge2(4,orderzt)%>>├ <%=Lang_Order(17)%></option>
<option value="5"<%=judge2(5,orderzt)%>>├ <%=Lang_Order(18)%></option>
</select>
</td>
<td style="padding-left:5px;">
<input name="s_order_number" id="s_order_number" type="text" value="<%=s_order_number%>" class="form_query" size="15" autocomplete="off" onkeyup="search_suggest('s_order_number','lebi_orders','')"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="user_id" value="<%=user_id%>"><input type="hidden" name="pagenum" value="<%= pagenum %>"><br /><div id="search_suggest_s_order_number" class="search_suggest" style="display:none"></div>
</td></tr></table>
</td>
<td align="right" class="classhead">
<%
If orderzt = "" Then
		response.write QuickMenu("","Admin_orders.asp?orderzt=0|"& Lang_Menu(91) &"")
Elseif is_booking = "1" Then
		response.write QuickMenu("Admin_orders.asp?orderzt=5|"& Lang_Menu(96) &"","Home_orders.asp|"& Lang_Menu(88) &"")
Elseif orderzt = "0" Then
		response.write QuickMenu("Admin_orders.asp?is_booking=1|"& Lang_Menu(90) &"","Admin_orders.asp?orderzt=1|"& Lang_Menu(92) &"")
Elseif orderzt = "1" Then
		response.write QuickMenu("Admin_orders.asp?orderzt=0|"& Lang_Menu(91) &"","Admin_orders.asp?orderzt=2|"& Lang_Menu(93) &"")
Elseif orderzt = "2" Then
		response.write QuickMenu("Admin_orders.asp?orderzt=1|"& Lang_Menu(92) &"","Admin_orders.asp?orderzt=3|"& Lang_Menu(94) &"")
Elseif orderzt = "3" Then
		response.write QuickMenu("Admin_orders.asp?orderzt=2|"& Lang_Menu(93) &"","Admin_orders.asp?orderzt=4|"& Lang_Menu(95) &"")
Elseif orderzt = "4" Then
		response.write QuickMenu("Admin_orders.asp?orderzt=3|"& Lang_Menu(94) &"","Admin_orders.asp?orderzt=5|"& Lang_Menu(96) &"")
Elseif orderzt = "5" Then
		response.write QuickMenu("Admin_orders.asp?orderzt=4|"& Lang_Menu(95) &"","Admin_orders.asp?is_booking=1|"& Lang_Menu(90) &"")
End If
%>
</td>
</tr>
</form>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="orderlist" class="classtable2">
<tbody>
<form name="forms" action="?action=del" method="post">
<tr>
<td align="left" colspan="3" class="classhead">
<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" border="0" title=" <%=Lang_sys(21)%> " onclick="location.href='javascript:tomove();';return false;" src="lang/<%=LangFilePath%>/images/bt_move.gif" align="absmiddle">
<input type="hidden" name="user_id" value="<%=user_id%>">
<input type="hidden" name="orderzt" value="<%=orderzt%>">
<input type="hidden" name="s_order_number" value="<%=s_order_number%>">
<input type="hidden" name="s_dateFrom" value="<%=s_dateFrom%>">
<input type="hidden" name="s_dateTo" value="<%=s_dateTo%>">
<input type="hidden" name="s_product_name" value="<%=s_product_name%>">
<input type="hidden" name="s_product_bianhao" value="<%=s_product_bianhao%>">
<input type="hidden" name="s_user_name" value="<%=s_user_name%>">
<input type="hidden" name="s_user_tel" value="<%=s_user_tel%>">
<input type="hidden" name="s_user_email" value="<%=s_user_email%>">
<input type="hidden" name="s_user_zip" value="<%=s_user_zip%>">
<input type="hidden" name="s_user_adds" value="<%=s_user_adds%>">
<input type="hidden" name="pagenum" value="<%= pagenum %>">
<input type="hidden" name="ref" id="ref" value="<%= backurl() %>">
</td>
<td height="30" class="classhead" align="right" colspan="10"><%=ors.ShowPageHead(page)%></td>
</tr>
<tr>
<td width="5%" height="30" class="classtop" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="javascript:selectallid('idn');return false;"><%=Lang_sys(50)%></td>
<td width="5%" class="classtop"><%=Lang_Order(111)%></td>
<td width="15%" class="classtop"><%=Lang_Order(112)%></td>
<td width="10%" class="classtop"><%=Lang_Order(171)%></td>
<td width="10%" class="classtop"><%=Lang_Order(113)%></td>
<td width="8%" class="classtop"><%=Lang_Order(53)%></td>
<td width="12%" class="classtop"><%=Lang_Order(57)%></td>
<td width="10%" class="classtop"><%=Lang_Order(114)%></td>
<td width="5%" class="classtop"><%=Lang_Order(14)%></td>
<td width="5%" class="classtop"><%=Lang_Order(15)%></td>
<td width="5%" class="classtop"><%=Lang_Order(16)%></td>
<td width="5%" class="classtop"><%=Lang_Order(17)%></td>
<td width="5%" class="classtop"><%=Lang_Order(18)%></td>
</tr>
</thead>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="idn" id="idn" type="checkbox" value="<%=DataList(0,i)%>"></td>
<td height="30" class="classrow">
<%
If DataList(1,i) <> 0 Then 
		response.write("<img src=""images/mark/"& DataList(1,i) &".gif"" title="""& DataList(2,i) &""">") 
Else 
		If DataList(14,i) = 1 Then 
				response.write("<span style=""color:#ff0000"">"& Lang_Order(13) &"</span>")
		Else 
				response.write("&nbsp;") 
		End If 
End If%></td>
<td class="classrow"><a href="Admin_orders_v.asp?id=<%=DataList(0,i)%>" title="<%=Lang_sys(59)%>"><%=DataList(3,i)%></a></td>
<td align="left" class="classrow"><%If DataList(5,i) <> "" Then response.write("<a href=""admin_user.asp?action=view&user_id="& server.urlencode(DataList(5,i)) &""">"& DataList(5,i) &"</a>") Else response.write("&nbsp;") End If%></td>
<td align="left" class="classrow"><%
Select Case sys_soft
Case "0" response.write(DataList(4,i))
Case "1" response.write(DataList(17,i))
End Select 
%>&nbsp;</td>
<td class="classrow"><%=formatnumber2(DataList(6,i)+DataList(7,i)+DataList(8,i)+DataList(9,i)-checknum(DataList(10,i),0)-DataList(15,i))%></td>
<td class="classrow"><%=DataList(11,i)%></td>
<td class="classrow"><%=FormatDateTime(DataList(12,i),2)%></td>
<td class="classrow"><%if Instr(DataList(13,i), 1)>0 then response.write"<strong><font color=red>√</font></strong>" else response.write"×" end if%></td>
<td class="classrow"><%
if Instr(DataList(13,i), 2)>0 Then
	response.write"<strong><font color=red>√</font></strong>" 
Else
	If DataList(16,i) = 1 Then 
		response.write"<font color=red>"& Lang_Order(191) &"</font>" 
	Else 
		response.write"×" 
	End If 
End If
%></td>
<td class="classrow"><%if Instr(DataList(13,i), 3)>0 then response.write"<a href=""Admin_ship.asp?action=edit&order_number="& DataList(3,i) &"&order_id="& DataList(0,i) &""" title="""& Lang_Order(115) &""" target=""_blank""><img src=""images/icon_ship_r.gif"" width=""16"" height=""16"" border=""0""></a>" else response.write"<a href=""Admin_ship.asp?action=add&id="& DataList(0,i) &""" title="""& Lang_Order(116) &""" target=""_blank""><img src=""images/icon_ship.gif"" width=""16"" height=""16"" border=""0""></a>" end if%></td>
<td class="classrow"><%if Instr(DataList(13,i), 4)>0 then response.write"<strong><font color=red>√</font></strong>" else response.write"×" end if%></td>
<td class="classrow"><%if Instr(DataList(13,i), 5)>0 then response.write"<strong><font color=red>√</font></strong>" else response.write"×" end if%></td>
</tr>
<%
        Next
End If
%>
</form>
</tbody>
<tfoot>
<tr>
	<td height="30" class="classfooter" colspan="3"><%=GetPageNum(15,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="10"><%=ors.ShowPageFoot(page)%></td>
</tr>
<tr>
<td height="30" colspan="13" class="classfaq">
<div class="faq_main">
<p class="faq_title"><%=Lang_sys(49)%></p>
<%=Lang_Order(117)%>
</div>
</td>
</tr>
</tfoot>
</table>
<script>tdshow("orderlist");</script>
<%
End Sub

Sub moveorder()
id= Replace(safereplace(request("id")),"，",",")
If Right(id,1) = "," Then id = Left(id,Len(id)-1)
%>
<script language="javascript">
function CheckForm()
{
	var user_id = document.getElementById("user_id").value;
	var re_user_id = document.getElementById("re_user_id").value;
	if (CheckEmpty('user_id')){ShowMessage('user_id','<%=Lang_Order(210)%>');return false;}
	if (CheckEmpty('re_user_id')){ShowMessage('re_user_id','<%=Lang_Order(211)%>');return false;}
	if (user_id != re_user_id){ShowMessage('re_user_id','<%=Lang_Order(212)%>');return false;}
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable" id="moveorder">
<form name="moveorder" method="get" action="Admin_orders.asp" onSubmit="return CheckForm();">
<tr>
	<td colspan="3" height="30" class="classhead"><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="ref" value=<%=request("ref")%>><input type="hidden" name="action" value="moveorder_ok"></td>
	<td align="right" class="classhead">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
<td height="30" class="classtop" colspan="4"><%=Lang_Order(207)%></td>
</tr>
<%
Set rs = conn.execute("Select order_number,user_id from [lebi_orders] where id in("& id &")")
Do While Not rs.eof
%>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Order(1)%></td>
<td width="35%" class="classrow"><%=rs(0)%></td>
<td width="15%" class="classrow"><%=Lang_Order(7)%></td>
<td width="35%" class="classrow"><%=rs(1)%>&nbsp;</td>
</tr>
<%
rs.movenext 
Loop
rs.close : Set rs = Nothing 
%>
<tr>
<td height="30" class="classtop" colspan="4"><%=Lang_Order(207)%></td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Order(7)%></td>
<td colspan="3" class="classrow">
<input type="text" name="user_id" id="user_id" class="form" size="30" class="form" autocomplete="off" onkeyup="search_suggest('user_id','lebi_user','')"> <span id="mes_user_id"></span><br /><div id="search_suggest_user_id" class="search_suggest" style="display:none"></div>
</td>
</tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_Order(208)%></td>
<td colspan="3" class="classrow">
<input type="text" name="re_user_id" id="re_user_id" class="form" size="30" class="form"> <span id="mes_re_user_id"></span>
</td>
</tr>
<tr>
<td height="30" colspan="4" align="left" class="classfooter">
<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" align="absmiddle" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" onclick="reset();return false;" align="absmiddle" title=" <%=Lang_sys(2)%> ">
</td>
</tr>
</table>
<script>tdshow("moveorder");</script>
<%
End Sub

Sub getNewOrders() '顶部最新订单提示
	Dim newOrders
	newOrders = conn.execute("select count(id) from [Lebi_orders] where order_number>'' and orderzt like '%0%'")(0)
	If newOrders = "" Or Not IsNumeric(newOrders) Then newOrders = 0
	response.write(newOrders)
	response.End
End Sub
%>