<%@language=vbscript codepage=936%>
<%
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
dim dns
dns="../"
%>
<!--#Include file="../Common/Inc_DatConn.asp"-->
<!--#Include file="Common/Inc_Config.asp"-->
<!--#Include file="Common/Inc_Function.asp"-->
<!--#Include file="fy_admin_check.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/Admin_Style.Css" rel="stylesheet" type="text/css">
<script src="../common/Admin.js" type="text/javascript"></script>

<%bbaction=changechr(request("bbaction"))
Select case bbaction
  	Case "viewuser"
  	id=RtnReplaceInt(request("id"),0)
		call viewuser
	Case "point"
		call editpoint
 	Case "saveeditpoint"
		call saveeditpoint
 	Case "editjb"
		call editjb
	Case "savejb"
		call savejb
	Case "lockuser"
		call lockuser
	Case "deluser"
		call deluser
 	Case else
if fla1<>1 and fla2<>1 and fla3=1 and fla4=1 and fla5=1 and Session("intUserLevel")<2 then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>错误：操作权限出错，您没有权限操作些功能！</li>"
Call Admin_ShowErr(ErrMsg)
end if
%>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="title"> 
    <td height="22" colspan="2" align="center">会员管理</td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>管理导航：</strong></td>
    <td height="30"><table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">
	    <tr>
		  <td width="50%" height="25">
			<img border="0" src="../images/dot_02.gif" width="14" height="14"><a href="?lx=1">个人会员</a>&nbsp;
			<img border="0" src="../images/dot_01.gif" width="14" height="14"><a href="?lx=2">企业会员</a></td>
		  <form method="post" action="user.asp" name="Form1">
		  <td width="50%" align="right">会员帐号：<input type="text" name="KeyWord" size="15" value="<% = Request("KeyWord")%>" class="face"> <input type="submit" name="Submit" value="搜"></td>
		  </form>
		</tr>
	  </table></td>
  </tr>
</table><br>
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" Class="border">
    <tr class="title"> 
      <td width="71" align="center">编 号</td>
      <td width="139" align="center">会员帐号</td>
      <td width="131" align="center">会员类型</td>
      <td align="center">状 态</td>
      <td width="100" align="center">会员级别</td>
      <td width="738" align="center">操作</td>
    </tr>
<%
Dim rdsMember         '/通告的数据库对象及SQL语句/
Dim sqlMember
Dim rdsTotalRec   
Dim strKeyWord        '/关键字/
Dim intPage           '/当前页/
Dim intTotalRec	      '/所有记录/
Dim intMemberCot	  '/通告条数/
Dim intMemberCount    '/通告条数/
Dim n,p,ii,strsql	          '/定义一些临时变量/
Dim strMemberType
'Dim strMemberLevel
'Dim strOperHot

strKeyWord = Request("KeyWord")
lx = Request("lx")
intPage = Trim(Request("Page"))
if intPage = "" then
	intPage = 1
else
	intPage = Clng(intPage)
end if

intMemberCot = 20
strsql=""
if lx<>"" then
strsql=strsql&" and MemberType="&lx&" "
end if
if strKeyWord<>"" then
strsql=strsql&" and Member like '%"& strKeyWord &"%' "
end if
set rdsMember = Server.CreateObject("ADODB.Recordset")
	set rdsTotalRec = Conn.Execute("Select Count(MemberKey) From Dat_Member Where Member<>'' "&strsql&"")
	intTotalRec = rdsTotalRec(0)
	sqlMember = "Select * From Dat_Member Where  Member<>'' "&strsql&" Order By MemberKey Desc"
rdsMember.Open sqlMember,Conn,1,1
if not rdsMember.EOF then
	if intTotalRec mod intMemberCot = 0 then
		n = intTotalRec \ intMemberCot
	else
		n = intTotalRec \ intMemberCot + 1
	end if
	rdsMember.MoveFirst
	if intPage > n then intPage = n
	if intPage < 1 then intPage = 1
	rdsMember.Move (intPage - 1) * intMemberCot
	do while not rdsMember.EOF and intMemberCount < Clng(intMemberCot)
		intMemberCount = intMemberCount + 1
		userid=rdsMember("MemberKey")
		if rdsMember("State") = 0 then
			strState = "开启"
			strOperState = "<a href=""?bbaction=lockuser&id="& userid &"&lx=1"">锁定</a>"
		else
			strState = "<font color=""#FF0000"">锁定</font>"
			strOperState = "<a href=""?bbaction=lockuser&id="& userid &"&lx=0"">开启</a>"
		end if
		'if rdsMember("Point") > 0 then
		'	strMemberLevel = "付费会员"
		'else
		'	strMemberLevel = "普通会员"
		'end if
        if rdsMember("MemberType") = "1" then
		  strMemberType = "个人会员"
		else
		  strMemberType = "企业会员"
		end if
%>
    <tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'"> 
      <td width="65" align="center"> 
      　<%=userid%></td>
      <td width="133" align="center"><a href="?bbaction=viewuser&id=<% =userid%>"><% = rdsMember("Member")%></a></td>
      <td width="125" align="center"><% = strMemberType%></td>
      <td width="112" align="center"><% = strState%></td>
      <td width="94" align="center"><%
	  Select case rdsMember("jb")
	  	Case 0
		  	Response.Write("<font color=#FF00FF> 普通会员</font>")
	  	Case 1
		  	Response.Write("<font color=#Ff0000> 高级会员</font>")
	  	Case -1
		  	Response.Write("<font color=#0000ff> 申请高级</font>")
	    case else
	    Response.Write(" 非法会员")
	  End Select
	  %></td>
      <td width="732" align="center"> 
<%if fla2=1 or Session("intUserLevel")>2 then%><%end if%>
			    <%if fla3=1 or Session("intUserLevel")>2 then%><a href="?bbaction=editjb&id=<% = userid%>">级别</a>&nbsp;&nbsp;<%end if%><%if fla4=1 or Session("intUserLevel")>2 then%><% = strOperState%>&nbsp;&nbsp;<%end if%><%if fla5=1 or Session("intUserLevel")>2 then%><a onClick="{if(confirm('确定删除吗?')){return true;}return false;}" href="?bbaction=deluser&id=<% = userid%>">删除</a><%end if%></td>
    </tr>
<%
		rdsMember.MoveNext
	loop
else
	Response.Write "<tr><td width=""100%"" height=""25"" colspan=""7"" class=""banma1"">&nbsp;<font color=""#FF0000"">没有会员信息...</font></td></tr>"
end if
rdsMember.Close
set rdsMember = nothing

if intPage - 1 mod 10 = 0 then
	p = (intPage - 1) \ 10
else
	p = (intPage - 1) \ 10
end if	
%>
  </table>
  <table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">
	    <form method="post" action="user.asp" id="form2" name="form2">
	    <input type="hidden" name="KeyWord" value="<% = strKeyWord%>">
	    <tr>
		  <td width="30%" height="30" valign="middle">页次：<b><%= intPage %></b>/<b><%= n %></b>页 每页<b><%= intMemberCot %></b>条 共<b><%= intTotalRec %></b>条</td>
		  <td width="70%" height="30" valign="middle"><div align="right">分页：
			<%
				if intPage = 1 then
					Response.Write "<font face=webdings>9</font>   "
				else
					Response.Write "<a href='?Page=1&KeyWord="& strKeyWord &"' title=首页><font face=webdings>9</font></a>   "
				end if
				if p * 10 > 0 then Response.Write "<a href='?Page="&Cstr(p*10)&"&KeyWord="& strKeyWord &"' title=上十页><font face=webdings>7</font></a>   "
				Response.Write "<b>"
				for ii = p * 10 + 1 to P * 10 + 10
					   if ii = intPage then
				          Response.Write "<font color=""#FF0000"">"+Cstr(ii)+"</font> "
					   else
					      Response.Write "<a href='?Page="&Cstr(ii)&"&KeyWord="& strKeyWord &"'>"+Cstr(ii)+"</a>   "
					   end if
					if ii = n then exit for
				next
				Response.Write "</b>"
				if ii < n then Response.Write "<a href='?Page="&Cstr(ii)&"&KeyWord="& strKeyWord &"' title=下十页><font face=webdings>8</font></a>   "
				if intPage=n then
					Response.Write "<font face=webdings>:</font>   "
				else
					Response.Write "<a href='?Page="&Cstr(n)&"&KeyWord="& strKeyWord &"' title=尾页><font face=webdings>:</font></a>   "
				end if
			%>
			转到：<input type="text" name="Page" size="2" maxlength="10" value="<%= intPage %>" class="face"> <input type="submit" value="Go" name="submit" class="button">
			</div></td>
		</tr>
		</form>
</table>
<%
End Select
sub viewuser
if fla1<>1 and Session("intUserLevel")<2 then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>错误：操作权限出错，您没有权限操作些功能！</li>"
Call Admin_ShowErr(ErrMsg)
end if
intMemberKey=RtnReplaceInt(Request("Id"),0)
set rdsMember = Server.CreateObject("ADODB.Recordset")
sqlMember = "Select * From Dat_Member Where MemberKey = "& intMemberKey
rdsMember.Open sqlMember,Conn,1,1
if not rdsMember.EOF then
	'if rdsMember("Point") > 0 then
	'	strMemberLevel = "付费"
	'else
	'	strMemberLevel = "普通"
	'end if
username=rdsMember("Member")
%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><br>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" height="73">
  <tr class="title"> 
    <td height="22" colspan="2" align="center"><strong>会员 <font color="#FF0000"><% =username%></font> 的信息资料</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">会员帐号：</td>
    <td height="23" width="87%"><% =username%></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">会员级别：<strong>：</strong></td>
    <td height="23" width="87%"><%
	  Select case rdsMember("jb")
	  	Case 0
		  	Response.Write("<font color=#FF00FF> 普通会员</font>")
	  	Case 1
		  	Response.Write("<font color=#FF0C66> 高级会员</font>")
	    case else
	    Response.Write(" 非法会员")
	  End Select
	  %></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">密码：</td>
    <td height="23" width="87%"><% = rdsMember("Password")%></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">会员类型：</td>
    <td height="23" width="87%"><%
          if rdsMember("MemberType") = "1" then
			Response.Write "&nbsp;个人会员"
		  else
			Response.Write "&nbsp;企业会员"
		  end if	
          %></td>
  </tr><%if rdsMember("MemberType") = "1" then%>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">真实姓名：</td>
    <td height="23" width="87%"><% = rdsMember("RealName")%></td>
  </tr><%else%>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">企业名称：</td>
    <td height="23" width="87%"><% = rdsMember("CompanyName")%></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">所属分类：</td>
    <td height="23" width="87%"><%dl=rdsMember("dl")
          xl=rdsMember("xl")
          if dl<>"" then
          set rsb=server.createobject("adodb.recordset")
sqlb="select * from hybigclass where id="&dl
rsb.open sqlb,conn,1,1
	if rsb.eof and rsb.bof  then 
		response.write "分类有误"
		response.end
	else
	dlmc=rsb("bigclassname")
	response.write"<a href=../hy/hyclass.asp?bid="&dl&" target=_blank>"&dlmc&"</a>"
end if
rsb.close
set rsb=nothing
          else
          Response.Write "&nbsp;没有分类"
          end if
'*********大类结束
if xl<>"" then
set rss=server.createobject("adodb.recordset")
sqls="select * from hysmallclass where id="&xl
rss.open sqls,conn,1,1
	if rss.eof and rss.bof  then 
		response.write "小类有误"
		response.end
	else
xlname=rss("smallclassname")
	response.write"&nbsp;>>&nbsp;<a href=../hy/hyclass.asp?sid="&xl&" target=_blank>"&xlname&"</a>"
end if
rss.close
set rss=nothing
end if
          %></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">单位性质：</td>
    <td height="23" width="87%"><% = rdsMember("qyxz")%></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">所在地区：</td>
    <td height="23" width="87%"><% = rdsMember("dq")%></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">成立日期：</td>
    <td height="23" width="87%"><% = rdsMember("clrq")%></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">注册资金：</td>
    <td height="23" width="87%"><% = rdsMember("zczj")%>万元</td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">经营类型：</td>
    <td height="23" width="87%"><% = rdsMember("jylx")%></td>
  </tr>
        <tr class="tdbg">
          <td height="25" align="right">联系人：</td>
          <td height="25">&nbsp;<% = rdsMember("ContactMan")%></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">简介：</td>
          <td height="25"><% = rdsMember("js")%></td>
        </tr>
        <%end if%>
        <tr class="tdbg">
          <td height="25" align="right">腾讯QQ：</td>
          <td height="25">&nbsp;<a target="blank" href="http://wpa.qq.com/msgrd?V=1&Uin=<% = rdsMember("qq")%>&Site=<% = strSiteName%>&Menu=yes">
		<img alt="点击即可直接咨询" src="../images/qq.gif" border="0"><% = rdsMember("qq")%></a></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">电话：</td>
          <td height="25">&nbsp;<% = rdsMember("Tel")%></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">传真：</td>
          <td height="25">&nbsp;<% = rdsMember("Fax")%></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">Homepage：</td>
          <td height="25">&nbsp;<a href="<% = rdsMember("Homepage")%>" target="_blank"><% = rdsMember("Homepage")%></a></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">E-Mail：</td>
          <td height="25">&nbsp;<a href="mailto:<% = rdsMember("Email")%>"><% = rdsMember("Email")%></a></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">联系地址：</td>
          <td height="25">&nbsp;<% = rdsMember("Add")%></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">邮政编码：</td>
          <td height="25">&nbsp;<% = rdsMember("Postalcode")%></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">注册 IP：</td>
          <td height="25">&nbsp;<% = rdsMember("IP")%></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">注册时间：</td>
          <td height="25">&nbsp;<% = rdsMember("CreateTime")%></td>
        </tr>
        <tr class="tdbg">
          <td height="25" align="right">更新时间：</td>
          <td height="25">&nbsp;<% = rdsMember("UpdateTime")%></td>
        </tr>
        <tr class="tdbg">
          <td height="12" align="right" colspan="2">
			<p align="center"><input onClick="parent.location.href='Javascript:history.back()'" type="button" value="返 回" name=button1></td>
        </tr>
</table>
<%
end if
rdsMember.Close
set rdsMember = nothing
end sub
sub editpoint
if fla2<>1 and Session("intUserLevel")<2 then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>错误：操作权限出错，您没有权限操作些功能！</li>"
Call Admin_ShowErr(ErrMsg)
end if
pointid=Request("Id")
%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
	<script language="javascript">
	<!-- Begin validation form script
	//检验表单的合法性
	function FeedBack() {
		if (document.AddCount.Add.value == "#") {
		alert("\请选择是增加还是减少点数！");
		document.AddCount.Add.focus();
		}
		else if (document.AddCount.UpdateCount.value == "") {
			alert("\点数不能为空！");
			document.AddCount.UpdateCount.focus();
		}
		else {
	        return true;
	    }
	    return false;
	}
	// End of validation form script -->
	</script>
<br>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" height="73">
  <tr class="title"> 
    <td height="22" colspan="2" align="center"><strong>会员点数管理</strong></td>
  </tr><form method="post" action="?bbaction=saveeditpoint" name="AddCount" OnSubmit="return FeedBack()">
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">增加/减少：<input type="hidden" name="ID" value="<% =pointid%>"></td>
    <td height="23" width="87%"><select size="1" name="Add" class="face">
			  <option value="#" selected>-选择-</option>
			  <option value="0">增加</option>
			  <option value="1">减少</option></select></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">更改点数：</td>
    <td height="23" width="87%"><input type="text" name="UpdateCount" size="9" class="face" onKeyUp="this.value=this.value.replace(/\D/gi,'')" maxlength="8"></td>
  </tr>
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">备注：</td>
    <td height="23" width="87%"><textarea rows="3" name="Remark" cols="27" maxlength="100" class="face"></textarea></td>
  </tr>
        <tr class="tdbg">
          <td height="12" align="right" colspan="2">
			<p align="center"><input type="submit" value="更 新" name="Submit1"> <input onClick="parent.location.href='Javascript:history.back()'" type="button" value="返 回" name=button1></td>
        </tr></form>
</table>
<%
end sub
sub editjb
if fla3<>1 and Session("intUserLevel")<2 then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>错误：操作权限出错，您没有权限操作些功能！</li>"
Call Admin_ShowErr(ErrMsg)
end if
id=Request("Id")
%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" height="73">
  <tr class="title"> 
    <td height="22" colspan="2" align="center"><strong>会员级别设置</strong></td>
  </tr><form method="post" action="?bbaction=savejb" name="savejb">
  <tr class="tdbg"> 
    <td width="12%" height="23" align="right">会员级别：<input type="hidden" name="ID" value="<% =id%>"></td>
    <td height="23" width="87%"><select size="1" name="jb" class="face">
			  <option value="0">普通会员</option>
			  <option value="1">高级会员</option>
			</select></td>
  </tr>
        <tr class="tdbg">
          <td height="12" align="right" colspan="2">
			<p align="center"><input type="submit" value="更 新" name="Submit1"> <input onClick="parent.location.href='Javascript:history.back()'" type="button" value="返 回" name=button1></td>
        </tr></form>
</table>
<%
end sub

%>