📄 kq_kqtjcx_bm.asp
字号:
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<!-- #include file="../inc/pubfun_a.inc" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<script language=vbscript src="..\js\pubfun_a_c.vbs"></script>
<script Language="vbScript">
sub doCX
if not Isdate(frmcx.cxsj.value) then
msgbox "查询时间应输入合法日期值,如" & formatdatetime_activenew(now,"yyyy-mm"),vbInformation,"提示"
frmcx.cxsj.focus
exit sub
end if
frmcx.cxsj.value=formatdatetime_activenew(frmcx.cxsj.value,"yyyy-mm")
frmcx.submit
end sub
function doPrintSet()
' 打印页面设置
call objPrint.ExecWB(8,1)
end function
function doPrint()
window.print()
end function
</script>
</head>
<body>
<OBJECT classid=CLSID:8856f961-340A-11D0-A96B-00C04fD705A2 height=0 id=objPrint name=objPrint width=0></OBJECT>
<%
dim skqyqsrq,skqyqsbz,scdsj1,scdsj2,scdsj3,ssbsj,sxbsj
Dim rs
set rs=server.CreateObject("ADODB.recordset")
rs.Open "select * from kq_csb",oConn,1,1
if rs.EOf then
rs.Close
set rs=nothing
oConn.close
set oConn=nothing
oConn.close
set oConn=nothing
Response.Write "未定义考勤参数"
Response.End
end if
skqyqsrq=rs("kqyqsrq")
skqyqsbz=rs("kqyqsbz")
scdsj1=rs("cdsj1")
scdsj2=rs("cdsj2")
scdsj3=rs("cdsj3")
rs.Close
dim scxsj,sbmbh,sbmmc
scxsj=Request("cxsj")
sbmbh=Request("bmbh")
if scxsj="" then
if now()>=cdate(formatdatetime_activenew(now,"yyyy-mm") & "-" & clng(skqyqsrq)) then
select case cstr(skqyqsbz)
case "1"
scxsj=formatdatetime_activenew(now,"yyyy-mm")
case "0"
scxsj=formatdatetime_activenew(dateadd("m",1,now),"yyyy-mm")
end select
else
select case cstr(skqyqsbz)
case "0"
scxsj=formatdatetime_activenew(now,"yyyy-mm")
case "1"
scxsj=formatdatetime_activenew(dateadd("m",-1,now),"yyyy-mm")
end select
end if
end if
dim ajb(),i
redim ajb(2,0) '存放假别字典,ajb(0,0)存放假别代码,ajb(1,0)存放请假次数
rs.Open "select * from KQ_JBZD",oConn,1,1
redim ajb(2,rs.RecordCount+11)
ajb(0,1)=-1
ajb(1,1)=""
ajb(2,1)="出勤"
ajb(0,2)=-2
ajb(1,2)=""
ajb(2,2)="缺勤"
ajb(0,3)=-10
ajb(1,3)=""
ajb(2,3)="未签到"
ajb(0,4)=-11
ajb(1,4)=""
ajb(2,4)="未签退"
ajb(0,5)=-3
ajb(1,5)=""
ajb(2,5)="迟到1"
ajb(0,6)=-4
ajb(1,6)=""
ajb(2,6)="迟到2"
ajb(0,7)=-5
ajb(1,7)=0
ajb(2,7)="迟到3"
ajb(0,8)=-6
ajb(1,8)=0
ajb(2,8)="早退1"
ajb(0,9)=-7
ajb(1,9)=0
ajb(2,9)="早退2"
ajb(0,10)=-8
ajb(1,10)=0
ajb(2,10)="早退3"
ajb(0,11)=-9
ajb(1,11)=0
ajb(2,11)="加班"
for i=1to rs.RecordCount
ajb(0,i+11)=rs("dm") & ""
ajb(1,i+11)=0
ajb(2,i+11)=rs("mc") & ""
rs.MoveNext
next
rs.Close
%>
<%
sub showbm(sbmbh)
'level表示级别,key表示上级部门的BH
Dim rs,lxjbms,sbmmc
set rs=server.CreateObject("ADODB.recordset")
if sbmbh<>"no" then
rs.open "select name from tbioaDepartment where id='" & sbmbh & "' " ,oConn,1,1
if not rs.eof then
sbmmc=rs(0) & ""
end if
rs.close
rs.open "Select id,Name from tbioaUser Where Department='" & sbmbh & "' and id in(select distinct ygbh from kq_ytjb where ny='" & scxsj & "')",oConn,1,1
else
rs.open "Select id,Name from tbioaUser Where (Department=0) and id in(select distinct ygbh from kq_ytjb where ny='" & scxsj & "')",oConn,1,1
sbmmc = "待分人员"
end if
Response.Write "<tr align=left>" _
& "<td class=td2 colspan=100>【<B>" & server.HTMLEncode(sbmmc) & "</b>】</td></tr>"
do while not rs.eof
Response.Write "<tr class=td1>" _
& "<td class=listcellrow width=180><nobr>" _
& server.HTMLEncode(rs("Name") & "") _
& " </nobr></td>" & chr(13)
showline rs("id")
Response.Write "</tr>"
rs.movenext
loop
rs.close
set rs=nothing
end sub
%>
<%
sub showline(sygbh)
dim rs
set rs=server.CreateObject("ADODB.recordset")
dim i
rs.open "select a.jb,a.sj,a.cs " _
& "from kq_ytjb a " _
& "where a.ygbh=" & sygbh & " " _
& "and a.ny='" & scxsj & "' " _
,oConn,1,1
for i= 1 to ubound(ajb,2)
ajb(1,i)=" "
next
if rs.eof then
Response.Write "<td align=center class=listcellrow colspan=" & ubound(ajb,2) & "> 本月统计数据尚未生成</td>"
else
do while not rs.eof
for i= 1 to ubound(ajb,2)
if cstr(ajb(0,i))=cstr(rs(0)) then
if i=1 or i=2 then
if rs(1) & ""<>"" then
ajb(1,i)=rs(1) & "天"
else
ajb(1,i)="0天"
end if
elseif i=11 then
if rs(1) & ""<>"" then
ajb(1,i)=rs(1) & "小时"
else
ajb(1,i)="0小时"
end if
elseif i<11 then
if rs(1) & ""<>"" then
ajb(1,i)=rs(1) & "次"
else
ajb(1,i)="0次"
end if
else '对应假别字典中的假别
if rs(2) & ""<>"" then
ajb(1,i)=rs(2) & "次"
else
ajb(1,i)="0次"
end if
end if
exit for
end if
next
rs.movenext
loop
for i= 1 to ubound(ajb,2)
Response.Write "<td class=listcellrow align=center width=60><nobr>" & ajb(1,i) & "</nobr></td>"
next
end if
rs.close
set rs=nothing
end sub
%>
<div class="TitleBar">考勤统计打印</div>
<table width=98% class=tabletoolbar border=0 cellspacing="1" cellpadding="0" align=center>
<form name=frmcx id=frmcx method="post" action="kq_kqtjcx_bm.asp" >
<tr>
<td align="left"><div class="TableTitleText">考勤统计表</div></td>
<td align="right" nowrap>
<input type=hidden id=bmbh name=bmbh value=<%=sbmbh%>>
查询时间:<input type="text" name="cxsj" id=cxsj class="input" size="7" value="<%=scxsj%>">
<input type="button" class="button" value="查询" onclick="vbscript:docx()" id=bcx name=bcx></input>
<input type="button" class="button" value="打印页面设置" onclick="vbscript:doprintSet()" id=bprintset name=bprintset></input>
<input type="button" class="button" value="打印" onclick="vbscript:doprint()" id=bprint name=bprint></input>
<input type="button" class="button" value="返回" onclick="javascript:history.go(-1);" id=bfh name=bfh></input>
</td>
</tr>
</form>
</table>
<table class="tab" cellpadding="2" cellspacing="1" style="margin-left:1%;margin-right:1%">
<tr align="center">
<td class="td3" rowspan=2><nobr><%=Application("pub_yg_showstr")%>名称</nobr></td>
<td rowspan=2 class=td3><nobr>出勤</nobr></td>
<td rowspan=2 class=td3><nobr>缺勤</nobr></td>
<td rowspan=2 class=td3><nobr>未签到</nobr></td>
<td rowspan=2 class=td3><nobr>未签退</nobr></td>
<td colspan=3 class=td3><nobr>迟到</nobr></td>
<td colspan=3 class=td3><nobr>早退</nobr></td>
<td rowspan=2 class=td3><nobr>加班</nobr></td>
<%
for i= 12 to ubound(ajb,2)
%>
<td class=td3 rowspan=2><nobr><%=server.HTMLEncode(ajb(2,i))%></nobr></td>
<%
next
%>
</tr>
<tr align=center>
<td class=td3><nobr><%=scdsj1%>分钟以内</nobr></td>
<td class=td3><nobr><%=scdsj2%>分钟以内</nobr></td>
<td class=td3><nobr><%=scdsj3%>分钟以内</nobr></td>
<td class=td3><nobr><%=scdsj1%>分钟以内</nobr></td>
<td class=td3><nobr><%=scdsj2%>分钟以内</nobr></td>
<td class=td3><nobr><%=scdsj3%>分钟以内</nobr></td>
</tr>
<%
if sbmbh <> "" then
dim stmpbm
stmpbm = split(sbmbh,",")
for i=0 to ubound(stmpbm)
call showbm(stmpbm(i))
next
end if
%>
<tr height="10"><td class=td2 colspan=100></td></tr>
</table>
<%
set rs=nothing
oConn.close
set oConn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -