Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Displaying Additional SubCategories
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Displaying Additional SubCategories

 Post Reply Post Reply
Author
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Topic: Displaying Additional SubCategories
    Posted: 04 December 2005 at 11:54pm

I have a web page that sends out an email every time the listing is approved. Some of the advertisers have more than one subcategories. I'd like to show any additional subcategories they might have in the email. At this time, I can only show the first subcategory that they are listed under. Advertiser, AdvertiserSubCategory, and SubCategories join tables. Advertiser joins AdvertiserSubCategory by AdvertiserID and AdvertiserSubCategory joins SubCategories by SubCategoryID.
 
'-------------------------------------------------------------
' name: GetValues()
' description: updates a  record
' note: This converts all empty strings to Null values
'--------------------------------------------------------------
Sub GetValues()
      AdvertiserID = rs("AdvertiserID") & ""
      SubCategoryID = rs("SubCategoryID") & ""
      BusinessName = rs("BusinessName") & ""
      Category = rs("Category") & ""
      SubCategory = rs("SubCategory") & ""
      ContactPerson = rs("ContactPerson") & ""
      Address = rs("Address") & ""
      City = rs("City") & ""
      State = rs("State") & ""
      County = rs("County") & ""
      Zip = rs("Zip") & ""
      Phone = rs("Phone") & ""
      Fax = rs("Fax") & ""
      TollPhone = rs("TollPhone") & ""
      CellPhone = rs("CellPhone") & ""
      Email = rs("Email") & ""
      Website = rs("Website") & ""
      ListingType = rs("ListingType") & ""
      Details = rs("Details") & ""
      ShowEmail = rs("ShowEmail") & ""
      Approve = rs("Approve") & ""  
      DateApproved = rs("DateApproved") & ""   
     
End Sub      
'-------------------------------------------------------------
' name: UpdateRecord()
' description: updates a  record
' note: This converts all empty strings to Null values
'--------------------------------------------------------------
Sub UpdateRecord()
      'Get values for new record
      Approve = Request.Form("chkApprove")
      SendEmail = Request.Form("radSendEmail")
    
   
     
      If Approve = "0" then
           rs("Approve") = true
      Else
           rs("Approve") = false
      End If
      rs("DateApproved") = Date()
     
      'Save the record to the database
      rs.Update
     
       If SendEmail = "Yes" then     
     
'I got some of this code from the forum application at
'www.webwiz.net
  dim i  
  dim MyMail, EmailBody, SenderName, SenderEmail
  Set MyMail = Server.CreateObject("CDO.Message")
 
  SenderName = "ExploreNCMountains.com"
  SenderEmail = "info@...........com"
 
  EmailBody = "Dear " & ContactPerson & ","
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p>Your Listing has been approved on ExploreNCMountains.com! Look at your information below.</p>"
  If ListingType = "Standard" then
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<br> " & ListingType & " Listing - $150 per year."     
  else
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<br> " & ListingType & " Listing - $300 per year."     
  end if
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Business Name: </b>" & BusinessName & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Contact Person: </b>" & ContactPerson & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Category: </b>" & Category & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Type of Business/Organization: </b>" & SubCategory & "" - would like to display any additional subcategories that may exist.
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>County: </b>" & County & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Address: </b>" & Address & ", "  & City & ", "  & State & "  " & Zip & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Email Address: </b><a href=""mailto:" &  Email  & """>" & Email & "</a>"
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Phone Number: </b>" & Phone & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Fax: </b>" & Fax & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Toll Free Phone Number: </b>" & TollPhone & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Cell Phone Number: </b>" & CellPhone & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Web Site: </b><a href=" &  WebSite &  ">" & WebSite & "</a>"
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Details About Business/Organization: </b>" & Details & ""
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><b>Link to Your Listing That The Public  Can View: </b><a href=""http://www.explorencmountains.com" & "/DisplayAdvertiser.aspx?ID=" & AdvertiserID & "&CatID=" & SubCategoryID & """>Go to Listing </a>"
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><a href=""Log'>http://www.explorencmountains.com/advertiserlogin.asp"">Log In to Your Listing </a>"
  EmailBody = EmailBody & vbCrLf & vbCrLf & "<p><img src=""http://www.explorencmountains.com/explorencmountains.gif""></p>"
 
      with MyMail
      .From = SenderName & "<" & SenderEmail & ">"
      .To = C
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.