<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/Lebi_md5.asp"-->
<!--#include file="../include/Lebi_Config.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_user.asp
'* 最后更新 2014-01-02 by 56770.kingdge
'*****************************************
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_user.inc"
CurrentId = 3
CurrentUrl = "admin_user.asp"
LB_Head()
LB_Menu()
action = request("action")
usergrade = SafeReplace(request("user_grade"))
ifpay = SafeReplace(request("ifpay"))
user_id = SafeReplace(request("user_id"))
PluginEmail = 0
Set rsplugin = conn.execute("select p_state from [lebi_plugin] where p_type = 3 and p_flag = '1'")
If Not rsplugin.eof Then 
	If rsplugin(0) = 1 Then 
	PluginEmail = 1
	End If 
End If 
rsplugin.close : Set rsplugin = Nothing 
%>
<div class="tabmenu mainwidth">
      <ul>
        <li <%If action <> "add" And action <> "view" And (usergrade = "" And ifpay = "") Then Response.Write("class=""current""") End If%>><a href="admin_user.asp"><span><%=Lang_Menu(56)%></span></a></li>
<%
If action <> "view" Then
		sql="select grade_dj,grade_name from [Lebi_user_grade] where grade_dj <> 0 order by grade_dj"
		set rs = conn.execute(sql)
		do while not rs.eof
			Response.Write("<li ")
			If usergrade = ""& rs(0) &"" Then Response.Write("class=""current""") End If
			Response.Write("><a href=""?user_grade="& rs(0) &"""><span>"& rs(1) &"</span></a></li>")
			rs.movenext
		Loop
		rs.close:Set rs = Nothing
%>
        <li <%If ifpay = "1" Then Response.Write("class=""current""") End If%>><a href="?ifpay=1"><span><%=Lang_Menu(104)%></span></a></li>
        <li <%If action = "add" Then Response.Write("class=""current""") End If%>><a href="?action=add"><span><%=Lang_User(14)%></span></a></li>
<%Else%>
        <li class="current"><a href="Admin_user.asp?action=view&user_id=<%=urlencode(user_id)%>"><span><%=user_id%></span></a></li>
        <li><a href="Admin_orders.asp?user_id=<%=urlencode(user_id)%>"><span><%=Lang_User(58)%></span></a></li>
        <li><a href="Admin_user_log.asp?user_id=<%=urlencode(user_id)%>"><span><%=Lang_User(59)%></span></a></li>
        <li><a href="Admin_user_account.asp?user_id=<%=urlencode(user_id)%>"><span><%=Lang_User(154)%></span></a></li>
        <li><a href="Admin_msg.asp?action=add&user_id=<%=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 action
		Case "del" : del()
		Case "dellostuser" : dellostuser()
		Case "add_ok" : add_ok()
		Case "add" : add()
		Case "edit_ok" : edit_ok()
		Case "edit" : edit()
		Case "view" : view()
		Case "shenqingok" : shenqingok()
		Case Else
		list()
End Select
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub add_ok()
		isback = request("isback")
        user_mail=Safereplace(trim(request("user_mail")))
        user_id=Safereplace(trim(request("user_id")))
        user_name=Safereplace(trim(request("user_name")))
        password=Safereplace(trim(request("ps2")))
        city=Safereplace(trim(request("city")))
        user_tel=Safereplace(trim(request("user_tel")))
        user_adds=Safereplace(trim(request("user_adds")))
        user_adds2=Safereplace(trim(request("user_adds2")))
        state=Safereplace(trim(request("state")))
        country=Safereplace(trim(request("country")))
        user_postalcode=Safereplace(trim(request("user_postalcode")))
        fax=Safereplace(trim(request("fax")))
		form_user_grade=Safereplace(trim(request("form_user_grade")))
		form_ifpay=Safereplace(trim(request("form_ifpay")))
		sex=Safereplace(trim(request("sex")))
		birthday=Safereplace(trim(request("birthday")))
		user_mobile=Safereplace(trim(request("user_mobile")))
		user_remark = safereplace(request("user_remark"))
		Set rs = conn.execute("select user_id from Lebi_user where user_id = '"& user_id &"'")
		If Not rs.eof Then
				response.write"<SCRIPT language=JavaScript>alert('"& Lang_User(4) &"');javascript:history.go(-1)</SCRIPT>"
				response.end
		End If
		rs.close
		'-----------------------------------------------------------------
		'系统整合
		'-----------------------------------------------------------------
		If sex = Lang_User(5) Then
			sex = "0"
		Else
			sex = "1"
		End If
		Dim API_LEBI,API_SaveCookie,SysKey
		If API_Enable Then
				Set API_LEBI = New API_Conformity
				API_LEBI.NodeValue "action","reguser",0,False
				API_LEBI.NodeValue "username",user_id,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",password,0,False
				API_LEBI.NodeValue "email",user_mail,1,False
				API_LEBI.NodeValue "question",user_question,1,False
				API_LEBI.NodeValue "answer",user_answer,1,False
				API_LEBI.NodeValue "truename",user_name,1,False
				API_LEBI.NodeValue "gender",sex,0,False
				API_LEBI.NodeValue "qq",user_oicq,1,False
				API_LEBI.NodeValue "mobile",user_mobile,1,False
				API_LEBI.NodeValue "address",user_adds,1,False
				API_LEBI.NodeValue "zipcode",user_postalcode,1,False
				API_LEBI.NodeValue "telephone",user_tel,1,False
				API_LEBI.SendHttpData
				If API_LEBI.Status = "1" Then
						Response.Write "<script>alert('" &  API_LEBI.Message  & "');</script>"
						Exit Sub
				Else
						Dim usercookies:usercookies=1
						API_SaveCookie = API_LEBI.SetCookie(SysKey,user_id,md5(password),usercookies)
				End If
				Set API_LEBI = Nothing
		End If
		'-----------------------------------------------------------------
		Set rs = Server.CreateObject("ADODB.Recordset")
		rs.open "select * from [Lebi_user]",conn,1,3
		rs.addnew
		rs("user_id")=user_id
		rs("user_name")=user_name
		rs("sex")=sex
		rs("city")=city
		rs("user_postalcode")=user_postalcode
		rs("user_tel")=user_tel
		rs("fax")=fax
		rs("oicq")=oicq
		rs("user_mail")=user_mail
		rs("jifen")=jifen
		rs("user_grade")=form_user_grade
		rs("user_adds")=user_adds
		rs("user_question")=user_question
		rs("ifpay")=form_ifpay
		rs("birthday") = birthday
		rs("user_mobile") = user_mobile
		rs("user_password")=md5(password)
		rs("user_answer")=""
		rs("jifen")=Config_Lebi_Eshop(0)
		rs("regdate")=now()
		rs("lastlogintime")=now()
		rs("lastloginip")=""
		rs("regip")=""
		rs("locksj")=now()
		rs("logins")=0
		rs("usermoney")=0
		rs("sumpay")=0
		rs("ifpay")=form_ifpay
		rs("shenqing")=0
		rs("lock")=1
		rs("user_remark") = user_remark
		If sys_soft = 1 Then 
			rs("user_adds2")=user_adds2
			rs("state") = state
			rs("country") = country
		End If 
		rs.update
		rs.close : Set rs = Nothing
		ManageLog Lang_User(7) &" ["&user_id&"]"
		If isback = 0 Then
				m_u = "?"
		Else
				m_u = "Admin_order_quick.asp?action=setcookie&user_id="& user_id
		End If
		Call Up_mes(Lang_sys(45),"·"& Lang_sys(44),0,m_u,0,0,2,1)
End Sub

Sub del()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",4.2,"
	    If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
                adminflag()
	    Else
                user_id=Split(safereplace(request("id")),",")
                if request("id")="" then
                       response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
                       response.end
                end If
                For i = 0 To UBound(user_id)
                        conn.execute "delete from [Lebi_user] where user_id = '" & Trim(user_id(i)) &"'"
                        conn.execute "delete from [Lebi_message] where to_user = '" & Trim(user_id(i)) &"'"
                        conn.execute "delete from [Lebi_action] where user_id = '" & Trim(user_id(i)) &"'"
                        conn.execute "delete from [Lebi_basket] where user_id = '" & Trim(user_id(i)) &"'"
                        conn.execute "delete from [Lebi_orders] where user_id = '" & Trim(user_id(i)) &"'"
                        conn.execute "delete from [Lebi_dvote] where user_id = '" & Trim(user_id(i)) &"'"
                        conn.execute "delete from [Lebi_money_log] where m_user_id = '" & Trim(user_id(i)) &"'"
						'-----------------------------------------------------------------
						'系统整合
						'-----------------------------------------------------------------
						Dim API_LEBI,API_SaveCookie,SysKey
						If API_Enable Then
							Set API_LEBI = New API_Conformity
							API_LEBI.NodeValue "action","delete",0,False
							API_LEBI.NodeValue "username",Trim(user_id(i)),1,False
							Md5OLD = 1
							SysKey = Md5(API_LEBI.XmlNode("username") & API_ConformKey)
							Md5OLD = 0
							API_LEBI.NodeValue "syskey",SysKey,0,False
							API_LEBI.SendHttpData
							If API_LEBI.Status = "1" Then
								Response.Write "<script>alert('" &  API_LEBI.Message  & "');javascript:history.back();</script>"
								Exit Sub
							End If
							Set API_LEBI = Nothing
						End If
						'-----------------------------------------------------------------
				Next
				ManageLog Lang_User(8) &" ["&request("id")&"]"
                response.redirect CheckUrl(request("ref"))
        End If
End Sub

Sub dellostuser
        If OnlyRead = 1 Then OnlyReadMessage()
		On Error Resume next
		admin_flag=",4.2,"
			If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
			adminflag()
			else
		set rs=conn.execute("select user_id from [Lebi_user] where logins>=1 and regdate<"&sqlnowstring&"-60 and lastlogintime<"&sqlnowstring&"-60")
		if rs.eof then
		response.write "<script language='javascript'>alert('没有可删除的信息！');window.document.location.href='Admin_user.asp';</script>"
		Response.End
		else
		do while not rs.eof
		conn.execute "delete from [Lebi_user] where user_id='" & rs("user_id")&"'"
		conn.execute "delete from [Lebi_message] where to_user='" & rs("user_id")&"'"
		conn.execute "delete from [Lebi_action] where user_id='" & rs("user_id")&"'"
		conn.execute "delete from [Lebi_basket] where user_id='" & rs("user_id")&"'"
		conn.execute "delete from [Lebi_orders] where user_id='" & rs("user_id")&"'"
		conn.execute "delete from [Lebi_dvote] where user_id='" & rs("user_id")&"'"
		conn.execute "delete from [Lebi_money_log] where m_user_id='" & rs("user_id")&"'"
		rs.movenext
		loop
		end if
		rs.close:set rs=nothing
		ManageLog "删除60天以上没有登陆的会员"
		response.write "<script language='javascript'>alert('60天以上没有登陆的用户已经删除！');window.document.location.href='Admin_user.asp';</script>"
		Response.End
		end if
end sub

sub shenqingok()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",4.1,"
        If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
                adminflag()
        Else
                ifpay=CheckNum(request("ifpay"),0)
                id=CheckNum(request("id"),0)
				Set rs = conn.execute("select a.*,b.accounts_jifen,b.accounts_cash from [Lebi_user] as a,[Lebi_user_grade] as b where a.id="&id&" and a.user_grade=b.grade_dj")
                jifen=rs("jifen")
                sumpay=rs("sumpay")
				user_id=rs("user_id")
				accounts_jifen = rs("accounts_jifen")
				accounts_cash = rs("accounts_cash")
                rs.close : set rs=nothing
                if ifpay=1 Then
                        if clng(jifen)<clng(accounts_jifen) Or clng(sumpay)<clng(accounts_cash) Then
                                response.write"<SCRIPT language=JavaScript>alert('"& Lang_User(9) &"');javascript:history.go(-1)</SCRIPT>"
                                response.end
                        Else
                                conn.execute "update [Lebi_user] set ifpay="&ifpay&",shenqing=0 where id=" & id
                        End If
                Else
                        conn.execute "update [Lebi_user] set ifpay="&ifpay&",shenqing=0 where id=" & id
                End If
				ManageLog Lang_User(10) &" ["&user_id&"]"
                m_u="?id="&id&"&user_grade="&request("user_grade")&"&moneypay="& request("moneypay") &"&pagenum="& request("pagenum") &"&ifpay="& request("ifpay") &"&page="&request("page")
                Call Up_mes(Lang_sys(69),"·"& Lang_User(11),0,m_u,0,0,2,1)
        End If
End Sub

Sub edit_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",4.1,"
        If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
                adminflag()
        Else
				Dim LoadSMSInfo,SMSMsg
                id = CheckNum(request("id"),0)
                user_name=Safereplace(trim(request("user_name")))
                sex=Safereplace(trim(request("sex")))
                city=Safereplace(trim(request("city")))
                if city="" then city=""
                user_postalcode=Safereplace(trim(request("user_postalcode")))
                if user_postalcode="" then user_postalcode=""
                user_tel=Safereplace(trim(request("user_tel")))
                if user_tel="" then user_tel=""
                fax=Safereplace(trim(request("fax")))
                if fax="" then fax=""
                oicq=Safereplace(trim(request("oicq")))
                if oicq="" then oicq=" "
                user_mail=Safereplace(trim(request("user_mail")))
                form_user_grade=CheckNum(request("form_user_grade"),0)
                jifen=CheckNum(request("jifen"),0)
                user_adds=Safereplace(trim(request("user_adds")))
                yxq=Safereplace(trim(request("yxq")))
                if yxq="" then yxq=Date()+365
                sumpay=CheckNum(request("sumpay"),0)
                usermoney=CheckNum(request("usermoney"),0)
                sfz=Safereplace(trim(request("sfz")))
                user_answer = safereplace(trim(request("user_answer")))
                user_question = safereplace(trim(request("user_question")))
                user_password = Trim(safereplace(request("user_password")))
                birthday = Trim(safereplace(request("birthday")))
                user_mobile = Trim(safereplace(request("user_mobile")))
				form_ifpay=CheckNum(request("form_ifpay"),0)
				user_remark = safereplace(request("user_remark"))
				user_adds2=Safereplace(trim(request("user_adds2")))
				state=Safereplace(trim(request("state")))
				country=Safereplace(trim(request("country")))
                Set rs = conn.execute("select usermoney,user_id,LangTxt from [Lebi_user] where id=" & id)
                str_usermoney=rs(0)
				user_id = rs(1)
				LangTxt = rs(2)
                rs.close
                set rs=Nothing
                rem 预存款消费明细 2006-1-2 Lebi.kingdge
                If Clng(usermoney)>Clng(str_usermoney) Then
		                conn.execute("insert into [Lebi_money_log](m_user_id,m_order_num,m_sj,m_type,m_price,m_zt)values('"&user_name&"','-',"&sqlnowstring&",'管理员"&Safereplace(Eshop_Lebi_name)&"操作：增加预存款"&usermoney-str_usermoney&"元',"&usermoney-str_usermoney&",1)")
						If SMS_State = "1" Then
								If CheckMobile(user_mobile) Then
										If InStr(","& SMS_SendMode &",",",7,") > 0 Then
												LoadSMSInfo = LoadStyle("../include/lebi_data/SMS"& LangTxt &".data")
												SMSMsg = splits(Split(LoadSMSInfo,"@@@")(6))
												ReplaceStyle "user_id",user_id,SMSMsg
												ReplaceStyle "user_name",user_name,SMSMsg
												ReplaceStyle "time",Now(),SMSMsg
												ReplaceStyle "money",usermoney,SMSMsg
												Call RedirectSendSMS(user_mobile,SMSMsg,0,"",sms_sendtype)
		'										code = newclient.getCode()
		'										If code <> "2000" Then
		'												m_s = m_s &"<br/>·手机短信发送失败！"
		'										Else
		'												m_s = m_s &"<br/>·手机短信发送成功！"
		'										End If
										End If
								End If
						End If
                ElseIf Clng(usermoney)<Clng(str_usermoney) Then
		                conn.execute("insert into [Lebi_money_log](m_user_id,m_order_num,m_sj,m_type,m_price,m_zt)values('"&user_name&"','-',"&sqlnowstring&",'管理员"&Eshop_Lebi_name&"操作：扣除预存款"&str_usermoney-usermoney&"元',"&str_usermoney-usermoney&",1)")
						If SMS_State = "1" Then
								If CheckMobile(user_mobile) Then
										If InStr(","& SMS_SendMode &",",",7,") > 0 Then
												LoadSMSInfo = LoadStyle("../include/lebi_data/SMS"& LangTxt &".data")
												SMSMsg = splits(Split(LoadSMSInfo,"@@@")(6))
												ReplaceStyle "user_id",user_id,SMSMsg
												ReplaceStyle "user_name",user_name,SMSMsg
												ReplaceStyle "time",Now(),SMSMsg
												ReplaceStyle "money",str_usermoney,SMSMsg
												Call RedirectSendSMS(user_mobile,SMSMsg,1,"",sms_sendtype)
		'										code = newclient.getCode()
		'										If code <> "2000" Then
		'												m_s = m_s &"<br/>·手机短信发送失败！"
		'										Else
		'												m_s = m_s &"<br/>·手机短信发送成功！"
		'										End If
										End If
								End If
						End If
                End If
				Set rs = Server.CreateObject("ADODB.Recordset")
                rs.open "select * from [Lebi_user] where id=" & id &"",conn,1,3
                        rs("user_name")=user_name
                        rs("sex")=sex
                        rs("city")=city
                        rs("user_postalcode")=user_postalcode
                        rs("user_tel")=user_tel
                        rs("fax")=fax
                        rs("oicq")=oicq
                        rs("user_mail")=user_mail
                        rs("jifen")=jifen
                        rs("user_grade")=form_user_grade
                        rs("user_adds")=user_adds
						rs("yxq")=yxq
                        rs("usermoney")=usermoney
                        rs("sumpay")=sumpay
                        rs("user_question")=user_question
						rs("ifpay")=form_ifpay
						rs("birthday") = birthday
						rs("user_mobile") = user_mobile
						rs("user_remark") = user_remark
						If sys_soft = 1 Then 
							rs("user_adds2")=user_adds2
							rs("state") = state
							rs("country") = country
						End If 
						If user_password <>"" Then rs("user_password")=md5(user_password)
						If user_answer <>"" Then rs("user_answer")=md5(user_answer)
						user_id = rs("user_id")
						'-----------------------------------------------------------------
						'系统整合
						'-----------------------------------------------------------------
						If sex = Lang_User(5) Then
							sex = "0"
						Else
							sex = "1"
						End If
						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_id,1,False
							Md5OLD = 1
							SysKey = Md5(API_LEBI.XmlNode("username") & API_ConformKey)
							Md5OLD = 0
							API_LEBI.NodeValue "syskey",SysKey,0,False
							If user_password <>"" Then API_LEBI.NodeValue "password",user_password,1,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_mobile,1,False
							API_LEBI.NodeValue "qq",oicq,1,False
							API_LEBI.NodeValue "gender",sex,1,False
							API_LEBI.NodeValue "address",user_adds,1,False
							API_LEBI.NodeValue "zipcode",user_postalcode,1,False
							API_LEBI.NodeValue "telephone",user_tel,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
						'-----------------------------------------------------------------
                rs.update
				rs.close : Set rs = Nothing
				ManageLog Lang_User(12) &" ["&user_id&"]"
                Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,CheckUrl(request("ref")),0,0,2,1)
        End If
End Sub

sub add()
admin_flag=",4.1,"
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
		adminflag()
		response.End
End If
isback = CheckNum(request("isback"),0)
%>
<script language="JavaScript" type="text/JavaScript" src="inc/js/user.js"></script>
<script type="text/JavaScript">
function CheckForm(theform)
	{
		if (Empty(theform.user_id))
		{
			ShowinnerHTML(theform.user_id,C_user_id,'<%=Lang_User(73)%>');return false;
		}
		if (theform.user_id.value.length<2 || theform.user_id.value.length>20)
		{
			ShowinnerHTML(theform.user_id,C_user_id,'<%=Lang_User(78)%>');return false;
		}
		if (Empty(theform.ps1))
		{
			ShowinnerHTML(theform.ps1,C_user_ps1,'<%=Lang_User(79)%>');return false;
		}
		if (theform.ps1.value.length<6 || theform.ps1.value.length>16)
		{
			ShowinnerHTML(theform.ps1,C_user_ps1,'<%=Lang_User(80)%>');return false;
		}
		if (Empty(theform.ps2))
		{
			ShowinnerHTML(theform.ps2,C_user_ps2,'<%=Lang_User(81)%>');return false;
		}
		if (trim(theform.ps1.value) == trim(theform.ps2.value)){}else{
			ShowinnerHTML(theform.ps2,C_user_ps2,'<%=Lang_User(82)%>');return false;
		}
		if (Empty(theform.user_name))
		{
			ShowinnerHTML(theform.user_name,C_user_name,'<%=Lang_User(83)%>');return false;
		}
	}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="add" class="classtable">
<form action="?action=add_ok" method="post" name="reg" onSubmit="return CheckForm(this);">
<tr>
	<td height="30" align="left" 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"></td>
	<td align="right" class="classhead">
	<%=QuickMenu("?ifpay=1|"& Lang_Menu(104) &"","Home_users.asp|"& Lang_Menu(102) &"")%>
	</td>
 </tr>
<tr>
   <td class="classtop" height="30" colspan="2"><%=Lang_User(14)%></td>
 </tr>
<tr class="classrow">
<td align=left width="15%" height="30" class="classrow"><%=Lang_User(15)%><font color=red>*</font></td>
<td width="85%" class="classrow"><input type="text" id="user_id" name="user_id" onChange="Check_user_id();" style="width:200px;" maxlength="20" class="form"> <span id="C_user_id"><em><%=Lang_User(16)%></em></span></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(17)%><font color=red>*</font></td>
<td class="classrow"><input type="password" id="ps1" name="ps1" onChange="Check_user_ps1();" style="width:200px;" maxlength="16"  class="form"> <span id="C_user_ps1"><em><%=Lang_User(18)%></em></span></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(19)%><font color=red>*</font></td>
<td class="classrow"><input type="password" id="ps2" name="ps2" onChange="Check_user_pass();" style="width:200px;" maxlength="16" class="form"> <span id="C_user_ps2"><em><%=Lang_User(20)%></em></span></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(21)%><font color=red>*</font></td>
<td class="classrow"><input type="text" id="user_name" name="user_name" onChange="Check_user_name();" style="width:200px;" class="form">&nbsp;<%=Lang_User(22)%>
<select name=sex class=form >
<option selected value="<%=Lang_User(6)%>"><%=Lang_User(6)%></option>
<option value="<%=Lang_User(5)%>"><%=Lang_User(5)%></option>
</select> <span id="C_user_name"><em><%=Lang_User(23)%></em></span></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(27)%></td>
<td class="classrow">
<%If sys_soft = 0 Then%>
<input type="text" name="user_tel" style="width:200px;" class="form">
<%Else%>
(<input type="text" name="user_tel" size="3" class="form">).<input type="text" name="user_tel" size="2" class="form">.<input type="text" name="user_tel" size="2" class="form">
<%End If%>
</td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(31)%></td>
<td class="classrow"><input type="text" name="user_adds" style="width:300px;" class="form"></td>
</tr>
<%If sys_soft = 1 Then%>
<tr class="classrow">
<td align=left height="30" class="classrow">&nbsp;</td>
<td class="classrow"><input type="text" name="user_adds2" style="width:300px;" class="form"></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(30)%></td>
<td class="classrow"><input type="text" name="user_postalcode" style="width:200px;" maxlength="6" class="form"></td>
</tr>
<%End If%>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(160)%></td>
<td class="classrow"><input type="text" name="city" style="width:200px;" class="form"></td>
</tr>
<%If sys_soft = 1 Then%>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(161)%></td>
<td class="classrow"><input type="text" name="state" style="width:200px;" class="form"></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(162)%></td>
<td class="classrow"><select name="country">
<%
Set country = conn.execute("Select id,area_name from [lebi_deliver_area] order by area_order desc")
If Not country.eof Then
	Do While Not country.eof
	Response.write("<option value="""& Country(0) &""">"& Country(1) &"</option>")
	country.movenext
	Loop
End If
country.close : Set country = Nothing
%>
</select></td>
</tr>
<%End If%>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(24)%></td>
<td class="classrow"><input type="text" name="birthday" style="width:200px;" maxlength="6" class="form"></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(25)%></td>
<td class="classrow"><input type="text" name="user_mail" style="width:200px;" value="@" class="form"> </td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(26)%></td>
<td class="classrow"><input type="text" name="user_mobile" style="width:200px;" class="form"> </td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(28)%></td>
<td class="classrow"><input type="text" name="fax" style="width:200px;" maxlength="18" class="form"></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(32)%></td>
<td class="classrow"><%=select_grade(1)%></td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow"><%=Lang_User(33)%></td>
<td class="classrow"><input type="radio" value="0" name="form_ifpay" checked> <%=Lang_User(34)%>
<input type="radio" value="1" name="form_ifpay"> <%=Lang_User(35)%>
</td>
</tr>
<tr class="classrow">
<td align=left height="30" class="classrow" valign="top" style="padding-top:6px"><%=Lang_sys(96)%><br /><em>≤ <span id="r_remLen">255</span></em></td>
<td class="classrow"><textarea wrap="r_physical" name="user_remark" id="user_remark" rows="3" cols="60" onKeyDown="r_checkMaxInput(this.form)" onKeyUp="r_checkMaxInput(this.form)" class="text"></textarea>
<script>
var r_maxLen = 255;
var user_remark = document.getElementById("user_remark");
function r_checkMaxInput(form) {
if (user_remark.value.length > r_maxLen)
user_remark.value = user_remark.value.substring(0, r_maxLen);
else document.getElementById("r_remLen").innerHTML = r_maxLen - user_remark.value.length;
}
</script>
<br /><a href="javascript:u_Size(-5,'user_remark')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
<a href="javascript:u_Size(5,'user_remark')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
</td>
</tr>
<tr>
<td height="30" align="left" class="classfooter" 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="isback" value="<%=isback%>">
</td>
</tr>
</form>
</table>
<script>tdshow("add");</script>
<%
end sub

sub edit()
admin_flag=",4.1,"
	If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
	adminflag()
	else
id=CheckNum(request("id"),0)
Set rs = conn.execute("select * from [Lebi_user] where id=" & id)
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="edit" class="classtable">
<form action="?action=edit_ok" method="post" name="edit_ok">
<tr>
	<td colspan="3" height="30" align="left" 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"></td>
	<td align="right" class="classhead">
	<%=QuickMenu("","")%>
	</td>
 </tr>
<tr>
   <td class="classtop" height="30" colspan="4"><%=Lang_User(36)%></td>
 </tr>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_User(15)%></td>
<td width="35%" class="classrow"><%=rs("user_id")%></td>
<td width="15%" class="classrow"><%=Lang_User(17)%></td>
<td width="35%" class="classrow">
<input type="text" name="user_password" value="" class="form">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(37)%></td>
<td class="classrow">
<input type="text" name="user_question" value="<%=Trim(rs("user_question"))%>" class="form">
</td>
<td class="classrow"><%=Lang_User(38)%></td>
<td class="classrow">
<input type="text" name="user_answer" value="" class="form">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(21)%></td>
<td class="classrow">
<input type="text" name="user_name" value="<%=Trim(rs("user_name"))%>" class="form">
</td>
<td class="classrow"><%=Lang_User(22)%></td>
<td class="classrow">
<input type="text" name="sex" value="<%=Trim(rs("sex"))%>" class="form">
</td>
</tr>
<!--<tr>
<td height="30" class="classrow">身份证号： </td>
<td height="30" class="classrow" colspan="3">
<input type="text" name="sfz" value="<%=rs("sfz")%>" class="form" size="18">
</td>
</tr>-->
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(24)%></td>
<td class="classrow">
<input type="text" name="birthday" value="<%=Trim(rs("birthday"))%>" class="form">
</td>
<td class="classrow"><%=Lang_User(26)%></td>
<td class="classrow">
<input type="text" name="user_mobile" value="<%=Trim(rs("user_mobile"))%>" class="form">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(27)%></td>
<td class="classrow">
<%If sys_soft = 0 Then%>
<input type="text" name="user_tel" value="<%=Trim(rs("user_tel"))%>" class="form">
<%
Else
user_tel = rs("user_tel")
If user_tel = "" Or isnull(user_tel) Then user_tel = user_tel &",,,"
If InStr(user_tel,",") = 0 Then user_tel = user_tel &",,"
%>
(<input type="text" name="user_tel" value="<%=Trim(split(user_tel,",")(0))%>" size="3" class="form">).<input type="text" name="user_tel" value="<%=Trim(split(user_tel,",")(1))%>" size="3" class="form">.<input type="text" name="user_tel" value="<%=Trim(split(user_tel,",")(2))%>" size="5" class="form">
<%End If%>
</td>
<td class="classrow"><%=Lang_User(28)%></td>
<td class="classrow">
<input type="text" name="fax" value="<%=Trim(rs("fax"))%>" class="form">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(31)%> </td>
<td colspan="3" class="classrow">
<input type="text" name="user_adds" value="<%=Trim(rs("user_adds"))%>" class="form" size="50">
<%If sys_soft = 1 Then%>
<input type="text" name="user_adds2" value="<%=Trim(rs("user_adds2"))%>" class="form" size="50">
<%End If%>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(160)%></td>
<td class="classrow">
<input type="text" name="city" value="<%=Trim(rs("city"))%>" class="form">
</td>
<td class="classrow"><%=Lang_User(30)%></td>
<td class="classrow">
<input type="text" name="user_postalcode" value="<%=Trim(rs("user_postalcode"))%>" class="form">
</td>
</tr>
<%If sys_soft = 1 Then%>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(161)%></td>
<td class="classrow">
<input type="text" name="state" value="<%=Trim(rs("state"))%>" class="form">
</td>
<td class="classrow"><%=Lang_User(162)%></td>
<td class="classrow">
<select name="country">
<%
Set country = conn.execute("Select id,area_name from [lebi_deliver_area] order by area_order desc")
If Not country.eof Then
	Do While Not country.eof
	Response.write("<option value="""& Country(0) &""" "& judge2(Country(0),rs("country")) &">"& Country(1) &"</option>")
	country.movenext
	Loop
End If
country.close : Set country = Nothing
%>
</select>
</td>
</tr>
<%End If%>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(39)%></td>
<td class="classrow">
<input type="text" name="oicq" value="<%=Trim(rs("oicq"))%>" class="form">
</td>
<td class="classrow"><%=Lang_User(25)%></td>
<td class="classrow">
<input type="text" name="user_mail" value="<%=Trim(rs("user_mail"))%>" class="form">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(40)%></td>
<td class="classrow">
<input type="text" name="jifen" value="<%=Trim(rs("jifen"))%>" class="form">
</td>
<td class="classrow"><%=Lang_User(32)%></td>
<td class="classrow"><%=select_grade(rs("user_grade"))%>
</td>
</tr>
<!--
<tr class="classrow">
<td height="30" class="classrow">VIP有效期： </td>
<td colspan="3" class="classrow">
<input type="text" name="yxq" value="<%=rs("yxq")%>" size="20"> 格式：2004-1-1
</td>
</tr>
-->
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(41)%></td>
<td class="classrow">
<input type="text" name="usermoney" value="<%=rs("usermoney")%>" class="form">
</td>
<td class="classrow"><%=Lang_User(42)%></td>
<td class="classrow">
<input type="text" name="sumpay" value="<%=rs("sumpay")%>" class="form">
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(33)%> </td>
<td colspan="3" class="classrow">
<input type="radio" value="1" <%if rs("ifpay")=1 then Response.Write"checked"%> name="form_ifpay"> <%=Lang_User(35)%>
<input type="radio" value="0" <%if rs("ifpay")=0 then Response.Write "checked"%> name="form_ifpay"> <%=Lang_User(34)%>
<%if rs("ifpay")=0 then%><input type="button" name="Submit2" value="<%=Lang_User(43)%>" onClick="location.href='?action=shenqingok&id=<%=rs("id")%>&usergrade=<%=request("usergrade")%>&page=<%=request("page")%>&ifpay=1'" class="button"><%End If%>&nbsp;<!--<input type="button" name="Submit2" value="<%=Lang_User(44)%>" onClick="location.href='?action=shenqingok&id=<%=rs("id")%>&ifpay=0'" class="button">-->
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow" valign="top" style="padding-top:6px"><%=Lang_sys(96)%><br /><em>≤ <span id="r_remLen">255</span></em></td>
<td colspan="3" class="classrow"><textarea wrap="r_physical" name="user_remark" id="user_remark" rows="3" cols="60" onKeyDown="r_checkMaxInput(this.form)" onKeyUp="r_checkMaxInput(this.form)" class="text"><%=rs("user_remark")%></textarea>
<script>
var r_maxLen = 255;
var user_remark = document.getElementById("user_remark");
function r_checkMaxInput(form) {
if (user_remark.value.length > r_maxLen)
user_remark.value = user_remark.value.substring(0, r_maxLen);
else document.getElementById("r_remLen").innerHTML = r_maxLen - user_remark.value.length;
}
</script>
<br /><a href="javascript:u_Size(-5,'user_remark')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
<a href="javascript:u_Size(5,'user_remark')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
</td>
</tr>
<tr>
<td height="30" align="left" class="classfooter" colspan="4">
<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="<%=rs("id")%>">
<input type="hidden" name="user_grade" value="<%=request("user_grade")%>">
<input type="hidden" name="moneypay" value="<%=request("moneypay")%>">
<input type="hidden" name="ifpay" value="<%=request("ifpay")%>">
<input type="hidden" name="page" value="<%=request("page")%>">
<input type="hidden" name="ref" value=<%=request("ref")%>>
</td>
</tr>
</form>
</table>
<script>tdshow("edit");</script>
<%
rs.close
set rs=nothing
end if
end sub

Sub list

admin_flag=",4.1,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		End If
        user_id=SafeReplace(request("user_id"))
        user_name=SafeReplace(request("user_name"))
        user_tel=SafeReplace(request("user_tel"))
        user_mob=SafeReplace(request("user_mob"))
        user_zip=SafeReplace(request("user_zip"))
        user_adds=SafeReplace(request("user_adds"))
        user_mail=SafeReplace(request("user_mail"))
        user_jifen_from=SafeReplace(request("user_jifen_from"))
        user_login_from=SafeReplace(request("user_login_from"))
        user_money_from=SafeReplace(request("user_money_from"))
        user_jifen_to=SafeReplace(request("user_jifen_to"))
        user_login_to=SafeReplace(request("user_login_to"))
        user_money_to=SafeReplace(request("user_money_to"))
        u_lastdate=SafeReplace(request("u_lastdate"))
        u_datefrom=SafeReplace(request("u_datefrom"))
        u_dateto=SafeReplace(request("u_dateto"))
		page = CheckNum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		moneypay = SafeReplace(request("moneypay"))
		Showlang = SafeReplace(request("Showlang"))
		keyword = SafeReplace(request("keyword"))
		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="u.id"
		.Field="u.id,u.user_id,u.user_name,u.user_grade,u.ifpay,u.logins,u.regdate,u.lastlogintime,u.lastloginip,u.regip,u.usermoney,g.grade_name,u.jifen,u.user_mail,u.user_mobile"
		.Table="[Lebi_user] as u,[Lebi_user_grade] as g"
		sql = "u.user_grade=g.grade_dj"
		If keyword <> "" Then sql=sql + " and (u.user_id like '%"&keyword&"%' or u.user_name like '%"&keyword&"%' or u.user_adds like '%"&keyword&"%' or u.user_tel like '%"&keyword&"%')" 
        if user_id<>"" Then sql=sql + " and u.user_id like '%"&user_id&"%'"
		if user_name<>"" Then sql=sql + " and u.user_name like '%"&user_name&"%'"
'        if usergrade<>"" Then sql=sql+ " and user_grade like '%"&usergrade&"%'"
		if usergrade<>"" Then sql=sql+ " and u.user_grade = "&usergrade&""	' WangLei 2008-2-26
		if user_tel<>"" Then sql=sql+ " and u.user_tel like '%"&user_tel&"%'"
		if user_mob<>"" Then sql=sql+ " and u.fax like '%"&user_mob&"%'"
		if user_zip<>"" Then sql=sql+ " and u.user_postalcode like '%"&user_zip&"%'"
		if user_adds<>"" Then sql=sql+ " and u.user_adds like '%"&user_adds&"%'"
		if user_mail<>"" Then sql=sql+ " and u.user_mail like '%"&user_mail&"%'"
		if u_lastdate<>"" And IsSqlDataBase =1 Then sql=sql+ " and DateDiff(d,u.lastlogintime,'"&u_lastdate&"')>=0"
		if u_lastdate<>"" And IsSqlDataBase =0 Then sql=sql+ " and DateDiff('d',u.lastlogintime,'"&u_lastdate&"')>=0"
		if u_datefrom<>"" And u_dateto<>"" And IsSqlDataBase =1 Then sql=sql+ " and DateDiff(d,u.regdate,'"&u_datefrom&"')<=0 and DateDiff(d,u.regdate,'"&u_dateto&"')>=0"
		if u_datefrom<>"" And u_dateto<>"" And IsSqlDataBase =0 Then sql=sql+ " and DateDiff('d',u.regdate,'"&u_datefrom&"')<=0 and DateDiff('d',u.regdate,'"&u_dateto&"')>=0"
		if user_jifen_from<>"" Then sql=sql+ " and u.jifen>="&CLng(user_jifen_from)&""
		if user_money_from<>"" Then sql=sql+ " and u.sumpay>="&CLng(user_money_from)&""
		if user_login_from<>"" Then sql=sql+ " and u.logins>="&CLng(user_login_from)&""
		if user_jifen_to<>"" Then sql=sql+ " and u.jifen<="&CLng(user_jifen_to)&""
		if user_money_to<>"" Then sql=sql+ " and u.sumpay<="&CLng(user_money_to)&""
		if user_login_to<>"" Then sql=sql+ " and u.logins<="&CLng(user_login_to)&""
		if ifpay<>"" Then sql=sql + " and u.ifpay="&ifpay&""
        if moneypay<>"" then sql=sql+ " and u.shenqing="& moneypay &""
		if Showlang<>"" then sql=sql+ " and u.LangName='"& Showlang &"'"
		.Condition=sql
		.OrderBy="u.regdate desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
        Response.write("<script language=""javascript"" type=""text/javascript"" src=""inc/js/MyCalendar.js""></script><table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" class=""classtable-top""><tbody>")
        Response.write("<tr><td height=""30"" align=""left"" class=""classhead""><form name=""forms"" action=""?"" method=""get""><table border=""0"" cellspacing=""0"" cellpadding=""0""><tr><td>")
		Response.write("<select name=""usergrade""><option value="""">┌ "& Lang_User(88) &"</option>")
		Set rs_s = conn.execute("select grade_dj,grade_name from [Lebi_user_grade] where grade_dj <> 0 order by grade_dj ")
		Do while Not rs_s.eof
				Response.write("<option value="""&rs_s("grade_dj")&""" "& judge2(usergrade,rs_s("grade_dj"))&">├ "&rs_s("grade_name")&"</option>")
				rs_s.movenext
		Loop
		rs_s.close:Set rs_s = Nothing
		Response.write("</select></td>")
		Response.write("<td style=""padding-left:5px;""><input type=""text"" name=""u_datefrom"" value="""& u_datefrom &""" size=""12"" class=""form_calendar"" onclick=""setday(this)"" /> - <input type=""text"" name=""u_dateto"" value="""& u_dateto &""" size=""12"" class=""form_calendar"" onclick=""setday(this)"" /></td>")
		Response.write("<td style=""padding-left:5px;""><input name=""keyword"" id=""keyword"" type=""text"" value="""& keyword &""" class=""form_query"" size=""15"" autocomplete=""off"" onkeyup=""search_suggest('keyword','lebi_user','')""><input name=""Submit"" type=""submit"" value="""" title="""& Lang_sys(25) &""" align=""absmiddle"" class=""btn_query""><br /><div id=""search_suggest_keyword"" class=""search_suggest"" style=""display:none""></div></td></tr></table></form></td>")
		Response.write("<td height=""30"" class=""classhead"" align=""right"">")
		If ifpay = "1" Then
				Response.write(QuickMenu("Admin_user.asp?user_grade="& UserGroupNumber &"|"& Lang_Menu(107) &"","?action=add|"& Lang_Menu(103) &""))
		ElseIf usergrade <> "" Then
				If CLng(usergrade) = 1 Then
						Response.write(QuickMenu("Admin_user.asp|"& Lang_Menu(56) &"","Admin_user.asp?user_grade=2|"& Lang_Menu(107) &""))
				ElseIf CLng(UserGroupNumber) > CLng(usergrade) Then
						Response.write(QuickMenu("Admin_user.asp?user_grade="& CLng(usergrade) - 1 &"|"& Lang_Menu(107) &"","Admin_user.asp?user_grade="& CLng(usergrade) + 1 &"|"& Lang_Menu(107) &""))
				Else
						Response.write(QuickMenu("Admin_user.asp?user_grade="& CLng(usergrade) - 1 &"|"& Lang_Menu(107) &"","Admin_user.asp?ifpay=1|"& Lang_Menu(104) &""))
				End If
		Else
				Response.write(QuickMenu("|","Admin_user.asp?user_grade=1|"& Lang_Menu(107) &""))
		End If
		Response.write("</td>")
        Response.write("</tr>")
        Response.write("</tbody></table>")
        Response.write("<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" id=""list"" class=""classtable2""><tbody>")
        Response.write("<form name=form action='?action=del' method=post>")
		Response.write("<input type=""hidden"" name=""page"" value="""& page &"""><input type=""hidden"" name=""ref"" value="""& backurl() &""">")
        Response.write("<tr>")
        Response.write("<td height=""30"" class=""classhead"" align=""left"" colspan=""3""><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(5) &" "" onclick=""location.href='?action=add';return false;"" src=""lang/"& LangFilePath &"/images/bt_add.gif"" align=""absmiddle""></td>")
		Response.write("<td height=""30"" class=""classhead"" align=""right"" colspan=""9"">"& ors.ShowPageHead(page) &"</td>")
        Response.write("</tr>")
        Response.write("<tr>")
        Response.write("<td class=""classtop"" height=""30"" width=""5%"" title="""& Lang_sys(4) &""" style=""cursor:pointer;"" onclick=""location.href='javascript:selectall();';return false;"">"& Lang_sys(50) &"</td>")
        Response.write("<td class=""classtop"" width=""12%"">"& Lang_User(45) &"</td>")
        Response.write("<td class=""classtop"" width=""12%"">"& Lang_User(46) &"</td>")
        Response.write("<td class=""classtop"" width=""8%"">"& Lang_User(47) &"</td>")
        Response.write("<td class=""classtop"" width=""8%"">"& Lang_User(48) &"</td>")
        Response.write("<td class=""classtop"" width=""8%"">"& Lang_User(49) &"</td>")
        Response.write("<td class=""classtop"" width=""6%"">"& Lang_User(155) &"</td>")
        Response.write("<td class=""classtop"" width=""9%"">"& Lang_User(50) &"</td>")
        Response.write("<td class=""classtop"" width=""10%"">"& Lang_User(156) &"/"& Lang_User(51) &"</td>")
        Response.write("<td class=""classtop"" width=""4%"">"& Lang_User(52) &"</td>")
        Response.write("<td class=""classtop"" width=""16%"">"& Lang_User(53) &"</td>")
        Response.write("</tr>")
		If DataCount >0 Then
				For i = 0 To Ubound(DataList,2)
                response.write("<tr class=""classrow"">")
                response.write("<td height=""30"" class=""classrow""><input name=""id"" type=""checkbox"" value="""& DataList(1,i) &"""></td>")
                response.write("<td align=""left"" class=""classrow""><a href=""?action=view&user_id="& DataList(1,i) &""">"& DataList(1,i) &"</a></td>")
                response.write("<td align=""left"" class=""classrow"">"& DataList(2,i) &"</td>")
                response.write("<td class=""classrow""><a href=""admin_msg.asp?action=add&user_id="& DataList(1,i) &""" target=""_blank""><img src=""images/message.gif"" width=""16"" height=""16"" border=""0"" title="""& Lang_User(54) &"""></a>")
				If Not IsNull(DataList(14,i)) And Trim(DataList(14,i)) <> "" Then 
                response.write("&nbsp;<a href=""admin_sms.asp?action=send&send_no="& DataList(14,i) &""" target=""_blank""><img src=""images/icon_sms.gif"" width=""16"" height=""16"" border=""0"" title="""& Lang_User(167) &"""></a>")
				End If 
				If PluginEmail = 1 And Not IsNull(DataList(13,i)) And Trim(DataList(13,i)) <> "" Then 
					response.write("&nbsp;<a href=""plugin/admin_mail.asp?action=sendmail&user_email="& DataList(13,i) &"&user_name="& urlencode(DataList(2,i)) &""" target=""_blank""><img src=""images/icon_email.gif"" width=""16"" height=""16"" border=""0"" title="""& Lang_User(166) &""" align=""absmiddle""></a>")
				End If 
				response.write("</td>")
                response.write("<td class=""classrow"">"&DataList(11,i))
                if DataList(4,i)=1 then
				        response.write"<img src='../images/icons/icon11.gif' title='"& Lang_User(55) &"' align='absmiddle'>"
				end if
                response.write("</td>")
                response.write("<td class=""classrow"">"& DataList(10,i) &"</td>")
                response.write("<td class=""classrow"">"& DataList(12,i) &"</td>")
                response.write("<td class=""classrow"">"& formatdatetime(DataList(6,i),2) &"</td>")
                response.write("<td class=""classrow"">"& GetLoginTime(DataList(7,i)) &"/"& DataList(5,i) &"</td>")
                response.write("<td class=""classrow""><img src=""images/ip.gif"" width=""13"" height=""15"" title=""")
				If DataList(5,i)=1 Then
				        response.write DataList(9,i)
				Else
				        response.write DataList(8,i)
				End If
				response.write(" "& Lang_User(56) &""& DataList(7,i) &"""></td>")
                response.write("<td class=""classrow""><a href=""Admin_order_quick.asp?action=setcookie&user_id="& DataList(1,i) &""">"& Lang_User(57) &"</a> | <a href=""Admin_orders.asp?user_id="& DataList(1,i) &""">"& Lang_User(58) &"</a> | <a href=""admin_user_log.asp?user_id="& DataList(1,i) &""">"& Lang_User(59) &"</a> | <a href=""?action=edit&id="& DataList(0,i) &"&ref="& urlencode(backurl()) &""">"& Lang_sys(51) &"</a></td>")
                response.write("</tr>")
				Next
		End If
		response.write("</form>")
		response.write("<tr><td height=""30"" class=""classfooter"" colspan=""2"">"& GetPageNum(15,pagenum) &"</td><td class=""classfooter"" align=""right"" colspan=""10"">"& ors.ShowPageFoot(page) &"</td></tr>")
		response.write("</tbody>")
		response.write("</form>")
		response.write("</table>")
		response.write("<script>tdshow(""list"");</script>")
end sub

Sub view()
		admin_flag=",4.1,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
				response.End
		End If
		user_id=safereplace(request("user_id"))
		set rs=conn.execute("select u.id,u.user_name,u.sex,u.user_tel,u.fax,u.oicq,u.user_mail,u.city,u.user_adds,u.user_postalcode,u.lastlogintime,u.logins,u.regip,u.lastloginip,u.regdate,u.jifen,u.sumpay,u.usermoney,u.ifpay,g.grade_name,u.user_remark,u.user_adds2,u.state,u.country,u.user_mobile from [Lebi_user] as u,[Lebi_user_grade] as g where u.user_grade=g.grade_dj and user_id='"&user_id&"'")
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="view" class="classtable">
<tr>
<td colspan="2" align="right" class="classhead" height="30">
<input type="image" src="lang/<%=LangFilePath%>/images/bt_bak.gif" border="0" title=" <%=Lang_sys(3)%> " onclick="location.href='javascript:history.back()';return false;" align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_update.gif" border="0" title=" <%=Lang_sys(51)%> " onclick="location.href='?action=edit&id=<%=rs("id")%>';return false;" align="absmiddle">
</td>
</tr>
<tr>
<td height="30" class="classtop" colspan="2"><%=Lang_User(60)%></td>
</tr>
<%If rs.eof then%>
<tr class="classrow">
<td align="center" height="50" class="classrow" colspan="2"><%=Lang_User(61)%>
</td>
</tr>
<%else%>
<tr class="classrow">
<td width="15%" height="30" class="classrow"><%=Lang_User(15)%></td>
<td class="classrow"><%=user_id%></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(32)%></td>
<td class="classrow"><%=rs("grade_name")%> <%if rs("ifpay")=1 then response.write"<img src='../images/icons/icon11.gif' title='"& Lang_User(55) &"' align='absmiddle'>" end if%></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(21)%></td>
<td class="classrow"><%=rs("user_name")%> (<%=rs("sex")%>)&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(27)%></td>
<td class="classrow"><%
Select Case sys_soft
Case "0" response.write(rs("user_tel"))
Case "1"
user_tel = rs("user_tel")
If user_tel = "" Or isnull(user_tel) Then user_tel = user_tel &",,,"
If InStr(user_tel,",") = 0 Then user_tel = user_tel &",,"
response.write("("& Split(user_tel,",")(0) &")."& Split(user_tel,",")(1) &"."& Split(user_tel,",")(2))
end select 
%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(26)%></td>
<td class="classrow"><%=rs("user_mobile")%>&nbsp;
<%
If Not IsNull(rs("user_mobile")) And Trim(rs("user_mobile")) <> "" Then 
	response.write("<a href=""admin_sms.asp?action=send&send_no="& rs("user_mobile") &""" target=""_blank""><img src=""images/icon_sms.gif"" width=""16"" height=""16"" border=""0"" title="""& Lang_User(167) &"""></a>")
End If 
%>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(39)%></td>
<td class="classrow"><%=rs("oicq")%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(25)%></td>
<td class="classrow"><%=rs("user_mail")%>&nbsp;
<%
If PluginEmail = 1 And Not IsNull(Trim(rs("user_mail"))) And Trim(rs("user_mail")) <> "" Then 
	response.write("<a href=""plugin/admin_mail.asp?action=sendmail&user_email="& rs("user_mail") &"&user_name="& urlencode(rs("user_name")) &""" target=""_blank""><img src=""images/icon_email.gif"" width=""16"" height=""16"" border=""0"" title="""& Lang_User(166) &""" align=""absmiddle""></a>")
End If 
%>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(31)%></td>
<td class="classrow"><%=rs("user_adds")%>&nbsp;</td>
</tr>
<%If sys_soft = 1 Then%>
<tr class="classrow">
<td height="30" class="classrow">&nbsp;</td>
<td class="classrow"><%=rs("user_adds2")%>&nbsp;</td>
</tr>
<%End If%>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(160)%></td>
<td class="classrow"><%=rs("city")%>&nbsp;</td>
</tr>
<%If sys_soft = 1 Then%>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(161)%></td>
<td class="classrow"><%=rs("state")%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(162)%></td>
<td class="classrow"><%
Set country = conn.execute("Select area_name from [lebi_deliver_area] where id = "& checknum(rs("country"),0) &"")
If Not country.eof Then
	Response.write(Country(0))
End If
country.close : Set country = Nothing
%>&nbsp;</td>
</tr>
<%End If%>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(30)%></td>
<td class="classrow"><%=rs("user_postalcode")%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(56)%></td>
<td class="classrow"><%=rs("lastlogintime")%> - <%If rs("logins")=1 Then response.write rs("regip") Else response.write rs("lastloginIP") End if%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(62)%></td>
<td class="classrow"><%=formatdatetime(rs("regdate"),2)%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(40)%></td>
<td class="classrow"><%=rs("jifen")%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(41)%></td>
<td class="classrow"><%=rs("usermoney")%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(42)%></td>
<td class="classrow"><%=rs("sumpay")%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_User(63)%></td>
<td class="classrow"><%=rs("logins")%>&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_Sys(96)%></td>
<td class="classrow"><%=rs("user_remark")%>&nbsp;</td>
</tr>
<tr>
<td colspan="2" align="right" class="classfooter" height="30">
<input type="image" src="lang/<%=LangFilePath%>/images/bt_bak.gif" border="0" title=" <%=Lang_sys(3)%> " onclick="location.href='javascript:history.back()';return false;" align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_update.gif" border="0" title=" <%=Lang_sys(51)%> " onclick="location.href='?action=edit&id=<%=rs("id")%>';return false;" align="absmiddle">
</td>
</tr>
<%
End If
rs.close:set rs=nothing
%>
</table>
<script>tdshow("view");</script>
<%
End Sub

Function select_tz(usergrade,ifpay,moneypay)
		select_tz = "<select name=""userlistselect"" onChange=""var jmpURL=this.options[this.selectedIndex].value ;if(jmpURL!='') {window.location=jmpURL; }else{ this.selectedIndex=0; }""><option selected>┌ "& Lang_User(77) &"</option><option value=""?"">├ "& Lang_User(144) &"</option><option value="""">├ ————</option>"
		Set rs_s = conn.execute("select grade_dj,grade_name from [Lebi_user_grade] where grade_dj <> 0 order by grade_dj ")
		Do while Not rs_s.eof
		select_tz = select_tz & "<option value=""?user_grade="&rs_s("grade_dj")&""""
		If usergrade <> "" Then
				If Clng(usergrade) = rs_s("grade_dj") Then select_tz = select_tz & " selected"
		End If
		select_tz = select_tz & ">├ "&rs_s("grade_name")&"</option>"
		rs_s.movenext
		Loop
		rs_s.close:Set rs_s = Nothing
		select_tz = select_tz & "<option value="""">├ ————</option>"
		select_tz = select_tz & "<option value=""?ifpay=1"""
		If ifpay = "1" Then select_tz = select_tz & " selected"
		select_tz = select_tz & ">├ "& Lang_User(55) &"</option>"
	'	select_tz = select_tz & "<option value=""?moneypay=1"""
	'	If moneypay = "1" Then select_tz = select_tz & " selected"
	'	select_tz = select_tz & ">├ 资金账号待审</option>"
		select_tz = select_tz & "</select>"
End Function

Function select_grade(usergrade)
		select_grade = "<select name=""form_user_grade"">"
		Set rs_s = conn.execute("select grade_dj,grade_name from [Lebi_user_grade] where grade_dj <> 0 order by grade_dj ")
		Do while Not rs_s.eof
				select_grade = select_grade & "<option value="""&rs_s("grade_dj")&""""
				If Clng(usergrade) = rs_s("grade_dj") Then select_grade = select_grade & " selected"
				select_grade = select_grade & ">"&rs_s("grade_name")&"</option>"
				rs_s.movenext
		Loop
		rs_s.close:Set rs_s = Nothing
		select_grade = select_grade & "</select>"
End Function

Function getUserGrade()
		sql="select grade_dj,grade_name from [Lebi_user_grade] where grade_dj <> 0 order by grade_dj"
		set rs_ug = conn.execute(sql)
		do while not rs_ug.eof
		getUserGrade = getUserGrade&"<INPUT TYPE=""checkbox"" NAME=""user_grade"" value="""&rs_ug("grade_dj")&"""> "&rs_ug("grade_name")&"&nbsp;"
		rs_ug.movenext
		Loop
		rs_ug.close:Set rs_ug = Nothing
End Function

Function GetLoginTime(str)
		If IsNull(str) Then 
				GetLoginTime = "" 
				Exit Function 
		End If 
		If DateDiff("d",str,Now()) = 0 Then 
				If DateDiff("h",str,Now()) = 0 Then 
						GetLoginTime = CLng(DateDiff("s",str,Now())/60) & Lang_User(157)
				Else
						GetLoginTime = DateDiff("h",str,Now()) & Lang_User(158)
				End If 
		Else
				GetLoginTime = DateDiff("d",str,Now()) & Lang_User(159)
		End If 
End Function 
%>