📄 kaoqinxiang.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="DataBase/conn.asp" -->
<%
'显示姓名
set rsxm=server.CreateObject("adodb.recordset")
sqlxm="SELECT dbo.tb_Employee.name, dbo.tb_User.username FROM dbo.tb_User INNER JOIN dbo.tb_Employee ON dbo.tb_User.name = dbo.tb_Employee.id WHERE (dbo.tb_User.username = '"&request("username")&"')"
rsxm.open sqlxm,conn,1,1
'接收时间
if request("year")<>"" then
yearr=request("year")
else
yearr=year(date)
end if
if request("month")<>"" then
monthh=request("month")
else
monthh=month(date())
end if
'读取年月日的天数
if monthh=1 or monthh=3 or monthh=5 or monthh=7 or monthh=8 or monthh=10 or monthh=12 then
dayy=31
elseif monthh=4 or monthh=6 or monthh=9 or monthh=11 then
dayy=30
elseif monthh=2 then
'判断二月的天数
if int(yearr) mod 400=0 then
dayy=29
elseif int(yearr) mod 4=0 then
dayy=29
else
dayy=28
end if
end if
'读取时间设置
set rss=server.CreateObject("adodb.recordset")
sqls="select * from tb_KaoqinSetup where id=1"
rss.open sqls,conn,1,1
'迟到早退
set rs=server.CreateObject("adodb.recordset")
sql="select * from tb_Kaoqin where name='"&request("username")&"' and month="&monthh&" and year="&yearr
rs.open sql,conn,1,1
chi=0
zao=0
do while not rs.eof
'//上午迟到
if not isnull(rs("shangwus")) then
bb=Split(rs("shangwus"),":")
qq=bb(0)&bb(1)&bb(2)
if int(qq)>int(rss("shangwus")) then
chi=chi+1
end if
else
chi=chi+1
end if
'//下午迟到
if not isnull(rs("xiawus")) then
bb1=Split(rs("xiawus"),":")
qq1=bb1(0)&bb1(1)&bb1(2)
if int(qq1)>int(rss("xiawus")) then
chi=chi+1
end if
else
chi=chi+1
end if
'//上午早退
if not isnull(rs("shangwux")) then
bb2=Split(rs("shangwux"),":")
qq2=bb2(0)&bb2(1)&bb2(2)
if int(qq2)<int(rss("shangwux")) then
zao=zao+1
end if
else
zao=zao+1
end if
'//下午早退
if not isnull(rs("xiawux")) then
bb3=Split(rs("xiawux"),":")
qq3=bb3(0)&bb3(1)&bb3(2)
if int(qq3)<int(rss("xiawux")) then
zao=zao+1
end if
else
zao=zao+1
end if
rs.movenext
loop
'假期
sjia=0
bjia=0
gjia=0
hjia=0
ssjia=0
cjia=0
jjia=0
kuang=0
set rsj=server.CreateObject("adodb.recordset")
sqlj="select * from tb_Leave where kmonth="&monthh&" and kyear="&yearr&" and name='"&request("username")&"'"
rsj.open sqlj,conn,1,1
do while not rsj.eof
if rsj("zpi")="是" and rsj("rpi")="是" then
if rsj("jiayin")="事假" then
if int(rsj("jmonth"))>int(rsj("kmonth")) then
sjia=sjia+int(dayy)-int(rsj("kday"))+1
elseif int(rsj("jmonth"))=int(rsj("kmonth")) and rsj("bantian")="是" then
sjia=formatnumber((sjia+0.5),1,-1)
elseif int(rsj("jmonth"))=int(rsj("kmonth")) then
sjia=sjia+int(rsj("jday"))-int(rsj("kday"))+1
end if
end if
if rsj("jiayin")="病假" then
if int(rsj("jmonth"))>int(rsj("kmonth")) then
bjia=bjia+int(dayy)-int(rsj("kday"))+1
elseif int(rsj("jmonth"))=int(rsj("kmonth")) and rsj("bantian")="是" then
bjia=formatnumber((bjia+0.5),1,-1)
elseif int(rsj("jmonth"))=int(rsj("kmonth")) then
bjia=bjia+int(rsj("jday"))-int(rsj("kday"))+1
end if
end if
if rsj("jiayin")="公假" then
if int(rsj("jmonth"))>int(rsj("kmonth")) then
gjia=gjia+int(dayy)-int(rsj("kday"))+1
elseif int(rsj("jmonth"))=int(rsj("kmonth")) and rsj("bantian")="是" then
gjia=formatnumber((gjia+0.5),1,-1)
elseif int(rsj("jmonth"))=int(rsj("kmonth")) then
gjia=gjia+int(rsj("jday"))-int(rsj("kday"))+1
end if
end if
if rsj("jiayin")="婚假" then
if int(rsj("jmonth"))>int(rsj("kmonth")) then
hjia=hjia+int(dayy)-int(rsj("kday"))+1
elseif int(rsj("jmonth"))=int(rsj("kmonth")) and rsj("bantian")="是" then
hjia=formatnumber((hjia+0.5),1,-1)
elseif int(rsj("jmonth"))=int(rsj("kmonth")) then
hjia=hjia+int(rsj("jday"))-int(rsj("kday"))+1
end if
end if
if rsj("jiayin")="丧假" then
if int(rsj("jmonth"))>int(rsj("kmonth")) then
ssjia=ssjia+int(dayy)-int(rsj("kday"))+1
elseif int(rsj("jmonth"))=int(rsj("kmonth")) and rsj("bantian")="是" then
ssjia=formatnumber((ssjia+0.5),1,-1)
elseif int(rsj("jmonth"))=int(rsj("kmonth")) then
ssjia=ssjia+int(rsj("jday"))-int(rsj("kday"))+1
end if
end if
if rsj("jiayin")="产假" then
if int(rsj("jmonth"))>int(rsj("kmonth")) then
cjia=cjia+int(dayy)-int(rsj("kday"))+1
elseif int(rsj("jmonth"))=int(rsj("kmonth")) and rsj("bantian")="是" then
cjia=formatnumber((cjia+0.5),1,-1)
elseif int(rsj("jmonth"))=int(rsj("kmonth")) then
cjia=cjia+int(rsj("jday"))-int(rsj("kday"))+1
end if
end if
if rsj("jiayin")="加班" then
if int(rsj("jmonth"))>int(rsj("kmonth")) then
jjia=jjia+int(dayy)-int(rsj("kday"))+1
elseif int(rsj("jmonth"))=int(rsj("kmonth")) then
jjia=jjia+int(rsj("jday"))-int(rsj("kday"))+1
end if
end if
end if
rsj.movenext
loop
set rsj1=server.CreateObject("adodb.recordset")
sqlj1="select * from tb_Leave where jmonth="&monthh&" and jyear="&yearr&" and name='"&request("username")&"'"
rsj1.open sqlj1,conn,1,1
do while not rsj1.eof
if rsj1("zpi")="是" and rsj1("rpi")="是" then
if rsj1("jiayin")="事假" then
if int(rsj1("jmonth"))>int(rsj1("kmonth")) then
sjia=sjia+int(rsj1("jday"))
end if
end if
if rsj1("jiayin")="病假" then
if int(rsj1("jmonth"))>int(rsj1("kmonth")) then
bjia=bjia+int(rsj1("jday"))
end if
end if
if rsj1("jiayin")="公假" then
if int(rsj1("jmonth"))>int(rsj1("kmonth")) then
gjia=gjia+int(rsj1("jday"))
end if
end if
if rsj1("jiayin")="婚假" then
if int(rsj1("jmonth"))>int(rsj1("kmonth")) then
hjia=hjia+int(rsj1("jday"))
end if
end if
if rsj1("jiayin")="丧假" then
if int(rsj1("jmonth"))>int(rsj1("kmonth")) then
ssjia=ssjia+int(rsj1("jday"))
end if
end if
if rsj1("jiayin")="产假" then
if int(rsj1("jmonth"))>int(rsj1("kmonth")) then
cjia=cjia+int(rsj1("jday"))
end if
end if
if rsj1("jiayin")="加班" then
if int(rsj1("jmonth"))>int(rsj1("kmonth")) then
jjia=jjia+int(rsj1("jday"))
end if
end if
end if
rsj1.movenext
loop
'旷职
kuang=dayy-rs.recordcount-sjia-bjia-gjia-hjia-ssjia-cjia
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>个人考勤信息</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style>
<link href="CSS/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #000000}
-->
</style>
</head>
<body>
<table width="363" border="1" align="center" cellspacing="0" bordercolorlight="#FFFFFF" bordercolordark="#666699">
<tr align="center">
<td width="45" height="20" background="images/index_24.gif"><span class="style2">姓名</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">迟到</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">早退</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">事假</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">病假</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">公假</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">婚假</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">丧假</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">产假</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">加班</span></td>
<td width="30" background="images/index_24.gif"><span class="style2">旷职</span></td>
</tr>
<tr align="center">
<td><%=rsxm("name")%></td>
<td><%=chi%> </td>
<td><%=zao%> </td>
<td><%=sjia%> </td>
<td><%=bjia%> </td>
<td><%=gjia%> </td>
<td><%=hjia%> </td>
<td><%=ssjia%> </td>
<td><%=cjia%> </td>
<td><%=jjia%> </td>
<td><%=kuang%> </td>
</tr>
</table>
<form name="form1" method="post" action="">
<div align="center">
<select name="year" id="year">
<%for i=2005 to 2100%>
<option value="<%=i%>" <%if int(yearr)=i then%>selected<%end if%>><%=i%></option>
<%next%>
</select>
<select name="month" id="month">
<%for i=1 to 12%>
<option value="<%=i%>"<%if i=int(monthh) then%>selected<%end if%>><%=i%></option>
<%next%>
</select>
<input name="Submit" type="submit" class="botton" value="查询">
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -