%@ Language=VBScript %>
<%Response.Buffer=True%>
<%
OpenConnection1
Set rs=Server.CreateObject("ADODB.Recordset")
If Request.QueryString("UI")<>"" then
ProductID=cint(Request.QueryString("UI"))
qstring="?UI=" & ProductID
Sel="SELECT txtProduct,nCatID FROM UProducts WHERE ProductID=" & ProductID
rs.Open Sel,DB,1,3
If rs.EOF then
rs.Close
Response.Redirect("usedequip.asp")
End If
txtProduct="Used Equipment:
" & rs("txtProduct")&""
CatID=rs("nCatID")
rs.Close
p="ui"
href="up_details.asp?PID=" & ProductID & "&C=" & CatID
ElseIf Request.QueryString("NI")<>"" then
ProductID=cint(Request.QueryString("NI"))
qstring="?NI=" & ProductID
Sel="SELECT txtProduct,nCatID FROM Products WHERE ProductID=" & ProductID
rs.Open Sel,DB,1,3
If rs.EOF then
rs.Close
Response.Redirect("newequip.asp")
End If
txtProduct="New Equipment:
" & rs("txtProduct")&""
CatID=rs("nCatID")
rs.Close
p="ni"
href="np_details.asp?PID=" & ProductID & "&C=" & CatID
ElseIf Request.QueryString("SI")<>"" then
SupplyID=cint(Request.QueryString("SI"))
qstring="?SI=" & SupplyID
Sel="SELECT txtSupply,txtItemNumber,nCatID FROM Supplies WHERE SupplyID=" & SupplyID
rs.Open Sel,DB,1,3
If rs.EOF then
rs.Close
Response.Redirect("supply_list.asp")
End If
txtProduct="Supply:
" & rs("txtSupply") & "
Item Number: " & rs("txtItemNumber") & ""
CatID=rs("nCatID")
rs.Close
p="si"
href="supply_details.asp?SID=" & SupplyID & "&C=" & CatID
ElseIf Request.QueryString("PTI")<>"" then
PartID=cint(Request.QueryString("PTI"))
qstring="?PTI=" & PartID
Sel="SELECT txtPart,txtItemNumber FROM Parts WHERE PartID=" & PartID
rs.Open Sel,DB,1,3
If rs.EOF then
rs.Close
Response.Redirect("parts.asp")
End If
txtProduct="Part:
" & rs("txtPart") & "
Item Number: " & rs("txtItemNumber") & ""
rs.Close
p="PTI"
href="parts.asp"
End If
fnc="#000000"
lnc="#000000"
ec="#000000"
pc="#000000"
nec="#000000"
nc="#000000"
ac="#000000"
cc="#000000"
zc="#000000"
ctc="#000000"
sac="#000000"
scc="#000000"
szc="#000000"
sctc="#000000"
error="The following required fields have been left blank:
"
ferror="Format errors:
"
If Request.Form("hidSave")<>"" then
p=Request.Form("pointer")
txtProduct=dbReplace(Trim(Request.Form("hidSave")))
txtFname=dbReplace(Trim(Request.Form("txtFname")))
txtLname=dbReplace(Trim(Request.Form("txtLname")))
txtEmail=Trim(Request.Form("txtEmail"))
txtPhone=dbReplace(Trim(Request.Form("txtPhone")))
txtFax=dbReplace(Trim(Request.Form("txtFax")))
txtCompany=dbReplace(Trim(Request.Form("txtCompany")))
txtTitle=dbReplace(Trim(Request.Form("txtTitle")))
txtBusiness=dbReplace(Trim(Request.Form("txtBusiness")))
nEmployees=dbReplace(Trim(Request.Form("nEmployees")))
txtURL=dbReplace(Trim(Request.Form("txtURL")))
txtComments=dbReplace(Trim(Request.Form("txtComments")))
If txtFName="" then
error=error & "First Name
"
fnc="#FF0000"
End If
If txtLName="" then
error=error & "Last Name
"
lnc="#FF0000"
End If
If txtEmail<>"" then
If IsValidEmail(txtEmail)=False then
ferror=ferror & "The Email address entered is not valid - please check for accuracy.
(Format example: me@here.com)
"
ec="#FF0000"
End If
Else
error=error & "Email Address
"
ec="#FF0000"
End If
If nEmployees<>"" then
If Not IsNumeric(nEmployees) then
ferror=ferror & "The value entered for Number Of Employees must be numeric.
"
nec="#FF0000"
End If
End If
If error="The following required fields have been left blank:
" And ferror="Format errors:
" then
Message="The following inquiry was sent " & formatdatetime(Date,1) & ".
"
If txtPhone="" then txtPhone="Not Specified"
If txtFax="" then txtFax="Not Specified"
Message=Message & "Sender: " & txtFname & " " & txtLname & "
"
Message=Message & "Email: " & txtEmail & "
"
Message=Message & "Phone: " & txtPhone & "
"
Message=Message & "Fax: " & txtFax & "
"
If txtCompany<>"" Or txtTitle<>"" Or txtBusiness<>"" Or nEmployees<>"" Or txtURL<>"" then
If txtCompany="" then txtCompany="Not Specified"
If txtTitle="" then txtTitle="Not Specified"
If txtBusiness="" then txtBusiness="Not Specified"
If nEmployees="" then nEmployees="Not Specified"
If txtURL="" then txtURL="Not Specified"
Message=Message & "Corporate Information
Sender's Title: " & txtTitle & "
"
Message=Message & "Company: " & txtCompany & "
"
Message=Message & "Type of Business: " & txtBusiness & "
"
Message=Message & "Number of Employees: " & nEmployees & "
"
Message=Message & "Website: " & txtURL & "
"
End If
Message=Message & txtProduct & "
"
Message=Message & "Inquiry:
" & "" & txtComments & ""
Set ASPMail = Server.CreateObject("SMTPsvg.Mailer")
ASPMail.ContentType = "text/html"
ASPMail.FromName = txtFname & " " & txtLname & " " & txtCompany
ASPMail.FromAddress = txtEmail & " (via On-Line Inquiry)"
ASPMail.RemoteHost = "209.47.206.2"
ASPMail.AddRecipient "Inquiries","info@wadesbindery.com"
'ASPMail.AddCC rs("tEmail"), rs("tEmail")
'ASPMail.AddBCC "steve@digitized.com", "steve@digitized.com" ' Send CC to applicant
ASPMail.Subject = "On-Line Inquiries"
ASPMail.BodyText = Message
If Not ASPMail.SendMail Then
messno=0
Else
messno=1
End If
Response.Redirect("inqthanks.asp?m=" & messno & "&p=" & p)
End If
End If
%>
Equipment Inquiry
<%
Function IsSelected(value,data)
If value=data then
IsSelected="Selected"
Else
IsSelected=""
End If
End Function
%>