kq_jilu.asp

来自「网络办公系统源码」· ASP 代码 · 共 154 行

ASP
154
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../config.asp"-->
<!--#include file="../checklogin.asp"-->
<!--#include file="../../inc/navigate.asp"-->
<%
dim sPageNavigate  '分页表格 
dim iRecordCount,iMaxPageCount,iPageCount,iCurrentPageIndex,i,sTMP  '分页
iMaxPageCount=20 '一页多少行记录
%>

<%
dim a_time,p_time
sql="select * from oa_kqtime where companyid="&session("companyid")
set rs=conn.execute(sql)
if not rs.eof then
	a_time=trim(rs("a_time"))
	p_time=trim(rs("p_time"))
end if
rs.close
set  rs=nothing
'--------------------------------------------
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<script language="javascript" src="../../inc/meizzDate.js"></script>
<link href="../img/css1.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {color: #FFFFFF}
.style3 {color: #FFFFFF; font-weight: bold; }
body,td,th {
	font-size: 12px;
}
-->
</style>
</head>
<body>
<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
  <tr align="right">
    <td width="15%" height="25" align="left" bgcolor="#CC0000"><span class="style1"><strong>个人考勤查询</strong></span></td>
    <td height="25" colspan="4" bgcolor="#CC0000">&nbsp;</td>
    </tr>
	<form name="myform" action="kq_jilu.asp" method="post">
  <tr bgcolor="#F9F9F9">
    <td height="25" align="right" bgcolor="#F2F2F2"><span class="ItemTitleFont">查询日期:</span> </td>
    <td height="25" colspan="4" align="left" bgcolor="#F2F2F2">
	<input name="startDate" type=text class="tabel1"  onFocus="setday(this)" size="10">
      <input name="endDate" type=text class="tabel1" onFocus="setday(this)" value="<%=date()%>" size="10">
      <select name="uid" id="uid">
        <option value="0">选择员工</option>
		<%
			sql="select id,truename from oa_Admin where companyid="&session("companyid")
			set rs=conn.execute(sql)
			do while not rs.eof
		%>
		<option value="<%=rs(0)%>"><%=rs(1)%></option>
		<%
			rs.movenext
			loop
			rs.close
			set rs=nothing
		%>
      </select>        
      <input name="Submit" type="submit" class="tabel1" value="提交">
        <input name="Submit2" type="reset" class="tabel1" value="重置">
        <input name="Submit3" type="button" class="tabel1" value="返回" onClick="window.history.go(-1)"></td>
  </tr></form>
  <tr bgcolor="#CC6633">
    <td height="25" align="center"><span class="style3">日期</span></td>
    <td width="17%" height="25" align="center"><span class="style1"><strong>姓名</strong></span></td>
    <td width="21%" align="center"><span class="style3">上午上班时间</span></td>
    <td width="18%" height="25" align="center"><span class="style3">下午下班时间</span></td>
    <td width="29%" height="25" align="center"><span class="style3">备注</span></td>
    </tr>
	<%
		startDate=trim(request.Form("startDate"))
		endDate=trim(request.Form("endDate"))
		uid=trim(request.Form("uid"))
		sql="select  kq_rq,kq_am,kq_pm,uid from oa_kq where companyid="&session("companyid")&""
		if uid<>"" then sql=sql & " and  uid="&uid&""
		if startDate <>"" and endDate <>"" then sql=sql & " and (kq_rq between '"&startDate&"' and '"&endDate&"')"
		sql=sql& " order by id desc"
		'set rs=conn.execute(sql)
		
		Call GetCurrentPageIndex()  '取得当前页码
				set rs=server.CreateObject("adodb.recordset")
				rs.open sql,conn,1,3
				rs.PageSize=iMaxPageCount
				rs.CacheSize =iMaxPageCount
				if not rs.Eof then  rs.Absolutepage=iCurrentPageIndex
				iRecordCount=rs.RecordCount  '所有查询出来的记录数
				iPageCount=rs.PageCount  '最终多少页
				if iCurrentPageIndex>iPageCount then iCurrentPageIndex=iPageCount  '控制当前页不得超出范围
				sPageNavigate=GetNavigate("kq_jilu.asp?uid="&uid&"&startDate="&startDate&"&endDate="&endDate&"",iRecordCount,iMaxPageCount,iCurrentPageIndex,true,true,"项")  '取得分页表格
				if Not rs.Eof then
				For i = 1 to iMaxPageCount '利用for next 循环依次读出当前页的记录 
			  if rs.EOF then  Exit For
				bgColor="#F8F8F8"
				if i mod 2=0 then bgColor="#DFEFFF"
				
			if len(rs(1))>0 then
				am=FORMATDATETIME(rs(1),3)
			end if
			if len(rs(2))>0 then
				pm=FORMATDATETIME(rs(2),3)
			end if
		if datediff("n",a_time,am)<0 then
			txt1="迟到"
		else
			txt1="正常"	
		end if
		if isnull(pm) then
			txt2=""
		end if
		if datediff("n",a_time,pm)<0 then
			txt2="早退"
		else
			txt2="正常"	
		end if	
		txt=txt1&","&txt2
		uname=conn.execute("select truename from oa_Admin where id="&rs("uid"))(0)
	%>
  <tr bgcolor="<%=bgcolor%>">
    <td height="25" align="center"><%=rs(0)%></td>
    <td height="25" align="center"><%=uname%></td>
    <td height="25" align="center"><%=am%></td>
    <td height="25" align="center"><%=pm%></td>
    <td height="25" align="center"><%=txt%></td>
    </tr>
    <%
						rs.MoveNext()
				       Next
                     End if
                  rs.close
                 set rs=nothing
				%>
				<tr>
    <td height="25" colspan="4" align="center"><%=sPageNavigate%></td>
  </tr>

</table>
</body>
</html>

⌨️ 快捷键说明

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