<% On Error Resume Next Response.Expires = 0 Dim objConn, strQuery Dim strConnection Dim tID, tPID, tKPIID, tUserID, tEmailCC, tTask Dim MailMessage Dim objCDOSYSMail, objCDOSYSCon if Session("Login") = "" then Response.Write "
" Response.Write "
You are not authorized to view this page.
" Response.Write "
" Response.Write "
" else %>
Hi <%= Session("Login") %>!

<%= Day(Date) & "/" & Month(Date) & "/" & Year(Date) & " " & Time%> |

Print |  | Back to Home |  | Logout

<% Set objConn = Server.CreateObject("ADODB.Connection") strConnection = "DSN=personahomes;Database=WebDB.mdb;" objConn.Open strConnection tID = GetNextID tPID = Request.Form("PID") tKPIID = Request.Form("KPIID") tUserID = Request.Form("UserID") tEmailCC = Request.Form("emailCC") tTask = Request.Form("task") If tTask = "" then Response.Write "
You have not input all the required fields. Please click on the Back button to try again.
" Response.Write "
" Response.Write "
" else if InStr(tTask,"'") > 0 then tRTask = Replace(tTask,"'","''") else tRTask = tTask end if strQuery = "INSERT INTO ProjectTask (ID, ProjectID, KPIID, UserID, CreatorID, EmailCC, Task, Status, CreateTime) VALUES (" & tID & ", " & tPID & ", " & tKPIID & ", " & tUserID & ", " & Session("LoginID") & ", '" & tEmailCC & "', '" & tRTask & "', 'Sent', #" & Month(Date) & "/" & Day(Date) & "/" & Year(Date) & " " & Time & "#)" objConn.Execute(strQuery) PstrQuery = "SELECT * FROM Project WHERE ID = " & tPID Set PobjRS = objConn.Execute(PstrQuery) KstrQuery = "SELECT * FROM KPI WHERE ID = " & tKPIID Set KobjRS = objConn.Execute(KstrQuery) UstrQuery = "SELECT * FROM Admin WHERE ID = " & tUserID Set UobjRS = objConn.Execute(UstrQuery) CstrQuery = "SELECT * FROM Admin WHERE ID = " & Session("LoginID") Set CobjRS = objConn.Execute(CstrQuery) tCC = CobjRS("Email") if tEmailCC <> "" then tCC = tCC & ";" & tEmailCC end if Set objCDOSYSMail = Server.CreateObject("CDO.Message") Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.tpg.com.au" objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "website18@tpg.com.au" objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "8quare181DMV" objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = false objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 objCDOSYSCon.Fields.Update MailMessage = "" MailMessage = MailMessage & "
" MailMessage = MailMessage & "
" MailMessage = MailMessage & "

" MailMessage = MailMessage & "
" MailMessage = MailMessage & "Project:" MailMessage = MailMessage & " | " & PobjRS("ID") & " - " & PobjRS("FirstName") & " " & PobjRS("LastName") & "" MailMessage = MailMessage & "
" MailMessage = MailMessage & "
" MailMessage = MailMessage & "Stage:" MailMessage = MailMessage & " | " & KobjRS("Name") & "" MailMessage = MailMessage & "
" MailMessage = MailMessage & "
" MailMessage = MailMessage & "Task:" MailMessage = MailMessage & " | " & tTask & "" MailMessage = MailMessage & "
" MailMessage = MailMessage & "
" MailMessage = MailMessage & "Created by:" MailMessage = MailMessage & " | " & CobjRS("FirstName") & " " & CobjRS("LastName") & "" MailMessage = MailMessage & "
" MailMessage = MailMessage & "
" MailMessage = MailMessage & "Assigned to:" MailMessage = MailMessage & " | " & UobjRS("FirstName") & " " & UobjRS("LastName") & "" MailMessage = MailMessage & "
" MailMessage = MailMessage & "

" MailMessage = MailMessage & "
" MailMessage = MailMessage & "
" Set objCDOSYSMail.Configuration = objCDOSYSCon objCDOSYSMail.From = CobjRS("Email") objCDOSYSMail.To = UobjRS("Email") objCDOSYSMail.CC = tCC objCDOSYSMail.Subject = "New Task - " & PobjRS("ID") & " - " & KobjRS("Name") objCDOSYSMail.HTMLBody = MailMessage objCDOSYSMail.Send Response.Write "
The task has been sent successfully.
" Response.Write "
" Response.Write "
" Set objCDOSYSMail = Nothing Set objCDOSYSCon = Nothing end if objConn.close Set objConn = Nothing end if %>