📄 editloghandle.asp
字号:
<%@ LANGUAGE = VBScript %><% Option Explicit %>
<!-- #include virtual="include/DataEnvi.asp" -->
<%
if session("AccountID")="" then
%>
<script language=javascript>
alert("因登录时间过长,会话失效,请退出重新登陆!")
</script>
<%
Response.End
end if
Sub Main()
Dim intID '计划ID
Dim strTitle '计划名称
Dim strPlace '计划地点
Dim strStartDate '开始时间
Dim strEndDate '结束时间
Dim strRemark '备注
Dim strIsRemind '是否提醒
Dim strRemind '提前多少提醒
intID = Request.Form("_ID")
strTitle = Request.Form("_Title")
strPlace = Request.Form("_Place")
strStartDate = Request.Form("_StartDate")
strEndDate = Request.Form("_EndDate")
strRemark = Request.Form("_Remark")
strRemind = Request.Form("_Remind")
'Response.Write Request.Form("_chkRemind")
if Request.Form("_chkRemind") = "on" then
strIsRemind = false
else
strIsRemind = true
end if
Dim strMsg '返回消息
If intID <> "" Then
strMsg = "修改"
Else
strMsg = "新增"
End If
If Request.Form.Count > 0 Then
Dim ObjDB
Dim ObjRS
Dim StrSQL
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDB ObjDB
Set ObjRS = Server.CreateObject("ADODB.Recordset")
StrSQL = "Select * From t_OA_Private_Log where IsForLeader=0 And AccountID= " & Session("AccountID") & "And (StartDate > '" & strStartDate & "' and StartDate < '" & strEndDate & "' ) or (EndDate < '"&strStartDate&"' and EndDate > '"&strEndDate&"')"
Set ObjRS = ObjDB.Execute(StrSQL)
If Not ObjRS.EOF then
%>
<script language=javascript>
alert("时间段冲突")
window.close()
</script>
<%
Response.End
elseIf intID="" then
ObjRS.Close
StrSQL = "Select * From t_OA_Private_Log Where ID = 0 "
ObjRS.Open StrSQL,ObjDB,2,2
ObjRS.AddNew
ObjRS("AccountID") = Session("AccountID")
ObjRS("Title") = strTitle
ObjRS("Place") = strPlace
ObjRS("StartDate") = strStartDate
ObjRS("EndDate") = strEndDate
ObjRS("Remark") = strRemark
ObjRS("Remind") = strRemind
ObjRS("IsRemind") = strIsRemind
ObjRS("IsForLeader") = 0
ObjRS.Update
strMsg = strMsg & "成功"
Else
ObjRS.Close
StrSQL = "Select * From t_OA_Private_Log Where ID =" & intID
ObjRS.Open StrSQL,ObjDB,2,2
ObjRS("Title") = strTitle
ObjRS("Place") = strPlace
ObjRS("StartDate") = strStartDate
ObjRS("EndDate") = strEndDate
ObjRS("Remark") = strRemark
ObjRS("Remind") = strRemind
ObjRS("IsRemind") = strIsRemind
ObjRS.Update
strMsg = strMsg & "成功"
Set ObjRS = Nothing
ObjDB.Close
Set ObjDB = Nothing
End If
End If
%>
<HTML>
<BODY bgcolor=#8cbde7>
<center>
<input type="hidden" name="message" value="<%=strMsg%>">
<script language="javascript">
alert( message.value);
window.opener.document.location = window.opener.document.location;
window.close();
</script>
</BODY>
</HTML>
<%
End Sub
Function GetRemindTime(strRemind, strDate)
Dim strRemindTime
Dim strInterval
Dim strTimeType
strTimeType = LCase(Left(strRemind, 1))
If InStr(1, "nhdw", strTimeType, 1) = 0 Then
strRemindTime = Now()
Else
If LCase(strTimeType) = "w" Then strTimeType = "ww"
strInterval = Mid(strRemind, 2)
If IsNumeric(strInterval) Then
strRemindTime = DateAdd(strTimeType, 0 - clng(strInterval), strDate)
Else
strRemindTime = Now()
End If
End If
GetRemindTime = Year(strRemindTime) & "/" & Month(strRemindTime) & "/" & Day(strRemindTime) & _
" " & DatePart("h", strRemindTime) & ":" & DatePart("n", strRemindTime) & ":" & DatePart("s", strRemindTime)
End Function
Call Main
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -