<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="12"
	dir="../err.asp" 
  %>
 <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../../inc/filesystem.asp"-->
 <!--#include file="../rolecheck.asp"-->

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<script language="javascript">


function UnSelect()
	{
	  for (var i=0;i<document.myform.elements.length;i++)
		{
		if(document.myform.elements[i].checked==true)
		{
		document.myform.elements[i].checked=false;
 		}
		else
		{
		document.myform.elements[i].checked=true;
 		}
		}
	}

function CheckAll()
	{
	  for (var i=0;i<document.myform.elements.length;i++)
		{
		document.myform.elements[i].checked=true;
		}
	}
	 
function UnAll()
	{
	  for (var i=0;i<document.myform.elements.length;i++)
		{
		document.myform.elements[i].checked=false;
		}
	}
 
	function isgo()
	{
	var isok=true;
 	 for (var i=0;i<document.myform.elements.length;i++)
		{
		if(document.myform.elements[i].checked==true)
		{
		isok=false;
		break;
		}
 		}
		if(isok)
		{
		alert("请选择要进行操作的项!");
		return false;
		}
 	}
	 
	function retval(value)
	{
	var val=confirm(value);
	if(val)
	{ 
 	return true ;
	}
	else
	{
	 return false;
	}
 	}
   function retvalborn(value)
	{
	var val=confirm(value);
	if(val)
	{	
    window.location.reload();       
	return true ;
	}
	else
	{
	 return false;
	}
 	}  
	function retvalmp(value)
	{
	var val=confirm(value);
	if(val)
	{	
     var isok=true;
 	 for (var i=0;i<document.myform.elements.length;i++)
		{
		if(document.myform.elements[i].checked==true)
		{
		isok=false;
		break;
		}
 		}
		if(!isok)
		{
		document.myform.action='usercard.asp';	
		document.myform.target="_blank";
		document.myform.submit(); 	 
		return true ;
		}
		else
		{
		alert("请选择要进行操作的项!");
		return false;
		}
	}
	else
	{
	 return false;
	}
 	}
     function retvalform(value)
	{
	var val=confirm(value);
	if(val)
	{	
     var isok=true;
 	 for (var i=0;i<document.myform.elements.length;i++)
		{
		if(document.myform.elements[i].checked==true)
		{
		isok=false;
		break;
		}
 		}
		if(!isok)
		{
  		document.myform.action='mobanborn.asp';	
		document.myform.target="_blank";
		document.myform.submit(); 	 
		return true ;
		}
		else
		{
		alert("请选择要进行操作的项!");
		return false;
		}
	}
	else
	{
	 return false;
	}
 	}
 function Emailhref(value)
 {
	var val=confirm(value);
	if(val)
	{	
     var isok=true;
 	 for (var i=0;i<document.myform.elements.length;i++)
		{
		if(document.myform.elements[i].checked==true)
		{
		isok=false;
		break;
		}
 		}
		if(!isok)
		{
        window.location.reload();       
		document.myform.action='message.asp';	
		document.myform.target="_blank";
		document.myform.submit(); 	 
		return true ;
		}
		else
		{
		alert("请选择要进行操作的项!");
		return false;
		}
	}
	else
	{
	 return false;
	}
   }
</script>
</head>
  <%
  searchname=replace_text(request("searchname"))
  scomname=replace_text(request("scomname"))
  kind=replace_text(request("kind"))
  searchgo=replace_text(request("searchgo"))
  shen=replace_text(request("shen"))
  exd=replace_text(request("exd"))
  tui=replace_text(request("tui"))
  %>
 <body>
 <%
  
sql="select * from Websen_corporation where id<>0 "
 if shen<>"" then 
 sql=sql&"  and flag="&shen
 end if
 if exd<>"" then 
 sql=sql&"   and Exd="&exd 
 end if
 if tui<>"" then
 sql=sql&"  and Uflag="&tui
 end if 
 if searchname<>"" then
  sql=sql&" and [user] like '%"&searchname&"%'"
 end if
 if scomname<>"" then 
 sql=sql&"  and qymc like '%"&scomname&"%' "
 end if
 if kind<>"" then
 if kind<>"all" then 
 sql=sql&" and gradeid="&kind&"  "
 end if
 end if 
   sql=sql&" order by id desc"
  Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1 
msg_per_page=15 '定义每页显示记录条数
if action=0 then action=1
		
%>
<!--#include file="../../inc/headpage.asp"-->
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr> 
<th width="100%" height=25  >会员信息搜索管理</th>
</tr>
<tr>
<td class="forumRowHighlight">  
</td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr>
<td  height="30" bgcolor="#F3F8FC">  
&nbsp;&nbsp;操作提示： <a href="usersearch.asp">所有会员</a>&nbsp;&nbsp;&nbsp; <a href="usersearch.asp?shen=1">已审核会员</a>&nbsp;&nbsp;&nbsp;<a href="usersearch.asp?shen=0">未审核会员</a>
&nbsp;&nbsp;&nbsp;<a href="usersearch.asp?exd=1">已过期会员</a>
&nbsp;&nbsp;&nbsp;<a href="usersearch.asp?exd=0">未过期会员</a>
&nbsp;&nbsp;&nbsp;<a href="usersearch.asp?tui=1">推荐会员</a>
&nbsp;&nbsp;&nbsp;<a href="usersearch.asp?tui=0">非推荐会员</a>
</td>
</tr>
<form method="post" action="usersearch.asp" name="searchform">
<tr  bgcolor="#B6C5DC" align="center"  > 
<td  height=25 colspan="2" >会员查询：登录名:<input  type="text" name="searchname" value="<%=request("searchname")%>" onBlur="this.value=this.value.replace(/\s/g,'');"  maxlength="30" />&nbsp;公司名:<input  type="text" name="scomname" value="<%=request("scomname")%>" maxlength="30"  onblur="this.value=this.value.replace(/\s/g,'');"/>&nbsp;所属等级:
<select size="1" name="kind" >
<option value="all" >所有等级</option>
 <%
set rss=server.CreateObject("adodb.recordset")
sqls="select * from Websen_vipgrade order by id desc"
rss.open sqls,conn,1,1
if not rss.eof then 
do while not rss.eof 
%>
<option value="<%=rss("roleid")%>"><%=rss("gradename")%></option>
<%
rss.movenext
loop
rss.close
end if
%>
</select>
&nbsp;<input type="submit" name="searchgo" value="搜索" />
</td>
</tr>
</form>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<form name="myform"  action="deluser.asp"  method="post"  onsubmit="return isgo()">


<%
if rs.eof then
response.Write"<tr><td  collspan=2  align=center height=80>暂无搜索数据信息</td></tr> "
else
%>
<tr  bgcolor="#B6C5DC" align="center"  > 
<td  height=25 colspan="2" >会员登录名称</td><td>企业名称</td><td>联系人</td><td>注册时间</td><td>服务</td><td>状态</td><td>操作</td>
</tr>

<tr><td colspan="8"   height="1"   bgcolor="#496C94"></td></tr> 
<%
i=0
do while not rs.eof and rowcount > 0
%>
<tr align="center"  <%if i mod 2=0 then response.Write("bgcolor=#ffffff  onMouseOut=""this.style.backgroundColor='#ffffff'"" onMouseOver=""this.style.backgroundColor='#D7E3F3'""") else response.Write(" bgcolor=#EEF0F2   onMouseOut=""this.style.backgroundColor='#EEF0F2'"" onMouseOver=""this.style.backgroundColor='#D7E3F3'""") end if%>>
<td><input name='userid' type='checkbox'  id="userid" value='<%=rs("id")%>'></td>
<td  height=30  ><a href="useredit.asp?id=<%=rs("id")%>"><%=rs("user")%></a>
<br />
<%
set rsdd=server.CreateObject("adodb.recordset")
sqldd="select gradename from Websen_vipgrade where roleid="&rs("gradeid")
rsdd.open sqldd,conn,1,1
if not rsdd.eof then 
response.Write("(<a href='usersearch.asp?kind="&rs("gradeid")&"'><font color=red>"&rsdd("gradename")&"</font></a>)")
else
response.Write("不详")
end if
rsdd.close
%>
<%
  gradeid=rs("gradeid")
  shen=replace_text(request("shen"))
  exd=replace_text(request("exd"))
  tui=replace_text(request("tui"))
  if gradeid="" then 
  response.Write("<script >alert('设置成功！');history.back(-1);</script>")
  response.End()  
  end if
  '自动更新是否有过期会员------------------------------
   set rsexd=server.CreateObject("adodb.recordset")
   sqlexd="select  * from Websen_corporation "
   rsexd.open sqlexd,conn,1,3
   if not rsexd.eof then 
   do while not rsexd.eof 
   if rsexd("EndDate")<>"" then
   if rsexd("EndDate")>date() then
   rsexd("exd")=0
   else
   rsexd("exd")=1
   end if
   else
   rsexd("exd")=0   
   end if
   rsexd.movenext
   loop
   rsexd.close
   end if
   '----------------------------------------------------
   '取出等级权限用于判断该等级是否允许使用模板建站--------------------------------------
	rolelist="a"
	set rssf=server.CreateObject("adodb.recordset")
	sqlsf="select * from Websen_vipgrade where roleid="&gradeid
	rssf.open sqlsf,conn,1,1
 	if not rssf.eof then 
	rolelist=rssf("rolelist")	
	rssf.close
	end if
	 '-------------------------------------------------------------
  %>
</td>
<td style="word-break:break-all"><a href="edit.asp?id=<%=rs("id")%>"><%=rs("qymc")%></a></td><td><a title="email" href="mailto:<%=rs("email")%>"><%=rs("name")%>(<%=rs("ch")%>)</a></td>
<td><%=rs("idate")%></td><td><%if rs("flag")=1 then%>开始时间:<br /><%=rs("begindate")%><br><font color="#CC3300">结束时间:<br /><%=rs("enddate")%></font><%else%><div align="center"><font color="#CC3300">暂未获得服务</font></div><%end if%></td>
<td width="50">
<%if rs("flag")=1 and rs("exd")=0 then 
response.Write("<a href='deluser.asp?checkbtn=shen&action=0&userid="&rs("id")&"' onclick=""return retval('你要取消审核吗？');"">已审核</a>")
end if
if  rs("Exd")=1 then
  response.Write("<a href='deluser.asp?checkbtn=shen&action=1&userid="&rs("id")&"&exd=0'   title='需要重新进行审核后,即可继续开通服务功能！"&vbcrlf&"请先设置为未审核状态，再通过审核后即完成开通继续服务功能！'   onclick=""return retval('你要让该会员再次通过审核吗？请注意该会员是否满足该等级的条件要求！通过审核后,将继续开通该会员服务功能');"" >未审核(<font color=red>已过期</font></a>)")
 end if 
 if rs("flag")=0 and rs("exd")=0 then 
  response.Write("<a href='deluser.asp?checkbtn=shen&action=1&userid="&rs("id")&"'  onclick=""return retval('你要让该会员通过审核吗？请注意该会员是否满足该等级的条件要求！通过审核后,将开通该会员服务功能');"">未审核</a>") 
  end if %>
</td>
<td >【<a href="deluser.asp?delbtn=del&userid=<%=rs("id")%>" onClick="return retval('你确定要删除吗？此操作不可恢复的！将删除该会员及所有相关信息！');">删除</a>
<%
if rs("flag")=1 then 
	
  	Set fso = YXFSO
	
 if instr(rolelist,"qw")>0 then 
	 FilePath=server.mappath(HOPE_InstallDir&"vipcom/"&rs("user")&"/index.htm")
 	%>
  <a href="userweb.asp?userid=<%=rs("id")%>&weburl_2=<%=rs("user")%>&username=<%=rs("user")%>&url=<%
 '取出默认模板-----------------------------------------------
  set rsmo=server.CreateObject("adodb.recordset")
 sqlmo="select id from Websen_userskin where isdefault=1"
 rsmo.open sqlmo,conn,1,1
 if   rsmo.eof  then 
 response.Write("0")
  else
  response.Write(rsmo("id"))
 rsmo.close
 end if
 '----------------------------------------------------
 %>
"  target="_blank"  onclick="return retvalborn('你确定要执行此操作吗？此操作可能消耗的资源较多，请慎重操作！');">
   
   <%
   	 on error resume next
   	If fso.FileExists(FilePath) Then 
 %>
  已经生成模板页(更新)</a><a href="<%=HOPE_InstallDir&"vipcom/"&rs("user")&"/index.htm"%>" target="_blank">查看</a>
<%
else 
%>
尚未生成模板页(生成)</a>
<% 
end if 
'----------------------------------------------------------------------------------------
else
'生成单页名片-----------------------------------------
 FilePath=server.mappath(HOPE_InstallDir&"Ptcom/"&rs("user")&".html")
 	 on error resume next
	 %>
	 <a href="usercard.asp?userid=<%=rs("id")%>"   target="_blank"  onclick="return retvalborn('你确定要执行此操作吗？此操作可能消耗的资源较多，请慎重操作！');">
  <%
 If fso.FileExists(FilePath) Then 
	%>
已经生成单页名片(更新</a>|<a href="<%=HOPE_InstallDir&"Ptcom/"&rs("user")&".html"%>" target="_blank">查看</a>)
<%
else 
%>
尚未生成单页名片(生成)</a>
<% 
end if 
'----------------------------------------------------------------
end if

fso.close
 end if
 %>


<%
if rs("flag")=1  then
if rs("Uflag")=1 then 
%>
&nbsp;<a href="deluser.asp?userid=<%=rs("id")%>&tuibtn=tui&tuiflag=0" onClick="return retval('你确定要取消该推荐设置吗！');">已推荐(取消)</a>
<%
else
%>
&nbsp;<a href="deluser.asp?userid=<%=rs("id")%>&tuibtn=tui&tuiflag=1" onClick="return retval('你确定要设置为推荐会员吗？');">未推荐(推荐)</a>
<%
end if
end if
%>】
</td>
 </tr>
 <%
 i=i+1
 rowcount=rowcount-1
rs.movenext
loop

  %>

<tr>
<td colspan="8"  align="center"  height="30">     <hr size="1" color="#EEEEEE" noshade="noshade" /> <input name="" type="button" value="全选" onClick="CheckAll();">
  <input type="button" name="Submit2" value="反选" onClick="UnSelect();">
      <input type="button" name="Submit3" value="全不选" onClick="UnAll();">
	  <input type="submit" name="delbtn" value="删除所选项" onClick="return retval('你确定要删除吗？此操作不可恢复的！将删除该会员及所有相关信息！');">
	  <input type="submit" name="checkbtn" value="审核通过所选项"  onclick="return retval('你确定要让所选的会员通过审核吗？请确定是否都满足该等级的要求！');">
	  <input type="submit" name="tuibtn" value="将所选项设为推荐"  onclick="return retval('你确定要将所选的会员设置为推荐会员吗？');">
	  
		  <input name="send" type=button   value="发送留言" onClick="return Emailhref('确定要给所选的会员留言吗？');"> 
	   <hr size="1" color="#EEEEEE" noshade="noshade" />
</td>
</tr>
<%
end if 
%>
<tr>
<td colspan="8"  align="center" >  <%=listPages("usersearch.asp?kind="&kind&"&searchname="&searchname&"&scomname="&scomname&"&shen="&shen&"&exd="&exd&"&tui="&tui&"")%>
</td>
</tr>
 </form>
  </table>
</body></html>