?? newuser.asp
字號:
<%@ LANGUAGE="VBScript"%>
<% response.buffer=true %>
<%const title="新增用戶"%>
<html>
<head>
<meta http-equiv="Content-Type"content="text/html; charset=gb_2312-80">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title><%=title%></title>
<link rel=stylesheet type=text/css href=forum.css>
</head>
<body topmargin="0" onload=this.document.input.name.focus();>
<!--#include file=myPrg.asp-->
<!--#include file=opendb.inc-->
<p>
<div align="center">
<h1 align="center">新增用戶
</p>
</h1>
<p>
<%
CheckLogin
getStorage(session("storage"))
%>
<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
msg=""
if request("name")="" then
msg=msg+"請輸入用戶名!<br>"
end if
if request("password")="" then
msg=msg+"請輸入密碼!<br>"
end if
if request("confirm")="" then
msg=msg+"請輸入確認密碼!<br>"
end if
if request("password")<>request("confirm") then
msg=msg+"密碼和確認密碼不一致!<br>"
end if
if request("selstorage")=0 and request("manage")="" then
msg=msg+"隸屬倉庫和是否可以管理其他倉庫至少選擇一樣!"
end if
sql="select * from user where username='"&session("username")&"'"
rs.open sql,conn
if rs("in_storage")>0 and request("manage")<>"" then
msg=msg&rs("username")&"本身就沒有管理其他倉庫的權限,所以這里就不能選!<br>"
end if
if rs("viewother")=False and request("view_other")<>"" then
msg=msg&rs("username")&"本身就沒有查看其他倉庫的權限,所以這里就不能選!<br>"
end if
rs.close
if msg<>"" then
showerror(msg)
end if
sql="select * from user where username='"&request.form("name")&"'"
rs.open sql,conn,3,2
if not rs.eof then
showerror("該用戶名已經存在,請重新選用另一個試試!")
else
rs.addnew
rs("username")=request.form("name")
rs("password")=request.form("password")
rs("memo")=request.form("memo")
if request.form("manage")="" then
if request.form("selstorage")<>0 then
rs("in_storage")=request.form("selstorage")
else
rs("in_storage")=session("storage")
end if
else
rs("in_storage")=0
end if
if request.form("view_other")="" then
rs("viewother")=False
else
rs("viewother")=True
end if
rs.update
ShowSuccess("數據已經成功保存!")
end if
rs.close
else
%>
<form action="newuser.asp" method="POST" name="input">
<p align=center><font color=red>請在以下的表格中填入相關的數據</font>
<p>
<table align=center border=0>
<tr>
<td nowrap><font color=blue>用戶名:</td>
<td><input class=smallInput type=textbox name="name" value=''>**</td>
</tr>
<tr>
<td nowrap><font color=blue>密碼:</td>
<td><input class=smallInput type=password name="password" value=''>**</td>
</tr>
<tr>
<td nowrap><font color=blue>確認密碼:</td>
<td><input class=smallInput type=password name="confirm" value=''>**</td>
</tr>
<tr>
<td nowrap align=right><font color=blue>隸屬倉庫:</td>
<td><%Showstorage%></td>
</tr>
<tr>
<td nowrap align=right><font color=blue>管理權限:</td>
<td><input type=checkbox name=manage>是否可以管理其他倉庫</td>
</tr>
<tr>
<td nowrap align=right><font color=blue>查看權限:</td>
<td><input type=checkbox name=view_other>是否可以查看其他倉庫</td>
</tr>
<tr>
<td valign="top"><font color=blue>相關說明:</td>
<td><textarea class=smallarea name=memo rows=3 cols=40> </textarea></td>
</tr>
<tr>
<td>
<td><br><input class=buttonface type=submit name=ok value=確定>
<input class=buttonface type=reset name=reset value=復原>
<input class=buttonface type=button name=retu value=返回 onclick=history.go(-1)>
</tr>
</table>
</form>
<%end if%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -