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

📄 chg.asp

📁 asp
💻 ASP
字号:
<%response.expires=0%>
<!--#include file="../inc/conn.asp"-->
<%
userid=Session("userid")
userlevel=Session("userlevel")
if userid="" or userlevel="" then
  call msgbox("请重新登陆!",3)
end if
if not isnumeric(userid) or not isnumeric(userlevel) then
  call msgbox("请重新登陆!",3)
end if
userlevel=CCur(userlevel)

if userlevel=1 then
  userid	=CCur(request("userid"))
end if
username	=request.form("username")
userpass	=request.form("userpass")

sql="select top 1 username from admin where userid="&userid
rs.open sql,conn,1,1
if not rs.eof then
  user=rs(0)
else
  rs.close
  call msgbox("该用户不存在!",1)
end if
rs.close

if userlevel=1 then
  userlevel	=request.form("userlevel")
  if not (username="" or userpass="" or userlevel="") then
    sql="select top 1 * from admin where userid="&userid
    rs.open sql,conn,1,3
    if not rs.eof then
      rs("username")	=username
      rs("userpass")	=userpass
      rs("userlevel")	=userlevel
      rs.update
    end if
    rs.close

    call msgbox("管理员修改成功!","../admin/default.asp")
  end if
else
  if not (username="" or userpass="") then
    sql="select top 1 * from admin where userid="&userid
    rs.open sql,conn,1,3
    if not rs.eof then
      rs("username")	=username
      rs("userpass")	=userpass
      rs.update
    end if
    rs.close

    call msgbox("添加员修改成功!","../admin/default.asp")
  end if
end if

Set rs=nothing
Set conn=nothing
%>
<!--#include file="../inc/head.asp"-->

<table width="300" border="0" align="center" cellpadding="2" cellspacing="1" bordercolor="#FFFFFF">
<form name="form" method="post" action="../admin/chg.asp?userid=<%=request("userid")%>">
  <tr class="menutitle"><th colspan="2">用户资料修改</th></tr>
  <tr bgcolor="#ffffff"><td>用户名</td><td><input class="text" type="text" name="username" value="<%=user%>"></td></tr>
  <tr bgcolor="#f0f0f0"><td>口令  </td><td><input class="text" type="text" name="userpass"></td></tr>
<%if Session("userlevel")=1 then%>
  <tr bgcolor="#ffffff"><td>权限  </td><td>
<select name="userlevel">
<option value="1">管理员</option>
<option value="2">添加者</option>
</select>
  </td></tr>
<%end if%>
  <tr bgcolor="#f0f0f0"><th colspan="2">
    <input class="button" type="button" value="返 回" onclick="window.location.href='../admin/default.asp';">
    <input class="button" type="submit" name="Submit" value="提 交">
    <input class="button" type="reset" name="reset" value="取 消">
  </th></tr>
</form>
</table>

<!--#include file="../inc/foot.asp"-->

⌨️ 快捷键说明

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