musers_form.asp
来自「用ASP写的电子购物系统」· ASP 代码 · 共 271 行
ASP
271 行
<%@ Language=VBScript %>
<!--#INCLUDE FILE = "include/manager.asp" -->
<%functionno=4%>
<!--#INCLUDE FILE="checkuser.asp" -->
<%
struserid=cstr(Request("userid"))
action=request("action")
if struserid <>"" then
set rs=server.CreateObject("adodb.recordset")
cmdTemp.CommandText="select * from sysuser where Userid='" & struserid & "'"
rs.Open cmdTemp, , adOpenKeyset
strfullname=rs("fullname")
password=rs("password")
email=trim(rs("email"))
phone=rs("phone")
groupname=rs("groupname")
street=rs("street")
end if
%>
<HTML>
<HEAD>
<% if struserid="" then
pageTitle="增加用户"
else
pageTitle="修改用户 '" & struserid &"'"
end if
%>
<title><%=pageTitle%></title>
<meta http-equiv="Content-Type" CONTENT="text/html"; charset="gb2312">
<LINK REL=stylesheet HREF="manager.css" TYPE="text/css">
</HEAD>
<SCRIPT Language=javascript>
<!--
function save(){
if (password() && isemail()) {
users_process.submit();
}
else{
return false;
}
}
function password()
{
var s1=users_process.password1.value;
var s2=users_process.password2.value;
if ((s1) !== (s2)) {
alert("密码确认与密码必须一致!");
return false;
}
else
return true;
}
function isemail() {
var str = document.users_process.email.value;
var rr="";
if (str !== "") {
for (var i = 0; i < str.length; i++) {
var ch = str.substring(i, i + 1);
if (ch=='@') {
rr='@'
}
}
if (rr=="") {
alert("\nE-mail地址输错.\n\n请重新输入您的E-mail.");
document.users_process.email.select();
document.users_process.email.focus();
return false;
}
else
return true;
}
else
return true;
}
function delete_onclick() {
if (confirm("删除用户" +users_process.userid.value+ "吗!")) {
users_process.action.value= "delete";
users_process.submit();
}
}
-->
</SCRIPT>
<body topmargin="0" >
<!--#INCLUDE FILE = "include/header.asp" -->
<table border="0" width="100%" height="423" cellspacing="0" cellpadding="0">
<tr>
<td width="140" valign="top" >
<!--#INCLUDE FILE = "include/menu.asp" -->
</td>
<td width="1" bgcolor="#000000" ></td>
<td width="600" height="423" align="center" valign="top" class="main">
<br>
<FORM action="xt_sys_add_update.asp" method="post" name="users_process" onsubmit="return save()">
<TABLE align=center border=0 cellPadding=1 cellSpacing=1 width="400">
<TR>
<TD class="mainleft">用户编号</TD>
<TD class="mainright">
<%
if struserid<>"" then
Response.Write struserid
Response.Write "<input type=hidden name=userid value=" & struserid & ">"
else
Response.Write "<INPUT id=userid name=userid style=HEIGHT: 21px; WIDTH: 100px maxLength=10 size=10>"
end if
Response.Write "<input type=hidden name=action value=" & action & ">"
%>
</TD></TR>
<TR>
<TD class="mainleft">用户名</TD>
<TD class="mainright">
<%
if strfullname<>"" then
Response.Write "<INPUT id=fullname name=fullname value='" & _
strfullname & "' style=HEIGHT: 21px; WIDTH: 230px maxLength=30 size=30>"
else
Response.Write "<INPUT id=fullname name=fullname " & _
" style=HEIGHT: 21px; WIDTH: 230px maxLength=30 size=30>"
end if
%>
</TD></TR>
<TR>
<TD class="mainleft">用户口令</TD>
<TD class="mainright">
<%
if password<>"" then
Response.Write "<INPUT name=password1 type=password value=" & _
password & " style=HEIGHT: 21px; WIDTH: 100px maxLength=20 size=6>"
else
Response.Write "<INPUT name=password1 type=password " & _
"style=HEIGHT: 21px; WIDTH: 100px maxLength=20 size=6>"
end if
%>
</TD></TR>
<TR>
<TD class="mainleft">口令验证
<TD class="mainright">
<%
if password<>"" then
Response.Write "<INPUT id=password2 name=password2 type=password value=" & _
password & " style=HEIGHT: 21px; WIDTH: 100px maxLength=20 size=6>"
else
Response.Write "<INPUT id=password2 name=password2 type=password " & _
"style=HEIGHT: 21px; WIDTH: 100px maxLength=20 size=6>"
end if
%>
</TD></TR>
<TR>
<TD class="mainleft">电话
<TD class="mainright">
<% if phone<>"" then
Response.Write "<INPUT id=phone name=phone value=" & _
phone& " style=HEIGHT: 21px; WIDTH: 100px maxLength=12 size=12>"
else
Response.Write "<INPUT id=phone name=phone " & _
"style=HEIGHT: 21px; WIDTH: 100px maxLength=12 size=12>"
end if
%>
</TD></TR>
<TR>
<TD class="mainleft">E-mail
<TD class="mainright">
<% if email<>"" then
Response.Write "<INPUT id=email name=email value=" & _
email& " style=HEIGHT: 21px; WIDTH: 100px maxLength=20 size=16>"
else
Response.Write "<INPUT id=email name=email " & _
"style=HEIGHT: 21px; WIDTH: 100px maxLength=20 size=16>"
end if
%>
</TD></TR>
<TR>
<TD class="mainleft">单位地址
<TD class="mainright">
<% if email<>"" then
Response.Write "<INPUT id=street name=street value=" & _
street& " style=HEIGHT: 21px; WIDTH: 100px maxLength=120 size=30>"
else
Response.Write "<INPUT id=street name=street " & _
"style=HEIGHT: 21px; WIDTH: 100px maxLength=20 size=30>"
end if
%>
</TD></TR>
<TR>
<TD class="mainleft">所属用户组
<%
set rs1 = Server.CreateObject("ADODB.Recordset")
cmdprod.CommandText="select name,description from workgroup "
rs1.Open cmdprod, , adOpenKeyset
if not rs1.EOF then
Response.Write "<td class=""mainright""><SELECT id=groupname name=groupname>"
while not rs1.EOF
if groupname=trim(rs1("name")) then
Response.Write "<OPTION value=" & trim(rs1("name")) & " selected>" & trim(rs1("description"))
else
Response.Write "<OPTION value=" & trim(rs1("name")) & ">" & trim(rs1("description"))
end if
rs1.MoveNext
wend
Response.Write "</SELECT>"
end if
rs1.Close
set rs1 = nothing
%>
<%
' Response.Write strdepartmentname
' Response.Write "<input type=hidden name=departmentname value=" & strdepartmentname & ">"
%>
<%
'if struserid="" then
' Response.Write "<input type=hidden name=action value=add>"
'else
' Response.Write "<input type=hidden name=action value=update>"
'end if
%>
</TD></TR></TABLE>
<P>
<TABLE align=center border=0 cellPadding=1 cellSpacing=1>
<TR>
<INPUT TYPE="HIDDEN" NAME="type" VALUE="sysuser">
<INPUT TYPE="HIDDEN" NAME="goto" VALUE="musers_list.asp">
<TD><INPUT type=submit value=保存 ></TD>
<%
if ucase(struserid) <> "SYSTEM" and struserid<>"" then
Response.Write "<TD><INPUT id=delete name=delete type=button value=删除 onclick='javascript:delete_onclick()'></TD>"
end if
%>
<TD><INPUT name=reset1 type=reset value=恢复 ></TD></TR></TABLE></P>
</FORM>
</td>
</table>
<!--#INCLUDE FILE = "include/copyright.asp" -->
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?