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

📄 admin_usergroup.asp

📁 淘客网上商店网站程序 淘客网上商店网站程序 淘客网上商店网站程序
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="Inc/Const.asp"-->
<!--#include file="../inc/Cl_Md5.asp"-->
<%
if Not Cl.TrueOtherPurview("User") then
	Cl.ShowErr("<br /><li>您无此操作权限!</li>")
end if
dim iCount
dim Action,sPurview,Purview_Other

Action=Trim(request("Action"))
Header
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="title"> 
    <td height="22" colspan="2" align="center"><strong>用 户 组 管 理</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>管理导航:</strong></td>
    <td height="30"><a href="Admin_UserGroup.asp">管理首页</a>&nbsp;|&nbsp;<a href="Admin_UserGroup.asp?Action=Add">新增用户组</a></td>
  </tr>
</table>
<br />
<%
Select Case Action
Case "Add", "Modify"
	call InfoPurview()
Case "SaveAdd"
	call SaveAdd()
Case "SaveModify"
	call SaveModify()
Case "Del"
	call Del()
Case else
	call main()
End Select

Footer

sub main()
	Set rs=Server.CreateObject("Adodb.RecordSet")
	sql="select * from Cl_UserGroup order by ID"
	OpenConn : rs.Open sql,Conn,1,1
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr align="center" class="title">
    <td  width="30" height="22"><strong>ID号</strong></td>
    <td height="22"><strong>组名称</strong></td>
    <td width="100"><strong>组图片</strong></td>
    <td width="80"><strong>属性</strong></td>
    <td width="80"><strong>权限</strong></td>
    <td  width="150" height="22"><strong>操 作</strong></td>
  </tr>
  <%do while not rs.EOF
	sPurview=Split(rs("Purview"),",")
	%>
  <tr align="center" class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'"> 
    <td width="30"><%=rs("ID")%></td>
    <td><%=rs("GroupName")%></td>
    <td width="100"><%=rs("GroupImg")%></td>
    <td width="80"><%
	if rs("ID")>7 then
		response.write "用户添加"
	else
		response.write "<font color=#ff0033>系统默认</font>"
	end if
	%> </td>
    <td width="80" align="center"><%
	Select Case Cl.GetClng(sPurview(0))
	Case 1 : response.write "<font color='#0000ff'>所有权限</font>"
	Case 2 : response.write "详细设置"
	Case else : response.write "<font color='#ff0033'>无权限</font>"
	End Select
	%> </td>
    <td width="150"><%
	response.write "<a href='Admin_UserGroup.asp?Action=Modify&ID=" & rs("ID") & "'>修改用户组</a>&nbsp;&nbsp;"
	if rs("ID")>7 then response.write "<a href='Admin_UserGroup.asp?Action=Del&ID=" & rs("ID") & "' onClick=""return confirm('确定要删除此用户组吗?');"">删除用户组</a>"
	%> </td>
  </tr>
  <%
	rs.MoveNext
loop
  %>
</table>  
<%
	rs.Close:set rs=Nothing
end sub


sub InfoPurview()

Dim frmAction,sSubmit
Dim sGroupName,sGroupImg,sLoginPoint
Dim sChargeType,sValidDays,sGroupPoint
if Action="Modify" then
	dim GroupID
	GroupID=Cl.GetClng(Request("ID"))
	if GroupID=0 then
		Cl.ShowErr("<br /><li>请指定要修改的用户组ID</li>")
	end if
	'if GroupID=5 then
	'	Cl.ShowErr("<br /><li>游客用户组不允许修改权限</li>")
	'end if
	Set rs=Cl.Execute("Select * from Cl_UserGroup where ID=" & GroupID)
	if rs.Bof and rs.EOF then
		Cl.ShowErr("<br /><li>不存在此用户组!</li>")
	end if
	sGroupName		= rs("GroupName")
	sGroupImg		= ""
	sChargeType		= rs("ChargeType")
	sValidDays		= rs("ValidDays")
	sGroupPoint		= rs("GroupPoint")
	sLoginPoint		= rs("LoginPoint")
	sPurview		= Split(rs("Purview"),",")
	Purview_Other	= rs("Purview_Other")
	for i=0 to Ubound(sPurview)
		sPurview(i)	= Cl.GetClng(sPurview(i))
	next
	frmAction		= "Modify"
	sSubmit			= "修改"
else
	sGroupName		= ""
	sGroupImg		= ""
	sChargeType		= 1
	sValidDays		= 0
	sGroupPoint		= 0
	sLoginPoint		= 0
	sPurview		= Split("7,8,8,8,8,8,8,8",",")
	Purview_Other	= "modifypwd"
	for i=0 to Ubound(sPurview)
		sPurview(i)	= Cint(sPurview(i))
	next
	frmAction		= "Add"
	sSubmit			= "新增"
end if
%>
<script language="JavaScript" type="text/javascript">
function CheckInfo()
{
  if(document.form1.GroupName.value=="")
    {
      alert("用户名不能为空!");
	  document.form1.GroupName.focus();
      return false;
    }
  if (document.form1.Purview_0[1].checked==true){
	GetarrClassPurview();
  }
}
function ChkarrClassPurview(cid,stype)
{
	if(stype==3){
		document.getElementById('arrClass_'+cid).height = '200';
		}
	else{
		document.getElementById('arrClass_'+cid).height = '0';
		}
}
</script>
<form method="post" action="Admin_UserGroup.asp" name="form1" onSubmit="return CheckInfo();">
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
    <tr class="title"> 
      <td height="22" colspan="2" align="center"><font size="2"><strong><%=sSubmit%>用户组</strong></font></td>
    </tr>
    <tr> 
      <td width="300" class="tdbg" align="right"><strong>用户组名称:</strong></td>
      <td class="tdbg"><input name="GroupName" type="text" size="30" value="<%=sGroupName%>" /></td>
    </tr>
    <tr class="tdbg"> 
      <td width="35%" class="tdbg" align="right"><strong>用户组图片:</strong></td>
      <td width="65%" class="tdbg"><input name="GroupImg" type="text" size="30" value="<%=sGroupImg%>" /></td>
    </tr>
    <tr class="tdbg"> 
      <td width="35%" class="tdbg" align="right"><strong>计费&nbsp;&nbsp;方式:</strong></td>
      <td width="65%" class="tdbg">
        <input name="ChargeType" type="radio" value="1" <%if sChargeType=1 then response.write " checked"%>>
        扣<%=Cl.Web_Setting(28)%>:每阅读一篇收费文章,扣除相应<%=Cl.Web_Setting(28)%>。<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认&nbsp;&nbsp;<%=Cl.Web_Setting(28)%>:<input name="GroupPoint" type="text" id="GroupPoint" value="<%=sGroupPoint%>" size="6" maxlength="5" /> 
		<%=Cl.Web_Setting(29)%><br />
        <input type="radio" name="ChargeType" value="2" <%if sChargeType=2 then response.write " checked"%>>
        有效期:在有效期内,用户可以任意阅读收费内容<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认有效期:<input name="ValidDays" type="text" id="ValidDays" value="<%=sValidDays%>" size="6" maxlength="5" /> 天</td>
    </tr>
    <tr class="tdbg"> 
      <td width="35%" class="tdbg" align="right"><strong>组登录<%=Cl.Web_Setting(28)%>:</strong></td>
      <td width="65%" class="tdbg"><input name="LoginPoint" type="text" size="30" value="<%=sLoginPoint%>" />
      <br /><font color="#3370cc">此用户组下的用户每天第1次登录得到的<%=Cl.Web_Setting(28)%>。</font></td>
    </tr>
    <tr class="tdbg"> 
      <td width="35%" class="tdbg" align="right"><strong>权限&nbsp;&nbsp;设置:</strong></td>
      <td width="65%" class="tdbg"><table width="100%" border="0" cellspacing="1" cellpadding="2">
        <tr>
          <td width="100"><input name="Purview_0" type="radio" value="1" onClick="PurviewDetail.style.display='none'" <%if sPurview(0)=1 then response.write "checked"%> />
          拥有所有权:</td>
          <td><font color="#3370cc">拥有前台所有频道权限(浏览、录入、审核、管理)</font></td>
        </tr>
        <tr>
          <td width="100"><input type="radio" name="Purview_0" value="2" onClick="PurviewDetail.style.display=''" <%if sPurview(0)=2 then response.write "checked"%> />
          <font color="#ff0033">详细&nbsp;&nbsp;设置:</font></td>
          <td><font color="#ff0033">需要详细指定每一项权限</font></td>
        </tr>
        <tr>
          <td width="100"><input type="radio" name="Purview_0" value="3" onClick="PurviewDetail.style.display='none'" <%if sPurview(0)>2 then response.write "checked"%> />
          无任何权限:</td>
          <td><font color="#3370cc">在前台无任何权限</font></td>
        </tr>
      </table>
     </td>
    </tr>
    <tr class="tdbg">
      <td colspan="2"><table id="PurviewDetail" width="100%" border="0" cellspacing="10" cellpadding="0" <%if sPurview(0)<>2 then response.write "style='display:none'"%>>
        <tr>
          <td colspan="2" align="center"><strong>用户组权限详细设置</strong></td>
        </tr>
        <tr>
          <td colspan="2" align="center"><strong><font color="#FF0033">注:栏目权限采用继承制度,即在某一栏目拥有某项管理权限,则在此栏目的所有子栏目中都拥有这项管理权限。</font></strong></td>
        </tr>
		<tr valign="top">
		<%
	
	dim n,sMaxCID,sTempJs,Node
	n=0 : sTempJs=""
	sTempJs = sTempJs & "document.form1.arrClassView.value='';" & vbCrlf
	sTempJs = sTempJs & "document.form1.arrClassInput.value='';" & vbCrlf
	sTempJs = sTempJs & "document.form1.arrClassCheck.value='';" & vbCrlf
	sTempJs = sTempJs & "document.form1.arrClassMaster.value='';" & vbCrlf
	For Each Node In Application(Cl.CacheName & "_channellist").DocumentElement.SelectNodes("channel[@channelid>0][@channeltype<2][@moduleid!=5][@moduleid!=6]")
		n=n+1 : sMaxCID=Node.SelectSingleNode("@channelid").text
		if Ubound(sPurview) < sMaxCID then
			Redim sPurview(sMaxCID)
			sPurview(sMaxCID)=5
		end if
		if n>2 then
			n=1
			Response.write "</tr><tr valign=""top"">"
		end if
		%>
		<td width="49%">
			<fieldset><legend align="center"><%=Node.SelectSingleNode("@channelname").text%></legend>
			<input type="radio" name="Purview_<%=sMaxCID%>" value="1"  onclick="ChkarrClassPurview('<%=sMaxCID%>','1')" <%if sPurview(sMaxCID)=1 then Response.write " checked"%> />
				所有管理:<font color="#3370cc">拥有此频道的所有管理权限</font><br />
			<input type="radio" name="Purview_<%=sMaxCID%>" value="2"  onclick="ChkarrClassPurview('<%=sMaxCID%>','2')" <%if sPurview(sMaxCID)=2 then Response.write " checked"%> />
				所有审核:<font color="#3370cc">拥有此频道的所有审核权限</font><br />
			<input type="radio" name="Purview_<%=sMaxCID%>" value="3" onClick="ChkarrClassPurview('<%=sMaxCID%>','3')" <%if sPurview(sMaxCID)=3 then Response.write " checked"%> /> 
				<font color="#ff0033">详细指定:详细指定每个栏目权限</font><br />
			<input type="radio" name="Purview_<%=sMaxCID%>" value="4"  onclick="ChkarrClassPurview('<%=sMaxCID%>','4')" <%if sPurview(sMaxCID)=4 then Response.write " checked"%> />
				所有录入:<font color="#3370cc">拥有此频道的所有录入权限(不用审核)</font><br />
			<input type="radio" name="Purview_<%=sMaxCID%>" value="5"  onclick="ChkarrClassPurview('<%=sMaxCID%>','5')" <%if sPurview(sMaxCID)=5 then Response.write " checked"%> />
				所有录入:<font color="#3370cc">拥有此频道的所有录入权限(需要审核)</font><br />
			<input type="radio" name="Purview_<%=sMaxCID%>" value="6"  onclick="ChkarrClassPurview('<%=sMaxCID%>','6')" <%if sPurview(sMaxCID)=6 then Response.write " checked"%> />
				所有浏览:<font color="#3370cc">拥有此频道的所有浏览权限</font><br />
			<input type="radio" name="Purview_<%=sMaxCID%>" value="7" onClick="ChkarrClassPurview('<%=sMaxCID%>','7')" <%if sPurview(sMaxCID)>=7 then Response.write " checked"%> /> 
				无任何权限:<font color="#3370cc">在此频道无任何权限
			<br />
			<iframe id="arrClass_<%=sMaxCID%>" <%
			if sPurview(sMaxCID)=3 then
				Response.write "height=""200"""

⌨️ 快捷键说明

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