View Single Post
  #4 (permalink)  
Old 11-19-09, 12:02
mind_grapes mind_grapes is offline
Registered User
 
Join Date: Jun 2009
Location: Midlands
Posts: 133
part 3 0f 3
Code:
ELSE
			IF action = "confirmsubmit" THEN
				IF isNumeric(confidentity) THEN
				 
					postedhtml=request.Form("posthtml")
				
					str = "UPDATE pgm_webformresponses SET wfr_status = 1, wfr_html_response='" & Base64Encode(endecrypt(postedhtml,password)) & "' WHERE wfr_id = '" & confidentity & "' "
					CON.Execute(str)
					
					str = "SELECT DISTINCT we_email_address, wf_name " &_ 
						  "FROM pgm_webform_email_recipients " &_ 
						  "INNER JOIN pgm_webforms ON wf_id=we_form_id " &_ 
						  "INNER JOIN superusers ON su_email_address=we_email_address " &_ 
						  "INNER JOIN pgm_webform_superuser_admin_roles ON wsar_su_id=su_id " &_
						  "INNER JOIN pgm_webform_admin_roles ON war_role_id=wsar_role_id " &_ 
						  "WHERE we_form_id= '" & formid & "' AND we_status=1 AND wsar_status=1 "
						  
    						  
					SET RS = con.Execute(str)
					
					IF NOT RS.EOF THEN
					
						tostr = RS("we_email_address")
						thesubject = RS("wf_name") & ": " & sentby & " (" & FormatdateTime(NOW(),2) & ") "
						
						WHILE NOT RS.EOF
						
							tostr = tostr & "," & RS("we_email_address")
							
						RS.MoveNext
						WEND
						
						bodyHTML = "<html><head><link rel=""stylesheet"" type=""text/css"" href=""http://kbserver/aform/v3/formmanager.css""></link></head><body>" &_ 
								   "<p>From: <b>" & sentby & "</b><br><a href=""http://kbserver/aform/V3/admin.asp"" style=""text-decoration:underline;"">Click Here for full details</a></p> " &_ 
								   postedhtml &_
								   "</body></html>"
						
						Set objMessage = CreateObject("CDO.Message") 
						objMessage.Subject = thesubject  
						objMessage.From = "robot@kbserver" 
						objMessage.To = tostr ' "dsmith@work.com" "pmartin@work.com" '
						'objMessage.TextBody = postedhtml 
						objMessage.HTMLBody = Replace(bodyHTML,"/images/","http://kbserver/images/")
						objMessage.Send
						SET objMessage = Nothing
					
					END IF
					
					messageStr = "<div class=""ok""><h1 style=""font-size: 4em;"">Done</h1><b>Thanks your form has been submitted.</b></div>" & vbcrlf		
					str = "SELECT wf_printable AS pr FROM pgm_webforms WHERE wf_id = '" & formid & "' "
					
					SET RS=con.execute(str)
					IF NOT RS.EOF THEN isPrintable = RS("pr")
					RS.CLOSE
					SET RS = Nothing
					
				END IF
			END IF
		End IF
		
		
	END IF
	
	
ELSE ' Not Logged In
	If Trim(Request("in")) = "1" THEN 
		messageStr = "<div class=""confirm"">You have been logged out. This is a security feature after 12 minutes of inactivity.</div>" & vbcrlf
	END IF 
	
	nav = "<form name=""login"" action=""" & Request.ServerVariables("SCRIPT_NAME") & """ method=""post"">" & vbcrlf
	nav = nav & "	<table class=""adminform"" width=""100%"" cellspacing=""0"">" & vbcrlf
	nav = nav & "		<tr class=""h"">" & vbcrlf
	nav = nav & "				<td colspan=""2""><b>Stores</b> - Swipe your card: </td>" & vbcrlf
	nav = nav & "			</tr>" & vbcrlf
	nav = nav & "			<tr class=""hr"">" & vbcrlf
	nav = nav & "				<td colspan=""2""><input type=""password"" name=""swipe"" style=""width: 60%"" />" & vbcrlf
	nav = nav & "				<input name=""submit"" type=""submit"" value=""Go"" /></td>" & vbcrlf
	nav = nav & "			</tr>" & vbcrlf
	nav = nav & "		</table>" & vbcrlf
	nav = nav & "		<table width=""100%"" class=""adminform"" cellspacing=""0"" style=""margin-top: 20px;"">" & vbcrlf
	nav = nav & "			<tr class=""h"">" & vbcrlf
	nav = nav & "				<td colspan=""2"" ><b>Head Office</b> - Login </td>" & vbcrlf
	nav = nav & "				</tr>" & vbcrlf
	nav = nav & "			<tr class=""hr"">" & vbcrlf
	nav = nav & "				<td width=""200"">Username:</td>" & vbcrlf
	nav = nav & "				<td><input name=""username"" type=""text"" style=""width: 25%;"" /></td>" & vbcrlf
	nav = nav & "			</tr>" & vbcrlf
	nav = nav & "			<tr class=""hr"">" & vbcrlf
	nav = nav & "				<td width=""200"">Password</td>" & vbcrlf
	nav = nav & "				<td><input type=""password"" name=""pass"" style=""width: 25%"" /> <input type=""submit"" value=""submit"" /></td>" & vbcrlf
	nav = nav & "			</tr>" & vbcrlf
	nav = nav & "		</table>" & vbcrlf
	nav = nav & "		<input type=""hidden"" name=""action"" value=""login"" />" & vbcrlf
	nav = nav & "	</form>" & vbcrlf


END IF

con.close
SET con = nothing
This I believe is everything, anything else please say. really need the help guys,

Kind regards
MG
Reply With Quote