<!-- #include file="include/con_help.asp" -->
<!-- #include file="../include/functions.asp" -->
<!-- #include file="../include/jk_ip_sys.asp" -->
<!-- #include file="../include/jk_page_cute.asp" -->
<!-- #include file="../include/jk_pagecute.asp" -->
<%
dim wt,nummer,nums,rssum,page,viewpage,thepages,username,pageurl,type_view,power
wt=int(format_mid_num(1))
tit="与我在线（模式一）"
nummer=dim_num(0)
pageurl="?"

call web_head(0,0,0,0,0)
'----------------------------左边 开始----------------------------
call left_help()
call left_action()
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td>&nbsp;<%response.write img_skin("m_help")&tit%></td></tr>
<tr class=bg_td><td align=center><% call online_main() %></td></tr>
<tr><td class=td>&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>
<tr class=bg_td><td align=center><a href='online1.asp' alt='更换到显示模式（二）' align='center'>更换到显示模式（二）</a></td></tr>
</table>
<%
'----------------------------中间 结束----------------------------
call web_end(0,0)

sub online_main()
  dim l_username,guest_name,l_type,l_sys,login_name,l_where,icon
  guest_name=request.cookies(joekoe_cms.web_cookies)("guest_name")
  if var_null(login_username)="" then
    response.write "<font class=blue>"
    if wt=1 then
      response.write request.cookies("joekoe_online")("guest_name")
    else
      response.write "游客"
    end if
    response.write "</font>，您好！"&web_nologin
  else
    response.write "<font class=blue>"&login_username&"</font>，您好！欢迎您注册并登陆本站！您现在可以点击浏览其它栏目的详细内容。"
  end if

  if wt=0 then
    response.write "<tr><td></td></tr><tr class=bg_td><td height=100>"
    exit sub
  end if
  if int(wt)>1 then
    sql="select count(l_id) from user_login"
    set rs=joekoe_cms.exec(sql,1)
    rssum=rs(0)
    rs.close
%>
<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=90>最后活动时间</td>
</tr>
<%
call format_pagecute()
  sql="select top "&nummer*viewpage&" l_id,l_username,l_where,l_type,l_tim_login,l_tim_end,l_ip,l_sys from user_login 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 end if
  for i=1 to nummer
  if rs.eof then exit for
  l_username=rs("l_username")
  l_where=rs("l_where")
  l_type=rs("l_type")
 
%>
<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
    if cstr(l_username)=cstr(guest_name) then
      response.write "<font class=blue"
    else
      response.write "<font class=gray"
    end if
    end if
    response.write " alt='真实 I P："&ip_types(rs("l_ip"),l_username,0)&"<br>"&view_sys(rs("l_sys"))&"' target=_blank"
if cstr(l_username)=cstr(login_username) 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> 
<%if login_mode="admin" then%>
<td align=left>
<a href=ip_address.asp?ip=<%=rs("l_ip")%> alt='<%response.write joekoe_cms.code_html(l_where,1,200)%><br>（管理员点此查看地理位置）'><%response.write joekoe_cms.code_html(l_where,1,45)%>
</td>
<%else%>
<td align=left>
<%response.write joekoe_cms.code_html(l_where,1,40)%>
</td>
<%end if%>
<%if login_mode="admin" then%>
<td><font class=gray alt='<%response.write joekoe_cms.time_type(rs("l_tim_end"),1)%>'><%response.write joekoe_cms.time_type(rs("l_tim_end"),3)%></font></td>
<%else%> 
<td class=gray>权限不足</td>
<%end if%>
</tr>
<%
    rs.movenext
  next
  rs.close
%>
<tr><td class=bg_tds colspan=5>
  <table border=0 cellspacing=0 cellpadding=0>
  <tr>
<td colspan=4>共有&nbsp;<font class=red><%response.write rssum%></font>&nbsp;位用户在线&nbsp;&nbsp;页次：<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font>&nbsp;&nbsp;分页：<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,8,"#ff0000") %></td></tr>
</td>
  </table>
</td></tr>
</table>
<%
  end if
end sub
%>