📄 list.asp
字号:
<%option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/String.asp" -->
<!-- #include virtual="include/Page.asp" -->
<!-- #include virtual="include/GetRoleName.asp" -->
<!-- #include virtual="include/DateFunction.asp" -->
<%
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control","no-cache,must-revalidate"
Dim ObjDB,StrSQL,ObjRS,RoleRS
Dim IntPageCount,IntPageNo,IntPageSize
Dim C,ArrList,i,j,IntRows,IntCols
Dim StrWhere,SubRoleID,RS
Dim StrRoleName,SubSysName
IntPageNo = Request.QueryString("PageNo")
StrWhere = Request.QueryString("W")
IntPageSize = 16
Set ObjDB = Server.CreateObject("Adodb.Connection")
OpenDB ObjDB
StrSQL = "Select SubRoles From t_OA_SYS_Account Where ID = " & Session("AccountID")
Set RoleRS = ObjDB.Execute(StrSQL)
SubRoleID = RoleRS("SubRoles")
if InStr(Cstr(SubRoleID),"101") > 0 then
StrSQL = "Select ID,AccountName,TrueName,RoleIDs,CreateTime From V_OA_SYS_Account Where 1=1" & StrWhere
else
StrSQL = "Select SubSysName from t_OA_Sub_SubRoles where SubRoleID IN (" & SubRoleID & ")"
Set RS = ObjDB.Execute(StrSQL)
While NOT RS.EOF
SubSysName = SubSysName & ",'" & RS("SubSysName") & "'"
RS.MoveNext
Wend
SubSysName = Replace(SubSysName,",","",1,1)
StrSQL = "Select a.ID, a.AccountName, a.TrueName, a.RoleIDs, a.CreateTime "
StrSQL = StrSQL & " From V_OA_SYS_Account a, t_OA_Sub_SubRoles b Where 1=1" & StrWhere
StrSQL = StrSQL & " and b.SubSysName =" & SubSysName & " and a.SubRoles=b.SubRoleID"
end if
'Response.Write StrSQL
Set ObjRS = ObjDB.Execute(StrSQL)
Set C = Server.CreateObject ("CMS2003.DBhandle")
C.Init(ObjDB)
ArrList = C.List(IntPageNo,IntPageSize,StrSQL) '使用List()函数获得列表数组
IntPageCount = C.GetPageCount() '使用GetPageCount()函数获得总页码
IntRows = C.GetRows() '使用GetRows()获得总返回的行数
IntCols = C.GetCols() '使用GetCols()获得总返回的列数
ObjDB.Close
Set ObjDB = Nothing
Set ObjDB = Server.CreateObject("Adodb.Connection")
OpenDB ObjDB
Set C = Server.CreateObject("CMS2003.DBHandle")
C.Init(ObjDB)
Set ObjRS = C.View("Select * From v_OA_SYS_Account")
StrRoleName = GetRoleName(ObjDB,ObjRS("RoleIDs"))
ObjDB.Close
Set ObjDB = Nothing
Sub Main
%>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr>
<td width=1%><input type=checkbox id=0 name=ITEM></td>
<td width=1%></td>
<td width=15%>登录名</td>
<td width=15%>真实姓名</td>
<td width=43%>系统角色</td>
<td width=15%>日期</td>
</tr>
<%
For i = 0 To IntRows
%>
<tr class=Ltr name=ITEMTR id=<%=ArrList(0,i)%>>
<td><input type=checkbox name=ITEM id=<%=ArrList(0,i)%>></td>
<td><img src='../../../images/oa/sys/account/icon.gif'></td>
<td><%=FixStr(ArrList(1,i))%></td>
<td><%=FixStr(ArrList(2,i))%></td>
<%
Set ObjDB = Server.CreateObject("Adodb.Connection")
OpenDB ObjDB
Set C = Server.CreateObject("CMS2003.DBHandle")
C.Init(ObjDB)
Set ObjRS = C.View("Select * From v_OA_SYS_Account where ID = " & ArrList(0,i))
If ObjRS("RoleIDs")<>"" Then
StrRoleName = Replace(GetRoleName(ObjDB,ObjRS("RoleIDs")),vbcrlf,"/")
Else
StrRoleName = ""
End If
ObjDB.Close
Set ObjDB = Nothing
%>
<td><%=StrRoleName%></td>
<td><%=FormatDate(FixStr(ArrList(4,i)))%></td>
</tr>
<%
Next
%>
</table>
<%
PageFooter IntPageCount,"PageNo"
End Sub
%>
<!-- #include virtual="Templet/Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -