⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webonline_info.asp

📁 视频点播系统
💻 ASP
字号:
<!--#include file="chklogin.asp"-->
<%

call myobj.chkrq()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网站在线用户信息</title>
<link href="images/style2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
a:link {
	color: #0000FF;
	text-decoration: none;
}
a:visited {
	color: #0000FF;
	text-decoration: none;
}
a:hover {
	color: #FF0000;
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
-->
</style>
<script language="JavaScript">
function tourl(form1_url){
    location=form1_url;
    for(var i=0;i<document.form1.elements.length;i++){
        document.form1.elements[i].options[0].selected=true
    }
}
</script>
<script language="vbscript">
function show_var()
if form2.sql.value="search_msg_title" or form2.sql.value="search_from_userid" or form2.sql.value="search_to_userid" then
    document.GetElementById("var").style.display="inline"
else
	document.GetElementById("var").style.display="none"
end if
end function
</script>
</head>

<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<table width="550" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">网站在线用户信息 <a href="webserver_info.asp">Web服务器检测</a> <a href="test.asp">Helix Server链接监控/记录</a></td>
  </tr>
</table>
<table width="550" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
  <tr>
    <td align="center" class="font1"><strong class="font1">网站在线用户状态</strong></td>
  </tr>
</table>

<table width="550" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><%if request.QueryString("sql")<>"" then%><a href="webonline_info.asp"><%end if%>列出全部在线用户<%if request.QueryString("sql")<>"" then%></a><%end if%> <%if request.QueryString("sql")<>1 then%><a href="webonline_info.asp?sql=1"><%end if%>只列出个人计点用户<%if request.QueryString("sql")<>1 then%></a><%end if%>,<%if request.QueryString("sql")<>2 then%><a href="webonline_info.asp?sql=2"><%end if%>只列出个人包月用户<%if request.QueryString("sql")<>2 then%></a><%end if%></td>
  </tr>
</table>
<%
if request.querystring("sql")="" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from online order by action_time desc",conn,1,1
end if
if request.querystring("sql")=1 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from online where u_type=1 order by action_time desc",conn,1,1
end if
if request.querystring("sql")=2 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from online where u_type=2 order by action_time desc",conn,1,1
end if
if rs.eof and rs.bof then
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
  <tr>
    <td height="100" align="center" bgcolor="#F7F7F7"><%if request.querystring("sql")="" then%>没有任何用户登陆到网站<%end if%><%if request.querystring("sql")=1 then%>没有任何个人计点用户登陆到网站<%end if%><%if request.querystring("sql")=2 then%>没有任何个人包月用户登陆到网站<%end if%></td>
  </tr>
</table>
<%
else

maxpage=10 '每页最大显示数
dim totalhow  '数据库中的总记录数
dim totalpage '总共页数
dim CurrentPage '当前处于的页数
currentPage=request.Querystring("page")
totalhow=rs.recordcount
if totalhow mod maxpage=0 then
totalpage= totalhow \ maxpage
else
totalpage = totalhow \ maxpage +1
end if


if currentpage<1 then
   currentpage=1
end if
if (currentpage-1)*MaxPage>totalhow then
   if (totalhow mod MaxPage)=0 then
      currentpage= totalhow \ MaxPage
	   else
      currentpage= totalhow \ MaxPage + 1
   end if
end if
if (currentPage-1)*MaxPage<totalhow then
    rs.move (currentPage-1)*MaxPage
    else
    currentPage=1
end if
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
  <tr>
    <td height="25" align="center" bgcolor="#F7F7F7">用户账号</td>
    <td align="center" bgcolor="#F7F7F7">用户类型</td>
    <td align="center" bgcolor="#F7F7F7">最后活动时间</td>
    <td align="center" bgcolor="#F7F7F7">在线时长(分)</td>
    <td align="center" bgcolor="#F7F7F7">操作</td>
  </tr>
<%
i=0
do while not rs.eof
i=i+1
%>
  <tr>
    <td height="25" align="center" bgcolor="#FFFFFF"><%=rs("userid")%></td>
    <td height="25" align="center" bgcolor="#FFFFFF"><%if rs("u_type")=1 then%>
      个人计点
        <%else%>
        个人包月
    <%end if%></td>
    <td height="25" align="center" bgcolor="#FFFFFF"><%=rs("action_time")%></td>
    <td height="25" align="center" bgcolor="#FFFFFF"><%=datediff("n",rs("action_time"),now())%></td>
    <td height="25" align="center" bgcolor="#FFFFFF"><a href="webonline_getout.asp?userid=<%=rs("userid")%>" target="_blank" title="将用户踢除登陆" onclick="javascript:{if(confirm('确定要将用户:<%=rs("userid")%> 踢除登陆吗?')){return true;}return false;}">踢除</a></td>
  </tr>
<%
if i>=maxpage then exit do
rs.movenext
loop
%>
</table>
<table width="550" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="form1" method="post">
    <tr>
      <td width="421" align="right"><!-- ########### 开始判断分页类型 ############### -->
          <font face="Webdings">7</font>&nbsp;
          <%if currentpage>1 then%>
          <a href="<%=filename%>?sql=<%=request.Querystring("sql")%>&var=<%=request.querystring("var")%>"><%end if%>首页<%if currentpage>1 then%></a><%end if%>
&nbsp;&nbsp;
        <%if currentpage>1 then%>
        <a href="<%=filename%>?page=<%=currentPage-1%>&sql=<%=request.Querystring("sql")%>&var=<%=request.querystring("var")%>"><%end if%>上一页<%if currentpage>1 then%></a>
        <%end if%>
&nbsp;&nbsp;&nbsp;
		<%if cint(currentpage)<totalpage then%>
        <a href="<%=filename%>?page=<%=currentPage+1%>&sql=<%=request.Querystring("sql")%>&var=<%=request.querystring("var")%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a>
		<%end if%>
&nbsp;&nbsp;&nbsp;
        <%if cint(currentpage)<totalpage then%>
        <a href="<%=filename%>?page=<%=totalpage%>&sql=<%=request.Querystring("sql")%>&var=<%=request.querystring("var")%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a>
        <%end if%>
&nbsp;<font face="Webdings">8</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 共有<span class="font3"><%=totalhow%></span>人在线&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共<span class="font3"><%=currentPage%></span>/<span class="font3"><%=totalpage%></span>页</td>
      <td width="129"> 
          <select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
            <%
for j=1 to totalpage
%>
            <option value="<%=filename%>?page=<%=j%>&sql=<%=request.Querystring("sql")%>&var=<%=request.querystring("var")%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
            <%next%>
        </select></td>
  </form>
  <!-- ############################ 判断分页类型结束 ######################## -->
</table>
<%
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -