📄 empmain_hol_list.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/EmpMain.asp" -->
<!--#include file="EmpMain_CheckRight.asp"-->
<%call fnCheckRight("hollist","1")%>
<%
Dim IDstring
if instr(request.QueryString,"IDstring") then
if request.QueryString("IDstring") = "" then
IDstring = "0"
else
IDstring=request.QueryString("IDstring")
end if
end if
Dim rs
Dim rs_numRows
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_EmpMain_STRING
sql = ""
sql = sql & "SELECT * FROM Holiday where 1=1 "
if trim(request("year")) <> "" and trim(request("month")) <> "" then
sql = sql & "and datepart('yyyy',hdfrom) = '"&trim(request("year"))&"' and datepart('m',hdfrom) = '"&trim(request("month"))&"'"
elseif trim(request("year")) <> "" and trim(request("month")) = "" then
sql = sql & "and datepart('yyyy',hdfrom) = '"&trim(request("year"))&"'"
end if
if instr(request.QueryString,"IDstring") then
sql = sql & " and EmpID in ("&IDstring&")"
end if
sql = sql & " order by EmpID asc"
'if trim(request("year")) <> "" and trim(request("month")) <> "" then
'rs.Source = "SELECT * FROM Holiday where datepart('yyyy',hdfrom) = '"&trim(request("year"))&"' and datepart('m',hdfrom) = '"&trim(request("month"))&"' order by EmpID asc"
'elseif trim(request("year")) <> "" and trim(request("month")) = "" then
'rs.Source = "SELECT * FROM Holiday where datepart('yyyy',hdfrom) = '"&trim(request("year"))&"' order by EmpID asc"
'else
'rs.Source = "SELECT * FROM Holiday order by EmpID asc"
'end if
rs.source = sql
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
rs_numRows = 0
%>
<%
dim emp()
redim emp(10,1)
i = 1
while not rs.eof
i = i + 1
if rs("EmpID") = emp(1,i-1) then
i = i -1
Select Case rs("HDtype")
Case "病假"
emp(2,i) = CDbl(emp(2,i))+rs("HDDayCount")
Case "事假"
emp(3,i) = CDbl(emp(3,i))+rs("HDDayCount")
Case "年休"
emp(4,i) = CDbl(emp(4,i))+rs("HDDayCount")
Case "婚假"
emp(5,i) = CDbl(emp(5,i))+rs("HDDayCount")
Case "产假"
emp(6,i) = CDbl(emp(6,i))+rs("HDDayCount")
Case "工伤"
emp(7,i) = CDbl(emp(7,i))+rs("HDDayCount")
Case "丧假"
emp(8,i) = CDbl(emp(8,i))+rs("HDDayCount")
Case "旷勤"
emp(9,i) = CDbl(emp(9,i))+rs("HDDayCount")
End Select
emp(10,i) = CDbl(emp(10,i))+rs("HDNoPayCount")
else
redim Preserve emp(10,i)
emp(1,i) = rs("EmpID")
Select Case rs("HDtype")
Case "病假"
emp(2,i) = rs("HDDayCount")
Case "事假"
emp(3,i) = rs("HDDayCount")
Case "年休"
emp(4,i) = rs("HDDayCount")
Case "婚假"
emp(5,i) = rs("HDDayCount")
Case "产假"
emp(6,i) = rs("HDDayCount")
Case "工伤"
emp(7,i) = rs("HDDayCount")
Case "丧假"
emp(8,i) = rs("HDDayCount")
Case "旷勤"
emp(9,i) =rs("HDDayCount")
End Select
emp(10,i) =rs("HDNoPayCount")
end if
rs.movenext
wend
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="CSS/SellWellWeb.css" rel="stylesheet" type="text/css">
<script>
function showDetail(obj){
URL = window.parent.frames("frmbottom").window.location.href
if(URL.indexOf("EmpMain_Main.asp")==-1){
window.parent.frames("frmbottom").window.location = "EmpMain_Main.asp?ID=" + obj.EmpID + "&PageType=hol"
return
}
window.parent.frames("frmbottom").window.document.form1.ID.value = obj.EmpID
strUrl=window.parent.frames("frmbottom").window.frames("main").location.href
NewUrl = "EmpMain_hol_Disp.asp" + "?ID="+obj.EmpID + "&PageType=hol"
window.parent.frames("frmbottom").window.frames("main").location.href = NewUrl
}
var objClassName
var objorgImg=null
function showCursorLocation(objimg){
if(objorgImg==null){
objorgImg = eval("document.all."+objimg)
}
else{
objorgImg.style.display = "none"
}
objorgImg = eval("document.all."+objimg)
eval("document.all."+objimg+".style.display=''")
}
function HLItem(obj){
obj.oldClassName=obj.className;
obj.className="ListValuehighlight";
}
function Re(obj){
obj.className=obj.oldClassName
}
function doEdit(ID){
window.location ="EmpMain_Work_Edit.asp?EmpID=<%=Request.QueryString("ID")%>&ID="+ID
}
function dosearch(){
objyear = document.form1.year
objmonth = document.form1.month
window.location ="EmpMain_Hol_List.asp?year="+objyear.options[objyear.selectedIndex].value + "&month="+objmonth.options[objmonth.selectedIndex].value
}
function fnRedirect(obj){
window.location= obj.value
}
</script>
</head>
<body class="body">
<form name="form1" action="" method="post">
<fieldset class="fiedset">
<legend><font size="2"><input name="paylist" onclick="fnRedirect(this)" type="radio" value="EmpMain_Pay_list.asp">薪资统计<input name="hollist" type="radio" value="EmpMain_hol_list.asp" checked>考勤统计<input name="Emplist" type="radio" value="EmpMain_list.asp" onclick="fnRedirect(this)">员工列表</font></legend>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="21" nowrap> <div align="left"><font size="2">当前统计范围:
<%if request("year") <> "" then%>
<%=request.QueryString("year")%>年
<%end if%>
<%if request("month") <> "" then%>
<%=request.QueryString("month")%>月
<%end if%>
</font></div></td>
<td width="8%" nowrap> <div align="right"><font size="2">年份:</font></div></td>
<td width="15%" nowrap> <font size="2">
<select name="year" class="select" onchange="dosearch()">
<%FOR K = 0 TO 10 %>
<OPTION <%if cint(request("year")) = (2000+K) then%>selected<%end if%> VALUE="<%=2000+K%>"><%=2000+K%></OPTION>
<%NEXT%>
</select>
</font></td>
<td width="12%" nowrap> <div align="right"><font size="2">月份:</font></div></td>
<td width="12%" nowrap> <font size="2">
<select name="month" class="select" onchange="dosearch()">
<option />
<%FOR M = 1 TO 12 %>
<OPTION <%if request("Month") <> "" then%><%if M = cint(request.QueryString("month")) then%>selected<%end if%><%end if%> VALUE="<%=M%>"><%=M%>月</OPTION>
<%NEXT%>
</select>
</font></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
<tr>
<td width="5%" align="center" class="listTitle" nowrap> </td>
<td width="10%" nowrap class="listTitle"> <div align="center">编号</div></td>
<td width="10%" nowrap class="listTitle"> <div align="center">姓名</div></td>
<td width="10%" nowrap class="listTitle"> <div align="center">病假</div></td>
<td width="10%" nowrap class="listTitle"> <div align="center">事假</div></td>
<td width="10%" nowrap class="listTitle"> <div align="center">年休</div></td>
<td width="10%" nowrap class="listTitle"> <div align="center">婚假</div></td>
<td width="10%" nowrap class="listTitle"> <div align="center">产假</div></td>
<td width="9%" nowrap class="listTitle"> <div align="center">工伤</div></td>
<td width="9%" nowrap class="listTitle"> <div align="center">丧假</div></td>
<td width="12%" nowrap class="listTitle"> <div align="center">旷勤</div></td>
<td width="12%" nowrap class="listTitle"> <div align="center">扣薪</div></td>
</tr>
<%N=0%>
<%for j = 2 to i %>
<%
Set UserName = Server.CreateObject("ADODB.Recordset")
UserName.ActiveConnection = MM_EmpMain_STRING
UserName.Source = "SELECT EmpName,EmpCompID FROM EmpGeneralInfo where id=" & emp(1,j)
UserName.CursorType = 0
UserName.CursorLocation = 2
UserName.LockType = 1
UserName.Open()
rs_numRows = 0
%>
<%
N= N + 1
if N mod 2 = 0 then
className = "listValueWhite"
else
className = "listValuegray"
end if
%>
<tr class="<%=className%>" EmpID="<%=emp(1,j)%>" style="cursor:hand" onMouseOver="HLItem(this)" onMouseOut="Re(this)" onclick="showDetail(this);;showCursorLocation('cursorimg<%=n%>')">
<td width="5%" nowrap><div align="center"><img src="images/location.gif" width="16" height="12" style="display:none" id="cursorimg<%=n%>"></div></td>
<td><%=UserName("EmpCompID")%></td>
<td><%=UserName("EmpName")%></td>
<td><%=emp(2,j)%></td>
<td><%=emp(3,j)%></td>
<td><%=emp(4,j)%></td>
<td><%=emp(5,j)%></td>
<td><%=emp(6,j)%></td>
<td><%=emp(7,j)%></td>
<td><%=emp(8,j)%></td>
<td><%=emp(9,j)%></td>
<td><%=emp(10,j)%></td>
</tr>
<%
UserName.close()
set UserName = nothing
next%>
</table>
</fieldset>
</form>
</body>
</html>
<%
rs.Close()
Set rs = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -