<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock
set cschat=server.createobject("ffcschat.cssbchat")

my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))
application.unlock

myname=cschat.myname
t_level=my_level
my_level=cint(cschat.GetListValue(Application(ConstStr & "_user_list"),myname,3))
super=0
if my_level-application( ConstStr & "_superlevel")=0 then super=1

Set Conn=Server.CreateObject("ADODB.Connection")
conn.open Application( ConstStr & "_connstr")%>
<META content="text/html; charset=gb2312" http-equiv=content-type>
<link rel="stylesheet" type="text/css" href="chat.css">
<style>li{text-align:left;}</style>
<body style="background-color:EAF2FF;color:112233;scrollbar-Base-Color: #b0d8ff;SCROLLBAR-DARKSHADOW-COLOR:#b0d8ff;SCROLLBAR-arrow-COLOR:#336699;SCROLLBAR-TRACK-COLOR: EAF2FF;SCROLLBAR-3DLIGHT-COLOR: #b0d8ff;SCROLLBAR-SHADOW-COLOR: #336699;SCROLLBAR-HIGHLIGHT-COLOR: #b0d8ff;" leftmargin=3 topmargin=3 >
  <table cellspacing=0 cellpadding=0 align=center width=100% height=100%><script src="showad.asp?id=1"></script><tr><td valign=center>
<%cschat.FilterStr=application(ConstStr & "_usernamefilter")
findkey=cschat.trdb(request("findkey"))

if request("cmdYes")="查找聊友" or findkey<>"" then%>
  <table cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
  <tr><td colspan=8 class=navy2>根据你输入的字符，查找聊友</td>
  <%
  if super=1 and instr(findkey,".")<>0 then
    firststr="first_ip"
    laststr="last_ip"
    sql="select * from user where (last_ip like '%"&findkey&"%' or first_ip like '%"&findkey&"%')"
  else
    firststr="log_time"
    laststr="in_time"
    sql="select * from user where username like '%"&findkey&"%'"
  end if
  set Rs=conn.execute(sql)
  If Rs.Bof OR Rs.Eof Then
    response.write "<tr><td colspan=7 class=navy1><font color=#cc00cc>没有找到任何聊友</font></td>"
  else%>
    <script>function xx(n,v,g,i,l,x,d){
    document.write("<tr><td nowrap><a href='topuser.asp?selwho="+n+"'>"+n+"</a></td><td>"+v+"</td><td>"+g+"</td><td>"+i+"</td><td>"+l+"</td><td>"+x+"</td>");
    if (d) document.write("<td><a href='userinfo.asp?name="+n+"'>修改</a></td><td><a onclick=\"return confirm('用户删除不可恢复，请确认！')\" href='userdel.asp?name="+n+"'>删除</a></td>"); }</script>
    <tr><td nowrap class=navy1>呢称</td><td nowrap class=navy1>次数</td><td nowrap class=navy1>首次访问</td>
    <td nowrap class=navy1>最后访问</td><td nowrap class=navy1>级别</td><td nowrap class=navy1>经验</td>
    <%if super then%><td class=navy1>修改</td><td class=navy1>删除</td><%end if%></tr>
    <%Do While Not Rs.Eof
      g=cschat.alldatestr(Rs(firststr))
      i=cschat.alldatestr(Rs(laststr))
      if my_level-application( ConstStr & "_l_seelevel")>=0 and my_level-Rs("user_level")>=0 then
        l=Rs("user_level")
      else
        l="&nbsp;"
      end if
      response.write "<script>xx('"&Rs("username")&"','"&Rs("visit_num")&"','"&g&"','"&i&"','"&l&"','"&Rs("exp_num")&"',"&super&");</script>"
      Rs.MoveNext
    Loop
  End If
  response.write "</table>"
else%>
 <br><table cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
 <tr><td colspan=4 class=navy2>欢迎您的光临！</td>
  <%set Rs=conn.execute("select * from user where username='"&myname&"'")
  if Rs.eof or Rs.bof then
    response.write "<tr><td colspan=4><font color=990099>您尚未登陆到聊天室！</font></td>"
  else%>
   <tr><td rowspan=2><img src='headface/<%=rs("headface")%>.gif'>
   <td>呢称：<%=Rs("username")%><td>性别：<%if rs("sex")=0 then%>男<%else%>女<%end if%><td>保留：<%if rs("saved")=0 then%>否<%else%>是<%end if%>
   <tr><td>级别：<%=Rs("user_level")%><td>经验：<%=Rs("exp_num")%><td>来访：<%=Rs("visit_num")%>次
   <tr><td colspan=2 style="text-align:left">首次访问：<%=cschat.alldatestr(Rs("log_time"))%><td style="text-align:left" colspan=2>首次IP：<%=Rs("first_ip")%>
   <tr><td colspan=2 style="text-align:left">最后访问：<%=cschat.alldatestr(Rs("in_time"))%><td colspan=2 style="text-align:left">最后IP：<%=Rs("last_ip")%></tr>
   <tr><td colspan=4 style="text-align:left">邮件地址：<%=Rs("email")%>
   <tr><td colspan=4 style="text-align:left">好友名单：<%=Rs("friends")%>
   <%if t_level-application( ConstStr & "_l_lockip")>=0 then%><tr><td colspan=4><marquee width=90% BEHAVIOR=ALTERNATE><a style="color:red" href="superuser.asp">你拥有一些超级管理权力，点这里进入吧！</a></marquee></td></tr><%end if%>
  <%end if%>
   <tr><td colspan=2 class=navy1>查找聊友</td>
   <form action='finduser.asp' method='post' onsubmit="if (document.forms[0].findkey.value == '') {alert('请输入搜索字符串！');return false;}">
   <td colspan=2 class=navy1><input tabindex='0' type='text' name='findkey' size='10' maxlength='16'>
   <input class='navy1' type='submit' tabindex='0' name='cmdYes' value='查找聊友' title='输入字符串然后查寻'>
   </td></tr></form></table>
<%end if%>
<br>[<a href='viewparam.asp'>系统参数</a>]<%if my_level-application( ConstStr & "_l_newuser")>=0 then%> [<a href='addnewuser.asp'>新用户预注册</a>]<%end if%> <%if super then%> [<a href='viewsys.asp'>管理员入口</a>]<%end if%> [<a href='javascript:history.go(-1)'>后退</a>]</table></body></html>
<%set cschat=nothing
rs.close
set rs=nothing
conn.close
Set conn=nothing%>