?? quanxian.asp
字號:
<!--#include file="conn.asp" -->
<%if request("act")="del" then
set rs=server.createobject("adodb.recordset")
sql="select * from user where id like '"&request("idd")&"' "
rs.open sql,conn,1,3
if rs.eof or rs.bof then
else%>
<script language=VBScript>
msgbox "刪除了!"
</script>
<%
rs.delete
end if
rs.close
end if%>
<%if request("name")<>"" and request("idm")<>"" and request("psw")<>"" and request("name")<>"" and request("act2")<>"" then
set rs=server.createobject("adodb.recordset")
sql="select * from user where id like'"&request("idm")&"'"
rs.open sql,conn,3,2
if rs.eof or rs.bof then
response.Write("error")
else
rs("name")=request("name")
rs("uid")=request("uid")
rs("psw")=request("psw")
rs("uid")=request("uid")
rs("quanxian")=request("quanxian")
rs("date")=date()
rs.update
%>
<script language=VBScript>
msgbox "更新成功!"
</script>
<%
end if
rs.close
end if%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #FFffff;
}
-->
</style>
<link href="style.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY bgcolor="#FF0000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<div align="center">
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td> <div align="right">
<% If session("admin")<>"yes" Then
response.write("系統超時,您需要<font color=red><b>重新登陸</font></b>。 ")
response.end
Else %>
您現在處于管理狀態。
<%end if%>
<strong><a href="javascript:self.location.reload();"><font color="#FF0000">刷新</font></a></strong>
</div></td>
</tr>
<tr>
<td valign="top"> <strong>權限分配:</strong><br> <br> <br> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><form name="form1" method="post" action="">
姓名:
<input name="name" type="text" id="name" size="15" maxlength="15">
用戶名:
<input name="uid" type="text" id="uid" size="10" maxlength="15">
密碼:
<input name="psw" type="text" id="psw" size="15" maxlength="15">
權限:
<select name="quanxian" id="quanxian">
<option value="只讀" selected>只讀</option>
<option value="添加">添加</option>
<option value="修改">修改</option>
<option value="刪除">刪除</option>
<option value="所有">所有</option>
</select>
<input name="act" type="submit" id="act" value="增加">
</form></td>
</tr>
<tr>
<td>
<%if request("act")<>"" and request("uid")<>"" and request("psw")<>"" and request("name")<>"" then
set rs=server.createobject("adodb.recordset")
sql="select * from user where uid like '"&request("uid")&"' "
rs.open sql,conn,3,2
if rs.eof or rs.bof then
rs.addnew
rs("name")=request("name")
rs("psw")=request("psw")
rs("uid")=request("uid")
rs("quanxian")=request("quanxian")
rs.update
else
response.Write("<center><font color=red>已經有了該帳號,不能重復增加</font></center>")
end if
rs.close
end if%>
</td>
</tr>
<%set rs=server.createobject("adodb.recordset")
sql="select * from user order by id desc "
rs.open sql,conn,3,1
if rs.eof or rs.bof then
else
do while not rs.eof
%><tr>
<td>姓名:<%=rs("name")%> 帳號:<%=rs("uid")%> 密碼:<%=rs("psw")%> 權限:<%=rs("quanxian")%> 日期: <%=rs("date")%> <a href="?act=modi&idm=<%=rs("id")%>"><font color="#FF0000">修改</font></a>
<a href="?act=del&idd=<%=rs("id")%>"><font color="#FF0000">刪除</font></a></td>
</tr>
<%if not rs.eof then rs.movenext
loop
end if
rs.close%>
</table>
<hr size="1" noshade>
<%if request("idm")<>"" then
set rs=server.createobject("adodb.recordset")
sql="select * from user where id like "&request("idm")&""
rs.open sql,conn,3,1
if rs.eof or rs.bof then
response.Write("沒有此記錄")
else%>
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td> <form name="form1" method="post" action="">
姓名 :
<input name="name" type="text" id="name" value="<%=rs("name")%>" size="15" maxlength="15" >
帳號:
<input name="uid" type="text" id="uid" value="<%=rs("uid")%>" size="10" maxlength="15">
密碼:
<input name="psw" type="text" id="psw" value="<%=rs("psw")%>" size="15" maxlength="15">
權限:
<select name="quanxian" id="quanxian">
<option value="只讀" selected>只讀</option>
<option value="添加">添加</option>
<option value="修改">修改</option>
<option value="刪除">刪除</option>
<option value="所有">所有</option>
</select>
<input name="act2" type="submit" id="act2" value="更新">
<input name="idm" type="hidden" id="idm" value="<%=request("idm")%>">
<input name="act" type="hidden" id="act" value="">
</form></td>
</tr>
</table>
<%
end if
rs.close
end if%>
</div>
</BODY>
</HTML> <%
conn.close%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -