?? kqmain.asp
字號:
<%response.expires=0%>
<!--#include file="conn.asp"-->
<%
'返回新時間
function getnewtime(oldtime,addtime)
dim hourvalue,minutevalue,newminute,newtime
hourvalue=hour(oldtime)
minutevalue=minute(oldtime)+addtime
hourvalue=hourvalue+fix(minutevalue/60)
newminute=minutevalue mod 60
newtime=timeserial(hourvalue,newminute,0)
getnewtime=newtime
end function
oabusyname=request.cookies("oabusyname")
oabusyuserid=request.cookies("oabusyuserid")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" or oabusyuserid="" then
response.write("<script language=""javascript"">")
response.write("alert(""您已經(jīng)過期,請重新登錄系統(tǒng)!"");")
response.write("window.close()")
response.write("</script>")
response.end
end if
set kqconn=openconn("kq")
set rs=server.createobject("adodb.recordset")
sql="select * from inittime"
rs.open sql,kqconn,1
amcometime=rs("amondutytime")
amgotime=rs("amoffdutytime")
pmcometime=rs("pmondutytime")
pmgotime=rs("pmoffdutytime")
comedelaytime=rs("ondutydelaytime")
goaheadtime=rs("offdutyaheadtime")
kqtimephase=rs("kqtimephase")
kqconn.close
set kqconn=nothing
set rs=nothing
amcometimephase1=getnewtime(amcometime,-kqtimephase)
amcometimephase2=getnewtime(amcometime,kqtimephase)
amgotimephase1=getnewtime(amgotime,-kqtimephase)
amgotimephase2=getnewtime(amgotime,kqtimephase)
pmcometimephase1=getnewtime(pmcometime,-kqtimephase)
pmcometimephase2=getnewtime(pmcometime,kqtimephase)
pmgotimephase1=getnewtime(pmgotime,-kqtimephase)
pmgotimephase2=getnewtime(pmgotime,kqtimephase)
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="pragma" content="no-cache">
<title> 企業(yè)考勤系統(tǒng)</title>
<link rel="stylesheet" type="text/css" href="../css/css.css">
<script language="javascript">
var winhandle;
function handkq()
{
winhandle=window.open('handkq.asp','handkqwin','width=450,height=380,toolbar=no,scrollbars=no,resizable=0,menubar=no');
}
function closewin()
{
if (winhandle!=null && !winhandle.closed)
winhandle.close();
}
</script>
</head>
<body onunload="closewin();">
<br>
<p align="center"><b><font color="#FF0000" size="3"> </font></b></p>
<p align="center"><font color="#808080">企 業(yè) 考 勤 系 統(tǒng)</font></p>
<div align="center">
<center>
<table border="1" width="346" cellspacing="0" cellpadding="0" bordercolorlight="#808080" bordercolordark="#D4D0C8">
<tr>
<td height="21" width="448" align="center" valign="middle" colspan="2" bgcolor="#D4D0C8">
<center>
<img src="../images/time/space.gif" name="one"><img src="../images/time/space.gif" name="two"><img src="../images/time/dgon.gif" name="three"><img src="../images/time/space.gif" name="four"><img src="../images/time/space.gif" name="five"><img src="../images/time/space.gif" name="six">
</center>
<script language="javascript">
<!--//
img = new Array()
for(var i=0; i <= 14; i++) {
img[i] = new Image()
}
img[1].src = "../images/time/dg0.gif"
img[2].src = "../images/time/dg1.gif"
img[3].src = "../images/time/dg2.gif"
img[4].src = "../images/time/dg3.gif"
img[5].src = "../images/time/dg4.gif"
img[6].src = "../images/time/dg5.gif"
img[7].src = "../images/time/dg6.gif"
img[8].src = "../images/time/dg7.gif"
img[9].src = "../images/time/dg8.gif"
img[10].src = "../images/time/dg9.gif"
img[11].src = "../images/time/dgon.gif"
img[12].src = "../images/time/dgoff.gif"
img[13].src = "../images/time/dgam.gif"
img[14].src = "../images/time/dgpm.gif"
var base = "../images/time/dg"
var space = "../images/time/space.gif"
var per = false
function go() {
per = true
start()
}
function start() {
if(per == true) {
var now = new Date()
var hours = now.getHours();
var ampm = (hours < 12) ? "am" : "pm"
hours = (hours > 12) ? (hours - 12) + "" : hours + ""
hours = (hours == "0") ? "12" : hours
hours = (hours < 10) ? "0" + hours : hours + ""
var minutes = now.getMinutes();
minutes = (minutes < 10) ? "0" + minutes : minutes + ""
var seconds = now.getSeconds();
seconds = (seconds < 10) ? "0" + seconds : seconds + ""
document.one.src = (hours.charAt(0)=="0") ? space : add(hours.charAt(0))
document.two.src = add(hours.charAt(1))
//document.three.src = (now.getSeconds() % 2) ? add("on") : add("off")
document.four.src = add(minutes.charAt(0))
document.five.src = add(minutes.charAt(1))
document.six.src = add(ampm)
setTimeout("start()",1000)
}
}
secflag=1;
function secondgo()
{
document.three.src = (secflag % 2) ? add("on") : add("off")
if (secflag==1)
{ secflag=2;}
else
{ secflag=1;}
setTimeout("secondgo()",500);
}
function add(it) {
return base + it + ".gif"
}
go();
secondgo();
//-->
</script>
</td>
</tr>
<tr>
<td height="25" width="224" bgcolor="#D4D0C8">
上午上班時間:<font color="#0000ee"><%=cstr(amcometime)%></font><br>
考勤時間段:<font color="#0000ee"><%=cstr(amcometimephase1)&"-"&cstr(amcometimephase2)%></font>
</td>
<td height="25" width="224" bgcolor="#D4D0C8">
上午下班時間:<font color="#0000ee"><%=cstr(amgotime)%></font><br>
考勤時間段:<font color="#0000ee"><%=cstr(amgotimephase1)&"-"&cstr(amgotimephase2)%></font>
</td>
</tr>
<tr>
<td height="25" width="224" bgcolor="#D4D0C8">
下午上班時間:<font color="#0000ee"><%=cstr(pmcometime)%></font><br>
考勤時間段:<font color="#0000ee"><%=cstr(pmcometimephase1)&"-"&cstr(pmcometimephase2)%></font>
</td>
<td height="25" width="224" bgcolor="#D4D0C8">
下午下班時間:<font color="#0000ee"><%=cstr(pmgotime)%></font><br>
考勤時間段:<font color="#0000ee"><%=cstr(pmgotimephase1)&"-"&cstr(pmgotimephase2)%></font>
</td>
</tr>
<tr>
<td width="224" height="25" bgcolor="#D4D0C8">上班延遲時間:<font color="#0000ee"><%=cstr(comedelaytime)%>分鐘</font></td>
<td width="224" height="25" bgcolor="#D4D0C8">下班提前時間:<font color="#0000ee"><%=cstr(goaheadtime)%>分鐘</font></td>
</tr>
<tr>
<td colspan="2" width="384" height="25" bgcolor="#D4D0C8">
<p align="center">
<marquee align="middle" width="446" height="12" behavior="alternate">
<%
nowtime=time()
if amcometimephase1<=nowtime and amcometimephase2>=nowtime then
strvalue1="上午上班時間"
amorpmvalue="am"
goorcomevalue="come"
elseif amgotimephase1<=nowtime and amgotimephase2>=nowtime then
strvalue1="上午下班時間"
amorpmvalue="am"
goorcomevalue="go"
elseif pmcometimephase1<=nowtime and pmcometimephase2>=nowtime then
strvalue1="下午上班時間"
amorpmvalue="pm"
goorcomevalue="come"
elseif pmgotimephase1<=nowtime and pmgotimephase2>=nowtime then
amorpmvalue="pm"
strvalue1="下午下班時間"
goorcomevalue="go"
else
amorpmvalue=""
end if
response.write(strvalue)
%>
</marquee>
</td>
</tr>
</table>
</center>
</div>
<%
if nowtime<amcometimephase1 then
amorpmvalue=""
elseif nowtime>=amcometimephase1 and nowtime<amgotimephase1 then
strvalue1="上午上班時間"
amorpmvalue="am"
goorcomevalue="come"
elseif nowtime>=amgotimephase1 and nowtime<pmcometimephase1 then
strvalue1="上午下班時間"
amorpmvalue="am"
goorcomevalue="go"
elseif nowtime>=pmcometimephase1 and nowtime<pmgotimephase1 then
strvalue1="下午上班時間"
amorpmvalue="pm"
goorcomevalue="come"
elseif nowtime>=pmgotimephase1 then
strvalue1="下午下班時間"
amorpmvalue="pm"
goorcomevalue="go"
end if
if amorpmvalue<>"" then
set kqconn=openconn("kq")
set rs=server.createobject("adodb.recordset")
sql="select * from month"&cstr(month(date()))&" where day=#"&date()&"# and dept='"&oabusyuserdept&"' and amorpm='"&amorpmvalue&"'"
rs.open sql,kqconn,1
if not rs.eof and not rs.bof then
%>
<div align="center">
<center>
<table border="1" width="450" bordercolorlight="#808080" cellspacing="0" cellpadding="3" bordercolordark="#D4D0C8">
<tr>
<td width="55" height="20" bgcolor="#D4D0C8">用戶名</td>
<td width="90" height="20" bgcolor="#D4D0C8">部門</td>
<td width="133" height="20" bgcolor="#D4D0C8"><%=strvalue1%></td>
<td width="172" height="20" bgcolor="#D4D0C8">狀態(tài)</td>
</tr>
<%
do while not rs.eof
if goorcomevalue="come" then
if rs("comedate")<>#0:00:00# then
%>
<tr>
<td width="55" height="20"><%=server.htmlencode(rs("name"))%></td>
<td width="90" height="20"><%=server.htmlencode(rs("dept"))%></td>
<td width="129" height="20"><%=cstr(rs("comedate"))%></td>
<td width="168" height="20"><font color="#ee0000"><b>√</b></font><%=rs("explain1")%></td>
</tr>
<%
end if
else
if rs("leavedate")<>#0:00:00# then
%>
<tr>
<td width="55" height="20"><%=server.htmlencode(rs("name"))%></td>
<td width="90" height="20"><%=server.htmlencode(rs("dept"))%></td>
<td width="129" height="20"><%=cstr(rs("leavedate"))%></td>
<td width="168" height="20"><font color="#ee0000"><b>√</b></font><%=rs("explain2")%></td>
</tr>
<%
end if
end if
rs.movenext
loop
%>
</table>
</center>
</div>
<%
end if
kqconn.close
set rs=nothing
set kqconn=nothing
end if
%>
<p align="center">
<input type="button" value="開始考勤" onclick="handkq()">
<input type="button" value=" 關(guān)閉 " onclick="window.top.close();">
</p>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -