if session("isadmin")"admin" then
response.Write "alert('对不起,你不是管理员!\n\n 图书管理系统');window.history.go(-1);"
end if
%>
BODY{
font-family:verdana,arial,helvetica;
margin:0;
}
td {
font-family:Tahoma,Verdana, Arial;
font-size:11px;
}
A:link, A:active,A:visited
{
color: #CCCCCC;
text-decoration: none;
padding-left:6px;
padding-right:6px;
}
A:hover
{
color: #FF3300;
text-decoration: none;
padding-left:6px;
padding-right:6px;
}
function checkadd(){
if (document.form1.username.value==""){
alert('用户名不能为空');
document.form1.username.select();
document.form1.username.focus();
return false;
}
}
用户管理
Dim action,id
action=trim(request.QueryString("action"))
select case action
case "add"
username=trim(request.Form("username"))
password=md5(request.Form("password"),16)
Set rs=server.CreateObject("adodb.recordset")
sql="select * from bookuser"
rs.open sql,conn,1,3
rs.addnew
rs("userid")=username
rs("password")=password
rs.update
rs.close
set rs=nothing
response.Write "alert('添加用户成功!');window.location.href='usermanage.asp';"
case "edituser"
%>
用户名
管理
set rs=conn.execute("select * from bookuser")
do while not rs.eof
%>
修改 | 删除
rs.movenext
loop
rs.close
set rs=nothing
%>
id=cint(request.QueryString("id"))
set rs=conn.execute("select * from bookuser where id="&id)
if rs.eof or rs.bof then
response.Write "alert('没有该用户!');window.location.href='usermanage.asp';"
else
%>
用户名
密码
操作管理
end if
%>
case "edit"
id=cint(request.querystring("id"))
password=md5(request.Form("password"),16)
Set rs=server.CreateObject("adodb.recordset")
sql="select * from bookuser where id="&id
rs.open sql,conn,1,3
rs("password")=password
rs.update
rs.close
set rs=nothing
'conn.execute("update manager set password="&password&" where id="&id)
response.Write "alert('修改密码成功!');window.location.href='usermanage.asp';"
case "del"
id=cint(request.QueryString("id"))
conn.execute("delete from bookuser where id="&id)
response.Write "alert('删除用户成功!');window.location.href='usermanage.asp';"
case else
%>
用户名
操作管理
set rs=conn.execute("select * from bookuser")
do while not rs.eof
%>
' set rs1=conn.execute("select count(*) from ebook where userid="&rs("id"))
' response.write rs1(0)
%>
修改 | 删除
rs.movenext
loop
rs.close
set rs=nothing
%>
用户名
密码
操作管理
end select
%>