📄 settime.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="form1" name="form1" method="post" action="settime.asp?action=Chksettime">
<table width="400" border="1" align="center">
<tr>
<td width="150"><div align="right">开始时间:</div></td>
<td width="250">
<label>
<input type="text" name="DutyTimeS" />
</label> </td>
</tr>
<tr>
<td><div align="right">结束时间:</div></td>
<td> <label>
<input type="text" name="DutyTimeE" />
</label> </td>
</tr>
<tr>
<td><div align="right">工作时间类型:</div></td>
<td height="20" ><select name="DutyType" id="DutyType" onchange="SelectUserSub()">
<option value="0"
<%if DutyType="0" then%>selected
<%end if%>>工作时间</option>
<option value="1"
<%if DutyType="1" then%>selected
<%end if%>>假期</option>
</select></td>
</tr>
<tr>
<td colspan="5" align="center"> <label>
<input type="submit" name="Submit" value="设置" />
</label> </td>
</tr>
</table>
</form>
<%
If Request("action")="Chksettime" Then
Call Chksettime()
End If
%>
<%
Sub Chksettime()
DutyType=trim(Request("DutyType")+"")
if len(DutyType)<1 then
DutyType="0"
end if
seltype=trim(Request.QueryString("seltype")+"")
DutyId=trim(Request("DutyId")+"")
if len(seltype)<1 then
DutyTimeS=trim(Request("DutyTimeS")+"")
DutyTimeE=trim(Request("DutyTimeE")+"")
if len(DutyTimeS)<1 then
Response.Write "<script>alert('开始时间必须输入!');history.go(-1);</script>"
Response.End
end if
if len(DutyTimeE)<1 then
Response.Write "<script>alert('结束时间必须输入!');history.go(-1);</script>"
Response.End
end if
Set rs=Server.CreateObject("ADODB.Recordset")
strsql="select*from settime where duty_type='"+DutyType+"'"
strsql=strsql+"order by offduty_time desc"
rs.Open strsql,con,3,3
if len(DutyId)<1 or DutyType="1"then
strsql="insert into settime"
strsql=strsql+"(duty_type,onduty_time,offduty_time)"
strsql=strsql+"values('"+DutyType+"',#"+DutyTimeS+"#"
strsql=strsql+",#"+DutyTimeE+"#)"
else
strsql="update settime set onduty_time=#"+DutyTimeS+"#"
strsql=strsql+",offduty_time=#"+DutyTimeE+"#"
strsql=strsql+"where keyid="+DutyId
end if
con.Execute strsql
Response.Write "<script>alert('设置工作时间成功!');history.go(-1);</script>"
Response.End
end if
end Sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -