<!--#include virtual="/incs/config.asp"-->
<% chk_log()%>
<%
chk_newpwr 4,17,1
''''''''''''''''''''''''''''''''
querytype=SafeRequest("querytype")
if chk_int(querytype)=false then
   ErrMsg="<font color=#ff0000>对不起</font>，非法操作！..."
elseif querytype=2 then
    qu1=SafeRequest("qu1")
    qu2=SafeRequest("qu2")
    qu3=SafeRequest("qu3")
    qu4=SafeRequest("qu4")
    qu5=SafeRequest("qu5")
    qu6=SafeRequest("qu6")				
    d1=dateserial(qu1,qu2,qu3)
    d2=dateserial(qu4,qu5,qu6)
	qstring=" and ( ('u_addtme')>='"&d1&"' and ('u_addtme')<='"&d2&"') "
elseif querytype=3 then
    qu1=SafeRequest("qu1")
    qu2=SafeRequest("qu2")
    qu3=SafeRequest("qu3")
    qu4=SafeRequest("qu4")
    qu5=SafeRequest("qu5")
    qu6=SafeRequest("qu6")				
    d1=dateserial(qu1,qu2,qu3)
    d2=dateserial(qu4,qu5,qu6)
	qstring=" and ( ('u_lsttme')>='"&d1&"' and ('u_lsttme')<='"&d2&"') "

elseif querytype=4 then
  qu1=cint(SafeRequest("qu1"))
   if  qu1=1 then
	    qstring=" and u_lck=0 "
   else
	    qstring=" and u_lck<>0 "
  end if 	
elseif querytype=5 then
  qu1=trim(SafeRequest("qu1"))
  if qu1="" then
  call errorpage(-2,"对不起，请输入查询条件！")
  end if
	 qstring=" and ( u_nme like '%"&qu1&"%'  )"
elseif querytype=6 then
  qu1=trim(SafeRequest("qu1"))
  if qu1="" then
  call errorpage(-2,"对不起，请输入查询条件！")
  end if
	 qstring=" and ( u_ctt_cn like '%"&qu1&"%'  or u_copnme_cn  like '%"&qu1&"%'  )"
elseif querytype=7 then
  qu1=trim(SafeRequest("qu1"))
  if qu1="" then
  call errorpage(-2,"对不起，请输入查询条件！")
  response.end 
  end if
	 qstring=" and ( u_prv_cn like '%"&qu1&"%'  or u_cty_cn  like '%"&qu1&"%'  )"
elseif querytype=8 then
  qu1=trim(SafeRequest("qu1"))
  if qu1="" then
  call errorpage(-2,"对不起，请输入查询条件！")
  response.end 
  end if
	 qstring=" and ( u_adr_cn like '%"&qu1&"%'   )"
elseif querytype=9 then
  qu1=trim(SafeRequest("qu1"))
  if qu1="" then
  call errorpage(-2,"对不起，请输入查询条件！")
  response.end 
  end if
	 qstring=" and ( u_tel like '%"&qu1&"%'  or u_fax  like '%"&qu1&"%'  )"
elseif querytype=10 then
  qu1=trim(SafeRequest("qu1"))
  if qu1="" then
  call errorpage(-2,"对不起，请输入查询条件！")
  response.end 
  end if
	 qstring=" and ( u_eml like '%"&qu1&"%'   )"
elseif querytype=11 then
  qu1=cint(SafeRequest("qu1"))
if  qu1=1 then
qstring=" and u_mnyrmn<0 "
else
qstring=" and u_mnyrmn>=0 "
end if
elseif querytype=16 then
  qu1=SafeRequest("qu1")
  if chk_int(qu1)=false then
  call errorpage(-2,"对不起，数据类型不正确！")
  end if
  qu1=cint(qu1)
if  qu1=-1 then
qstring=" and c_pwr=0 "
elseif qu1=-2 then
qstring=" and (c_pwr=1 or c_pwr=2) "
elseif qu1=-3 then
qstring=" and c_pwr=1 "
elseif qu1=-4 then
qstring=" and c_pwr=2 "
else
qstring=" and u_prc="&qu1&" "
end if
elseif querytype=12 then
     datastring=date()
	 qstring=" and (u_addtme>'"&datastring&"') " 
elseif querytype=13 then
     datastring=now()-weekday(now())
	 qstring=" and (u_addtme>'"&datastring&"') " 
elseif querytype=14 then
     datastring=now()-day(now())
	 qstring=" and (u_addtme>'"&datastring&"') " 
elseif querytype=15 then
	 weekd=dateadd("m",-1,dateadd("d",-day(now()),now()))
	 weekd2=dateadd("d",-day(now()),now())
	 qstring=" and (u_addtme>'"&weekd&"' and u_addtme<'"&weekd2&"') "
end if 
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
perpage=SafeRequest("perpage")
if chk_int(perpage)=false then
perpage=20
end if 
perpage=clng(perpage)
if perpage>50 then
perpage=50
end if
ThePage=0
page=0
rcount=0
thepage=0
'''''''''''''''''''''''''''''''''
ordernum=SafeRequest("ordernum")
if chk_int(ordernum)=true then
if ordernum=11 then
orderstring=" u_id asc"
elseif ordernum=12 then
orderstring=" u_id desc"
elseif ordernum=21 then
orderstring=" u_nme asc"
elseif ordernum=22 then
orderstring=" u_nme desc"
elseif ordernum=41 then
orderstring=" u_prc asc"
elseif ordernum=42 then
orderstring=" u_prc desc"
elseif ordernum=51 then
orderstring=" u_addtme asc"
elseif ordernum=52 then
orderstring=" u_addtme desc"
elseif ordernum=61 then
orderstring=" u_lgncnt asc"
elseif ordernum=62 then
orderstring=" u_lgncnt desc"
elseif ordernum=71 then
orderstring=" u_lsttme asc"
elseif ordernum=72 then
orderstring=" u_lsttme desc"
elseif ordernum=81 then
orderstring=" u_copnme_cn asc"
elseif ordernum=82 then
orderstring=" u_copnme_cn desc"
elseif ordernum=91 then
orderstring=" u_rotnme asc"
elseif ordernum=92 then
orderstring=" u_rotnme desc"
elseif ordernum=101 then
orderstring=" f_nme asc"
elseif ordernum=102 then
orderstring=" f_nme desc"
elseif ordernum=111 then
orderstring=" pw_nme asc"
elseif ordernum=112 then
orderstring=" pw_nme desc"
else
end if
else
ordernum=52
orderstring=" u_addtme desc"
end if
'''''''''''''''''''''''''''''''''''''''''
conn.open constr
   if session("sysclass")>=5 then
   query="select * from v_memlst where  u_sys<="&session("sysclass")&" "&qstring&qstring2&"  order by "&orderstring
   else
   query="select * from v_memlst where  (u_rotnme='"&session("usrname")&"' or (u_rotnme='' and ("&session("sysarestr")&"  or u_myare=0))) and u_sys<="&session("sysclass")&" and  u_id<>"&session("usrid")&"  "&qstring&qstring2&"  order by "&orderstring
   end if
rs.open query,conn,1,1
if rs.RecordCount<=0 then
          ErrMsg="<font color=#ff0000>对不起</font>，没有搜索到符合条件的记录！..."
		
	   else
	      rcount=rs.recordcount
	      rs.pagesize=perpage
		  ThePage=rs.pagecount
		  if Chk_Int(SafeRequest("page"))=false then
		  page=1
		  else
		   page=cint(SafeRequest("page"))
		    if page<=0  then
		       page=1
		    elseif page>ThePage then
		       page=ThePage
		    end if	  
		  end if
		    rs.absolutepage=page
       end if   

%>
<!--#include virtual="/incs/top.asp"-->
<script language="javascript">
<!--

function tofirst()
{searchform.page.value=1;
searchform.submit();
 }
  function toprev()
{searchform.page.value-=1;
searchform.submit();
 }
  function tonext()
{
searchform.page.value=<%=page%>-1+2;
searchform.submit();
 }
  function tolast()
{searchform.page.value=<%=ThePage%>;
searchform.submit();
 }
 function toorder(ordn)
{searchform.ordernum.value=ordn;
searchform.page.value=1;
searchform.submit();
 }
 function deluser(uid)
 {
if(confirm("是否确认删除该会员！"))
showurl("mem_mng.asp?module=usrdel&uid="+uid);
 }

 //-->
 </script>
<table cellspacing=2 cellpadding=0 width="100%" border=0>
  <tbody> 
  <tr> 
    <td  colspan=2 valign="middle"> 
      <table class=line cellspacing=0 cellpadding=0 width="100%" 
                  border=0 align="center">
        <tbody> 
        <tr> 
          <td valign=bottom width="25%" height=20><font color="#000000" class=ddropshadow><b><span class=enbold><strong>会员<font color="#000000">列表<a href="index.asp"  class=commonface><font color="#FF0000">（查询）</font></a></font></strong></span></b></font></td>
          <td valign=bottom noWrap align=right 
                        width="75%"><a href="javascript:showurl('mem_add.asp');" class=commonface><font color="#FF0000"><b>添加新会员</b></font></a> 
            <font color="#000000">|</font> <a href="mem_lst.asp?querytype=16&qu1=-2" class=commonface><font color="#FF0000"><b>代理列表</b></font></a> 
            <font color="#000000">|</font> <a href="mem_lst.asp?querytype=12" class=commonface></a><a href="mem_lst.asp?querytype=12" class=commonface>今天新注册</a> 
            <font color="#000000">|</font> <a href="mem_lst.asp?querytype=13" class=commonface>本周新注册</a> 
            <font color="#000000">|</font> <a href="mem_lst.asp?querytype=14" class=commonface>本月新注册</a> 
            <font color="#000000">| </font><a href="mem_lst.asp?querytype=15" class=commonface>上月新注册</a></td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=5></td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=2 class=menuline></td>
        </tr>
        </tbody> 
      </table>
      <br>
    </td>
  </tr>
  <tr> 
    <td  colspan=2 valign="middle" height="28"> 
      <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tbody> 
        <form action=mem_lst.asp method=post name=searchform2>
          <tr> 
            <td height=20 width="119">&nbsp;共计 <b> <%=rcount%> </b>条记录 </td>
            <td height=20> 
              <div align="center"> 
                <input type=hidden name=qu1 value="<%=qu1%>">
                <input type=hidden name=qu2 value="<%=qu2%>">
                <input type=hidden name=qu3 value="<%=qu3%>">
                <input type=hidden name=qu4 value="<%=qu4%>">
                <input type=hidden name=qu5 value="<%=qu5%>">
                <input type=hidden name=qu6 value="<%=qu6%>">
                <input type=hidden name=qu7 value="<%=qu7%>">
                <input type=hidden name=qu8 value="<%=qu8%>">
                <input type=hidden name=querytype value="<%=querytype%>">
                <input type=hidden name=perpage value="<%=perpage%>">
                <input type=hidden name=ordernum value="<%=ordernum%>">
                <%=page_turn%></div>
            </td>
            <td height=20 width="120"> 
              <div align="right">转第 
                <select name="page" onChange="javascript:document.searchform2.submit();">
                  <option selected value=<%=page%>><%=page%></option>
                  <%
				   for i=1 to thepage
				   response.write "<option value="&i&">"&i&"</option>"
				   next
				   %>
                </select>
                页</div>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <table border=0 cellpadding=0 
                        cellspacing=0 class=datalist width="100%" bordercolordark="#FFFFFF" align="center"  >
        <tbody> 
        <tr> 
          <th width="7%" height="20"  class=datalistheader> 
            <%
			if ordernum=11 then
			odr1=12
			else
			odr1=11
			end if
			if ordernum=21 then
			odr2=22
			else
			odr2=21
			end if
			if ordernum=31 then
			odr3=32
			else
			odr3=31
			end if
			if ordernum=41 then
			odr4=42
			else
			odr4=41
			end if
			if ordernum=51 then
			odr5=52
			else
			odr5=51
			end if
			if ordernum=61 then
			odr6=62
			else
			odr6=61
			end if
			if ordernum=71 then
			odr7=72
			else
			odr7=71
			end if
			if ordernum=81 then
			odr8=82
			else
			odr8=81
			end if
			if ordernum=91 then
			odr9=92
			else
			odr9=91
			end if
			if ordernum=101 then
			odr10=102
			else
			odr10=101
			end if
			if ordernum=111 then
			odr11=112
			else
			odr11=111
			end if

			%>
            <div align="center"><a href="javascript:toorder(<%=odr1%>);" class=commonface><b>编号</b></a></div>
          </th>
          <th width="9%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr2%>);" class=commonface><b>会员名称</b></a></div>
          </th>
          <th width="18%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr8%>);" class=commonface><b>公司名称</b></a></div>
          </th>
          <th width="8%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr9%>);" class=commonface><b>管理专员</b></a></div>
          </th>
          <th width="8%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr10%>);" class=commonface><b>所属区域</b></a></div>
          </th>
          <th width="8%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr11%>);" class=commonface><b>管理等级</b></a></div>
          </th>
          <th width="8%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr4%>);" class=commonface><b>价格等级</b></a></div>
          </th>
          <th width="10%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr5%>);" class=commonface><b>加入时间</b></a></div>
          </th>
          <th width="6%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr6%>);" class=commonface><b>登录</b></a></div>
          </th>
          <th width="8%"  class=datalistheader> 
            <div align="center"><a href="javascript:toorder(<%=odr7%>);" class=commonface><b>最后登录</b></a></div>
          </th>
          <th class=datalistheader> 
            <div align="center">操作</div>
          </th>
        </tr>
        <%
		  i=1
	Do While Not rs.eof 
if i mod 2=1 then
classstl="datalistgrida"
else
classstl="datalistgridb"
end if
	%>
        <tr> 
          <td height=20 align=center <%
		  if session("userclass")=100 then
		  response.write "title=站点"&rs("rootid")
		 		  end if
		  %>  class=<%=classstl%>><a href="javascript:showurl('mem_dtl.asp?uid=<%=rs("u_id")%>');" class=commonface><%=rs("u_id")%></a></td>
          <td align=center  class=<%=classstl%> ><a class=commonface href="javascript:showurl('mem_dtl.asp?uid=<%=rs("u_id")%>');"><b><u><%=rs("u_nme")%></u></b></a> 
          </td>
          <td  align=center  class=<%=classstl%>><%=rs("u_copnme_cn")%>&nbsp;</td>
          <td align=center  class=<%=classstl%> ><a class=commonface href="javascript:showurl('mem_dtl.asp?unme=<%=rs("u_rotnme")%>');"><u><%=rs("u_rotnme")%></u>&nbsp;</a> 
          </td>
          <td align=center  class=<%=classstl%> ><%=rs("f_nme")%>&nbsp; </td>
          <td align=center  class=<%=classstl%> ><%=rs("pw_nme")%>&nbsp; </td>
          <td  align=center  class=<%=classstl%>> <a href="javascript:showurl('/master/sysmng/prc_mng/prc_edt.asp?c_cls=<%=rs("u_prc")%>');"><font color="#FF0000"><%=rs("c_nme")%></font></a></td>
          <td  align=center  class=<%=classstl%>><%=year(rs("u_addtme"))&"-"&month(rs("u_addtme"))&"-"&day(rs("u_addtme"))%></td>
          <td  align=center class=<%=classstl%> ><b><%=rs("u_lgncnt")%></b></td>
          <td  align=center  class=<%=classstl%>><%=rs("u_lsttme")%></td>
          <td  align=center class=<%=classstl%>> <a href="javascript:deluser('<%=rs("u_id")%>');" class=commonface>删除</a>&nbsp;&nbsp;<a href="javascript:showurl('mem_dtl.asp?uid=<%=rs("u_id")%>');" class=commonface>修改</a> 
          </td>
        </tr>
        <%
  rs.movenext
i=i+1
if i>perpage then
exit do
end if

  loop 
  	rs.close
	conn.close
  %>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tbody> 
        <form action=mem_lst.asp method=post name=searchform>
          <tr> 
            <td height=20 width="120">&nbsp;共计 <b> <%=rcount%> </b>条记录 </td>
            <td height=20> 
              <div align="center"> 
                <input type=hidden name=qu1 value="<%=qu1%>">
                <input type=hidden name=qu2 value="<%=qu2%>">
                <input type=hidden name=qu3 value="<%=qu3%>">
                <input type=hidden name=qu4 value="<%=qu4%>">
                <input type=hidden name=qu5 value="<%=qu5%>">
                <input type=hidden name=qu6 value="<%=qu6%>">
                <input type=hidden name=qu7 value="<%=qu7%>">
                <input type=hidden name=qu8 value="<%=qu8%>">
                <input type=hidden name=querytype value="<%=querytype%>">
                <input type=hidden name=perpage value="<%=perpage%>">
                <input type=hidden name=ordernum value="<%=ordernum%>">
                <%=page_turn%> </div>
            </td>
            <td height=20 width="120"> 
              <div align="right">转第 
                <select name="page" onChange="javascript:document.searchform.submit();">
                  <option selected value=<%=page%>><%=page%></option>
                  <%
				   for i=1 to thepage
				   response.write "<option value="&i&">"&i&"</option>"
				   next
				   %>
                </select>
                页</div>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <br>
    </td>
  </tr>
  </tbody> 
</table>
<!--#include virtual="/incs/bottom.asp"-->
