<%@ 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 %> Submit Supplies capabilities
"> "> <% SQL = "SELECT SupplyCategoryID, SupplyCategoryDescription " SQL = SQL & "FROM SupplyCategory " SQL = SQL & "ORDER BY SupplyCategoryDescription" Set rs = cn.Execute(SQL) If Not (rs Is Nothing) Then If Not rs.EOF Then rs.MoveFirst While Not rs.EOF %> <% SQL = "SELECT " SQL = SQL & "SupplyProvider.SupplyProviderID, " SQL = SQL & "Supply.SupplyID, " SQL = SQL & "Supply.SupplyDescription " SQL = SQL & "FROM " SQL = SQL & "SupplyProvider, " SQL = SQL & "Supply " SQL = SQL & "WHERE " SQL = SQL & "SupplyProvider.SupplyID =* Supply.SupplyID AND " SQL = SQL & "Supply.SupplyDescription IS NOT NULL AND " SQL = SQL & "Supply.SupplyDescription <> '' AND " SQL = SQL & "Supply.IsLocked <> 'Y' AND " SQL = SQL & "SupplyProvider.UserprofileID = " & Session("UPID") & " AND " SQL = SQL & "Supply.SupplycategoryID = " & rs(0) & " " SQL = SQL & "ORDER BY SupplyDescription" Set rs1 = cn.Execute(SQL) If Not (rs1 Is Nothing) Then If Not rs1.EOF Then rs1.MoveFirst While Not rs1.EOF If IsNull(rs1(0)) Then %> <% Else %> <% End If rs1.MoveNext Wend End If End If %> <% rs.MoveNext Wend End If End If %>

Supply Capabilities:

<%= rs(1) %>
  > <%= rs1(2) %> value="0">
  > <%= rs1(2) %> value="<%= rs1(0) %>">
  > Suggest New <%= rs(1) %> Item >

 
<% rs.Close Set rs = Nothing rs1.Close Set rs1 = Nothing cn.Close Set cn = Nothing %>