<!--#include file="Config.asp" -->
<div class='menu'>&nbsp;查看 &gt; 用户</div>
<%
eims = "User"
eTable = Prefix&eims
ListUrl = eims&"List.asp?eims="&eims
EditUrl = eims&"Edit.asp?eims="&eims
Mgt("p88") 'Cookies : Permission

'================================================
'发送邮件
'================================================
If Trim(Request("submit"))="发送邮件" Then
if Trim(Request("BoxID"))="" then WtMsg("没有选择数据")
Response.Redirect "SendMail.asp?BoxID="&Trim(Request("BoxID"))
End If

If Trim(Request("submit"))="恢复" Then Conn.Execute "update ["&eTable&"] set ItemRec=1 where ItemID in ("&Trim(Request("BoxID"))&")"
If Trim(Request("submit"))="冻结" Then Conn.Execute "update ["&eTable&"] set ItemRec=0 where ItemID in ("&Trim(Request("BoxID"))&")"
%>
<div class="title">
<form method='post' name='sForm' action="<%=ListUrl%>">
  <table width="100%" border="0" cellspacing="1" cellpAdding="1">
    <tr>
      <td><a href="<%=EditUrl%>" target="mainFrame">【添加信息】</a></td>
      <td align="right"><!-- Search Begin -->
        用户<input type='text' name='UserName'>
		<select name='eType'>
            <option value=''>=用户类型=</option>
            <option value='3'>前台注册</option>
			<option value='2'>特别用户</option>
            <option value='1'>后台管理</option>
          </select>
        <select name="ItemRec">
            <option value=''>=状态=</option>
			<option value='1'>正常</option>
			<option value='0'>冻结</option>
          </select>
        <input type='submit' value='搜索' name='submit'>
		<input type='submit' value='冻结' name='submit'>
		<input type='submit' value='恢复' name='submit'>		
		<input type='submit' value='删除' name='submit' onClick="return confirm('确定要删除吗？')">
		<input type='submit' value='发送邮件' name='submit'>
		<input type="hidden" name="del" value="yes">
        <!-- Search end -->
      </td>
    </tr>
  </table>
</div>
<div class="content" align="center">
<table width="100%" border="0" cellspacing="1" cellpAdding="1">
  <tr bgcolor="#FFFFFF" align="center">    
	<td width='60'><div class='title'>ID</div></td>
	<td width='60'><div class='title'>用户类型</div></td>
	<td><div class='title'>用户</div></td>
	<td><div class='title'>姓名</div></td>
	<td><div class='title'>电话</div></td>
	<td><div class='title'>QQ</div></td>
	<td><div class='title'>邮箱</div></td>
	<td width="150"><div class='title'>更新日期</div></td>
	<td width='35'><div class='title'>操作</div></td>
    <td width='35'><div class='title'>状态</div></td>
	<td width='35'><div class='title'><input type='checkbox' name='chkall' onClick='CheckAll(this.form)' value='ON'> </div></td>
  </tr>
<%
fField="ItemID,UserName,RelName,Tel,QQ,Mail,EditDate,ItemRec,eType"
OrderBy="ItemID desc"

Condition="ItemID>0"
If Trim(Request("ItemRec"))<>"" Then Condition=Condition&" and ItemRec="&Trim(Request("ItemRec"))&" "
If Trim(Request("eType"))<>"" and Int(Request("eType"))>0 Then Condition=Condition&" and eType="&Int(Request("eType"))&" "
If Trim(Request.Form("UserName"))<>"" Then Condition=Condition&" and UserName like '%"&Trim(Request.Form("UserName"))&"%'"

Sql="Select "&fField&" From ["&eTable&"] Where "&Condition&" Order By "&OrderBy&" "
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open Sql,Conn,1,1
totalnumber=rs.recordcount'总记录数
if not (rs.eof and rs.bof) then'有记录
rs.PageSize=pagenum
maxpage=rs.pageCount'总页数
page=cint(request("page"))'接收页面传来的参数
if page<1 then page=1
If page>maxpage then page=maxpage
rs.Absolutepage=Page
for i=1 to rs.PageSize
if rs.eof then exit for

ItemRec="正常"
if Int(Rs("ItemRec"))=0 then ItemRec="<span class=red>冻结</span>"
%>
  <tr onMouseOver='trOver(this)' onMouseOut='trOut(this)' align="center">
	<td><%=Int(Rs(0))%></td>
	<td><%=UserRank(Rs("eType"))%></td>
	<td><%=Trim(Rs(1))%></td>
	<td><%=Trim(Rs(2))%></td>
	<td><%=Trim(Rs(3))%></td>
	<td><%=Trim(Rs(4))%></td>
	<td><%=Trim(Rs(5))%></td>
    <td><%=Trim(Rs(6))%></td>
	<td><a href='<%=EditUrl%>&action=Edit&ItemID=<%=Int(Rs(0))%>'>修改</a></td>
    <td><%=ItemRec%></td>
	<td><input name='BoxID' type='checkbox' value='<%=Int(Rs(0))%>'></td>
  </tr>
<% 
Rs.MoveNext
next
end if
Rs.Close
Set Rs=nothing
%>
</table>
</form>
<div class="page"><%showpage Page,totalnumber,pagenum,ReUrl() %></div>
</div>
</body></html>
<%Call CloseConn()%>
