<%
'**************************************
'* 最后更新 2013-01-19 by 56770.kingdge
'* Copyright www.56770.com
'**************************************
Dim myuser_main
ShowPath = "<a href='"& Eshop_url & LangPath &"'>"& Lebi_word(0) &"</a> → <a href='"& Eshop_url & PagePath(0) &"'>"& Lebi_word(8) &"</a>"
Select Case request("action")
	   Case "xgpass" : xgpass()
	   Case "xgzl" : xgzl()
	   Case "lostpass" : lostpass()
	   Case "getpass" : myuser_main = getpass : strwebtitle = Lebi_user(160) &"-" : ShowPath = ShowPath &" → "& Lebi_user(160)
	   Case "shoucang_add" : myuser_main = myuser_collect_add : strwebtitle = Lebi_user(78) &"-" : ShowPath = ShowPath &" → "& Lebi_user(78)
	   Case "shoucang_del" : myuser_main = myuser_collect_del : strwebtitle = Lebi_user(78) &"-" : ShowPath = ShowPath &" → "& Lebi_user(78)
	   Case "wmsg" : myuser_main = myuser_msg_ok : strwebtitle = Lebi_user(10) &"-" : ShowPath = ShowPath &" → "& Lebi_user(10)
	   Case "del_msg" : myuser_main = myuser_msg_del
	   Case "vip_update_yes" : myuser_main = myuser_vipuser_ok : strwebtitle = Lebi_user(12) &"-" : ShowPath = ShowPath &" → "& Lebi_user(12)
	   Case "change_score_yes" : myuser_main = myuser_change_score_ok : strwebtitle = Lebi_user(11) &"-" : ShowPath = ShowPath &" → "& Lebi_user(11)
	   Case "shenqing_yes" : myuser_main = myuser_sqpay_ok : strwebtitle = Lebi_user(13) &"-" : ShowPath = ShowPath &" → "& Lebi_user(13)
	   Case "up_orderzt" : myuser_main = myuser_orderinfo_state_ok : strwebtitle = Lebi_cart(113) &"-"
	   Case "payment_inform_ok" : myuser_main = payment_inform_ok : strwebtitle = Lebi_cart(171) &"-" : ShowPath = ShowPath &" → "& Lebi_cart(171)
	   Case "del_order" : myuser_main = myuser_del_order
End Select

Sub xgpass()
        Dim user_password,ps,ps1,error_type,Is_error
        ps1=safereplace(request("ps1"))
		ps=safereplace(request("ps"))
        if ps="" or Len(ps)>16 or len(ps)<6 Then
		        error_type = error_type & ",1,"
				Is_error = 1
		elseif ps1="" or Len(ps1)>16 or len(ps1)<6 Then
				error_type = error_type & ",2,"
				Is_error = 1
        elseif ps<>ps1 Then
				error_type = error_type & ",3,"
				Is_error = 1
        End If
		If Is_error = 1 Then
		        response.redirect Eshop_url & PagePath(1) &"?action=modiuserinfo&error_type="& error_type
				response.End
		Else
				'-----------------------------------------------------------------
				'系统整合
				'-----------------------------------------------------------------
				Dim API_LEBI,API_SaveCookie,SysKey
				If API_Enable Then
					Set API_LEBI = New API_Conformity
					API_LEBI.NodeValue "action","update",0,False
					API_LEBI.NodeValue "username",Lebi_UserId,1,False
					Md5OLD = 1
					SysKey = Md5(API_LEBI.XmlNode("username") & API_ConformKey)
					Md5OLD = 0
					API_LEBI.NodeValue "syskey",SysKey,0,False
					API_LEBI.NodeValue "password",ps,1,False
					API_LEBI.SendHttpData
					If API_LEBI.Status = "1" Then
						Response.Write "<script>alert('" &  API_LEBI.Message  & "');</script>"
						Exit Sub
					End If
					Set API_LEBI = Nothing
				End If
				'-----------------------------------------------------------------
                user_password=md5(ps)
                conn.execute "update [Lebi_user] set user_password='"&user_password&"' where user_id='"& Lebi_UserId &"'"
                response.redirect Eshop_url & PagePath(0) &"?action=modi&xgpass=ok"
                response.end
        end If
End sub

Sub xgzl()
		Dim fapiao_taitou,fapiao_company,fapiao_zhanghao,fapiao_shuihao,fapiao_adds,fapiao_zip,user_postalcode,user_tel,user_name,user_mail,oicq,fax,city,user_mobile,user_adds,birthday,user_answer,user_question,error_type,Is_error
		Dim regerror
        user_postalcode=safereplace(request("user_postalcode"))
        user_tel=safereplace(request("user_tel"))
        user_name=safereplace(request("user_name"))
        user_mail=safereplace(request("user_mail"))
        oicq=safereplace(request("oicq"))
        if oicq="" then oicq=" "
        fax=safereplace(request("fax"))
        if fax="" then fax=" "
        city=safereplace(request("city"))
        user_mobile=safereplace(request("user_mobile"))
        user_adds=safereplace(request("user_adds"))
        user_adds2=safereplace(request("user_adds2"))
        state=safereplace(request("state"))
        country=checknum(request("country"),0)
        birthday=safereplace(request("birthday"))
        fapiao_taitou=safereplace(request("fapiao_taitou"))
        fapiao_company=safereplace(request("fapiao_company"))
        fapiao_zhanghao=safereplace(request("fapiao_zhanghao"))
        fapiao_shuihao=safereplace(request("fapiao_shuihao"))
        fapiao_adds=safereplace(request("fapiao_adds"))
        fapiao_zip=safereplace(request("fapiao_zip"))
		If Len(user_name)<2 Or Len(user_name)>=20 Then
		        error_type = error_type & ",4,"
				Is_error = 1
        End if
		If Len(user_tel)<6 Or Len(user_tel)>20 Then
		        error_type = error_type & ",5,"
				Is_error = 1
        End if
		If IsValidEmail(user_mail)=false Then
		        error_type = error_type & ",6,"
				Is_error = 1
		End if
		If user_postalcode="" Or Len(user_postalcode)>6 Or not IsNumeric(user_postalcode) Then
		        error_type = error_type & ",7,"
				Is_error = 1
		End if
        If user_adds="" Or Len(user_adds)<5 Or Len(user_adds)>100 Then
		        error_type = error_type & ",8,"
				Is_error = 1
	    End If
		If Is_error = 1 Then
		        response.redirect Eshop_url & PagePath(1) &"?action=modiuserinfo&error_type="& error_type
				response.End
		Else
				user_answer = safereplace(trim(request("user_answer")))
				user_question = safereplace(trim(request("user_question")))
				'-----------------------------------------------------------------
				'系统整合
				'-----------------------------------------------------------------
				Dim API_LEBI,API_SaveCookie,SysKey
				If API_Enable Then
					Set API_LEBI = New API_Conformity
					API_LEBI.NodeValue "action","update",0,False
					API_LEBI.NodeValue "username",Lebi_UserId,1,False
					Md5OLD = 1
					SysKey = Md5(API_LEBI.XmlNode("username") & API_ConformKey)
					Md5OLD = 0
					API_LEBI.NodeValue "syskey",SysKey,0,False
					API_LEBI.NodeValue "user_name",user_name,1,False
					API_LEBI.NodeValue "question",user_question,1,False
					API_LEBI.NodeValue "answer",user_answer,1,False
					API_LEBI.NodeValue "email",user_mail,1,False
					API_LEBI.NodeValue "mobile",user_tel,1,False
					API_LEBI.NodeValue "qq",oicq,1,False
					API_LEBI.NodeValue "address",user_adds,1,False
					API_LEBI.NodeValue "zipcode",user_postalcode,1,False
					API_LEBI.NodeValue "telephone",fax,1,False
					API_LEBI.SendHttpData
					If API_LEBI.Status = "1" Then
						Response.Write "<script>alert('" &  API_LEBI.Message  & "');</script>"
						Exit Sub
					End If
					Set API_LEBI = Nothing
				End If
				'-----------------------------------------------------------------
				sql = "update [Lebi_user] set user_name='"&user_name&"',fax='"&fax&"',oicq='"&oicq&"', city='"&city&"', user_postalcode='"&user_postalcode&"', user_tel='"&user_tel&"', user_mail='"&user_mail&"', user_adds='"&user_adds&"',user_question='"& user_question &"',user_mobile='"& user_mobile &"',birthday='"& birthday &"'"
				If sys_soft = 1 Then sql = sql &",user_adds2='"&user_adds2&"',state='"&state&"',country='"&country&"'"
				If Config_Lebi_Eshop(2) = 1 Then sql = sql &",fapiao_company='"&fapiao_company&"',fapiao_adds='"&fapiao_adds&"',fapiao_zip='"&fapiao_zip&"'"
				If user_answer <>"" Then sql = sql &",user_answer='"& md5(user_answer) &"'"
				sql = sql &" where user_id='"& Lebi_UserId &"'"
                conn.execute(sql)
        		response.redirect Eshop_url & PagePath(0) &"?action=modi&xgzl=ok"
        		response.End
        End if
End Sub

Sub lostpass()
        Dim user_password,ps1,ps,u,r,error_type,Is_error
        ps1=safereplace(request("newpass"))
		ps=safereplace(request("Re_newpass"))
        u = safereplace(Trim(request("u")))
		r = safereplace(Trim(request("r")))
		Set rs = conn.execute("select * from [Lebi_lostpass] where l_user_id = '"& u &"' and l_md5str = '"& r &"'")
		If rs.eof Then
		        response.redirect"../"
		        response.End
		End If
		rs.close : Set rs = Nothing
        if ps="" or Len(ps)>16 or len(ps)<6 Then
		        error_type = error_type & ",1,"
				Is_error = 1
		elseif ps1="" or Len(ps1)>16 or len(ps1)<6 Then
				error_type = error_type & ",2,"
				Is_error = 1
        elseif ps<>ps1 Then
				error_type = error_type & ",3,"
				Is_error = 1
        End If
		If Is_error = 1 Then
		        response.redirect Eshop_url & PagePath(1) &"?action=modiuserinfo&error_type="& error_type
				response.End
		Else
				'-----------------------------------------------------------------
				'系统整合
				'-----------------------------------------------------------------
				Dim API_LEBI,API_SaveCookie,SysKey
				If API_Enable Then
					Set API_LEBI = New API_Conformity
					API_LEBI.NodeValue "action","update",0,False
					API_LEBI.NodeValue "username",u,1,False
					Md5OLD = 1
					SysKey = Md5(API_LEBI.XmlNode("username") & API_ConformKey)
					Md5OLD = 0
					API_LEBI.NodeValue "syskey",SysKey,0,False
					API_LEBI.NodeValue "password",ps,1,False
					API_LEBI.SendHttpData
					If API_LEBI.Status = "1" Then
						Response.Write "<script>alert('" &  API_LEBI.Message  & "');</script>"
						Exit Sub
					End If
					Set API_LEBI = Nothing
				End If
				'-----------------------------------------------------------------
				If SMS_State = "1" Then
						Set rsuser = conn.execute("select user_mobile,user_name from [Lebi_User] where user_id = '"& u &"'")
						If Not rsuser.eof Then
								If InStr(","& SMS_SendMode &",",",4,") > 0 Then
										If CheckMobile(rsuser(0)) Then
												Dim LoadSMSInfo,SMSMsg
												LoadSMSInfo = LoadStyle(Eshop_url&"include/lebi_data/SMS"& LangTxt &".data")
												SMSMsg = splits(Split(LoadSMSInfo,"@@@")(3))
												ReplaceStyle "user_id",u,SMSMsg
												ReplaceStyle "user_name",rsuser(1),SMSMsg
												ReplaceStyle "time",Now(),SMSMsg
												ReplaceStyle "password",request("newpass"),SMSMsg
												Call RedirectSendSMS(rsuser(0),SMSMsg,"lostpass","",sms_sendtype)
										End If
								End If
						End If
						rsuser.close : Set rsuser = Nothing
				End If
                user_password=md5(ps)
                conn.execute("update [Lebi_user] set user_password='"&user_password&"' where user_id='"& u &"'")
                response.redirect Eshop_url & PagePath(0) &"?action=changepass&do=update&u="&u&"&r="&r&"&newpass="& ps1
                response.end
        end If
End Sub

Function getpass()
        Dim user_name,answer,newpass,Re_newpass,rsuser
        user_name = safereplace(trim(request("user_name")))
        answer = safereplace(trim(request("answer")))
        newpass = safereplace(trim(request("newpass")))
        Re_newpass = safereplace(trim(request("Re_newpass")))
		If Len(newpass) < 6 Or Len(newpass) > 16 Then
				getpass = CallBack(Lebi_word(3),"·"&Lebi_user(162),"javascript:history.back();",2)
		End If
        If newpass <> Re_newpass Then
				getpass = CallBack(Lebi_word(3),"·"&Lebi_user(58),"javascript:history.back();",2)
	    End If
	    set Rs = conn.execute("select user_answer from [Lebi_user] where user_id = '"& user_name &"'")
	    If not rs.eof Then
                If cstr(trim(rs("user_answer"))) = cstr(md5(answer)) Then
						If SMS_State = "1" Then
								Set rsuser = conn.execute("select user_mobile,user_name from [Lebi_User] where user_id = '"& user_name &"'")
								If Not rsuser.eof Then
										If InStr(","& SMS_SendMode &",",",4,") > 0 Then
												If CheckMobile(rsuser(0)) Then
														Dim LoadSMSInfo,SMSMsg
														LoadSMSInfo = LoadStyle(Eshop_url&"include/lebi_data/SMS"& LangTxt &".data")
														SMSMsg = splits(Split(LoadSMSInfo,"@@@")(3))
														ReplaceStyle "user_id",u,SMSMsg
														ReplaceStyle "user_name",rsuser(1),SMSMsg
														ReplaceStyle "time",Now(),SMSMsg
														ReplaceStyle "password",request("newpass"),SMSMsg
														Call RedirectSendSMS(rsuser(0),SMSMsg,"lostpass","",sms_sendtype)
												End If
										End If
								End If
								rsuser.close : Set rsuser = Nothing
						End If
			            conn.execute("Update [Lebi_user] set user_password='"& md5(trim(newpass)) &"' where user_id='"& user_name &"'")
						'-----------------------------------------------------------------
						'系统整合
						'-----------------------------------------------------------------
						Dim API_LEBI,API_SaveCookie,SysKey
						If API_Enable Then
							Set API_LEBI = New API_Conformity
							API_LEBI.NodeValue "action","update",0,False
							API_LEBI.NodeValue "username",user_name,1,False
							Md5OLD = 1
							SysKey = Md5(API_LEBI.XmlNode("username") & API_ConformKey)
							Md5OLD = 0
							API_LEBI.NodeValue "syskey",SysKey,0,False
							API_LEBI.NodeValue "password",trim(newpass),1,False
							API_LEBI.SendHttpData
							If API_LEBI.Status = "1" Then
								Response.Write "<script>alert('" &  API_LEBI.Message  & "');</script>"
								Exit Function
							End If
							Set API_LEBI = Nothing
						End If
						'-----------------------------------------------------------------
						getpass = CallBack(Lebi_user(160),"·"& Lebi_user(175) &" "& newpass,Eshop_url & PagePath(6),2)
                Else
						getpass = CallBack(Lebi_word(3),"·"&Lebi_user(176),"javascript:history.back();",2)
                End If
		Else
				getpass = CallBack(Lebi_word(3),"·"&Lebi_user(173),"javascript:history.back();",2)
		End If
End Function

Function myuser_collect_add()
		rem	<-{ 判断会员组收藏权限 2008-3-4 by 56770.WangLei
		If Lebi_UserId = "" Then 
				response.redirect Eshop_url & PagePath(1) &"?action=needlogin&HTTP_REFERER="& server.urlencode(GetFileUrl())
		        response.End
		Else 
				If getGradePurview(1) <> 1 Then
						response.redirect Eshop_url & PagePath(1) &"?action=notgrade&HTTP_REFERER="& GetFileUrl()
						response.End
				End If
		End If 
		rem	}->
        Dim pid,id,product_name,mes,backurl,product_type,rsCount
        id = clng(request("id"))
        pid = clng(request("id"))
		product_type = safereplace(Trim(request("product_type")))
        product_name = safereplace(Trim(request("product_name")))
		If show_html = "0" Then
				backurl = CheckUrl(trim(request("backurl")))
				If backurl = "" Then backurl = CheckUrl(trim(request("HTTP_REFERER")))
				If InStr(backurl,"HTTP_REDIRECT=") > 0 Then backurl = URLDecode(Split(backurl,"HTTP_REDIRECT=")(1))
				If backurl = "" Then
					backurl = Request.ServerVariables("QUERY_STRING")
					If Instr(backurl,"HTTP_REDIRECT=") > 0 Then backurl = Split(backurl,"HTTP_REDIRECT=")(1)
				End If 
		Else
				backurl = "javascript:history.go(-1)" 'Request.ServerVariables("HTTP_REFERER")
		End If
		If InStr(LCase(Request.ServerVariables("HTTP_REFERER")),"error")>0 Then
				backurl = Eshop_url & LangPath
		End If
		If backurl = "" Then backurl = "javascript:history.go(-1)"
        '//收藏，判断是否存在
        set rs=server.CreateObject("adodb.recordset")
        sql="select id,user_id,actiondate,product_name,product_type from [Lebi_action] where user_id='"& Lebi_UserId &"' and id="&id
        rs.open sql, conn, 1, 3
        if not rs.eof and not rs.bof Then
                mes="·"&Lebi_user(152)
        Else
                '//判断收藏数
				rsCount = conn.execute("select count(id) from [Lebi_action] where user_id='"& Lebi_UserId &"'")(0)
                if rsCount >= CInt(getGradePurview(21)) Then

                        mes="·"& replace(Lebi_user(153),"{fav_qty}",getGradePurview(21))
                Else
                        '//添加收藏
                        rs.addnew
                        rs("id")=id
                        rs("user_id")=Lebi_UserId
                        rs("actiondate")=now()
                        rs("product_name")=Left(product_name,50)
						If product_type <> "[product_type]" Then  'WangLei 2008-1-14
							rs("product_type") = product_type
						End If
                        rs.update
						mes="·"&Lebi_user(154)
                end If
                rs.close:set rs=nothing
        end If
		myuser_collect_add = CallBack(Lebi_user(78),mes,backurl,2)
End Function

Function myuser_collect_del()
		Dim del_id
        del_id= Replace(safereplace(Trim(request("id"))),"，",",")
		If Right(del_id,1) = "," Then del_id = Left(del_id,Len(del_id)-1)
        conn.execute("delete from [Lebi_action] where user_id='"& Lebi_UserId &"' and actionid in("&del_id&")")
		myuser_collect_del = CallBack(Lebi_user(78),"·"&Lebi_word(68),Eshop_url & PagePath(0) &"?action=shoucang&page="& request("page"),2)
End Function

Function myuser_msg_ok()
        If Lebi_UserId ="" Then
                response.redirect Eshop_url & PagePath(1) &"?action=needlogin&HTTP_REFERER="& GetFileUrl()
		        response.End
        End If
        subject=safereplace(trim(request("subject")))
        strmsg=Replace(request("strmsg"),"'","&#180;")
        user_id=safereplace(request("user_id"))
        idate=now()
        ifre=1
        to_user="Admin"
        If subject="" or strmsg="" Then
		        myuser_msg_ok = CallBack(Lebi_user(10),"·"&Lebi_user(158),0,2)
        Else
                conn.execute "insert into [Lebi_message] (subject,msg, user_id, idate, to_user)values('"&subject&"', '"&strmsg&"', '"&user_id&"', '"&idate&"', '"&to_user&"')"
				If SMS_State = "1" Then
						If InStr(","& SMS_SendMode &",",",13,") > 0 Then
								If CheckMobile(sms_receiveno) Then
										Set rs = conn.execute("select user_name,user_mobile from [Lebi_user] where user_id='" & user_id &"'")
										user_name = rs(0)
										user_mobile = rs(1)
										rs.close:Set rs = Nothing
										Dim LoadSMSInfo,SMSMsg
										LoadSMSInfo = LoadStyle(Eshop_url&"include/lebi_data/SMS"& LangTxt &".data")
										SMSMsg = splits(Split(LoadSMSInfo,"@@@")(12))
										ReplaceStyle "user_id",user_id,SMSMsg
										ReplaceStyle "user_name",user_name,SMSMsg
										ReplaceStyle "mobile",user_mobile,SMSMsg
										ReplaceStyle "time",Now(),SMSMsg
										ReplaceStyle "title",subject,SMSMsg
										ReplaceStyle "content",strmsg,SMSMsg
										Call RedirectSendSMS(sms_receiveno,SMSMsg,"msgok","",sms_sendtype)
								End If
						End If
				End If
                myuser_msg_ok = CallBack(Lebi_user(10),"·"&Lebi_user(130),Eshop_url & PagePath(0) &"?action=msg&action2=outbox",2)
        End if
End Function

Function myuser_msg_del()
        If Lebi_UserId ="" Then
                response.redirect Eshop_url & PagePath(1) &"?action=needlogin&HTTP_REFERER="& GetFileUrl()
		        response.End
        End If
		Dim del_id
        del_id= Replace(safereplace(Trim(request("msgid"))),"，",",")
		If Right(del_id,1) = "," Then del_id = Left(del_id,Len(del_id)-1)
		conn.execute "delete from [Lebi_message] where id in ("& del_id &") and (user_id='"& Lebi_UserId &"' or to_user='"& Lebi_UserId &"')"
		myuser_msg_del = CallBack(Lebi_user(10),"·"&Lebi_word(68),Eshop_url & PagePath(0) &"?action=msg&action2="&request("action2"),2)
End Function

Function myuser_vipuser_ok()
        If Lebi_UserId ="" Then
                response.redirect Eshop_url & PagePath(1) &"?action=needlogin&HTTP_REFERER="& GetFileUrl()
		        response.End
        End If
		Dim tl,mes
        set Rs = server.CreateObject("adodb.recordset")
		rs.open "select jifen,user_grade,update_grade_time from [Lebi_user] where user_id='"& Lebi_UserId &"'",conn,1,3
        if rs("jifen")<CLng(getGradePurview(11)) Then
		        myuser_vipuser_ok = CallBack(Lebi_user(12),"·"& Lebi_user(144),0,2)
        ElseIf cache_auto_upgrade(rs("user_grade"))="1" Then
				If CInt(getGradePurview(12)) = 1 Then rs("jifen") = rs("jifen") - CDbl(getGradePurview(11))
				rs("user_grade") = CInt(rs("user_grade")) + 1
				rs("update_grade_time") = Date()
		        Response.cookies(cookiesname&"_user")("user_grade") = CInt(rs("user_grade")) + 1
				Session(cookiesname&"_user")("user_grade") = CInt(rs("user_grade")) + 1
				rs.update
		        myuser_vipuser_ok = CallBack(Lebi_user(12),"·"& Lebi_user(145),0,2)
		Else
				myuser_vipuser_ok = CallBack(Lebi_user(12),"·"& Lebi_user(144),0,2)
        End If
        rs.close:set rs=nothing
End Function

Function myuser_change_score_ok()
        If Lebi_UserId ="" Then
                response.redirect Eshop_url & PagePath(1) &"?action=needlogin&HTTP_REFERER="& GetFileUrl()
		        response.End
        End If
        Dim mes,jifen
		jifen = checknum(request("c_jifen"),0)
        if CStr(getGradePurview(4)) = "1" then
        sql="select jifen from [Lebi_user] where user_id='"& Lebi_UserId &"'"
        set rs= conn.execute(sql)
        if jifen = 0 Then
                mes="·"&Lebi_user(146)
        elseif CLng(jifen*moneyhl)>rs("jifen") Then
                mes="·"&Lebi_user(144)
        elseif CLng(jifen)<100 Then
                mes="·"&Lebi_user(147)
        Else
                conn.execute "update [Lebi_user] set jifen=jifen-"& jifen*moneyhl &" where user_id='"& Lebi_UserId &"'"
                conn.execute "update [Lebi_user] set usermoney=usermoney+"&jifen*CDbl(getGradePurview(5))*moneyhl&" where user_id='"& Lebi_UserId &"'"
                mes="·"&Lebi_user(148)&" "& dw & jifen*CDbl(getGradePurview(5)) & dw2
        end If
		myuser_change_score_ok = CallBack(Lebi_user(11),mes,0,2)
        rs.close:Set rs=Nothing
        end if
End Function

Function myuser_sqpay_ok() ' 2008-3-7 by 56770.WangLei
        If Lebi_UserId ="" Then
                response.redirect Eshop_url & PagePath(1) &"?action=needlogin&HTTP_REFERER="& GetFileUrl()
		        response.End
        End If
        Dim mes
        set Rs = conn.execute("select jifen,sumpay from [Lebi_user] where user_id='"& Lebi_UserId &"'")
        If (clng(rs(0))<clng(getGradePurview(7)) And clng(rs(1))<clng(getGradePurview(8))) Then
                mes="·"&Lebi_user(149)
        Else
	            conn.execute("update [Lebi_user] set ifpay=1 where user_id='"&   Lebi_UserId &"'")
                mes="·"&Lebi_user(200)
        end If
		myuser_sqpay_ok = CallBack(Lebi_user(13),mes,0,2)
        rs.close:set rs=Nothing
End Function

Function myuser_orderinfo_state_ok()
        If Lebi_UserId ="" Then
                response.redirect Eshop_url & PagePath(1) &"?action=needlogin&HTTP_REFERER="& GetFileUrl()
		        response.End
        End If
		Dim order_number,orderzt,rsuser,user_name,user_mail
		orderzt = ""
        order_number = Safereplace(request("order_number"))
        Set rs = conn.execute("select orderzt,order_number from [Lebi_orders] where order_number='"& order_number &"' and user_id='"& Lebi_UserId &"'")
	    If Not rs.eof Then
				orderzt = orderzt & rs(0) &",4,"
				conn.execute("update [Lebi_orders] set orderzt = '"& orderzt &"' where order_number='"& order_number &"' and user_id='"& Lebi_UserId &"'")
				conn.execute("update [Lebi_ShipMes] set s_state = 1 where s_order_number='"& order_number &"'")
				If SMS_State = "1" Then
						If InStr(","& SMS_SendMode &",",",11,") > 0 Then
								If CheckMobile(sms_receiveno) Then
										Set rsuser = conn.execute("select user_name,user_mobile from [Lebi_user] where user_id='" & Lebi_UserId &"'")
										user_name = rsuser(0)
										user_mobile = rsuser(1)
										rsuser.close:Set rsuser = Nothing
										Dim LoadSMSInfo,SMSMsg
										LoadSMSInfo = LoadStyle(Eshop_url&"include/lebi_data/SMS"& LangTxt &".data")
										SMSMsg = splits(Split(LoadSMSInfo,"@@@")(10))
										ReplaceStyle "user_id",Lebi_UserId,SMSMsg
										ReplaceStyle "user_name",user_name,SMSMsg
										ReplaceStyle "mobile",user_mobile,SMSMsg
										ReplaceStyle "time",Now(),SMSMsg
										ReplaceStyle "order_number",order_number,SMSMsg
										Call RedirectSendSMS(sms_receiveno,SMSMsg,"confirm_order","",sms_sendtype)
								End If
						End If
				End If
        End If
	    rs.close:Set rs=Nothing
	    myuser_orderinfo_state_ok = CallBack(Lebi_cart(113),"·"&Lebi_cart(117)&"!",CheckUrl(trim(request("backurl"))),2)
End Function

Function payment_inform_ok()
        Dim orders_id,payment_type,payment_money,payment_time,payment_info,p_error,err_msg
		p_error=false
		orders_id = safereplace(trim(request("id")))
        payment_type = safereplace(trim(request("payment_type")))
        payment_money = safereplace(trim(request("payment_money")))
        payment_time = safereplace(trim(request("payment_time")))
        payment_info = safereplace(trim(request("payment_info")))
		If orders_id = "" Then
				p_error = True
				err_msg = err_msg & "·"& Lebi_cart(177)
'		Else
'			Set rs = conn.execute("select user_id from [Lebi_orders] where order_number='"&orders_id&"'")
'			If Not rs.eof Then
'				user_id = rs("user_id")
'			Else
'				p_error = True
'				err_msg = err_msg & "<tr><td height='25'>·"& Lebi_cart(177) &"</td></tr>"
'			End If
'			rs.close : Set rs = Nothing
		End If
		If payment_type = "" Then
				p_error = True
				err_msg = err_msg & "·"& Lebi_cart(175) &"<br/>"
		End If
		If payment_money = "" Or Not IsNumeric(payment_money) Then
				p_error = True
				err_msg = err_msg & "·"& Lebi_cart(176) &"<br/>"
		End If
		If Not p_error Then
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select * from [Lebi_payment_inform] where orders_id = '"& orders_id &"'", conn,1,3
				If not rs.eof Then
	'				p_error = True
	'				err_msg = err_msg & "<tr><td height='25'>·"& Lebi_cart(178) &"</td></tr>"h
					rs("payment_type") = payment_type
					rs("payment_money") = payment_money
					rs("payment_time") = payment_time
					rs("payment_info") = payment_info
					rs.update
				Else
					rs.addnew
					rs("orders_id") = orders_id
					rs("user_id") = Lebi_UserId
					rs("payment_type") = payment_type
					rs("payment_money") = payment_money
					rs("payment_time") = payment_time
					rs("payment_info") = payment_info
					rs.update
				End If
				rs.close:Set rs = Nothing
				If SMS_State = "1" Then
						If InStr(","& SMS_SendMode &",",",10,") > 0 Then
								If CheckMobile(sms_receiveno) Then
										Set rs = conn.execute("select user_name,user_mobile from [Lebi_user] where user_id='" & Lebi_UserId &"'")
										user_name = rs(0)
										user_mobile = rs(1)
										rs.close:Set rs = Nothing
										Dim LoadSMSInfo,SMSMsg
										LoadSMSInfo = LoadStyle(Eshop_url&"include/lebi_data/SMS"& LangTxt &".data")
										SMSMsg = splits(Split(LoadSMSInfo,"@@@")(9))
										ReplaceStyle "user_id",Lebi_UserId,SMSMsg
										ReplaceStyle "user_name",user_name,SMSMsg
										ReplaceStyle "mobile",user_mobile,SMSMsg
										ReplaceStyle "time",Now(),SMSMsg
										ReplaceStyle "paymentype",payment_type,SMSMsg
										ReplaceStyle "money",payment_money,SMSMsg
										Call RedirectSendSMS(sms_receiveno,SMSMsg,"payment_info_ok","",sms_sendtype)
								End If
						End If
				End If
		End If
		If p_error Then
				payment_inform_ok = CallBack(Lebi_word(3) &"&nbsp;&nbsp;〖"& Lebi_cart(171) &"〗",err_msg,0,2)
		Else
				payment_inform_ok = CallBack(Lebi_cart(171),"·"&Lebi_user(130),Eshop_url & PagePath(0) &"?action=dingdan",2)
		End If
End Function

Function myuser_del_order()
        If Lebi_UserId ="" Then
                response.redirect Eshop_url & PagePath(1) &"?action=needlogin"
		        response.End
        End If
        page=checknum(request("page"),1)
        Set rs = server.CreateObject("adodb.recordset")
		rs.open "select user_id from [Lebi_orders] where id=" & checknum(request("id"),0),conn,1,3
		If Not rs.eof Then
				If CStr(rs(0)) <> CStr(Lebi_UserId) Then
						response.write("<script>alert('ERROR[001]');javascript:history.back();</script>")
						response.End
				Else
						rs.delete
						rs.update()
				End If
        end If
        rs.close : Set rs = Nothing
        response.redirect Eshop_url & PagePath(0) &"?action=dingdan"
		response.End
End Function
%>