📄 admin_admin.asp
字号:
response.write "<a href="&request.servervariables("URL")&"?page="&page-1&">上一页</a> "
end if
if page<rs.pagecount then
response.write "<a href="&request.servervariables("URL")&"?page="&page+1&">下一页</a> "
response.write "<a href="&request.servervariables("URL")&"?page="&rs.pagecount&">尾页</a> "
end if
response.write "共"&rs.recordcount&"人 每页显示"&pagecount&"人 共"&rs.pagecount&"页 "
%>
<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->
</script>
<select size="1" onchange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
<%for i=1 to rs.pagecount%>
<option value="<%=request.servervariables("URL")%>?page=<%=i%>" <%if page=i then response.write "selected"%> style="font-size: 9pt">第<%=i%>页</option>
<%next%>
</select>
<%end if%>
</td></tr>
</table>
<%
rs.close:set rs=nothing
End Sub
Sub addAdministrators()
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td colspan="2" height=25 class="bg_tr" align="center">添加管理员</td>
</tr>
<form method="POST" action="?action=savenew" onSubmit="return FrmAddLink_onsubmit()" language="JavaScript" name="FrmAddLink">
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left><b><u>管 理 员 名:</u></b><br>
<font color="#FF0000">用于登录后台的名称,不能少于5个字符</font></td>
<td width="73%" align=left><input name="username" size="26" class="Input_1" maxlength="30" style="font-family: 宋体; font-size: 9pt" ></td>
</tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left><b><u>前 台 用 户 名:</u></b><br>
<font color="#FF0000">前台会员中心注册的用户名(不可更改)</font></td>
<td width="73%" align=left><input name="PrUserName" size="26" class="Input_1" maxlength="30" style="font-family: 宋体; font-size: 9pt" ></td>
</tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left ><b><u>密 码:</u></b><br>
<font color="#FF0000">不能少于5个字符</font></td>
<td ><input name="passwd" type="password" size="26" class="Input_1" maxlength="50" style="font-family: 宋体; font-size: 9pt"></td>
</tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left><b><u>验证密码:</u></b><br>
必须和密码一致</td>
<td ><input name="passwd2" size="26" class="Input_1" maxlength="15" style="font-family: 宋体; font-size: 9pt" type="password">
</td>
</tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% ><b><u>管理员性别:</u></b></td>
<td ><select size="1" name="sex" style="font-family: 宋体; font-size: 9pt" title="请在这里填写您的性别。">
<option selected value="">请选择性别</option>
<option value="先生">先生</option>
<option value="女士">女士</option>
<option value="保密">保密</option>
</select>
</td>
</tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left ><b><u>管理员真实姓名:</u></b><br>
<FONT color=#ff5500>姓名必须是1-10个字</FONT> </td>
<td ><input name="fullname" size="26" class="Input_1" maxlength="10" style="font-family: 宋体; font-size: 9pt" >
</td>
</tr>
<tr bgcolor="#ffffff" onMouseOut="this.style.backgroundColor='#ffffff'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left ><b><u>管理员邮箱:</u></b></td>
<td ><input name="email" size="26" class="Input_1" maxlength="50" style="font-family: 宋体; font-size: 9pt" >
</td>
</tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left ><b><u>管理员联系地址:</u></b></td>
<td ><input name="depname" size="26" class="Input_1" maxlength="50" style="font-family: 宋体; font-size: 9pt" >
</td>
</tr>
<tr bgcolor="#ffffff" onMouseOut="this.style.backgroundColor='#ffffff'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left ><b><u>管理员身份:</u></b></td>
<td ><select name="dj" style="font-family: 宋体; font-size: 9pt">
<option selected value="">请选择管理员身份</option>
<option value="1">超级管理员</option>
<option value="2">普通管理员</option>
<option value="3">只读管理员</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center" class="forumRaw">
<input type="submit" value=" 提 交 " name="B1"> <input type="reset" value=" 重 置 " name="B2"> <input name="reset" type="reset" class="buttonface" style="font-family: 宋体; font-size: 9pt;" onClick="javascript:history.go(-1)" value=" 返 回 ">
</td> </tr>
</form>
</table>
<%
End Sub
Sub editAdministrators()
Dim Rs,SQL
SQL="SELECT * FROM [Admin] WHERE id=" & ChkNumeric(Request("id"))
Set Rs = conn.Execute(SQL)
If Rs.BOF And Rs.EOF Then
ErrMsg = "<li>错误的系统参数!</li>"
ReturnError(ErrMsg)
Set Rs = Nothing
Exit Sub
End If
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form method="POST" name="FrmAddLink" LANGUAGE="javascript" onsubmit="return FrmAddLink_onsubmit()" action="?action=savedit">
<tr>
<td height="25" class="bg_tr" align="center" colspan="2"><strong>正在修改 <font color="red"><%=rs("fullname")%></font> 的资料</strong></td>
</tr>
<tr bgcolor="#E9EAF3" onMouseOut="this.style.backgroundColor='#E9EAF3';this.style.color='black';" onMouseOver="this.style.backgroundColor='#6188D7';this.style.color='white';">
<td width=29% align=left><b><u>管理员名:</u></b></td>
<td height="20"><input name="username" size="26" value="<%=rs("user")%>" class="Input_1" maxlength="30" style="font-family: 宋体; font-size: 9pt" <%if Request.Cookies(Art2008)("admindj")<>1 then response.write "readonly"%>></td>
</tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=29% align=left ><b><u>密 码:</u></b><br><font color="#FF0000">不能少于5个字符</font></td>
<td height="20"><input name="passwd" type="password" size="26" onmouseover=this.focus() onfocus=this.select() onclick="if(this.value=='<%=rs("pass")%>')this.value=''" value="<%=rs("pass")%>" class="Input_1" maxlength="50" style="font-family: 宋体; font-size: 9pt"></td>
</tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=29% align=left><b><u>验证密码:</u></b></td>
<td height="20"><input name="passwd2" size="26" class="Input_1" maxlength="50" style="font-family: 宋体; font-size: 9pt" type="password" onmouseover=this.focus() onfocus=this.select() onclick="if(this.value=='<%=rs("pass")%>')this.value=''" value="<%=rs("pass")%>" ></td>
</tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=29% align=left ><b><u>管理员真实姓名:</u></b><br><FONT color=#ff5500>姓名必须是1-10个字</FONT> </td>
<td height="20"><input name="fullname" size="26" class="Input_1" maxlength="10" style="font-family: 宋体; font-size: 9pt" value="<%=rs("fullname")%>"></td>
</tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=27% align=left ><b><u>管理员邮箱:</u></b></td>
<td ><input name="email" size="26" value="<%=rs("email")%>" class="Input_1" maxlength="50" style="font-family: 宋体; font-size: 9pt" >
</td>
</tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=29% align=left class="butext">管理员性别:</td>
<td height="20">
<select size="1" name="sex" style="font-family: 宋体; font-size: 9pt" >
<option <%if rs("sex")="先生" then%>selected<%end if%> value="先生">先生</option>
<option <%if rs("sex")="女士" then%>selected<%end if%> value="女士">女士</option>
<option <%if rs("sex")="保密" then%>selected<%end if%> value="保密">保密</option>
</select>
</td>
</tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=29% align=left class="butext">管理员联系地址:</td>
<td height="20"><input name="depname" size="26" class="Input_1" maxlength="50" style="font-family: 宋体; font-size: 9pt" value="<%=rs("depname")%>"></td>
</tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=29% align=left class="butext">管理员身份:</td>
<td height="20">
<select name="dj" style="font-family: 宋体; font-size: 9pt">
<option <%if rs("dj")="1" then%> selected <%end if%>value="1">超级管理员</option>
<option <%if rs("dj")="2" then%> selected <%end if%>value="2">普通管理员</option>
<option <%if rs("dj")="3" then%> selected <%end if%>value="3">只读管理员</option>
</select>
</td>
</tr>
<tr>
<td align="center" class="forumRow" height="30" colspan="2">
<input type="hidden" name="id" value="<%=Rs("id")%>">
<input type="submit" value=" 提 交 " name="B3"> <input type="reset" value=" 重 置 " name="B4"> <input name="reset" type="reset" style="font-family: 宋体; font-size: 9pt;" onClick="javascript:location='admin_admin.asp'" value=" 返 回 "></td>
</tr></form>
</table>
<%
Rs.Close:Set Rs=Nothing
End Sub
Sub savenew()
dim sql,rs,passwd,passwd1,username, dj, depname, fullname,sex,Email,PrUserName
username=htmlencode(request.form("username"))
PrUserName=htmlencode(request.form("PrUserName"))
fullname=htmlencode(request.form("fullname"))
passwd=trim(request("passwd"))
if passwd<>"" then passwd=md5(passwd)
dj=htmlencode(request.form("dj"))
sex=request.form("sex")
depname=request.form("depname")
email=htmlencode(request.form("email"))
if PrUserName<>"" then
IF Conn.Execute("Select Count(UserID) From Art_User Where UserName='" & PrUserName & "'")(0)>=1 Then
Call Alert("您填写的前台注册用户已经存在,不能再添加!", "")
End IF
end if
sql = "select * from admin where user='"&username&"'"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,2
if rs.recordcount=0 then
rs.addnew
rs("user")=username
rs("fullname")=fullname
if passwd<>"" then rs("pass")=passwd
rs("lmid")=""
rs("dj")=dj
rs("sex")=sex
Select Case dj
Case "1"
rs("purview")=99999
Case Else
rs("purview")=1
End Select
Rs("OSKEY") = ",,,,,,,,,,,,,,,"
rs("depname")=depname
rs("adder")=chkhtm(Request.Cookies(Art2008)("adminuser"))
rs("jingyong")=0
rs("reglevel")=1
rs("dateandtime")=now()
rs("email")=email
rs.update
rs.close:set rs=nothing
if PrUserName<>""then
Conn.Execute("insert into [Art_User] ([UserName],[PassWord],[GroupID],[RegDate],[RealName],[Address],[Email]) values('"&PrUserName&"','"&passwd&"',1,"&NowString&",'"&fullname&"','"&depname&"','"&Email&"')")
Call PointInOrOut(0,0,UserName,1,50,"系统","管理员添加新会员时,赠送的点数")
end if
Call ArtErr("用户ID:" & username & " 添加成功,请到管理员管理给予相应的权限,如需修改请返回管理员管理!","2")
else
ReturnError("此用户名("&username&")已经存在,请重新选择一个用户名。")
end if
End Sub
Sub savedit()
Dim usernw
Dim Rs,SQL
If Request.Form("username") = "" Then
ErrMsg = "<li>请输入管理员名字。</li>"
ReturnError(ErrMsg)
Exit Sub
Else
usernw = Trim(Request.Form("username"))
End If
set rs=server.createobject("adodb.recordset")
sql="select * from admin where id="& ChkNumeric(Request("id"))
Rs.Open SQL, conn, 1, 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -