% IF REQUEST("createticket")="go" THEN StrCTErr="None" str_subject=sanitizeRequest("subject","form") IF str_subject <> "" AND len(str_subject) < 200 THEN 'ok ELSE StrCTErr="Subject is required" END IF str_content= sanitizeRequest("content","form") IF str_content <> "" AND len(str_content) < 1000 THEN 'ok ELSE StrCTErr="Description is required (upto 1000 characters allowed)" END IF 'ticketDate=year(now())&"-"&month(now())&"-"&day(now())&":"&hour(now())&":"&minute(now())&":00" IF StrCTErr <> "None" THEN 'print the errors response.write("") ELSE dbCBK.Execute("INSERT into cbk_support_tickets (`schoolID`,`parentID`,`status`,`dateCREATED`,`whoCREATED`,`subject`,`content`) VALUES('"&str_u_id&"','"&str_parent_id&"','new',NOW(),'parent','"&str_subject&"','"&str_full_u_name&" said: "&str_content&"')") 'get the new ticket ID pfSQL = "SELECT @@IDENTITY AS 'Identity'" Set rsSelectResultpf = dbCBK.Execute( pfSQL ) If rsSelectResultpf.EOF Then StrError = "An error occurred, please try again" & vbCrLf nTID="" Else StrError = "None" nTID=CInt(rsSelectResultpf(0).value) End If 'get the school support email address strEM="none" SET rsE = dbCBK.Execute("SELECT `email`, `contactname` from cbk_schools WHERE schoolID='"&str_u_id&"' limit 1") IF rsE.EOF THEN strEM="none" END IF DO WHILE NOT rsE.EOF strEM=rsE("email") strCN=rsE("contactname") rsE.MoveNext loop rsE.Close SET rsE = Nothing 'build email IF strEM <> "" THEN body="
" body=body & "