📄 function_setuplist.asp
字号:
<!--#include file="../Include/TimeOut.asp"-->
<!--#include file="../Include/AdoConn.asp"-->
<!--#include file="../Include/online.asp"-->
<%
usercode=session("usercode")
username=session("username")
info=""
%>
<%
'用户自定义桌面设置存入数据库
if Request("MyModuleSubmit")="submit" then
strsqldel="delete from XT_TD_UserModule where 用户编码='"& userCode &"'"
conn.Execute strsqldel
for each item in Request.Form("checkbox1")
strsqldel="insert into XT_TD_UserModule (用户编码,模块编码) values('" & session("usercode") & "','" & item & "')"
conn.Execute strsqldel,1
next
info="您已设置成功!"
Response.Redirect "Function_setupList.asp?info="+info
else info=""
end if
%>
<%
'读出当前用户所有有权限的模块
dim objres 'recordset对象
dim strsql 'sql语句
strsql="select 模块编码,模块名称 from XT_VP_ModuleUserRole where 用户编码='"+usercode+"' and 末级菜单='1'"
set objres=server.CreateObject ("adodb.recordset")
objres.CursorType =3
objres.CursorLocation =3
objres.LockType =2
objres.Open strsql,strconn
'已有的权限读出
dim objres1 'recordset对象
dim strsql1 'sql语句
set objres1=server.CreateObject ("adodb.recordset")
objres1.CursorType =3
objres1.CursorLocation =3
objres1.LockType =2
strsql1="select 模块编码 from XT_Td_userModule where 用户编码='"& usercode &"'"
objres1.Open strsql1,strconn
if objres1.RecordCount >0 then
Response.Write "<script language='vbscript'>"&chr(13)
Response.Write "dim MyModule("& (objres1.RecordCount-1) &")"& chr(13)
for i=0 to objres1.RecordCount -1
Response.Write "MyModule(" & i & ")=" & objres1.Fields("模块编码").Value & chr(13)
objres1.MoveNext
next
Response.Write "dim biaoshi"&chr(13)
Response.Write "biaoshi=1"&chr(13) '标示读了权限
Response.Write "</script>"
end if
%>
<html>
<head>
<title>桌面设置</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../CssLib/Cssbutton.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="check()">
<form name="conlist" method="post" action="Function_setupList.asp?mymodulesubmit=submit" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="../public/images/config_bg.gif" height="20" width="180">
<div align="center"><font size="3" color="#003399"></font></div>
</td>
<td width="250" height="20">
<div align="center"><font size="3" color="#003399"><b>桌 面 设 置</b></font></div>
</td>
<td background="../public/images/config_bg.gif" height="20" width="170"> </td>
</tr>
<tr>
<td height="20" width="180"> </td>
<td width="250" height="20"> </td>
<td height="20" width="170"> </td>
</tr>
<tr>
<td height="20" colspan="3"> <%=username%>您好,以下是您可以操作的权限。<br>
您可以选择8个常用的功能自定义桌面。<br>
将项目前的复选框选中您的桌面即可在您的桌面中显示此功能,否则隐藏此功能。单击“提交”按钮即可完成桌面设置。</td>
</tr>
<tr>
<td height="20" colspan="3" align="center"> <font color=red>
<%Response.Write request("info") %>
</font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bordercolor="0" bgcolor="#FFFFFF">
<tr bgcolor="#336699">
<td width="52" height="20"> </td>
<td width="151" bgcolor="#336699"> <font color="#FFFFFF">模块编码</font></td>
<td width="393"> <font color="#FFFFFF">模块名称</font></td>
</tr>
<%
'定义单选框的索引值
dim indexNo
indexNo=0
if not objres.Eof then
do while not objres.EOF
%>
<tr>
<td width="52">
<input type="checkbox" name="checkbox1" value="<%=objres.Fields("模块编码").Value %>" onclick="check8('<%=indexNo%>')">
</td>
<td width="151"> <%=objres("模块编码")%></td>
<td width="393"><%=objres("模块名称")%> </td>
</tr>
<%
indexNo=indexNo+1
objres.MoveNext
loop
%>
<tr bgcolor="#336699">
<td colspan="3" height="2" >
<%else Response.Write "<font size=2 color=red>此用户无任何操作权限!</font>"
end if
%>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3">
<div align="center">
<input type="submit" name="Submit" value="提交" class="button">
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
<script language="vbscript">
function check() '已有的模块勾上
if biaoshi=1 then
for i=lbound(Mymodule) to ubound(Mymodule)
for j=0 to document.conlist("checkbox1").length -1
if clng( document.conlist("checkbox1")(j).value)=Mymodule(i) then document.conlist("checkbox1")(j).checked=true
next
next
end if
end function
function check8(No)
con=0
for i=0 to document.conlist("checkbox1").length-1
if document.conlist("checkbox1")(i).checked=true then
con=con+1
end if
next
if con>8 then
document.conlist("checkbox1")(Cint(No)).checked=false
window.alert ("您自定义桌面时最多可以选择8个功能!")
end if
end function
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -