⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kaoqin.asp

📁 网络办公系统源码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../config.asp"-->
<!--#include file="../checklogin.asp"-->
<%
'----------------------------------------------------------------
'得到考勤时间设置18:28

'nowtime=FORMATDATETIME(now,vbShortTime)
nowtime=time
nowtime1=date()
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
t1=datediff("n",nowtime,am_time)
t2=datediff("n",p_time,nowtime)
'判断当天有无考勤记录
sql1="select count(id) as num,kq_pm from oa_kq where kq_rq='"&nowtime1&"' and uid="&session("adminid")&" GROUP BY kq_pm"
set rs=conn.execute(sql1)
if not rs.eof then
n=rs(0)
kq_pm=rs(1)
else

end if
rs.close
set rs=nothing
'---------------------------------------------------------------------
Submit=trim(request.Form("Submit"))
select case Submit
		case "上班考勤"
			if n=0 then'当天还没考勤
				ksql="insert into oa_kq(uid,kq_rq,kq_am,companyid) values("&session("adminid")&",'"&nowtime1&"','"&nowtime&"',"&session("companyid")&")"
			conn.execute(ksql)
				Call Message ( "您本次考勤成功。\n时间:"&nowtime&"","back")
				call endexit()

			else
				call Message("您今天上午已经考勤了!","back")
				call endexit()
			end if
		case "下班考勤"
			if trim(kq_pm)<>null or trim(kq_pm)<>"" then
			    Call Message ( "您下午已经考勤了","back")
				call endexit()
			end if
				ksql="update oa_kq set kq_pm='"&time()&"' where kq_rq='"&nowtime1&"' and uid="&session("adminid")
				conn.execute(ksql)
				Call Message ( "您本次考勤成功。\n时间:"&time&"","back")
				call endexit()
end select		


%>
<!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>
<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; }
-->
</style>
</head>
<body>
<form name="form1" method="post" action="kaoqin.asp">
<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2">
  <tr bgcolor="#CC6633">
    <td width="85" height="25" colspan="5" align="center"><span class="style1"><strong>个人考勤</strong></span></td>
    </tr>
  <tr>
    <td colspan="5" align="center">&nbsp;</td>
  </tr>
  <tr>
    <td height="25" colspan="5" align="center" class="table2"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="28%" height="150" align="center"><img src="../img/clock.gif" width="119" height="120"><br>
            <br>
      现在时间:<%=time()%></td>
        <td width="72%" align="left"><table width="55%"  border="0" cellspacing="2" cellpadding="0">
            <tr>
              <td height="25" colspan="2">考勤只设上午上班考勤和下午下班考勤两个时间段</td>
            </tr>
            <tr>
              <td height="25" colspan="2"> 上午上班登记<%=a_time%></td>
            </tr>
            <tr>
              <td height="25" colspan="2"> 午下班登记<%=p_time%> </td>
            </tr>
            <tr align="center">
              <td width="42%" height="25" align="left"><input name="Submit" type="submit" class="bon" value="上班考勤"></td>
              <td width="58%" height="25" align="left"><%if t2<0 then%>
                  <input name="Submit2" type="submit" disabled="true" class="bon" id="Submit" value="未到下班考勤时间">
                  <%else%>
                  <input name="Submit2" type="submit" class="bon" id="Submit" value="下班考勤">
                  <%end if%></td>
            </tr>
            <tr align="center">
              <td height="25" align="left"><input name="Submit2" type="button" class="bon" value="外出登记" onClick="window.location.href='oa_dengji.asp?act=out'"></td>
              <td height="25" align="left"><input name="Submit3" type="button" class="bon" value="请假登记" onClick="window.location.href='oa_dengji.asp?act=qj'"></td>
            </tr>
            <tr align="center">
              <td height="25" align="left"><input name="Submit22" type="button" class="bon" value="出差登记" onClick="window.location.href='oa_dengji.asp?act=cc'"></td>
              <td height="25" align="left"><input name="Submit23" type="button" class="bon" value="个人考勤查询" onClick="window.location.href='p_kqtj.asp'"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
    </tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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