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

📄 editloghandle.asp

📁 功能齐全的oa系统
💻 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")
	strIsRemind		= Request.Form("_chkRemind")
	strRemind		= Request.Form("_Remind")
	
	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=1 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("IsForLeader") = 1
		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.Update
		strMsg = strMsg & "成功"
		Set ObjRS = Nothing
		ObjDB.Close
		Set ObjDB = Nothing
	End If
	End If

	%>

	<HTML>
	<BODY bgcolor=#cdc0d4>
	<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 + -