📄 admin_daili.asp
字号:
<!--#include file="../conn.asp"-->
<!--#include file="Admin_ChkPurview.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/function.asp"-->
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<link href='Admin_Style.css' rel='stylesheet' type='text/css'>
</head>
<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>
<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
<form name='form1' action='' method='get'>
<tr class='topbg'>
<td height='22' colspan='2' align='center'><strong>代 理 商 用 户 管 理</strong></td>
</tr>
<tr class='tdbg'>
<td width='79' height='30'><strong>快速查找:</strong></td>
<td width='673' height='30'> <a href="?">用户管理首页</a>|<a href="?action=add">添加新代理帐户</a>|<a href="?keyword=lastreg">24小时登陆的用户</a>|<a href="?keyword=open">代理资格开启的帐户</a>|<a href="?keyword=close">代理资格关闭的帐户</a></td>
</tr>
</form>
</table>
<%
select case lcase(request("action"))
case "add"
call add()
case "modifyl"
case "del"
call del()
call main()
case "savemodifyl"
case "saveadd"
call saveadd()
case "userinfo"
call userinfo()
call main()
case "saveuserinfo"
call saveuserinfo()
call main()
case "update"
call UpdateUser()
case "doupdate"
call doupdate()
case else
call main()
end select
sub saveuserinfo()
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from daili where id="&request("id")
rs.Open sql,Conn,1,3
if trim(request("Password"))>"" then rs("Password")=md5(request("Password"))
rs("realname")=request("realname")
rs("Money")=request("Money")
rs("Address")=request("Address")
rs("phone")=request("phone")
rs("State")=request("State")
rs("QQ")=request("QQ")
rs("Connect")=request("Connect")
rs.update
end sub
sub saveadd()
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from daili where name='" &request("name")&"'"
rs.Open sql,Conn,1,3
if rs.eof then
rs.addnew
rs("Name")=request("name")
rs("realname")=request("realname")
rs("Password")=md5(request("Password"))
rs("Money")=request("Money")
rs("Address")=request("Address")
rs("phone")=request("phone")
rs("State")=request("State")
rs("QQ")=request("QQ")
rs("Connect")=request("Connect")
rs.update
call WriteSuccessMsg("代理商添加成功!")
else
call WriteErrMsg("该用户已经存在!")
end if
end sub
sub del()
conn.execute "delete from daili where id="&cint(trim(request("id")))
end sub
sub main()
if request("command")="edit" then
select case lcase(request("action"))
case "delselect"
for each id in split(request("typeID"),",")
conn.execute "delete from daili where id="&id
next
case "closestate"
for each id in split(request("typeID"),",")
set rs=server.createobject("adodb.recordset")
conn.execute "update daili set state=false where id ="&id
next
case "openstate"
for each id in split(request("typeID"),",")
conn.execute "update daili set state=true where id ="&id
next
end select
end if
%>
<SCRIPT language=javascript>
function unselectall(){
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.Name != 'chkAll'&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
</SCRIPT>
<%
Set rs=Server.CreateObject("Adodb.RecordSet")
sqltype="select * from daili order by id desc"
if request.form("search")>"" then
sqltype="select * from daili where name like '%"&request.form("search")& "%'"
else
sqltype="select * from daili where name like '%"&request.QueryString("search")& "%'"
end if
if request("Keyword")="lastlogin" then
sqltype="select * from daili where datediff('h' ,LoginDate,now())<25 order by id desc"
end if
if request("Keyword")="lastreg" then
sqltype="select * from daili where datediff('h' ,RegDate,now())<25 order by id desc"
end if
if request("Keyword")="close" then
sqltype="select * from daili where state=false"
end if
if request("Keyword")="open" then
sqltype="select * from daili where state=true"
end if
rs.Open sqltype,Conn,1,1
rs.PageSize = 20
pgnum=rs.Pagecount
page=request("page")
if page="" or clng(page)<1 then page=1
if clng(page) > pgnum then page=pgnum
if pgnum>0 then rs.AbsolutePage=page
%>
<br><table width='100%'><tr>
<td align='left'>您现在的位置:<a href="admin_user.asp">用户管理</a>>><a href="admin_user.asp"> 所有代理用户</a></td>
<td align='right'>共找到 <font color=red><%=rs.recordcount%></font> 个用户</td>
</tr></table><table width='100%' border='0' cellpadding='0' cellspacing='0'> <tr> <form name='myform' method='Post' action='?command=edit' onsubmit="return confirm('确定要执行选定的操作吗?');"> <td> <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
<tr class='title'>
<td width='45' align='center'><strong>选中</strong></td>
<td width='39' align='center'><strong>ID</strong></td>
<td width='100' height='21' align='center'><strong>代理帐户</strong></td>
<td width="88" height='21' align='center'><strong>代理状态</strong></td>
<td width='126' align='center'> <p><strong>登陆次数</strong></p></td>
<td width='104' height='21' align='center'> <p><strong>剩余金钱</strong></p></td>
<td width='225' height='21' align='center'><strong> 操作</strong></td>
</tr>
<%
if rs.eof then response.Write("<tr class='tdbg'><td colspan='20' align='center'><br>没有任何用户信息!<br><br></td></tr>")
do until rs.eof or i>=rs.pagesize
%>
<tr class='tdbg' onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td width='45' height="24" align='center'> <input name='typeID' type='checkbox' onclick="unselectall()" id='UserID' value='<%=rs("id")%>'></td>
<td width='39' align='center'><%=rs("id")%></td>
<td width='100' align='center'><a href='?action=userinfo&id=<%=rs("id")%>' title=""><%=rs("name")%></a>
</td>
<td align='center'><font color=green><%if rs("state")=true then response.write "开启" else response.write "关闭" end if %></font> </td>
<td width='126' align='center'><%=rs("LoginTimes")%> </td>
<td width='104' align='center'> <%=RS("money")%> </td>
<td width='225' align='center'>详细销售情况 <a href="?action=userinfo&id=<%=rs("id")%>">详细信息</a>
<a href='?Action=Del&ID=<%=rs("id")%>' onClick='return confirm("确定要删除此用户吗?");'>删除</a> </td>
</tr>
<%i=i+1
rs.movenext
loop
%>
</table>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td width='191' height='23'>
<input name='chkAll' type='checkbox' id='chkAll2' onclick='CheckAll(this.form)' value='checkbox'>
选中本页所有QQ用户</td>
<td width="574"> <div align="left"><strong>操作:</strong>
<input name='Action' type='radio' value='Delselect' checked>
删除
<input name='Action' type='radio' value='closestate'>
关闭代理资格
<input name='Action' type='radio' value='openstate'>
开启代理资格
<input type='submit' name='Submit' value=' 执 行 '>
</div></td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -