📄 out.asp
字号:
<%@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 '一页多少行记录
%>
<!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="3" bgcolor="#CC0000"> </td>
</tr>
<form name="myform" action="out.asp" method="post">
<tr bgcolor="#F9F9F9">
<td height="25" align="right" bgcolor="#F2F2F2"><span class="ItemTitleFont">查询日期:</span> </td>
<td height="25" colspan="3" 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="">选择员工</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="style1"><strong>姓名</strong></span></td>
<td width="14%" height="25" align="center"><span class="style1"><span class="style3">出去时间</span></span></td>
<td width="21%" align="center"><span class="style3">返回时间</span></td>
<td 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 uid,uname,out_star,out_end,out_txt from oa_out where companyid="&session("companyid")
if uid<>"" then sql=sql & " and uid="&uid&""
if startDate <>"" and endDate <>"" then sql=sql & " and (datediff(day,out_star,'"&startDate&"')<=0 and datediff(day,out_end,'"&endDate&"')>=0)"
'if startDate <>"" and endDate <>"" then sql=sql & " and (kq_rq between '"&startDate&"' and '"&endDate&"')"
sql=sql& " order by id desc"
'response.Write(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("out.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"
%>
<tr bgcolor="<%=bgcolor%>">
<td height="25" align="center"><%=rs(1)%></td>
<td height="25" align="center"><%=rs(2)%></td>
<td height="25" align="center"><%=rs(3)%></td>
<td height="25" align="center"><%=rs(4)%></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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -