<%
'**************************************
'* 最后更新 2009-8-18 by 56770.kingdge 
'* Copyright www.56770.com             
'**************************************
strwebtitle = Lebi_word(59) &" - "
sitename = site_name
Showpath = "<a href='"& Eshop_url & LangPath &"'>"& Lebi_word(0) &"</a> → "& Lebi_word(59) &""
Function query_main()
        Dim order_number,sql,Total_money
        order_number=safereplace(Trim(request("order_number")))
        query_main = "<table width='100%' cellpadding='0' cellspacing='1' align='center' class='MyUserInfo'>"
		If order_number = "" Then 
		      query_main = query_main &"<tr><td height='25' colspan='2' class='headmenu'>"& Lebi_word(59) &"</td></tr>"
			  query_main = query_main &"<form name=""form"" method=""post"" action=""default.asp"">"
              query_main = query_main &"<tr><td height='25' width='15%' class='listleft'>"& Lebi_cart(86) &"</td><td class='listright'><input name=""order_number"" size=""15"" class=""form"" onMouseOver=""this.focus()"" onBlur=""if (value ==''){value='"& Lebi_word(57) &"'}"" onFocus=""this.select()"" onClick=""if(this.value=='"& Lebi_word(57) &"')this.value=''"" value="""& Lebi_word(57) &"""></td></tr>"
			  query_main = query_main &"<tr><td height='30' colspan='2' class='list' align='left'><INPUT TYPE=""submit"" name=""submit"" value="""& Lebi_word(58) &""" title="""& Lebi_word(58) &""" class=""button""></td></tr>"
			  query_main = query_main &"</form>"
		Else 
		query_main = query_main &"<tr><td height='25' colspan='4' class='headmenu'>"& Lebi_user(161) &"</td></tr>"
        sql="select * from [Lebi_orders] where order_number='"&order_number&"'"
        set rs = conn.execute(sql)
        If rs.eof Then 
                query_main = query_main &"<tr><td height='100' class='list' align='center'>"& Lebi_word(6) &"</td></tr>"
        Else      
				If IsNull(rs("coupon_price")) Or IsEmpty(rs("coupon_price")) Then coupon_price = 0
				Total_money = rs("dis_sum")+rs("fei")+rs("packing_price")-coupon_price
				If Config_Lebi_Eshop(2)="1" Then 
						Total_money = Total_money + rs("fapiao_money")
				End If 
                query_main = query_main &"<tr><td height='25' width='15%' class='listleft'>"& Lebi_cart(86) &"</td><td class='listright'>"& rs("order_number") &"</td><td height='25' width='15%' class='listleft'>"& Lebi_cart(87) &"：</td><td class='listright'>"& rs("order_time") &"</td></tr>"
                query_main = query_main &"<tr><td height='25' width='15%' class='listleft'>"& Lebi_cart(113) &"</td><td  class='listright' colspan='3'>"
                query_main = query_main &""& Lebi_cart(114) &"："
		        If Instr(rs("orderzt"),1)>0 Then 
		                query_main = query_main &"<font color=red>√</font>" 
		        Else
                        query_main = query_main &"×"
		        End If
                query_main = query_main &"&nbsp;&nbsp;"& Lebi_cart(115) &"："
                If Instr(rs("orderzt"),2)>0 Then 
                        query_main = query_main &"<font color=red>√</font>" 
		        Else
                        query_main = query_main &"×"
		        End If  
                query_main = query_main &"&nbsp;&nbsp;"& Lebi_cart(116) &"："
		        If Instr(rs("orderzt"),3)>0 Then 
                        query_main = query_main &"<font color=red>√</font>" 
		        Else
                        query_main = query_main &"×"
		        End If  
                query_main = query_main &"&nbsp;&nbsp;"& Lebi_cart(117) &"："
                If Instr(rs("orderzt"),4)>0 then 
                        query_main = query_main &"<font color=red>√</font>"
		        Else
                        query_main = query_main &"×"
		        End If  
                query_main = query_main &"&nbsp;&nbsp;"& Lebi_cart(118) &"："
                If Instr(rs("orderzt"),5)>0 Then 
                        query_main = query_main &"<font color=red>√</font>" 
		        Else
                        query_main = query_main &"×"
		        End If 
                query_main = query_main &"</td></tr>"
                query_main = query_main &"<tr><td height='25' class='listleft'>"&  Lebi_cart(80) &"：</td><td class='listright' colspan='3'><span style=""color:#FF0000;font-size:18px;font-weight:bold;"">"& dw & FormatNumber2(Total_money/moneyhl) &"</span> = "& Lebi_cart(77) &"："& dw & FormatNumber2(rs("dis_sum")/moneyhl) &" + "& Lebi_cart(78) &"："& dw & FormatNumber2(rs("fei")/moneyhl) &""
				If Config_Lebi_Eshop(2)="1" And rs("fapiao_money")>0 Then query_main = query_main &" + "& Lebi_cart(79) &"："& dw & FormatNumber2(rs("fapiao_money")/moneyhl) End If 
				If rs("packing_price")>0 Then query_main = query_main &" + "& Lebi_cart(164) &"："& dw & FormatNumber2(rs("packing_price")/moneyhl) 
				if coupon_price > 0 Then query_main = query_main &" <font color=""#ff0000"">- "& Lebi_cart(138) &"："& dw & FormatNumber2(coupon_price/moneyhl) &"</font>" 
				query_main = query_main &"</td></tr>"
                query_main = query_main &"<tr><td height='25' class='listleft'>"& Lebi_cart(48) &"：</td><td class='listright'>"& rs("paymenttype") &"</td><td class='listleft'>"& Lebi_cart(49) &"：</td><td class='listright'>"& rs("sendtype") &"</td></tr>"
				If Trim(rs("fuyan")) <> "" Then 
                        query_main = query_main &"<tr><td height='30' class='listleft'>"& Lebi_cart(110) &"：</td><td class='listright'>"& rs("fuyan") &"</td></tr>"
				End If 
				Dim ship_name,ship_no,ship_date,ship_fei1
				Set shipdb = conn.execute("select s_name,s_no,s_date,s_fei1 from Lebi_ShipMes where s_order_number = '"& order_number &"'")
				If Not shipdb.eof Then 
						ship_name = shipdb(0)
						ship_no = shipdb(1)
						ship_date = shipdb(2)
						ship_fei1 = dw & FormatNumber2(shipdb(3))
				end If
				shipdb.close : Set shipdb = Nothing
				query_main = query_main &"<tr><td height='25' class='listleft'>"& Lebi_cart(189) &"：</td><td class='listright'>"& ship_name &"</td><td class='listleft'>"& Lebi_cart(190) &"：</td><td class='listright'>"& ship_no &"</td></tr>"
				query_main = query_main &"<tr><td height='25' class='listleft'>"& Lebi_cart(191) &"：</td><td class='listright'>"& ship_date &"</td><td class='listleft'>"& Lebi_cart(192) &"：</td><td class='listright'>"& ship_fei1 &"</td></tr>"
                query_main = query_main &"<tr>"&_
                        "     <td height='25' colspan='4' class='headmenu'>"&Lebi_cart(41)&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' class='listleft'>"&Lebi_cart(42)&"</td>"&_
                        "     <td class='listright'>"&rs("to_name")&"</td>"&_
                        "     <td class='listleft'>"&Lebi_cart(43)&"</td>"&_
                        "     <td class='listright'>"&rs("to_tel")&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' class='listleft'>"&Lebi_cart(143)&"</td>"&_
                        "     <td class='listright'>"&rs("to_tel2")&"</td>"&_
                        "     <td class='listleft'>"&Lebi_cart(45)&"</td>"&_
                        "     <td class='listright'>"&rs("to_zip")&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' class='listleft'>"&Lebi_cart(46)&"</td>"&_
                        "     <td colspan='3' class='listright'>"&rs("to_adds")&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' class='listleft'>"&Lebi_cart(47)&"</td>"&_
                        "     <td colspan='3' class='listright'>"&rs("to_other")&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' colspan='4' class='headmenu'>"&Lebi_cart(141)&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' class='listleft'>"&Lebi_cart(142)&"</td>"&_
                        "     <td class='listright'>"&rs("from_name")&"</td>"&_
                        "     <td class='listleft'>"&Lebi_cart(43)&"</td>"&_
                        "     <td class='listright'>"&rs("from_tel")&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' class='listleft'>"&Lebi_cart(44)&"</td>"&_
                        "     <td class='listright'>"&rs("from_email")&"</td>"&_
                        "     <td class='listleft'>"&Lebi_cart(45)&"</td>"&_
                        "     <td class='listright'>"&rs("from_zip")&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' class='listleft'>"&Lebi_cart(144)&"</td>"&_
                        "     <td colspan='3' class='listright'>"&rs("from_adds")&"</td>"&_
                        "   </tr>"&_
                        "   <tr>"&_
                        "     <td height='25' class='listleft'>"&Lebi_cart(47)&"</td>"&_
                        "     <td colspan='3' class='listright'>"&rs("from_other")&"</td>"&_
                        "   </tr>"
                If rs("iffapiao")=1 Then 
                        query_main = query_main &"<tr><td colspan='4' height='25' class='headmenu'>"& Lebi_cart(52) &"</td></tr>"
                        query_main = query_main &"<tr><td height='25' class='listleft'>"& Lebi_cart(54) &"：</td><td colspan='3' class='listright'>"& rs("fapiao_company") &"</td></tr>"
                        query_main = query_main &"<tr><td height='25' class='listleft'>"& Lebi_cart(55) &"：</td><td colspan='3' class='listright'>"& rs("fapiao_adds") &"</td></tr>"
                        query_main = query_main &"<tr><td height='25' class='listleft'>"& Lebi_cart(45) &"：</td><td colspan='3' class='listright'>"& rs("fapiao_zip") &"</td></tr>"
                End If 
                query_main = query_main &"<tr><td colspan='4' class='listright' height='35'><input type=""button"" name=""paybuyusermoney"" value="""& Lebi_cart(103) &""" ONCLICK=""window.open('" & Eshop_url & "basket/paymoney/?order_number="& rs("order_number")&"', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=50,left=100,top=100')"" class=""button""></td></tr>"
                query_main = query_main &"<tr><td height='25' class='listleft'>"& Lebi_word(9) &"：</td>"
                query_main = query_main &"<td class='listright' colspan='3'>"
                rem 在线支付模块
				Dim payprice : payprice = formatnumber2(rs("dis_sum")+rs("fei")+rs("fapiao_money")+rs("packing_price")-coupon_price)
                If chinabank_state=1 Then
						If chinabank_paymentpic <> "" Then
								query_main = query_main &"<a href='"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=4&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& chinabank_url &"' target='_blank'><img src='"& Eshop_url & chinabank_paymentpic &"' alt='使用网银在线付款' border='0' align='absmiddle'></a>&nbsp;"
						Else
								query_main = query_main &"<input type='button' onclick=""window.open('"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=4&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& chinabank_url &"');"" value='使用网银在线付款' class='button'>&nbsp;"
						End If 
		        End If 
                If alipay_state=1 Then    
						If alipay_paymentpic <> "" Then 
								query_main = query_main &"<a href='"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=1&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& alipay_url &"' target='_blank'><img src='"& Eshop_url & alipay_paymentpic &"' alt='使用支付宝付款' border='0' align='absmiddle'></a>&nbsp;"  
						Else
								query_main = query_main &"<input type='button' onclick=""window.open('"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=1&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& alipay_url &"');"" value='使用支付宝付款' class='button'>&nbsp;"
						End If 
		        End If 
                If paypal_state=1 Then
						If paypal_paymentpic <> "" Then 
								query_main = query_main &"<a href='"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=3&pro_id=0&subject="&trim(rs("order_number")) &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& paypal_url &"' target='_blank'><img src='"& Eshop_url & paypal_paymentpic &"' alt='使用Paypal付款' border='0' align='absmiddle'></a>&nbsp;"
						Else
								query_main = query_main &"<input type='button' onclick=""window.open('"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=3&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& paypal_url &"');"" value='使用Paypal付款' class='button'>&nbsp;"
						End If 
		        End If 
                If paypal_cn_state=1 Then
						If paypal_paymentpic <> "" Then 
								query_main = query_main &"<a href='"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=7&pro_id=0&subject="&trim(rs("order_number")) &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& paypal_cn_url &"' target='_blank'><img src='"& Eshop_url & paypal_cn_paymentpic &"' alt='使用贝宝支付付款' border='0' align='absmiddle'></a>&nbsp;"
						Else
								query_main = query_main &"<input type='button' onclick=""window.open('"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=7&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& paypal_cn_url &"');"" value='使用贝宝支付付款' class='button'>&nbsp;"
						End If 
		        End If 
                If bill_state="1" Then 
						If bill_paymentpic <> "" Then 
								query_main = query_main &"<a href='"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=2&pro_id=0&subject="&trim(rs("order_number")) &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& bill_url &"' target='_blank'><img src='"& Eshop_url & bill_paymentpic &"' alt='使用快钱支付付款' border='0' align='absmiddle'></a>&nbsp;"
						Else
								query_main = query_main &"<input type='button' onclick=""window.open('"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=2&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& bill_url &"');"" value='使用快钱支付付款' class='button'>&nbsp;"
						End If 
		        End If 	
                If tenpay_state="1" Then 
						If tenpay_paymentpic <> "" Then 
								query_main = query_main &"<a href='"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=5&pro_id=0&subject="&trim(rs("order_number")) &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& tenpay_url &"' target='_blank'><img src='"& Eshop_url & tenpay_paymentpic &"' alt='使用财付通-即时到帐付款' border='0' align='absmiddle'></a>&nbsp;"
						Else
								query_main = query_main &"<input type='button' onclick=""window.open('"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=5&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& tenpay_url &"');"" value='使用财付通-即时到帐付款' class='button'>&nbsp;"
						End If 
		        End If 	
                If tenpay2_state="1" Then 
						If tenpay2_paymentpic <> "" Then 
							    query_main = query_main &"<a href='"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=6&pro_id=0&subject="&trim(rs("order_number")) &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& tenpay2_url &"' target='_blank'><img src='"& Eshop_url & tenpay2_paymentpic &"' alt='使用财付通-担保支付付款' border='0' align='absmiddle'></a>&nbsp;"
						Else
								query_main = query_main &"<input type='button' onclick=""window.open('"& Eshop_url &"plus/Onlinepay.asp?pay_page=2&pay_type=6&pro_id=0&subject="& rs("order_number") &"&trade_no="& rs("order_number") &"&price="& payprice &"&md5char="& md5(payprice) &"&paybackurl="& tenpay2_url &"');"" value='使用财付通-担保支付付款' class='button'>&nbsp;"
						End If 
		        End If 	
                query_main = query_main &"</td></tr></table>"
		Dim sqlGift,RsGift
        sqlGift="select * from [Lebi_basket] where order_number="&rs("id")&" and IsGift=1"
'        If IsSqlDataBase = 1 Then sqlGift=sqlGift&" and datediff(s,basket_date,'"&rs("order_time")&"')<172800"
'        If IsSqlDataBase = 0 Then sqlGift=sqlGift&" and datediff('h',basket_date,'"&rs("order_time")&"')<48"
        set RsGift = conn.execute(sqlGift)
        If Not RsGift.eof Then 
                query_main = query_main &"<table width='100%' cellpadding='0' cellspacing='1' align='center' class='MyUserInfo'><tr><td width='64%' height='25' align='center' class='headmenu'>"& Lebi_gift(0) &"</td><td width='12%' class='headmenu'>"& Lebi_gift(1) &"</td><td width='12%' align='center' class='headmenu'>"& Lebi_gift(6) &"</td><td width='12%' align='center' class='headmenu'>"& Lebi_gift(7) &"</td></tr>"
                Do While Not RsGift.eof 
                query_main = query_main &"<tr><td height='25' class='list'>"& RsGift("product_name") &"</td><td align='center' class='list'>"& RsGift("price") &"</td><td align='center' class='list'>"& RsGift("basket_count") &"</td><td align='center' class='list'>"& RsGift("price")*RsGift("basket_count") &"</td></tr>"
                RsGift.movenext 
                Loop
                query_main = query_main &"</table>"
        End If 
        RsGift.close : Set RsGift = Nothing 

        Dim SqlPro,RsPro,rss,sqls
        SqlPro="select * from [Lebi_Basket] where order_number="& rs("id") &" and IsGift=0 order by id desc"
'        If IsSqlDataBase = 1 Then SqlPro=SqlPro&" and datediff(s,basket_date,'"&rs("order_time")&"')<172800 order by basket_date desc"
'        If IsSqlDataBase = 0 Then SqlPro=SqlPro&" and datediff('h',basket_date,'"&rs("order_time")&"')<48 order by basket_date desc"
        Set RsPro = conn.execute(SqlPro)
		If Not Rspro.eof Then 
                query_main = query_main &"<table width='100%' cellpadding='0' cellspacing='1' align='center' class='MyUserInfo'><tr><td width='10%' height='25' align='center' class='headmenu'>"& Lebi_cart(33) &"</td><td width='40%' class='headmenu'>"& Lebi_cart(17) &"</td>"
				If EshopUseType = "1" Then
				        query_main = query_main &"<td width='10%' align='center' class='headmenu'>"& Lebi_cart(18) &"</td><td width='10%' align='center' class='headmenu'>"& Lebi_cart(19) &"</td>"
				End If 
				query_main = query_main &"<td width='10%' align='center' class='headmenu'>"& Lebi_cart(21) &"</td><td width='10%' align='center' class='headmenu'>"& Lebi_cart(22) &"</td><td width='10%' align='center' class='headmenu'>"& Lebi_cart(23) &"</td></td></tr>"
                do while not RsPro.eof
                query_main = query_main &"<tr><td align='center' class='list' height='25'>"& RsPro("bianhao") &"</td>"
                query_main = query_main &"<td height='25' class='list'><a target='_blank' href='"& Eshop_url & LangPath &""
				Select Case Config_Lebi_Eshop(16)
					   Case "0" : query_main = query_main &"showproduct.asp?id="& RsPro("id")
					   Case "1" : query_main = query_main &"product/?id="& RsPro("id")
					   Case "2" : query_main = query_main &"product/default.asp?id="& RsPro("id")
				End Select 
				query_main = query_main &"'>"& RsPro("product_name") &"</a></td>"
				If EshopUseType = "1" Then
                        query_main = query_main &"<td align='center' class='list'>"& RsPro("color") &"</td>"
                        query_main = query_main &"<td align='center' class='list'>"& RsPro("chima") &"</td>"
				End If 
                query_main = query_main &"<td align='center' class='list'>"& FormatNumber2(RsPro("price")/moneyhl) &"</td>"
                query_main = query_main &"<td align='center' class='list'>"& RsPro("basket_count") &"</td>"
                query_main = query_main &"<td align='center' class='list'>"& FormatNumber2(RsPro("price")*RsPro("basket_count")/moneyhl) &"</td></tr>"
				rspro.movenext 
				loop
		End If 
        RsPro.close : set RsPro=Nothing
        End If 
		End If 
		query_main = query_main &"</table>"
End Function 
Dim other_main
other_main = query_main
%>