📄 setlist_table.asp
字号:
<%'--------------------------------------------------------------------------
' Project: COLLAMBER网络办公系统
' Module : 职员资料维护表
' By: badoon
' Discription: 职员资料维护表演示-
'--------------------------------------------------------------------------%>
<%response.expiresabsolute=#jan 01,1980 00:00:00#
if session("userid")="" then
response.write "<SCRIPT LANGUAGE='JavaScript'>"&chr(13)
response.write "<!--"&chr(13)
response.write "parent.location.href=""/error/error.htm"""&chr(13)&chr(13)
response.write "//-->"&chr(13)
response.write "</SCRIPT>"&chr(13)
end if
%>
<!--#include virtual="/_inc/GeneralADO.asp"-->
<html>
<head>
<title>职员资料维护-</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="<%=session("css")%>person.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript" src="/js/popwin.js">
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<%
Function fnExpandingDataStr(str,aParam)
Dim m_oRS
Dim sCutString,sExp
Dim aVariable()
Dim iCount
iCount=0
sCutString=str
sExp=str
while instr(sCutString,"${")<>0
redim preserve aVariable(iCount)
sCutString=Right(sCutstring,len(sCutString)-instr(sCutstring,"${")-1)
aVariable(iCount)=left(sCutString,instr(sCutstring,"}")-1)
iCount=iCount+1
''-esponse.write "+String=" & sCutString &"<BR>"
''-esponse.write "var["&iCount-1&"]="&aVariable(iCount-1)&"<br>"
Wend
if iCount=0 then
fnExpandingDataStr=str
exit function
end if
'---------------- change parameter to low case --------------------
for i=0 to uBound(aVariable)
sExp=replace(sExp,"${" & aVariable(i) & "}","${" & lcase(aVariable(i)) & "}")
next
'---------------- replace parameter -----------------
for i=0 to ubound(aParam)
sExp=replace(sExp,"${param" & i & "}",aparam(i))
next
'------------------ replace const ----------------
set m_oRS=server.createobject("adodb.recordset")
if instr(sExp,"${CONST_DEPARTMENT_ID}")>0 then
m_oRS.open "select department_id from userinfo where id="&session("userid"),oCon
if not m_oRS.eof then
sExp=replace(sExp,"${CONST_DEPARTMENT_ID}",m_oRS("department_id"))
else
response.write "出错,当前用户没有缺省部门!"
response.end
end if
m_oRS.close
end if
sExp=replace(sExp,"${CONST_USER_ID}",session("userid"))
'-------------------- ---------------------
for i=0 to uBound(aVariable)
if instr(sExp,"${" & aVariable(i) & "}")>0 then
response.write "fnExpandingDataStr函数参数不匹配!"
response.end
end if
next
fnExpandingDataStr=sExp
End Function
table_id = request.querystring("table_id")
FilterCount = request.querystring("FilterCount")
statistic = request.querystring("statistic")
submitit = request.querystring("submitit")
bStatistic = false
if len(statistic)>0 then
oRS.open "select * from fn_table_col where id="&statistic,oCon
if not oRS.eof then
SumField = oRS("Field_str")
bStatistic = true
end if
oRS.close
end if
if not isnumeric(FilterCount) or isnull(FilterCount) then
FilterCount=0
else
FilterCount = cint(FilterCount)
end if
oRS.open "select * from fn_table where id=" & table_id ,oCon
if oRS.eof then
response.write "no this table"
response.end
end if
sqlSelect=oRS("table_sql_select")
sqlwhere=trim(oRS("table_sql_where"))
oRS.close
sqlSelect="select * from (" & sqlSelect
if sqlwhere<>"" then
sqlSelect=sqlSelect & " where " & sqlWhere & ") as AmbAspListTable"
else
sqlSelect=sqlSelect & ") as AmbAspListTable"
end if
sqlWhere = ""
'------------------------------------- 读取列、行、授权的权限 --------------------------------------
Col_id=""
oRS.open "select * from fn_table_accredit where table_id="&table_id & " and user_id="&session("userid"),oCon
if not oRS.eof then
col_id = "," & oRS("Col_ID_LIST") & ","
filter_str = oRS("filter_str")
accredit = oRS("accredit")
if len(sqlWhere)>0 and len(filter_str)>0 then
sqlWhere = sqlWhere & " and (" & filter_str &")"
else
sqlWhere = sqlWhere & filter_str
end if
elseif session("userid")=1 then
accredit = 1
else
if len(sqlWhere)>0 then
sqlWhere = sqlWhere & " and 1=0"
else
sqlWhere = " 1=0"
end if
end if
oRS.close
Set oTBL = Server.CreateObject("Amber.Table")
otbl.setconnection oCon
otbl.pagesize=23
'otbl.debugsql=true
for i=0 to FilterCount
sKEY = request.querystring("key" & i)
sField = request.querystring("Field" & i)
sOperator=request.querystring("Operator" & i)
sLogic=request.querystring("logic" & i)
otbl.querystring.add "key" & i , sKEY
otbl.querystring.add "Field" & i , sField
otbl.querystring.add "Operator" & i , sOperator
otbl.querystring.add "logic" & i , sLogic
if sField <> "" then
sFieldType = left(sField,instr(sField,"|")-1)
sField = mid(sField,instr(sField,"|")+1)
end if
If sKEY <> "" Then '类别筛选条件 sFieldType:1、字串 2、数字 3、日期
if sFieldType = "3" then
if sOperator="like" then sOperator="="
if SqlWhere1 = "" then
SqlWhere1 = "datediff(dd,'" & sKEY & "'," & sField & ")" & " " & sOperator & " 0 "
else
SqlWhere1 = sqlwhere1 & " " & request.querystring("logic" & i) & " " & "datediff(dd,'" & sKEY & "'," & sField & ")" & " " & sOperator & " 0 "
end if
else
if sOperator="like" then
sKEY="'%" & sKEY & "%'"
elseif sFieldType = "1" then
sKEY="'" & sKEY & "'"
end if
if SqlWhere1 = "" then
SqlWhere1 = sField & " " & sOperator & " " & sKEY
else
SqlWhere1 = sqlwhere1 & " " & request.querystring("logic" & i) & " " & sField & " " & sOperator & " " & sKEY
end if
end if
end if
next
'response.write "key1="&otbl.querystring("key1")
if len(SqlWhere)>1 and len(sqlWhere1)>1 then
sqlWhere=sqlWhere & " and (" & sqlWhere1 & ")"
else
sqlWhere=sqlWhere & sqlWhere1
end if
otbl.setsql sqlSelect , sqlwhere
'response.write sqlwhere
otbl.StatTableStyle = "width=""100%"""
otbl.tablestyle.stylestring=" width=""100%"" border=""1"" cellspacing=""0"" cellpadding=""0"" bordercolorlight=""#C1C1C1"" bordercolordark=""#FFFFFF"""
'----------- chaxun ----------------
otbl.querystring.add "submitit",submitit
otbl.querystring.add "table_id",table_id
otbl.querystring.add "FilterCount",FilterCount
'----------------------------------------
sColStyle = " align=""center"" bgcolor=""#F4F3F0"""
ColFilter=""
oRS.open "select * from fn_table_col where table_id="&table_id,oCon
while not oRS.eof
if submitit="yes" then
sPriv = request.querystring("Priv"&oRS("id"))
'---------- 是否显示,admin全显示 -------------
elseif instr(col_id,","&oRS("id")&",")>0 or session("userid")=1 then
sPriv = "1"
else
sPriv = "0"
end if
if sPriv = "1" then
if ColFilter = "" then
ColFilter = oRS("id")
else
ColFilter = ColFilter & "," & oRS("id")
end if
end if
otbl.querystring.add "Priv"&oRS("id"),sPriv
if sPriv="1" then
otbl_field_string="%&" & oRS("field_str") & "%"
otbl_col_style=sColStyle
if oRS("OTBL_FIELD_STRING") <> "" then otbl_field_string = oRS("OTBL_FIELD_STRING")
if oRS("OTBL_COL_STYLE") <> "" then otbl_col_style = oRS("OTBL_COL_STYLE")
otbl.addcolumn oRS("field_str"),oRS("field_name"),otbl_field_string,otbl_col_style
'--------------------------- 统计 ----------------------------
if bStatistic and instr(","&oRS("sum_str")&",",","& sumfield &",")>0 then
otbl.cols(oRS("field_str")).sumfield = sumfield
if len(oRS("STAT_CAPTION"))>0 then
otbl.cols(oRS("field_str")).statcaption = oRS("statcaption")
else
otbl.cols(oRS("field_str")).statcaption = "按" & oRS("field_name") & "统计"
end if
'if len(oRS("SORT_FIELD"))>0 then
' otbl.cols(oRS("field_str")).sortfield2 = oRS("SORT_FIELD")
' response.write otbl.cols(oRS("field_str")).sortfield2
'end if
end if
if oRS("sort_type")=1 then
otbl.cols(oRS("field_str")).sort=true
otbl.cols(oRS("field_str")).sortfield = oRS("field_str")
end if
end if
oRS.movenext
wend
oRS.close
oTBL.Header.Style.stylestring=" align=""center"" bgcolor=""#E3E2DB"" "
'otbl.space="(无)"
otbl.imagePath="/images/amber-table/002/"
'otbl.cols("delete").caption="删除"
'otbl.keyfield="id"
'otbl.delconfirm="确定要删除么?"
oTBL.company=""
otbl.sorttype=2
if bStatistic then
otbl.querystring.add "statistic",statistic
otbl.statCaption = "按统计"
otbl.writereport
else
otbl.writetable
end if
set otbl=nothing
%>
<%
'------------------------------------------------ 授权表格 ----------------------------------------------------
if accredit=1 then
%>
<FORM NAME="sendForm" METHOD=POST ACTION="SETLIST_TABLE_SAVE.ASP">
<INPUT TYPE="hidden" NAME="ColFilter" value="<%=ColFilter%>">
<INPUT TYPE="hidden" NAME="RowFilter" VALUE="<%=sqlWhere%>">
<INPUT TYPE="hidden" name="table_id" Value="<%=table_id%>">
<table width="100%" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td >
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td colspan=2 align=center>授 权 设 置</td>
</tr>
<tr>
<td width="10%">
<table width="100" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>
<input type="submit" name="Submit23" style="width:0px;height:16px;BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; FONT-SIZE: 9pt; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid;background-color:#EEEDE8" value=" ">
<input type="button" name="Submit123" value="被授权人" style="width:80px;height:17px;BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #ffffff 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #666666 1px solid" onClick="popwin('select_user.asp',425,280,'')">
</td>
</tr>
</table>
</td>
<td width="90%">
<input type="text" name="reusername" style="width:98%;BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid;background-color:#F9F9F9" value="" readonly>
<input type="hidden" name="reuserid" value="">
</td>
</tr>
<tr>
<td width="10%" >
<table width="100" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>
<input type="submit" name="Submit13" style="width:0px;height:16px;BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; FONT-SIZE: 9pt; BORDER-LEFT: 0px solid; BORDER-BOTTOM: 0px solid;background-color:#EEEDE8" value=" ">
<input type="button" name="Submit223" value="授权权" style="width:80px;height:17px;BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #ffffff 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #666666 1px solid" onclick="if(accredit.checked){accredit.checked=false}else{accredit.checked=true}" >
</td>
</tr>
</table>
</td>
<td width="90%">
<INPUT TYPE="checkbox" NAME="accredit" value=1>选中此权限,被授权人也可以将浏览权付给别人。
</td>
</tr>
<tr>
<td colspan=2 align=center>
<table width="100" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>
<input type="submit" name="Submitbtn" value="保 存" style="width:80px;height:17px;BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #ffffff 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #666666 1px solid" >
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</FORM>
<%
end if
%>
</body>
</html>
<html><script language="JavaScript"> </script></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -