<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnSiteData.Asp" -->
<!--#include file="../CheckAdmin.Asp"-->
<%
ID = request.QueryString("ID")
Result = request.QueryString("Result")
strReferer = Request.ServerVariables("http_referer")
If Result = "Modify" Then
	    Dim rs,sql
		Taskframe=trim(request.Form("Task_frame"))
		select case Taskframe
		      case "today"
			       TEtime=date()&" 23:59:59"
			  case "tomorrow"
			       TEtime=DateAdd("d",+1,Date())&" 23:59:59"
			  case "aftertomorrow"
			       TEtime=DateAdd("d",+2,Date())&" 23:59:59"
			  case "this_week"
			       TEtime=dateadd("d",date,7-weekday(date))&" 23:59:59"
			  case "next_week"
			       TEtime=DateAdd("d",+7,dateadd("d",date,7-weekday(date)))&" 23:59:59"
			  case "later"
			  case "calendar"
			       TEtime=trim(Request.Form("d241"))
			  case else
		end select
		Set rs = server.CreateObject("adodb.recordset")
	    sql = "select * from Zqj_Tasks"
        rs.Open sql, conn, 1, 3
        rs.addnew           
        rs("Demo")=Request.Form("TDemo")
		rs("TasksSortID")=Request.Form("TasksSort")
		rs("MemName")=session("UserName")
		if trim(Request.Form("TKehuID"))="" then
			rs("TKehuID")=0
		else
			rs("TKehuID")=trim(Request.Form("TKehuID"))
		end if
		if trim(Request.Form("TChancesID"))="" then
			 rs("TChancesID")=0
		else
			 rs("TChancesID")=Request.Form("TChancesID")
		end if
		rs("Etime")=TEtime
		rs("Task_frame")=trim(request.Form("Task_frame"))
        rs.update
        rs.Close
        Set rs = Nothing
End If
response.Redirect strReferer
%>