<!--#include file="chklogin.asp"-->
<!--#include file="../conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>快问我知道 - 注册用户管理</title>
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-color: #FF9999;
	scrollbar-face-color: #FF3333;
        scrollbar-highlight-color: #FFFFFF;
}
-->
</style>
</head>
<body bgcolor="#FF9999"><br>
<br>
<br>
<%
Response.Buffer = True 
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache"

if session("userflag")="编辑管理员" then
response.Write("&nbsp;&nbsp;&nbsp;&nbsp;你没有权限进行此项操作！")
response.End()
end if

dim action,id
dim rs,sql,i,username
action=request.QueryString("action")
id=request.QueryString("id")
if action="sc" then
sc
elseif action="xg" then
xg
end if
sub sc()
sql="delete from kw_user where id="&id
conn.execute sql
response.write "<script language=javascript>alert('成功的删除了用户');history.go(-1);</script>"
response.End
end sub

sub xg()
dim dengji,jifen
dengji=request.Form("dengji")
jifen=request.Form("jifen")
set rs=server.CreateObject("adodb.recordset")
sql="select dengji,jifen from kw_user where id="&id
rs.open sql,conn,1,3
rs("dengji")=dengji
rs("jifen")=jifen
rs.update
response.write "<script language=javascript>alert('修改成功');document.location.href='kw_user.asp'</script>"
response.End
end sub

username=request("username")
set rs=server.CreateObject("adodb.recordset")
if username<>"" then
sql="select * from kw_user where username='"&username&"' and zhuan<>1"
else
sql="select * from kw_user where zhuan<>1 order by id desc"
end if
rs.open sql,conn,1,3
%>
<table width="680" border="0" align="center" cellpadding="0" cellspacing="1" class="tablebg">
  <tr align="center" bgcolor="#ff6666">
    <td colspan="5" class="font_bt">注 册 用 户 管 理</td>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <form action="Kw_user.asp" method="post">
	<td height="30" colspan="5">
	查找用户(用户全部ID)：&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="username" type="text">&nbsp;&nbsp;<input name="submit" type="submit" id="submit" value="查 找">
    </td>
    </form>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <td width="117" height="40"><b style="color:#0033CC">用户名称</b></td>
    <td width="78"><b style="color:#0033CC">等 级</b></td>
    <td width="67"><b style="color:#0033CC">积 分</b></td>
    <td width="140"><b style="color:#0033CC">注册时间</b></td>
    <td width="192"><b style="color:#0033CC">操 作</b></td>
  </tr>
          <%
    if rs.bof and rs.eof then
	   response.Write("<tr><td>没有该用户</td></tr>")
	else
		  dim page
		  rs.pagesize=12
          page=clng(Request.QueryString("page"))
          if page<1 then page=1
          if page>rs.pagecount then page=rs.pagecount
          rs.absolutepage=page
          for i=1 to rs.pagesize
		       if rs.eof then
		       exit for
		       end if
		  %>
  <tr bgcolor="#ff6666">
  <form action="Kw_user.asp?id=<%=rs("id")%>&action=xg" method="post">
    <td height="30">&nbsp;&nbsp;&nbsp;&nbsp;<b><%=rs("username")%></b></td>
    <td align="center"><input name="dengji" type="text" size="6" value="<%=rs("dengji")%>" align="absmiddle"></td>
    <td align="center"><font color="#FF6600">
      <input name="jifen" type="text" size="4" value="<%=rs("jifen")%>" align="absmiddle">
    </font></td>
    <td>&nbsp;&nbsp;&nbsp;<%=rs("regtime")%></td>
    <td align="center"><input name="提交" type="submit" value="修 改">&nbsp;&nbsp;
      <a href="zhuan.asp?action=1&id=<%=rs("id")%>" onClick="return confirm('您确定？')">设为专家</a>&nbsp;&nbsp;<a href="kw_user.asp?action=sc&id=<%=rs("id")%>" onClick="return confirm('您确定进行删除操作吗？')">删除 ？</a>&nbsp;&nbsp;<img src="images/email.gif" width="15" height="16" alt="发送邮件" onClick="window.open('mail2.asp?usermail=<%=rs("usermail")%>','popdown','width=680,height=450,top=100,left=100')"></td>
  </form>
  </tr>
  <%
       rs.movenext
       next
  end if
  if username="" then
  %>
  <tr align="center" bgcolor="#ff6666">
    <td colspan="5">
	<a href="Kw_user.asp?page=1">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_user.asp?page=<%=page-1%>">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_user.asp?page=<%=page+1%>">下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_user.asp?page=<%=rs.pagecount%>">尾页</a></td>
  </tr>
</table>
<%
  end if
  rs.close
  set rs=nothing
  closedb
%>
</body>
</html>
