📄 groupmng.asp
字号:
<%@LANGUAGE="VBScript"%>
<!--#include file="../public/wxl_conn.asp"-->
<!--#include file="../public/PublicFunction.asp"-->
<%
response.expires = 0
Const PageSize=18
Page=CInt(request("Page"))
if Page<=0 then Page=1
wxl=request("wxl")
GroupId=request("GroupId")
%>
<script language="javascript">
function confirmDel(id){
if ( confirm("你确定要删除吗?")) {
window.location.href = <%response.write("'"&UrlFile&"?MenuId="&MenuId&"&wxl=del&GroupId=")%>' + id
}
}
</script>
<%
'显示已有的组列表
if wxl="" then
ShowLookHtml
elseif wxl="ShowHtml" then
dim sql1(10)
ShowAddHtml(sql1)
'增加新组
elseif wxl="Add" then
GroupName=request("GroupName")
GroupAbout=html(request("GroupAbout"))
set sql=Server.Createobject("ADODB.Recordset")
if GroupId<>"" then
int_sLogType=1
sql.open "select * from web_SysOperGroup where int_sOperGrpID="&GroupId,conn,3,2
else
int_sLogType=0
GroupId=GetID("select Max(int_sOperGrpID)+1 from web_SysOperGroup")
sql.open "select * from web_SysOperGroup where int_sOperGrpID="&GroupId,conn,3,2
sql.AddNew
sql("int_sOperGrpID")=GroupId
end if
sql("str_sOperGrpName")=GroupName
sql("txt_sOperGrpExplain")=GroupAbout
sql("int_sOperGrpOper")=UserInfo("int_sOleUserID")
sql("int_sOperGropTime")=now
sql.update
sql.close
%>
<script language='javascript'>
alert('数据保存成功!');
window.location.href = "<%=UrlFile%>";
</script>
<%
'修改组信息
elseif wxl="Modi" then
Query="select * from web_SysOperGroup where int_sOperGrpID="&GroupId
set sql=conn.Execute(Query)
ShowAddHtml sql
'删除用户组
elseif wxl="del" then
Query="delete from web_SysOperGroup where int_sOperGrpID="&GroupId
conn.Execute(Query)
%>
<script language='javascript'>
alert('指定用户组成功删除');
window.location.href = "<%=UrlFile&"?MenuId="&MenuId%>";
</script>
<%
'显示对定组的权限列表
elseif wxl="ShowPurview" then
Query="select MenuName,SysName,PurviewId,SelectPurview,InsertPurview,DeletePurview,UpdatePurview from MySystem,MyMenu,MyOperPurview where MyMenu.SysId=MySystem.SysId and MyMenu.MenuId=MyOperPurview.MenuId and IsGroup=1 and OperatorId='"&GroupId&"' order by MyOperPurview.AddTime"
set sql=Conn.Execute(Query)
ShowPurview(sql)
'删除选定权限
elseif wxl="DelPurview" then
num=request("DelId").count
for i=1 to num
Query="Delete from MyOperPurview where PurviewId='"&request("DelId")(i)&"'"
Conn.Execute(Query)
next
Mesg "操作成功,共有 "&num&" 个权限被删除!","A"
end if
sub ShowAddHtml(sql)
HtmlHead("[增加新组]--用户组管理")
%>
<SCRIPT language=JavaScript>
<!--
function checkvalue() {
aa=document.form1
if (aa.GroupName.value=="") {
window.alert ("请输入组名!"); aa.GroupName.focus();return false}
if (aa.GroupAbout.value=="") {
window.alert ("请输入组说明!"); aa.GroupAbout.focus();return false}
}
//-->
</SCRIPT>
<table border="1" width="550" cellpadding="3" cellspacing="0" bgcolor="#D6D3CE" bordercolordark="#FFFFFF" bordercolorlight="#808080" align="center" >
<form name=form1 action="<%=UrlFile%>" method="POST" onSubmit='return checkvalue();'>
<tr >
<td width="60" class="pt1">组 名:</td>
<td width="440">
<input type="text" name="GroupName" class="text2" size="58" value=<%="'"&sql(1)&"'"%>>
</td>
</tr>
<tr >
<td width="60" valign="top" class="pt1">内 容:</td>
<td width="440">
<textarea name="GroupAbout" class="text2" rows="5" cols="58"><%=sql(2)%></textarea>
</td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#D6D3CE">
<tr>
<td height="6"></td>
</tr>
<tr>
<td height="2" align="center">
<%if GroupId<>"" then%>
<input type="submit" value=" 修 改" name="B1" class="submit" style="width:60; height:25;">
<%else%>
<input type="submit" value=" 确 认" name="B1" class="submit" style="width:60; height:25;">
<%end if%>
<input type="reset" value=" 返 回" name="B2" class="submit" style="width:60; height:25;" onClick="history.back();"></td>
</tr>
<tr>
<td height="6"></td>
</tr>
</table>
<input type=hidden name="wxl" value="Add">
<input type=hidden name="GroupId" value=<%=GroupId%>>
</form>
<%end sub
sub ShowLookHtml()
set sql2=server.createobject("ADODB.recordset")
Query="select * from web_SysOperGroup order by int_sOperGrpID desc "
sql2.open Query,conn,1,1
sql2.PageSize=CLng(PageSize)
if Page>sql2.PageCount then Page=sql2.PageCount
if not(sql2.eof) then
sql2.absolutepage=CLng(Page)
end if
PageNum=sql2.PageCount
Rows=sql2.RecordCount
call HtmlListHead("用户组列表",sql2.RecordCount,sql2.PageCount,Page,"<a href='"&UrlFile&"?wxl=ShowHtml'>新建用户组</a>",UrlFile&"?wxl=")
%>
<TABLE class=coolTable cellSpacing=0 cellPadding=2 altRowColor="oldlace" borderStyle="2">
<THEAD>
<TR align=middle>
<TD width=100 align="center">组名</TD>
<TD width=200 align="center">组说明</TD>
<TD width=60 align="center">操 作 员</TD>
<TD width=130 align="center">操作时间</TD>
<TD width=70 align="center">操 作</TD>
</TR>
</THEAD>
<TBODY>
<%for i=1 to Pagesize
if sql2.eof then exit for
%>
<TR>
<td ><%=sql2("str_sOperGrpName")%></td>
<td ><%=sql2("txt_sOperGrpExplain")%></td>
<TD><%=GetName("select str_sOperName from web_SysOperators where int_sOperID="&sql2("int_sOperGrpOper"))%></TD>
<TD><%=sql2("int_sOperGropTime")%></TD>
<TD >
<a href=<%response.write(UrlFile&"?wxl=Modi&GroupId="&sql2("int_sOperGrpID")&"&MenuId="&MenuId)%>>修改</a>
<a href=<%response.write("javascript:confirmDel("&sql2("int_sOperGrpID")&")")%>>删除</a>
</TD>
</TR>
<%
sql2.movenext
next
if i<>18 then
for i=i to 18
%>
<TR>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
</TR>
<%
next
end if
%>
</TBODY></TABLE>
<%
HtmlListEnd sql2.RecordCount,sql2.PageCount,Page,"<a href='"&UrlFile&"?wxl=ShowHtml'>新建用户组</a>",UrlFile&"?wxl="
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -