?? 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 + -