<%
'乘风多用户计数器
'作者QQ：178575
'作者EMail：yliangcf@163.com
'作者网站：http://www.qqcf.com
'详细简介：http://www.qqcf.com/cfcount.htm
'上面有程序在线演示，安装演示，使用疑难解答，最新版本下载等内容
'因为这些内容可能时常更新，没有放在程序里，请自己上网站上查看
%>
<%If SysCode="" Then Response.End%>

<%
UserName=ChkStr(Request("UserName"),1)
Px=ChkStr(Request("Px"),1)

If Px="" Then Px="ID"

PageUrl = "?Action="&Action&"&UserName="&UserName

Call PxFilter(Px,"ID,UserName,ParentName,LoginTotal,RealIpTotal,PageName,AddTime,LastTime,UserState")
%>

<table class="tb_1">
<tr>
<td colspan="10">点击标题可以选择其相应的排序方式</td>
</tr>
<tr class="tr_1"> 
<td><a href="<%=PageUrl%>&Px=ID">ID</a></td>
<td><a href="<%=PageUrl%>&Px=UserName">用户名</a></td>
<td><a href="<%=PageUrl%>&Px=ParentName">账号情况</a></td>
<td><a href="<%=PageUrl%>&Px=LoginTotal">登陆次数</a></td>
<td><a href="<%=PageUrl%>&Px=RealIpTotal">实际计数</a></td>
<td><a href="<%=PageUrl%>&Px=PageName">主页</a></td>
<td><a href="<%=PageUrl%>&Px=AddTime">注册时间</a></td>
<td><a href="<%=PageUrl%>&Px=LastTime">最后更新时间</a></td>
<td><a href="<%=PageUrl%>&Px=UserState">状态</a></td>
<td>操作</td>
</tr>
<%
Sql="Select * From CFCount_User Where 1=1" 
If UserName<>"" Then Sql=Sql&" And UserName like '%"&UserName&"%'"
Sql=Sql&" Order By "&px&" Desc"

Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.open Sql,Conn,1,1

If Not Rs.eof then
 Rs.pagesize=20
 TotalRs=Rs.RecordCount
 TotalPage=Rs.PageCount
 MyPageSize=Rs.PageSize
 Page=CLng(ChkStr(Request("Page"),2))
 If Page<=0 Then Page=1
 If Page>TotalPage Then Page=TotalPage
 Rs.AbsolutePage=Page
End If

While Not Rs.Eof And MyPageSize>0%>
<tr class="tr_2"> 
<td><%=Rs("ID")%></td>
<td><%=Rs("UserName")%></td>
<td>
<%
If Rs("ParentName")="" Then
 Response.write "无父账号"
Else
 Response.write "父账号:"&Rs("ParentName")
End If
%></td>
<td><%=Rs("LoginTotal")%></td>
<td><%=Rs("RealIpTotal")%></td>
<td><a href="<%=Rs("PageUrl")%>" target="_blank"><%=Rs("PageName")%></a></td>
<td><%=year(Rs("AddTime"))&"-"&month(Rs("AddTime"))&"-"&day(Rs("AddTime"))%></td>
<td><%=Rs("LastTime")%></td>
<td> 
<%if rs("UserState")=-1 then
  response.Write "有效"
  elseif rs("UserState")=0 then
  response.Write "<font color=#ff0000>无效</font>"
  end if%>
</td>
<td>
<a href="?Action=usergo&UserName=<%=Rs("UserName")%>" target="_blank">查看</a> 
<a href="?Action=usermodify&ID=<%=Rs("ID")%>">修改</a> 
<%
 Response.write "<a href=""javascript:;"" onclick=""$(function () { confirm('确定要删除吗?', '', function (isConfirm) {if (isConfirm) {gotoUrl('?Action=userdel&UserName="&Rs("UserName")&"')}}, {confirmButtonText: '确定', cancelButtonText: '取消', width: 400});});"">删除</a>"
%>
</td>
</tr>
<%rs.movenext
mypagesize=mypagesize-1
wend
Rs.Close
%>
</table>
 
<%
Response.write GetPageList(TotalRs,TotalPage,Page,PageUrl,Px)
%>

<script>
$(function(){
 	$("#search").click(function(){		
		 var searchurl ="?Action=<%=Action%>";
		 searchurl += '&UserName=' + $('#UserName').val();
		 searchurl += '&UserState=' + $('#UserState').val();
		 searchurl += '&VipState=' + $('#VipState').val();
		 location.href=searchurl;
	});
});
</script> 
<table class="tb_3">
<tr> 
<td>搜索：用户名 
<input name="UserName" type="text" id="UserName" size="10" value="<%=UserName%>">
<input type="submit" name="search" id="search" value="查找">
</td>
</tr>
</table>
