<% Option Explicit %>
<!--#include file="../../Inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Const.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0803") then Call ReturnError1()
Dim AdminSql,RsUGObj,RsObjIndex
RsObjIndex = 1
AdminSql = "Select * from Members order by RegTime desc"
Set RsUGObj = Server.CreateObject("ADODB.recordset")
RsUGObj.open AdminSql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员列表</title>
</head>
<link href="../../CSS/css.css" rel="stylesheet">
<script src="../JS/PublicJS.js" language="JavaScript"></script>
<body topmargin="0" leftmargin="0" oncontextmenu="SelectAdmin();showMenu(MouseRightMenu);return false;">
<table width="100%" border="0"  cellspacing="0" cellpadding="0">
  <tr>
  <td valign="top"><table width="100%" border="0" onClick="SelectAdmin();" cellpadding="0" cellspacing="0">
  	<tr>
    <td class="ButtonList"><div align="center">编号</div></td>
    <td class="ButtonList"><div align="center">会员名称</div></td>
    <td class="ButtonList"><div align="center">组名</div></td>
    <td class="ButtonList"><div align="center">性别</div></td>
    <td class="ButtonList"><div align="center">真实姓名</div></td>
    <td class="ButtonList"><div align="center">锁定</div></td>
    <td class="ButtonList"><div align="center">注册时间</div></td>
  </tr>
  <%if RsUGObj.eof then%>
  <tr> 
    <td colspan="7"><div align="center"><font color=red>暂时没有会员记录</font></div></td>
  </tr>
 <% else 
   Dim page_size,page_no,page_total,record_all,PageNums
	page_size=Request.QueryString("page_size")
	if page_size<=0 or page_size="" then page_size=20
	If isnumeric(Request.Form("PageNums")) then
		if Request.Form("PageNums")<>0 then
			page_size = Cint(Request.Form("PageNums"))
		end if
	End if
	page_no=request.querystring("page_no")
	if page_no<=1 or page_no="" then page_no=1
	If Request.QueryString("page_no")="" then
		page_no=1
	end if
	RsUGObj.PageSize=page_size
	page_total=RsUGObj.PageCount
	if (cint(page_no)>page_total) then page_no=page_total
	RsUGObj.AbsolutePage=page_no
	record_all=RsUGObj.RecordCount
	Dim i
	for i=1 to RsUGObj.PageSize
	if RsUGObj.eof then exit for
%>
  <tr Lock="<% = RsUGObj("Lock") %>" UserID="<% = RsUGObj("ID") %>" style="background:white;cursor:default;"> 
    <td><div align="center"><%=RsObjIndex%></div></td>
    <td height="26"> <div align="center"> 
        <% = RsUGObj("MemName") %>
      </div></td>
    <td><div align="center"> 
        <%
Dim RsAdminGroupObj
Set RsAdminGroupObj = Conn.Execute("Select Name from MemGroup where GroupID='" & RsUGObj("GroupID") & "'")
if Not RsAdminGroupObj.Eof then
	Response.Write(RsAdminGroupObj("Name"))
else
	Response.Write("未分配组")
end if
%>
      </div></td>
    <td><div align="center"> 
        <%
if RsUGObj("Sex") = 0 then
	Response.Write("男")
else
	Response.Write("女")
end if
%>
      </div></td>
    <td><div align="center"> 
        <% = RsUGObj("Name") %>
      </div></td>
    <td><div align="center">
	<%
	if RsUGObj("Lock") = 1 then
		Response.Write("是")
	else
		Response.Write("否")
	end if
	%>
	</div></td>
    <td> <div align="center">
        <% = RsUGObj("RegTime") %>
      </div></td>
  </tr>
  <%
  		RsObjIndex = RsObjIndex + 1
		RsUGObj.MoveNext
	Next
end if	
%>	
</table>
	</td>
	</tr>
	<%if page_total>1 then%>
<tr>
<td height="18">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr height="1">
	  <td width="42%" height="18"><table width="99%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
		  </tr>
	   </table> </td>
	
	<td width="51%" height="25" valign="middle"> <div align="right">
		<% =  "NO.<b>"& page_no &"</b>,&nbsp;&nbsp;" %>
		<% = "Totel:<b>"& page_total &"</b>,&nbsp;RecordCounts:<b>" & record_all &"</b>&nbsp;&nbsp;&nbsp;"%>
		<%
			if Page_Total=1 then
					response.Write "&nbsp;<img src=../images/First1.gif border=0 alt=首页></img>&nbsp;"
					response.Write "&nbsp;<img src=../images/prePage.gif border=0 alt=上一页></img>&nbsp;"
					response.Write "&nbsp;<img src=../images/nextPage.gif border=0 alt=下一页></img>&nbsp;"
					response.Write "&nbsp;<img src=../images/endPage.gif border=0 alt=尾页></img>&nbsp;"
			else
				if cint(Page_No)<>1 and cint(Page_No)<>Page_Total then
					response.Write "&nbsp;<a href=?page_no=1&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)-1)&"&page_size="&page_size&"&Keywords="&Request("Keywords")&"><img src=../images/prePage.gif border=0 alt=上一页></img></a>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)+1)&"&page_size="&page_size&"&Keywords="&Request("Keywords")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="& Page_Total &"&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/endPage.gif border=0 alt=尾页></img></a>&nbsp;"
				elseif cint(Page_No)=1 then
					response.Write "&nbsp;<img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
					response.Write "&nbsp;<img src=../images/prePage.gif border=0 alt=上一页></img>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)+1)&"&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="& Page_Total &"&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/endpage.gif border=0 alt=尾页></img></a>&nbsp;"
				else
					response.Write "&nbsp;<a href=?page_no=1&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/First1.gif border=0 alt=首页></img>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)-1)&"&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/prePage.gif border=0 alt=上一页></img></a>&nbsp;"
					response.Write "&nbsp;<img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
					response.Write "&nbsp;<img src=../images/endpage.gif border=0 alt=尾页></img>&nbsp;"
				end if
			end if
			%>
	</div></td>
	<td width="7%" valign="middle"><select onChange="ChangePage(this.value);" style="width:50;" name="select">
	  <% for i=1 to Page_Total %>
	  <option <% if cint(Page_No) = i then Response.Write("selected")%> value="<% = i %>">
	  <% = i %>
	  </option>
	  <% next %>
	</select></td>
  </tr>
</table>
</td>
</tr>
<% end if %>
</table>
</body>
</html>
<!-- 鼠标右键菜单 -->
<div id=MouseRightMenu onclick="ClickMenu(this);" onmouseover="MouseOverRightMenu();" onmouseout="MouseOverRightMenu();" class="menu"> 
  <div class="MouseRightItem" id="AddAdmin" ExeFunction="OpenWindow('Frame.asp?FileName=UserAdd.asp&Titles=添加会员',350,205,window);">新建</div> 
  <div class="MouseRightItem" id="EditAdmin" ExeFunction="OpenWindow('Frame.asp?FileName=UserModify.asp&Titles=修改会员信息&ID='+UserID,550,430,window);">修改</div>
  <div class="MouseRightItem" id="DelAdmin" ExeFunction="OpenWindow('Frame.asp?FileName=UserDell.asp&Titles=删除会员&OperateType=Dell&ID='+UserID,220,105,window);">删除</div>
  <hr id="HR1">
  <div class="MouseRightItem" id="LockAdmin" ExeFunction="OpenWindow('Frame.asp?FileName=UserDell.asp&Titles=锁定会员&OperateType=Lock&ID='+UserID,220,105,window);">锁定</div>
  <div class="MouseRightItem" id="UNLockAdmin" ExeFunction="OpenWindow('Frame.asp?FileName=UserDell.asp&Titles=解锁会员&OperateType=UnLock&ID='+UserID,220,105,window);">解锁</div>
  <div class="MouseRightItem" id="SetPop" ExeFunction="OpenWindow('Frame.asp?FileName=UserGroupSet.asp&Titles=设置会员组&ID='+UserID,280,105,window);">设置组</div> 
  <hr id="HR2">
  <div class="MouseRightItem" id="Refresh" ExeFunction="window.location.reload();">刷新</div>
   <hr id="HR3">
  <div class="MouseRightItem" id="Pros" ExeFunction="javascript:window.prompt('本页面路径属性' , '<%=Request.ServerVariables("SCRIPT_NAME")%>');">路径属性</div>
</div>
<%
Set Conn = Nothing
%>
<script>
var UserID='';
var DisableOrActiveMenuArray=new Array();
DisableOrActiveMenuArray[0]=EditAdmin;
DisableOrActiveMenuArray[1]=DelAdmin;
DisableOrActiveMenuArray[2]=LockAdmin;
DisableOrActiveMenuArray[3]=UNLockAdmin;
DisableOrActiveMenuArray[4]=SetPop;
DisableMenu(DisableOrActiveMenuArray);
function SelectAdmin()
{
	var i=0,j=0;
	var EventObj=event.srcElement;
	var TRObj;
	switch (EventObj.tagName.toLowerCase())
	{
		case 'div':
			TRObj=EventObj.parentElement.parentElement;
			break;
		case 'td':
			TRObj=EventObj.parentElement;
			break;
		case 'tr':
			TRObj=EventObj;
			break;
		default:
			return;
	}
	for (j=0;j<document.all.length;j++)
	{
		if (document.all(j).style.backgroundColor=='highlight')
		{
			document.all(j).style.backgroundColor='';
			for (i=0;i<document.all(j).children.length;i++) document.all(j).children(i).style.color='black';
		}
	}
	if (TRObj.UserID!=null) UserID=TRObj.UserID;
	else UserID='';
	if (UserID!='')
	{
		if (TRObj.UserID==null)  UserID='';
		TRObj.style.backgroundColor='highlight';
		if (TRObj.Lock=='1')
		{
			LockAdmin.className='MenuItemDisable';
			UNLockAdmin.className='MouseRightItem';
		}
		else
		{
			LockAdmin.className='MouseRightItem';
			UNLockAdmin.className='MenuItemDisable';
		}
		EditAdmin.className='MouseRightItem';
		DelAdmin.className='MouseRightItem';
		SetPop.className='MouseRightItem';
		for (i=0;i<TRObj.children.length;i++) TRObj.children(i).style.color='white';
	}
	else
	{
		UserID='';
		LockAdmin.className='MenuItemDisable';
		UNLockAdmin.className='MenuItemDisable';
		EditAdmin.className='MenuItemDisable';
		DelAdmin.className='MenuItemDisable';
		SetPop.className='MenuItemDisable';
	}
}
function ChangePage(PageNum)
{
	var page_size=<% = page_size %>
	window.location.href='?page_no='+PageNum+'&page_size='+page_size;
}
</script>