📄 admin.asp
字号:
<!--#include file="inc/const.asp"-->
<!--#include file="cookies.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/Admin_css.css" type=text/css rel=stylesheet>
<title>雷诺家庭财务管理系统HomeIO2.0</title>
</head>
<body>
<%
Dim Action,username,password
Action=Request("Action")
If Action="Add" Then
Call Add()
elseif Action="SAdd" Then
Call SAdd()
elseif Action="Del" Then
Call Del()
elseif Action="Edit" Then
Call Edit()
elseif Action="SEdit" Then
Call Sedit()
else
Call Adm()
End if
Sub SEdit()
username=trim(request("username"))
password=trim(request("password"))
if len(username)<2 then
response.Write("<script>alert(""用户名不能少于2位"");history.back();</script>")
else
set rs=db("Select top 1 * from [{pre}Admin]",3)
rs("Admin_name")=username
If password<>"" then
rs("Admin_password")=password
end if
rs.update
rs.close
set rs=nothing
Response.Write("<script language=javascript>alert('修改成功!');this.location.href='admin.asp';</script>")
end if
End Sub
%>
<% Sub Adm() %>
<table border="0" align="center" cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" class="admintable">
<tr>
<td colspan="6" class="admintitle">管理员列表</td>
</tr>
<tr>
<td width="12%" height="25" align="center" bgcolor="#FFFFFF" class="ButtonList">ID</td>
<td width="20%" align="center" bgcolor="#FFFFFF" class="ButtonList">管理员名称</td>
<td width="19%" align="center" bgcolor="#FFFFFF" class="ButtonList">密码</td>
<td width="16%" align="center" bgcolor="#FFFFFF" class="ButtonList">管理选项</td>
</tr>
<%
set rs=db("select * from [{pre}Admin]",2)
if rs.eof and rs.bof then
response.Write("<tr><td colspan=""5""><li>Sorry,当前没有管理员...</li></td></tr>")
else
do while not rs.eof
%>
<tr>
<td height="25" align="center" bgcolor="f7f7f7"><%=rs("id")%></td>
<td align="center" bgcolor="f7f7f7"><%=rs("Admin_name")%></td>
<td align="center" bgcolor="f7f7f7"><%=rs("Admin_password")%></td>
<td align="center" bgcolor="f7f7f7"><a href="?Action=Edit&id=<%=rs("id")%>">编辑</a></td>
</tr>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</table>
<% End Sub%>
<% Sub Edit()
Dim id
id=Request("id")
set rs=db("select * from [{pre}Admin] where id="&id,2)
%>
<table border="0" align="center" cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" class="admintable">
<tr>
<td colspan="2" class="admintitle"> 修改管理员资料</td>
</tr>
<form action="?Action=SEdit" method="post">
<tr>
<td width="20%" height="25" bgcolor="f7f7f7"> 用户名称:</td>
<td height="25" bgcolor="f7f7f7"><input name="username" value="<%=rs("Admin_name")%>" type="text" size="30"></td>
</tr>
<tr>
<td height="25" bgcolor="f7f7f7"> 用户密码:</td>
<td height="25" bgcolor="f7f7f7"><input name="password" value="<%=rs("Admin_password")%>" type="text" size="30"></td>
</tr>
<tr>
<td height="25" colspan="2" align="center" class="tabletd2"><input type="submit" name="Submit" value="确定修改"></td>
</tr>
</form>
</table>
<%
rs.close
set rs=nothing
End Sub %>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -