?? adminadmin1.asp
字號:
<!--#include file="conn.asp"--> <%
if session("adminname")="" then
response.redirect "relogin.asp"
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系統(tǒng)管理 | 綜合管理 | 管理員管理</title>
<script language="javascript">
function editit(id)
{
page="adminadminedit.asp?adminid="+id
window.open (page,'編輯用戶','width=500,height=400,resizable=1,scrollbars=1')
}
function viewit(myform)
{
myform.action="adminadmin.asp";
myform.submit();
}
function searchit(myform)
{
myform.action="adminadmin1.asp";
myform.submit();
}
function addit(myform)
{
myform.action="adminaddadmin.asp";
myform.submit();
}
function FanAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.checked == false){ e.checked = true; }
else { e.checked = false;}
}}
</script>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body>
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="25">
<tr>
<td width="100%">當(dāng)前位置: 系統(tǒng)管理 >
<a href="adminsomething.asp">綜合管理</a><span lang="en-us"> > </span>管理員管理</td>
</tr>
</table>
<center>
<table border="1" cellspacing="1" style="border-collapse: collapse" id="AutoNumber2" bgcolor="#99CCFF" width="100%" background="images/admin_bg_1.gif" bordercolor="#799AE1">
<form name="viewaddform" method="POST" action="adminadmin.asp?mykey=<%=request("mykey")%>">
<tr>
<td><center>
<input type="submit" value="所有管理員" name="I8" onclick="viewit(viewaddform)" class="s02"><span lang="en-us">
</span>
<input type="submit" value="添加管理員" name="I6" onclick="addit(viewaddform)" class="s02">
<span lang="en-us"> </span>
<input type="text" name="mykey" size="10" value="--關(guān)鍵字--" onfocus="this.select()" class="s01"><span lang="en-us">
<select size="1" name="fanwei">
<option selected value="username">用戶名</option>
<option value="tname">姓 名</option>
<option value="email">電子信箱</option>
</select></span>
<input type="submit" value="查 詢" name="I7" onclick="searchit(this.form)" class="s02"></center>
</td>
</tr>
</table></center>
<%
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
fanwei=request("fanwei")
mykey=request("mykey")
if mykey= "--關(guān)鍵字--" or mykey="" then
%>
<br><br>
<center>
<h1>沒有輸入關(guān)鍵字</h1></center>
<%
else
sql="select * from tbadmin where "&fanwei&" like '%"& mykey &"%' order by adminid,username "
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
on error resume next
rs.PageSize = 10
Page = CLng(Request("Page"))
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
i=page+(page-1)*9
rs.AbsolutePage = Page
%>
<%
if rs.eof then
%>
<br><br>
<center>
<h4>在<font color="#FF0000"><%
if fanwei="username" then
response.write "用戶名"
end if
if fanwei="tname" then
response.write "姓 名"
end if
if fanwei="email" then
response.write "電子信箱"
end if
%></font>中沒有找到<font color="#FF0000"><%=mykey%></font></h4></center>
<%
else%>
<br><center><b>
在<font color="#FF0000"><%
if fanwei="username" then
response.write "用戶名"
end if
if fanwei="tname" then
response.write "姓 名"
end if
if fanwei="email" then
response.write "電子信箱"
end if
%></font>中找到<font color="#FF0000"><%=mykey%></font></b> </center>
<br><center>
<b>管理員共有<%=rs.recordcount%>人</b> </center>
<center>
<table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="100%" id="AutoNumber1">
<tr class="trh">
<td width="30" align="center" bgcolor="#799AE1" height="20">
<input type="submit" value="刪除" name="I3" class="s02"></td>
<td width="30" align="center" bgcolor="#799AE1"><font color="#FFFFFF"><b>序號</b></font></td>
<td align="left" bgcolor="#799AE1" width="104">
<p align="center"><font color="#FFFFFF"><b>用戶名</b></font></td>
<td align="left" bgcolor="#799AE1" width="65">
<p align="center"><font color="#FFFFFF"><b>姓 名</b></font></td>
<td align="left" bgcolor="#799AE1" width="75">
<p align="center"><font color="#FFFFFF"><b>密 碼</b></font></td>
<td align="left" bgcolor="#799AE1" width="111">
<p align="center"><font color="#FFFFFF"><b>電子信箱</b></font></td>
<td align="left" bgcolor="#799AE1" width="141">
<p align="center"><font color="#FFFFFF"><b>權(quán)限</b></font></td>
<td align="left" bgcolor="#799AE1" width="29">
<p align="center"><font color="#FFFFFF"><b>操作</b></font></td>
</tr>
<%
For iPage = 1 To rs.PageSize
%>
<tr class="trh1">
<td align="center" width="30">
<input type="checkbox" name='selAnnounce' value="<%=rs("adminid")%>"></td>
<td align="center" width="30"><%=i%> </td>
<td align="center" width="104"><a href="javascript:editit(<%=rs("adminid")%>)"><%=replace(rs("username"),""&mykey&"","<font color=red>"&mykey&"</font>")%></a> </td>
<td align="center" width="65"><%=replace(rs("tname"),""&mykey&"","<font color=red>"&mykey&"</font>")%> </td>
<td align="center" width="75"><%=rs("pwd")%>
</td>
<td align="center" width="111"><a href="mailto:<%=rs("email")%>"><%=replace(rs("email"),""&mykey&"","<font color=red>"&mykey&"</font>")%></a> </td>
<td align="center" width="141"><%
powerid=rs("power")
if instr(powerid,"-2")>0 then
response.write "無"
end if
if instr(powerid,"-1")>0 then
response.write "最高管理員"
end if
if instr(powerid,"0")> 0 then
response.write "一般管理員"
end if
idlistt=powerid
if instr(idlistt,",")>0 then
dim idarra
idArra=split(idlistt)
dim idd
for j = 0 to ubound(idarra)
idd=clng(idarra(j))
call power(idd)
next
else
call power(powerid)
end if
%> </td>
<td align="left" width="29">
<p align="center"><a href="javascript:editit(<%=rs("adminid")%>)">
<img border="0" src="images/edit.gif" alt="查看/編輯"></a></td>
</tr>
<%
rs.MoveNext
If rs.EOF Then Exit For
i=i+1
Next
%>
<caption></caption>
</table>
</center>
</form>
<div ALIGN="right">
<table>
<form ACTION="<%=Myself%>?fanwei=<%=fanwei%>&mykey=<%=mykey%>%" METHOD="GET">
<tr>
<td>
<p ALIGN="right"> <input type=checkbox name=del_all1 value=1 onclick=FanAll(viewaddform)>全選<span lang="en-us"> </span>
<INPUT class="s02" onclick="window.location='adminsomething.asp'" type=button value=返回 name=close><%If Page <> 1 Then ' 如果不是位于第一頁%><span lang="en-us">
</span> <span lang="en-us">
</span>
<a href="<%=Myself%>?Page=1&mykey=<%=mykey%>&fanwei=<%=fanwei%>">
第一頁</a>
<a HREF="<%=Myself%>?Page=<%=(Page-1)%>&mykey=<%=mykey%>&fanwei=<%=fanwei%>">
上一頁</a>
<%
End If
If Page <> rs.PageCount Then ' 如果不是位于最后一頁
%> <a HREF="<%=Myself%>?Page=<%=(Page+1)%>&mykey=<%=mykey%>&fanwei=<%=fanwei%>">
下一頁</a>
<a HREF="<%=Myself%>?Page=<%=rs.PageCount%>&mykey=<%=mykey%>&fanwei=<%=fanwei%>">
最后一頁</a> <% End If %>
<font SIZE="2">頁次:</font><font COLOR="Red" SIZE="2"><%=Page%>/<%=rs.PageCount%></font></p>
<p> </td>
</tr>
</form>
</table>
<%end if
end if
sub deleteannounce(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="delete from tbadmin where adminid="&cstr(id)
conn.execute sql
if err.Number<>0 then
err.clear
response.write "刪 除 失 敗 !<br>"
else
response.write "<br><center>刪 除 成 功!</center>"
end if
End sub
sub power(idd)
dim rs3,sql3
set rs3=server.createobject("adodb.recordset")
sql3="select * from tbkc where kcid="&idd
rs3.open sql3,conn,3,2
response.write "<li>"&rs3("kcm")
End sub
%>
</div>
</div>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -