📄 attendance.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>员工考勤界面</title>
</head>
<!--#include file="connection.asp"-->
<body>
<form id="form2" name="form2" method="post" action="attendance.asp?action=Chkattendance">
<table width="356" border="1" align="center">
<tr>
<td width="125" align="right">员工姓名:</td>
<td width="215"><label>
<input type="text" name="Employee" value="<%=session("name")%>" readonly>
</label> </td>
</tr>
<tr>
<td align="right">上班时间:</td>
<td><input type="text" name="DutyTimeS" /></td>
</tr>
<tr>
<td align="right">下班时间:</td>
<td><input type="text" name="DutyTimeE" /></td>
</tr>
<tr>
<td colspan="2" align="right">
<label>
<input type="submit" name="Submit" value="考勤" />
</label>
</td>
</tr>
</table>
</form>
<%
If Request("action")="Chkattendance" Then
Call Chkattendance()
End If
%>
<%
Sub Chkattendance()
DutyTimeS=trim(Request("DutyTimeS")+"")
DutyTimeE=trim(Request("DutyTimeE")+"")
Employee=trim(Request("Employee")+"")
if len(DutyTimeS)<1 then
Response.Write "<script>alert('上班时间必须输入!');history.go(-1);</script>"
elseif len(DutyTimeE)<1 then
Response.Write "<script>alert('下班时间必须输入!');history.go(-1);</script>"
else
nowdate=DateValue(now)
employeeid=request("employeeid")
Set on_rs=Server.CreateObject("ADODB.Recordset")
strsql="select * from attendance "
strsql =strsql + " where DateValue(onduty_date)=#"&nowdate&"#"
on_rs.Open strsql,con,1,3
if not on_rs.EOF then
Response.Write "<script>alert('员工当日已增加了考勤!');history.go(-1);</script>"
else
on_rs.addnew
on_rs.Fields ("employeeid") = session("employeeid")
on_rs("onduty_date")=trim(Request("DutyTimeS")+"")
on_rs("offduty_date")=trim(Request("DutyTimeE")+"")
on_rs.update
Response.Write "<script>alert('考勤成功!');history.go(-1);</script>"
end if
on_rs.Close
end if
end Sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -