<!-- #include file="include/con_help.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<!-- #include file="include/jk_ip_sys.asp" -->
<%

dim ntit,nummer,nums,rssum,page,viewpage,thepages,pageurl,sql_add,wt
iframe=true
nummer=dim_num(0)
nums=nummer
page=1
ntit="在线用户"
wt=int(format_mid_num(1))
tit="与我在线"

call web_head(0,0,0,0,0)
'----------------------------左边 开始----------------------------
call left_action()
call left_help()
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
call online_main()
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td0>&nbsp;<%response.write img_skin("m_help")%>相关说明</td></tr>
<tr class=bg_td><td align=center height=30><%response.write img_user%></td></tr>
<tr class=bg_td><td align=center><%
select case wt
case 1
  response.write "本站现在已开启 模式１：本站的注册用户可以登陆，并记录用户在线列表。"
case 2
  response.write "本站现在已开启 模式２：所有登陆和浏览本站的人被并记录在线列表。"
case else
  response.write "本站现在已开启 模式０：本站的注册用户可以登陆，不记录在线列表。"
end select
%></td></tr>
</table>
<%
response.write ukong
'----------------------------中间 结束----------------------------
call web_end(0,0)

sub online_main()
    dim l_username,guest_name,l_id,l_type,l_sys
    guest_name=request.cookies(joekoe_cms.web_cookies)("guest_name")
    if var_null(login_username)="" then
    if wt=1 then
      guest_name=request.cookies("joekoe_online")("guest_name")
    else
      guest_name="游客"
    end if
  else
    guest_name=""&login_username&""
  end if
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr align=center>
<td class=td width=30>序号</td>
<td class=td width=110>用户名</td>
<td class=td width='*'>当前位置</td>
<td class=td width='*'>活动时间</td>
<td class=td width=90>来自何方</td>
</tr>
<%
  sql="select count(l_id) from user_login"&sql_add
  set rs=joekoe_cms.exec(sql,1)
  rssum=rs(0)
  rs.close
  call format_pagecute()
  sql="select top "&nummer*viewpage&" * from user_login"&sql_add&" order by l_id desc"
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,1
  if int(viewpage)>1 then rs.move (viewpage-1)*nummer
  if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
  for i=1 to nums
  l_id=rs("l_id")
  l_type=rs("l_type")
  l_username=rs("l_username")
  l_sys=rs("l_sys")
%>
<tr class=bg_td align=center>
<td class=tims><%response.write (viewpage-1)*nummer+i%></td>
<td><%
    if int(l_type)=0 then
      response.write "<a href='user_view.asp?username="&server.urlencode(l_username)&"'"
    else
      response.write "<font class=gray"
    end if
    response.write " alt='来访时间："&rs("l_tim_login")&"<br>真实IP："&ip_types(rs("l_ip"),l_username,1)&"<br>"&view_sys(rs("l_sys"))&"' target=_blank"
    if cstr(l_username)=cstr(guest_name) then
      response.write " class=blue"
    end if
    response.write ">"&l_username
    if int(l_type)=0 then
      response.write "</a>"
    else
      response.write "</font>"
    end if
%></td>
<td align=center><%response.write joekoe_cms.code_html(rs("l_where"),1,20)%></td>
<td class=gray><%response.write joekoe_cms.time_type(rs("l_tim_end"),3)%></td>
<td align=center>
<script src=ip_script.asp?ip=<%=rs("l_ip")%>></script>
</td>
</tr>
<%
  rs.movenext
  next
  rs.close
%>
<tr><td class=bg_tds colspan=5>
  <table border=0 cellspacing=0 cellpadding=0>
  <tr>
  <td colspan=4>
现有<font class=red><%response.write rssum%></font>位<%response.write ntit%>，
每页<font class=red><%response.write nummer%></font>条，
页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>
分页：<%response.write jk_pagecute(nummer,thepages,viewpage,"online.asp?"&pageurl,5,"#ff0000")%>
  </td>
  </tr>
  </table>
</td></tr>
</table>
<% 
end sub

%>















