<%@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"-->

<%
  Response.Buffer = true
  Response.ExpiresAbsolute=now()-1
  Response.Expires=0
  Response.CacheControl="no-cache"

%>
 <!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='../../manage/makehtml/corporation/makedetail.asp?all=com';
		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>
  <%
  gradeid=replace_text(request("gradeid"))
  shen=replace_text(request("shen"))
  exd=replace_text(request("exd"))
  tui=replace_text(request("tui"))
  trust_score=replace_text(request("trust_score"))
  if gradeid="" then 
  response.Write("<script >alert('参数传递错误！');history.back(-1);</script>")
  response.End()  
  end if
  '自动更新是否有过期会员------------------------------
   set rsexd=server.CreateObject("adodb.recordset")
   sqlexd="select  * from yixiang_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 yixiang_vipgrade where roleid="&gradeid
	rssf.open sqlsf,conn,1,1
 	if not rssf.eof then 
	rolelist=rssf("rolelist")	
	rssf.close
	end if
	 '-------------------------------------------------------------
  %>
 <body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr> 
<th width="100%" height=25  >[<%=request("gradename")%>]信息管理</th>
</tr>
<tr>
<td class="forumRowHighlight">  
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr>
<td  height="30" bgcolor="#F3F8FC">  
&nbsp;&nbsp;操作提示： <a href="userlist.asp?gradename=<%=request("gradename")%>&gradeid=<%=gradeid%>&shen=">所有会员</a>&nbsp;&nbsp;&nbsp; <a href="userlist.asp?gradename=<%=request("gradename")%>&gradeid=<%=gradeid%>&shen=1">已审核会员</a>&nbsp;&nbsp;&nbsp;<a href="userlist.asp?gradename=<%=request("gradename")%>&gradeid=<%=gradeid%>&shen=0">未审核会员</a>
&nbsp;&nbsp;&nbsp;<a href="userlist.asp?gradename=<%=request("gradename")%>&gradeid=<%=gradeid%>&exd=1">已过期会员</a>
&nbsp;&nbsp;&nbsp;<a href="userlist.asp?gradename=<%=request("gradename")%>&gradeid=<%=gradeid%>&exd=0">未过期会员</a>
&nbsp;&nbsp;&nbsp;<a href="userlist.asp?gradename=<%=request("gradename")%>&gradeid=<%=gradeid%>&tui=1">推荐会员</a>
&nbsp;&nbsp;&nbsp;<a href="userlist.asp?gradename=<%=request("gradename")%>&gradeid=<%=gradeid%>&tui=0">非推荐会员</a>
</td>
</tr>
<form method="post" action="usersearch.asp" name="searchform">
<tr  bgcolor="#B6C5DC" align="center"  > 
<td  height=25 colspan="2" >会员查询：登录名:<input name="searchname"  type="text" value="<%=request("searchname")%>" size="15" maxlength="30" />
&nbsp;公司名:
<input name="scomname"  type="text" value="<%=request("scomname")%>" size="15" maxlength="30" />
&nbsp;会员指数：
<input name="trust_score"  type="text" id="trust_score" value="<%=request("trust_score")%>" size="15" maxlength="30" />
所属等级:
<select size="1" name="kind" >
 <option value="all" >所有等级</option>
 <%
set rss=server.CreateObject("adodb.recordset")
sqls="select * from yixiang_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="100%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<form name="myform"  action="deluser.asp?gradeid=<%=request("gradeid")%>&gradename=<%=request("gradename")%>&LogName=43"  method="post"  onsubmit="return isgo()">

<%
  
sql="select * from yixiang_corporation where id<>0 "
if gradeid<>"" then 
sql=sql&" and  gradeid="&gradeid
 end if
 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 trust_score<>"" then sql=sql&" and trust_score="&trust_score
 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"-->
<%
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 width="20%">企业名称</td>
<td width="10%">注册时间</td>
<td width="11%">服务</td>
<td width="5%">状态</td>
<td width="43%">操作</td>
</tr>
<tr><td colspan="7"   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 width="3%"><input name='userid' type='checkbox'  id="userid" value='<%=rs("id")%>'></td>
<td width="8%"  height=30  ><a href="useredit.asp?id=<%=rs("id")%>" title="查看用户注册资料信息"><%=rs("user")%></a></td>
<td style="word-break:break-all"><a href="edit.asp?id=<%=rs("id")%>" title="查看企业资料信息"><%=rs("qymc")%></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>
<%if rs("flag")=1 and rs("exd")=0 then 
response.Write("<a href='deluser.asp?checkbtn=shen&action=0&userid="&rs("id")&"&LogName=37&gradeid="&request("gradeid")&"&gradename="&request("gradename")&"' 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&LogName=36&gradeid="&request("gradeid")&"&gradename="&request("gradename")&"'   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")&"&gradeid="&request("gradeid")&"&gradename="&request("gradename")&"'  onclick=""return retval('你要让该会员通过审核吗？请注意该会员是否满足该等级的条件要求！通过审核后,将开通该会员服务功能');"">未审</a>") 
  end if %>
</td>
<td >【<a href="deluser.asp?delbtn=del&userid=<%=rs("id")%>&LogName=35&gradename=<%=request("gradename")%>&gradeid=<%=gradeid%>" onClick="return retval('你确定要删除吗？此操作不可恢复的！将删除该会员及所有相关信息！');">删除</a>&nbsp;
<%
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 yixiang_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 
	newsql="update yixiang_corporation set isbuild=1 where id="&rs("id")&" "
	conn.execute(newsql)
	rs.update
	Else
	newsql="update yixiang_corporation set isbuild=null where id="&rs("id")&" "
	conn.execute(newsql)
	rs.update
	End If
	If rs("isbuild")=1 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="../../manage/makehtml/corporation/makedetail.asp?userid=<%=rs("id")%>&all=com"   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&LogName=40" onClick="return retval('你确定要取消该推荐设置吗！');">已推荐(取消)</a>
<%
else
%>
&nbsp;<a href="deluser.asp?userid=<%=rs("id")%>&tuibtn=tui&tuiflag=1&LogName=39" 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('你确定要将所选的会员设置为推荐会员吗？');">
	  <%
	   if instr(rolelist,"qw")>0 then 
 	  %>
		  <input type="button" name="mobanbtn" value="生成所选项默认模板页"  onclick="return retvalform('你确定要生成所选会员的默认模板页吗？');"> 
		  <%
		  else
		  %>
		  		  <input type="button" name="mingpianbtn" value="生成所选项名片页"  onclick="return retvalmp('你确定要生成所选会员的名片页吗？');">
		<%
		end if
		%>
		  <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("userlist.asp?gradename="&request("gradename")&"&gradeid="&gradeid&"&shen="&shen&"&exd="&exd&"&tui="&tui&"")%>
</td>
</tr>
 </form>
 </table>
</body></html>