<% 'on error resume next dist_id = request.querystring("d") business_name = CheckString(Request.Form("business_name")) contact_name = CheckString(Request.Form("contact_name")) email = CheckString(Request.Form("email")) addr1 = CheckString(Request.Form("addr1")) addr2 = CheckString(Request.Form("addr2")) city = CheckString(Request.Form("city")) state = CheckString(Request.Form("state")) zip = CheckString(Request.Form("zip")) phone = CheckString(Request.Form("phone")) fax = CheckString(Request.Form("fax")) username = CheckString(Request.Form("username")) password = CheckString(Request.Form("password")) if request.form("submit") = "Submit" then sql = "insert into distributor (business_name) values('" & business_name & "')" conn.Execute(Sql) sql = "select max(dist_id) from distributor" set rs = conn.Execute(sql) dist_id = rs(0) blnUpdate = true create_new = 1 access = 1 elseif request.form("submit") = "Update" then blnUpdate = true create_new = CheckBit(Request.Form("create_new")) access = CheckBit(Request.Form("access")) end if if blnUpdate then sql = "update distributor set business_name = '" & business_name & "',contact_name = '" & contact_name & "',email = '" & email & "',addr1 = '" & addr1 & "',addr2 = '" & addr2 & "',city = '" & city & "',state = '" & state & "',zip = '" & zip & "',phone = '" & phone & "',fax = '" & fax & "',username = '" & username & "',password = '" & password & "',create_new = " & create_new & ",access = " & access & " where dist_id = " & dist_id 'd sql conn.Execute(sql) end if if request.form("submit") = "Approve" then sql = "update distributor set approved = 1,username = '" & username & "' where dist_id = " & dist_id conn.Execute(sql) msg = "Your registration at Lynx Power Systems has been approved." & vbcrlf msg = msg & " " & vbcrlf msg = msg & "Your username is: " & username & vbcrlf & vbcrlf msg = msg & "Your password is: " & password & vbcrlf msg = msg & " " & vbcrlf msg = msg & "You may login at http://www.lynxpower.com/warranty/default.asp" & vbcrlf subject = "Registration at Lynx Power Systems" SendMail email,subject, msg end if if dist_id = "" then dist_id = 0 sql = "select * from distributor where dist_id = " & dist_id set rs = conn.Execute(sql) on error resume next if rs("username") = "" then username = "0000" & CStr(dist_id) username = "U" & Right(username,4) else username = rs("username") end if if rs.eof then subCap = "Submit" else subCap = "Update" end if %>

Distributor List

Distributor List

Company Name: " size=50>
Contact Name: " size=50>
Email: " size=50>
Address: " size=50>
Address: " size=50>
City, St. Zip: " size=30> "> " size=12>
Phone: ">
Fax: ">
Username:
Password: ">
Permissions: >Create New       >Allow Access
<%if subCap = "Update" then%> <%if rs("approved") = 0 then%> <%end if%> <%end if%>