⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kq_kqtjcx.asp

📁 OFFICE办公自动化
💻 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>
	<title>考勤统计查询</title>
	<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.action="kq_kqtjcx.asp"
			frmcx.submit
		end sub
		
		function doSelall()
			for each x in frmcx.elements 
				if x.type="checkbox" and left(x.name,6)="chkall" then
					x.checked = frmcx.chkall.checked
				end if
			next
		end function
	</script>
</head>
<body>
<div class="TitleBar">考勤统计查询</div>
<%
	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
	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
	scxsj=Request("cxsj") & ""
	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(level,key)
		'level表示级别,key表示上级部门的BH
		Dim rs,lxjbms
		set rs=server.CreateObject("ADODB.recordset")
		rs.open "Select * from tbioaDepartment Where parentid = '" & key & "'",oConn,1,1
		do while not rs.eof
			Response.Write "<tr class=td1>" _
				 & "<td class=listcellrow width=1><nobr><input type=checkbox name='chkall" & rs("id") & "' value='" & rs("id") & "'></nobr></td>" _
				 & "<td class=listcellrow width=180><nobr>" & replace(string(level*2," ")," ","&nbsp") _
				 & "<a href=kq_kqtjcx_bm.asp?cxsj=" & scxsj & "&bmbh=" & rs("id") & ">" _
				 & server.HTMLEncode(rs("name") & "")  _
				 &  "</a>&nbsp;</nobr></td>" & chr(13)
			showline rs("id")
			Response.Write "</tr>"
			call showbm(level+1,rs("id"))
			rs.movenext  
		loop
		rs.close  
		set rs=nothing
	end sub
%>
<%
	sub showLzRY
		Response.Write "<tr class=td1>" _
				& "<td class=listcellrow width=1><nobr><input type=checkbox name='chkallno' value='no'></nobr></td>" _
				& "<td class=listcellrow width=180><nobr>&nbsp;&nbsp;" _
				& "<a href=kq_kqtjcx_bm.asp?cxsj=" & scxsj & "&bmbh=no>" _
				& "待分人员"  _
				& "</a></nobr></td>" & chr(13)
		showline "no"
		Response.Write "</tr>"
	end sub
%>
<%
	sub showline(sbmbh)
		dim rs 
		set rs=server.CreateObject("ADODB.recordset")
		dim i
		if sbmbh<>"no" then
			rs.open "select a.jb,count(a.ygbh),sum(a.sj),sum(a.cs) " _
						& "from kq_ytjb a,tbioaUser b " _
						& "where b.Department='" & sbmbh & "' " _
						& "and a.ygbh=b.id " _
						& "and a.ny='" & scxsj & "' " _
						& "group by a.jb",oConn,1,1
						
		else
			
			rs.open "select a.jb,count(a.ygbh),sum(a.sj),sum(a.cs) " _
						& "from kq_ytjb a,tbioaUser b " _
						& "where (b.Department=0) " _
						& "and a.ygbh=b.id " _
						& "and a.ny='" & scxsj & "' " _
						& "group by a.jb",oConn,1,1
		end if
		for i= 1 to ubound(ajb,2)
			ajb(1,i)="&nbsp;"
		next
		if rs.eof then
			Response.Write "<td align=center class=listcellrow colspan=" & ubound(ajb,2) & ">&nbsp;本月统计数据尚未生成或该部门无下属人员</td>"
		else
			do while not rs.eof
				for i= 1 to ubound(ajb,2)
					if clng(ajb(0,i))=clng(rs(0)) then
						if i=1 or i=2 then
							if rs(2) & ""<>"" then
								ajb(1,i)=rs(2) & "天"							
							else
								ajb(1,i)="0天"
							end if
						elseif i=11 then
							if rs(2) & ""<>"" then
								ajb(1,i)=round(rs(2),2) & "小时"
							else
								ajb(1,i)="0小时"
							end if
						elseif i<11 then
							if rs(2) & ""<>"" then
								ajb(1,i)=rs(2) & "次"
							else
								ajb(1,i)="0次"
							end if
						else	'对应假别字典中的假别
							if rs(3) & ""<>"" then
								ajb(1,i)=rs(3) & "次"
							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
%>
<table width=98% class=tabletoolbar border=0 cellspacing="1" cellpadding="0" align=center>	
	<form name=frmcx id=frmcx method="post" action="kq_kqtjcx.asp" >
	<input type="hidden" name="id" value="">
	<tr>
		<td align="left"><div class="TableTitleText">考勤统计表</div></td>
		<td align="right" nowrap>
			查询时间:<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="location.href='kq_sckqtj.asp'"></input>
		</td>
	</tr>
	
</table>

<table class="tab" cellpadding="2" cellspacing="1" style="margin-left:1%;margin-right:1%">
	<tr align="center">
		<td rowspan=2 class=td3 width=1><nobr><input type="checkbox" name="chkall" id="chkall" onclick="vbscript:doSelall"></nobr></td>
		<td class="td3" rowspan=2><nobr><%=Application("pub_bm_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>
	<%call showbm(1,"0")%>
	<%call showLzRY%>
	<tr height="10"><td class=td2 colspan=100></td></tr>
</table>
</form>
<%
	set rs=nothing
	oConn.close
	set oConn=nothing
%>
</body>
</html> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -