%@ Language=VBScript%> <% Set rs = Server.CreateObject("ADODB.Recordset") Set rs1 = Server.CreateObject("ADODB.Recordset") Set rs2 = Server.CreateObject("ADODB.Recordset") Set rs3 = Server.CreateObject("ADODB.Recordset") Set cn = Server.CreateObject("ADODB.Connection") cn.Open Application("ConnectionString") If Request("actionItem") = "Submit" Then For Each Item In Request.Form If Left(Item, 3) = "hdn" Then iPos = Instr(1, Item, ".") SPID = Request(Item) SID = Right(Item, Len(Item) - iPos) chkKey = Right(Item, (Len(Item) - 3)) If Request(chkkey) = "on" And SPID = 0 Then SQL = "INSERT INTO SupplyProvider(SupplyID, UserprofileID) VALUES(" SQL = SQL & SID & ", " SQL = SQL & Session("UPID") & ")" cn.Execute(SQL) ElseIf Request(chkkey) <> "on" And SPID > 0 Then SQL = "DELETE FROM SupplyProvider WHERE SupplyProviderID = " & SPID cn.Execute(SQL) End If Else If Instr(1, Item, "NEWSUPPLYID") > 0 Then iPos = Instr(1, Item, ".") SCID = Right(Item, Len(Item) - iPos) If Request(Item) = "on" And Len(Trim(Request("NEWSUPPLYTEXT." & SCID))) > 0 Then MsgBody = "" SQL = "SELECT " SQL = SQL & "Userprofile.Fullname, " SQL = SQL & "Userprofile.CompanyName, " SQL = SQL & "Userprofile.Email, " SQL = SQL & "Userprofile.Phone " SQL = SQL & "FROM " SQL = SQL & "Userprofile " SQL = SQL & "WHERE " SQL = SQL & "Userprofile.SupplierID = " & Session("UPID") Set rs = cn.Execute(SQL) If Not (rs Is Nothing) Then If Not rs.EOF Then rs.MoveFirst MsgBody = "Name: " & rs(0) & vbCrLf MsgBody = MsgBody & "Company: " & rs(1) & vbCrLf MsgBody = MsgBody & "Email: " & rs(2) & vbCrLf MsgBody = MsgBody & "Phone: " & rs(3) & vbCrLf MsgBody = MsgBody & "New Supply Item Idea" & vbCrLf MsgBody = MsgBody & Request("NEWSUPPLYTEXT." & SCID) Set SendMail = Server.CreateObject("Persits.MailSender") SendMail.Host = Application("EmailServer") SendMail.From = Application("ContactEmail") SendMail.FromName = Application("ContactName") SendMail.Subject = "New buyCASTINGS.Com Supplier Category Suggestion" SendMail.Body = MsgBody SendMail.AddAddress "rdzugan@emtec.org", "Robert Dzugan" SendMail.AddAddress "evans@commkey.net", "Andy Evans" SendMail.Send If Err <> 0 Then Else End If End If End If End If End If End If Next If Request("RETURN") = "YES" Then Response.Redirect("Suppliers.asp") Else Response.Redirect("TermsConditions_Suppliers.asp") End If End If %>