<%@language=vbscript codepage=936 %>
<!--#include file="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<%
If Request.QueryString("action")="pass" Then
Dim cid
cid = Request.QueryString("id")
Conn.ExeCute("Update [User] Set [Check]=1 Where id="&cid&"")
JaSys("管理员" & session("ManagerUser") & "<font color=red>通过ID为"&cid&"的用户审核</font>")
 Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('通过审核成功!');" & Chr(13)
		Response.write "window.document.location.href='User_Manage.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
    Response.End
End If
If Request.QueryString("action")="close" Then
cid = Request.QueryString("id")
Conn.ExeCute("Update [User] Set [Check]=0 Where id="&cid&"")
JaSys("管理员" & session("ManagerUser") & "<font color=red>取消ID为"&cid&"的用户审核</font>")
 Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('取消审核成功!');" & Chr(13)
		Response.write "window.document.location.href='User_Manage.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
    Response.End
End If

If Request.Form("cndok") Then Response.Redirect "User_Manage.asp?page="&Trim(Request.Form("pp"))
Set rs=Server.CreateObject("Adodb.Recordset")
Sql="Select * From [User] Order By ID desc"
rs.Open Sql,Conn,1,1

dim MaxPerPage
MaxPerPage=20

Dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
%>
<script language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除此用户吗？"))
     return true;
   else
     return false;
}
</script>
<html>
<head>
<titel></titel>
<LINK href="admin/admin.css" type=text/css rel=stylesheet>
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width="98%" align=center border=0>
  <TBODY>
  <TR>
    <TD width="100%" bgColor=#f7f3f7 colSpan=2 
      height=30>&nbsp;&nbsp;<B>说明</B>：系统配置中设置用户是否需要审核为开时用户审核才有效，关闭无效</TD></TR>
</TBODY>
</TABLE>
<table width="500" border="0" align="center" cellpadding="10" cellspacing="10">
  <tr>
    <td><div align="center"><strong>会员管理</strong></div></td>
  </tr>
</table>
<table width="750" border="0" align="center" cellpadding="2" cellspacing="0" class=tableBorder>
  <tr> 
    <td width="38" height="25" align="center" background="admin/admin_bg_1.gif"><strong> 
      <font color="#FFFFFF">ID</font></strong></td>
    <td width="108" height="25" align="center" background="admin/admin_bg_1.gif"><strong> 
      <font color="#FFFFFF">用户名</font></strong></td>
    <td width="43" height="25" align="center" background="admin/admin_bg_1.gif"><strong> 
      <font color="#FFFFFF">性别</font></strong></td>
    <td width="150" height="25" align="center" background="admin/admin_bg_1.gif"><strong><font color="#FFFFFF">Email</font></strong></td>
    <td width="176" height="25" align="center" background="admin/admin_bg_1.gif"><strong><font color="#FFFFFF">公司名称</font></strong></td>
    <td width="100" align="center" background="admin/admin_bg_1.gif"><strong><font color="#FFFFFF">注册时间</font></strong></td>
     <td width="100" align="center" background="admin/admin_bg_1.gif"><strong><font color="#FFFFFF">审核情况</font></strong></td>
    <td width="200" height="25" align="center" background="admin/admin_bg_1.gif"><strong> 
      <font color="#FFFFFF">操作</font></strong></td>
  </tr>
  <%If rs.Eof or rs.Bof Then
Response.Write "<center>没有注册会员</center>"
Else
i=0
Do While Not rs.Eof
%>
  <tr> 
    <td height="22" align="center"><%=rs("ID")%></td>
    <td align="center"><%=rs("UserName")%></td>
    <td align="center"> 
      <%If rs("Sex")=1 Then 
	  Response.Write "男"
	  Else
	  Response.Write "女"
	  End if
	  %>
    </td>
    <td><div align="center"><a href="mailto:<%=rs("Email")%>"><%=rs("Email")%></a></div></td>
    <td> <%=rs("Compname")%> </td>
    <td><div align="center"><%=FormatdateTime(rs("RegTime"),2)%></div></td>
    <td><div align="center"><%If Cint(Rs("Check"))=1 Then Response.Write "已审核" Else Response.Write "未审核" End if%></div></td>
    <td align="center"><a href="User_Edit.asp?action=update&id=<%=rs("ID")%>">修改</a> 
      | &nbsp;<a href="User_Edit.asp?action=del&id=<%=rs("ID")%>" onClick="return ConfirmDel();">删除</a>&nbsp;|&nbsp;<%If int(Rs("Check"))=1 Then%><a href="?action=close&id=<%=rs("ID")%>">取消审核</a><%Else%><a href="?action=pass&id=<%=rs("ID")%>">通过审核</a><%End If%></td>
  </tr>
  <%
i=i+1 
If i >= MaxPerpage Then Exit do 
rs.MoveNext
 Loop
 End if
 %>
</table>
    </td>
  </tr>
</table>
 
<table width="750" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr>
                  <td> 
                    <form name="form1" method="post" action="">
<%
Response.write "全部"
Response.write "共 </font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'> 位注册会员</font></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Response.write "第</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) &  "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font></strong>&nbsp;"
If currentpage > 1 Then
response.write "<a href='User_Manage.asp?&page="+cstr(1)+"'>首页 </a>"
Response.write "<a href='User_Manage.asp?page="+Cstr(currentpage-1)+"'> 上一页 </a>"
Else
Response.write " 上一页 "
End if
If currentpage < Rs.PageCount Then
Response.write "<a href='User_Manage.asp?page="+Cstr(currentPage+1)+"'> 下一页 "
Response.write "<a href='User_Manage.asp?page="+Cstr(Rs.PageCount)+"'> 尾页</a>&nbsp;&nbsp;"
Else
Response.write "下一页&nbsp;&nbsp;"
End if
response.write "</td><td align='right'>"
response.write "转到：<input type='text' name='pp' size=4 maxlength=4 class=smallInput value="&Currentpage&">&nbsp;"
response.write "<input type='submit'  value='Go'  name='cndok'>&nbsp;&nbsp;"
%>
                    </form> </td>
                </tr>
              </table>
</body>
</html>
<%rs.Close
Conn.Close%>