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

📄 users.asp

📁 网页源码,是最好的网店代码。可以支持批量上传产品等功能。
💻 ASP
📖 第 1 页 / 共 4 页
字号:
        <div class="th jz">管 理 员 信 息</div>
        <div class="td3 h20 w231"  style="float: left;">用户名</div>
        <div class="td3 h20 w231"  style="float: left;">前台用户名</div>
        <div class="td3 h20 w291"  style="float: left;">操作</div>
		<%
		set rs=conn.execute("select id,name,username from yx_admin")
		while not rs.eof
		%>
 		<div class="td3 w231"><a href="?action=useredit&userid=<%=rs("id")%>"><%=rs("name")%></a></div>		
		<div class="td3 w231"><%=rs("username")%></div>		
		<div class="td3 w291" ><a href="?action=editadmin&id=<%=rs("id")%>">编辑</a> <a href="?action=deladmin&id=<%=rs("id")%>" onclick="return okdel()">删除</a></div>		
		<%
		rs.movenext
		wend
		set rs=nothing
		%>
<div style="clear: both;"></div></div>
<%end sub

sub editadmin
dim id
id=request("id")
if id="" or not isnumeric(id) then
	call goback("","错误参数!")	
end if

set rs=conn.execute("select name,username from yx_admin where id="&id)
if rs.eof or rs.bof then
	call goback("","没有此管理员!")
else
%>
 <form action="?action=saveeditadmin" method=post>
<div class="ta">
        <div class="th jz">管 理 员 编 辑</div>
        <div class="td1 h20">后台登陆名称</div>
        <div class="td2 h20"><input type="hidden" name="id" value="<%=id%>">
		<input name="adminname" size="30" value="<%=rs(0)%>"></div>
	<div class="td1 h20">后台登陆密码</div>
	<div class="td2 h20"><input type=password name="password" size="30"> <font color="#999999">如不更改请留空!</font></div>
        <div class="td1 h20">前台用户名称</div>
	<div class="td2 h20"><%=rs(1)%></div>
	<div style="clear: both;"></div><div class="tf jz"><input type="submit" value="编 辑" name="b1"></div>
	</div></form>
<%
end if
set rs=nothing
end sub

sub saveeditadmin
dim id,sql,password
adminname=request.form("adminname")
password=request.form("password")
id=request.form("id")

if id="" or not isnumeric(id) then
	call goback("","参数错误!")	
end if

if adminname="" then
	call goback("","请输入后台登录名称!")	
end if

set rs=server.createobject("adodb.recordset")
sql="select * from yx_admin where id="&id
rs.open sql,conn,1,3
if rs.eof or rs.bof then
	call goback("","没有此用户!")	
else
	rs("name")=adminname
	if password <> "" then rs("password")=md5(password)
	rs.update
end if
rs.close
set rs=nothing
call suc("","管理员修改成功!","?action=admin")
end sub

sub deladmin
        if conn.execute("select count(*) from yx_admin")(0)<=1 then 
        call goback("","目前只有一个管理员,不能删除!")
        else
        conn.execute("delete from yx_admin where id="&request("id")&"")
        call suc("","管理员删除成功!","?action=admin")
		    end if
end sub

sub userclassadd
%>
 <form action="?action=saveaddclass" method=post name="creator">
<div class="ta">
<div class="th jz">用 户 组 添 加</div>
<div class="td1 h20">组名称</div>
<div class="td2 h20"><input name="classname" size="20"></div>
<div style="clear: both;"></div><div class="tf">一般权限</div>
<div class="td1 h20">可以查看会员信息</div>
<div class="td2 h20">是<input  checked="true" name="canviewuserinfo" type="radio" value="1">&nbsp;否<input name="canviewuserinfo" type="radio" value="0"></div>
<div class="td1 h20">可以查看其他人发布的主题</div>
<div class="td2 h20">是<input  checked="true" name="canviewnewtopic" type="radio" value="1">&nbsp;否<input name="canviewnewtopic" type="radio" value="0"></div>
<div class="td1 h20">可以浏览精华帖子</div>
<div class="td2 h20">是<input checked="true" name="canviewtopicdigest" type="radio" value="1">&nbsp;否<input name="canviewtopicdigest" type="radio" value="0"></div>
<div class="td1 h20">可以发布新主题</div>
<div class="td2 h20">是<input checked="true" name="cannewtopic" type="radio" value="1">&nbsp;否<input name="cannewtopic" type="radio" value="0"></div>
<div class="td1 h20">可以回复自己的主题</div>
<div class="td2 h20">是<input checked="true" name="canpostmytopic" type="radio" value="1">&nbsp;否<input name="canpostmytopic" type="radio" value="0"></div>
<div class="td1 h20">可以回复其他人的主题</div>
<div class="td2 h20">是<input checked="true" name="canpostorthertopic" type="radio" value="1">&nbsp;否<input name="canpostorthertopic" type="radio" value="0"></div>
<div class="td1 h20">可以上传附件</div>
<div class="td2 h20">是<input checked="true" name="canupfile" type="radio" value="1">&nbsp;否<input name="canupfile" type="radio" value="0"></div>
<div class="td1 h20">可以发布新投票</div>
<div class="td2 h20">是<input checked="true" name="cannewtopicvote" type="radio" value="1">&nbsp;否<input name="cannewtopicvote" type="radio" value="0"></div>
<div class="td1 h20">可以参与投票</div>
<div class="td2 h20">是<input checked="true" name="canposttopicvote" type="radio" value="1">&nbsp;否<input name="canposttopicvote" type="radio" value="0"></div>
<div class="td1 h20">可以编辑自己的帖子</div>
<div class="td2 h20">是<input checked="true" name="caneditmytopic" type="radio" value="1">&nbsp;否<input name="caneditmytopic" type="radio" value="0"></div>
<div class="td1 h20">可以发送短信</div>
<div class="td2 h20">是<input name="cansendmessage" type="radio" value="1" checked="true">&nbsp;否<input name="cansendmessage" type="radio" value="0"></div>
<div class="td1 h20">每日最多上传</div>
<div class="td2 h20"><input name="sendmaxcount" size="10" value="5"></div>
<div class="td1 h20">上传大小限制</div>
<div class="td2 h20"><input name="sendmessagemaxsize" size="10" value="300"> KB</div>
<div class="td1 h20">信箱大小限制</div>
<div class="td2 h20"><input name="messagemaxsize" size="10" value="100"> KB</div>
<div style="clear: both;"></div><div class="tf">管理权限</div>
<div class="td1 h20">可以删除其它人帖子</div>
<div class="td2 h20">是<input name="candeltopic" type="radio" value="1">&nbsp;否<input name="candeltopic" type="radio" value="0" checked="true"></div>
<div class="td1 h20">可以移动其它人帖子</div>
<div class="td2 h20">是<input name="canmovetopic" type="radio" value="1">&nbsp;否<input name="canmovetopic" type="radio" value="0" checked="true"></div>
<div class="td1 h20">可以固顶/解除固顶帖子</div>
<div class="td2 h20">是<input name="cantoptopic" type="radio" value="1">&nbsp;否<input name="cantoptopic" type="radio" value="0" checked="true"></div>
<div class="td1 h20">可以进行帖子总固顶操作</div>
<div class="td2 h20">是<input name="canttoptopic" type="radio" value="1">&nbsp;否<input name="canttoptopic" type="radio" value="0" checked="true"></div>
<div class="td1 h20">可以编辑其它人帖子</div>
<div class="td2 h20">是<input name="canedittopic" type="radio" value="1">&nbsp;否<input name="canedittopic" type="radio" value="0" checked="true"></div>
<div class="td1 h20">可以加入/解除精华帖子v</div>
<div class="td2 h20">是<input name="candigesttopic" type="radio" value="1">&nbsp;否<input name="candigesttopic" type="radio" value="0" checked="true"></div>
<div class="td1 h20">可以锁定/解除锁定其它人帖子</div>
<div class="td2 h20">是<input name="canlocktopic" type="radio" value="1">&nbsp;否<input name="canlocktopic" type="radio" value="0" checked="true"></div>
<div class="td1 h20">可以提升他人帖子</div>
<div class="td2 h20">是<input name="tstopic" type="radio" value="1">&nbsp;否<input name="tstopic" type="radio" value="0" checked="true"></div>
<div style="clear: both;"></div><div class="tf jz"><input type="submit" value="添 加" name="b1"></div></div></form>
<%
end sub

sub saveaddclass
	dim classname,classsetting
	classname=request.form("classname")
	if classname="" then
		call goback("","您没有输入组名,请输入组名。")
		exit sub
	end if
	
	classsetting=request.form("canviewuserinfo") & "," & request.form("canviewnewtopic") & "," & request.form("canviewtopicdigest") & "," & request.form("cannewtopic") & "," & request.form("canpostmytopic") & "," & request.form("canpostorthertopic") & "," & request.form("canupfile") & "," & request.form("cannewtopicvote") & "," & request.form("canposttopicvote") & "," & request.form("caneditmytopic") & "," & request.form("cansendmessage") & "," & request.form("sendmaxcount") & "," & request.form("sendmessagemaxsize") & "," & request.form("messagemaxsize") & "," & request.form("candeltopic") & "," & request.form("canmovetopic") & "," & request.form("cantoptopic") & "," & request.form("canttoptopic") & ","& request.form("canedittopic") & "," & request.form("candigesttopic") & "," & request.form("canlocktopic") & "," & request.form("tstopic")
	dim rs
	set rs=conn.execute("select * from yx_usergrade where gradename='" & classname & "'")
	
	if not(rs.eof and rs.bof) then
		call goback("","该等级名称已经存在!")
		exit sub
	end if
	
	dim sql
	set rs=server.createobject("adodb.recordset")
	sql="select * from yx_userclass where classname='"& classname &"'"
	rs.open sql,conn,1,3
	if rs.eof or rs.bof then
		rs.addnew
		rs("classname")=classname
		rs("classsetting")=classsetting
		rs.update
	else
		call goback("","该用户组名称已经存在!")
		exit sub
	end if
	
	rs.close
	set rs=nothing
	call suc("","用户组添加成功!","?action=userclass")
end sub

sub userclass
%>
<div class="ta">
<div class="th jz">用 户 组 管 理</div>
<div class="td3 w160">用户组</div>
<div class="td3 w100">用户数量</div>
<div class="td3 w152">编辑权限</div>
<div class="td3 w160">例出所有用户</div>
<div class="td3 w162">操作</div>
	  <%
		dim user_count,uc
		set rs=conn.execute("select classid,classname from yx_userclass")
		while not rs.eof 
			set uc=conn.execute("select count(id) from yx_user where classid="&rs(0)&"")
				user_count=uc(0)
				uc.close
			set uc=nothing
		%>
	
		<div class="td3 w160"><%=rs("classname")%></div>		
		<div class="td3 w100"><%=user_count%></div>		
		<div class="td3 w152"><a href="?action=classedit&classid=<%=rs("classid")%>">编辑</a></div>		
		<div class="td3 w160"><a href="users.asp?classid=<%=rs("classid")%>">查看</a></div>
                <div class="td3 w162"><a href="users.asp?action=deluserclass&classid=<%=rs("classid")%>" onclick="checkclick('删除前请先将该组用户全部移动到其他组,否则后果自负!\n\n您确定要删除吗?')">删除</a></div>		
	  <%
		rs.movenext
		wend
		rs.close
		set rs=nothing
		%>
	<div style="clear: both;"></div></div>
<%end sub

sub userclassedit
	dim rs,classid,classname,classsetting
	classid=request("classid")
	if not isnumeric(classid) then
		call goback("错误提示","参数错误,请提交正确的参数")
		exit sub
	end if
	set rs=conn.execute("select * from yx_userclass where classid="& classid)
	if rs.eof or rs.bof then
		call goback("错误提示","找不到此用户组或已被删除。")
		exit sub
	else
		classname=rs("classname")
				classsetting=split(rs("classsetting"),",")
%>
<form action="?action=saveeditclass" method=post name="creator">
<div class="ta">
<div class="th jz">用 户 组 添 加</div>
<div class="td1 h20">组名称</div>
<div class="td2 h20"><input type="hidden" name="classid" value="<%=classid%>">
		<input name="classname" size="20" value="<%=classname%>" readonly></div>
<div style="clear: both;"></div><div class="tf">一般权限</div>
<div class="td1 h20">可以查看会员信息</div>
<div class="td2 h20">是<input name="canviewuserinfo" type="radio" value="1" <%if classsetting(0)=1 then response.write "checked=""true"""%>>&nbsp;否<input name="canviewuserinfo" type="radio" value="0" <%if classsetting(0)=0 then response.write "checked=""true"""%>></div>
<div class="td1 h20">可以查看其他人发布的主题</div>
<div class="td2 h20">是<input name="canviewnewtopic" type="radio" value="1" <%if classsetting(1)=1 then response.write "checked=""true"""%>>&nbsp;否<input name="canviewnewtopic" type="radio" value="0" <%if classsetting(1)=0 then response.write "checked=""true"""%>></div>
<div class="td1 h20">可以浏览精华帖子</div>
<div class="td2 h20">是<input name="canviewtopicdigest" type="radio" value="1" <%if classsetting(2)=1 then response.write "checked=""true"""%>>&nbsp;否<input name="canviewtopicdigest" type="radio" value="0" <%if classsetting(2)=0 then response.write "checked=""true"""%>></div>
<div class="td1 h20">可以发布新主题</div>
<div class="td2 h20">是<input name="cannewtopic" type="radio" value="1" <%if classsetting(3)=1 then response.write "checked=""true"""%>>&nbsp;否<input name="cannewtopic" type="radio" value="0" <%if classsetting(3)=0 then response.write "checked=""true"""%>></div>
<div class="td1 h20">可以回复自己的主题</div>
<div class="td2 h20">是<input name="canpostmytopic" type="radio" value="1" <%if classsetting(4)=1 then response.write "checked=""true"""%>>&nbsp;否<input name="canpostmytopic" type="radio" value="0" <%if classsetting(4)=0 then response.write "checked=""true"""%>></div>
<div class="td1 h20">可以回复其他人的主题</div>
<div class="td2 h20">是<input name="canpostorthertopic" type="radio" value="1" <%if classsetting(5)=1 then response.write "checked=""true"""%>>&nbsp;否<input name="canpostorthertopic" type="radio" value="0" <%if classsetting(5)=0 then response.write "checked=""true"""%>></div>

⌨️ 快捷键说明

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