📄 admin_userset.asp
字号:
<!--#include file="Include/Tyi86_setup.asp"-->
<!--#include file="Conn_User.asp" -->
<!--#include file=Include/check.asp-->
<!--#include file="other/Tyi86_md5.asp" -->
<% CheckAdmin3 %>
<HTML><HEAD>
<TITLE>通盈系统-用户管理</TITLE>
<link href="other/Admin.css" rel="stylesheet" type="text/css">
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</HEAD>
<BODY>
<%
Action=trim(request("Action"))
set rs=server.createobject("adodb.recordset")
dim trs
select case Action
case "save"
call Saveuser()
case "edit"
call edituser()
case else
call edituser()
end select
if FoundErr=True then
call Error_Msg(ErrMsg)
end if
sub edituser()
set rs=Conn_User.execute("select * from "&Tyi86_DBTable&" where "&Tyi86_UserID&"="&request("UserID"))
%>
<form action="?action=save" method="POST" name="ModifyUser" id="ModifyUser">
<input type=hidden value="<%=request("UserID")%>" name="UserID">
<table width="95%" border="0" cellspacing="1" cellpadding="3" align=center>
<tr>
<td height="23" colspan="2" ><B>说明</B>:<BR>修改用户信息,只能修改其用户名和密码、邮箱。
</td>
</tr>
</table>
<table width="95%" border="0" align=center cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#EAEAEA">
<th height="23" colspan="2" >修改用户信息</th>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%" bgcolor="#FFFFFF"><div align="right"><B>用户名称:</B></div></td>
<td width="67%"> <input type="text" name="username" size="35" value="<%=rs(Tyi86_UserName)%>" readonly="True"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%" bgcolor="#FFFFFF"><div align="right"><B>用户密码:</B></div></td>
<td width="67%"> <input name="userpass" type="password" id="userpass" size="35">
为安全不显示密码 (<font color="#FF0000">不修改保留</font>)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%" bgcolor="#FFFFFF"><div align="right"><B>电子邮件:</B></div></td>
<td width="67%"> <input type="text" name="useremail" size="35" value="<%=rs(Tyi86_UserEmail)%>"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#FFFFFF" class="forumrow"><div align="right"><strong>姓名:</strong></div></td>
<td class="forumrow"><% if isnull(rs("Truename")) then response.write "没有填写" else response.write rs("Truename")end if %></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>性 别:</B></div></td>
<td width="67%" class="forumrow"> <input type="radio" value="1" <%if rs(Tyi86_UserSex)=1 then%> checked<%end if%> style="border:0px"></font>
男孩 <font color="#FF0000">
<input type="radio" value="0" <%if rs(Tyi86_UserSex)=0 then%> checked<%end if%> style="border:0px">
</font>女孩</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>OICQ:</B></div></td>
<td width="67%" class="forumrow"> <%=rs("OICQ")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td bgcolor="#FFFFFF" class="forumrow"><div align="right"><strong>EMail:</strong></div></td>
<td class="forumrow"><%=rs(Tyi86_UserEmail)%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>邮政编码:</B></div></td>
<td width="67%" class="forumrow"> <% if isnull(rs("Postcode")) then response.write "没有填写" else response.write rs("Postcode")end if %></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>联系电话:</B></div></td>
<td width="67%" class="forumrow"> <% if isnull(rs("TelPhone")) then response.write "没有填写" else response.write rs("TelPhone")end if %></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>联系地址:</B></div></td>
<td width="67%" class="forumrow"> <% if isnull(rs("UserAddress")) then response.write "没有填写" else response.write rs("UserAddress")end if %></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="33%"> </td>
<td width="67%"> <input name="Submit" type="submit" class="kuang" onClick="MM_validateForm('username','','R','useremail','','R');return document.MM_returnValue" value="提交修改"> </td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
end sub
Sub saveuser()
if request("userpass")<>"" then
conn_user.execute("update "&Tyi86_DBTable&" set "&Tyi86_UserName&"='"&request("username")&"',"&Tyi86_UserPassword&"='"&md5(request("userpass"))&"',"&Tyi86_UserEmail&"='"&request("useremail")&"' where "&Tyi86_UserID&"="&request("userid"))
else
conn_user.execute("update "&Tyi86_DBTable&" set "&Tyi86_UserName&"='"&request("username")&"',"&Tyi86_UserEmail&"='"&request("useremail")&"' where "&Tyi86_UserID&"="&request("userid"))
end if
Response.Write "<script>alert(""选择的用户已成功修改!"");location.href='"&request.servervariables("HTTP_REFERER")&"';</script>"
End Sub
%>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -