⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newuser.asp

📁 这是用数据库语言编写的仓库管理系统
💻 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-->
<%
CheckLogin
Showtitle(title)
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%>
<!--#include file=copyright.asp-->

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -