I'm not sure how to go about doing this. I am still fairly new to ASP, but can get around fairly well. What I am trying to do is when an end user selects a certain category and zip code they get displayed the providers who are in that zip code and category. My problem is getting the layout I want. There are premium ads that take up most of the width of the page and then there are basic ads that are half the premium ad. I want to make it so that all premium and basic ads get displayed for that category/zip code and have the premium ad on per row and the basic ad two per row. I don't know if this sounds complicated, but in my head it sounds fairly simple I just don't know how to go about doing it. I have made it where it will either display a premium ad or a basic ad, but not both. The code for my page is below. I know it looks aweful, but it is a work in progress.
<tr><td colspan="5">
<%
Dim ConnStr
Dim SQL
Dim viewAd
Dim rs
Dim strZipcode
Dim strCompanyname
Dim strTown
Dim strOwner
Dim strAddress
Dim strPhone
Dim str2ndphone
Dim strMobile
Dim strPager
Dim strFax
Dim strEmail
Dim strWebsite
Dim strInbusiness_since
Dim strLicense
Dim strInsured
Dim strBonded
Dim strHours
Dim str24houremerg
Dim strServicesoffered
Dim strOtherservices
Dim strServicearea
Dim strFreeestimate
Dim strWorkguaranteed
Dim strProvidertagline
Dim strAd_size
Dim strProviderservice
Dim providerID
Dim reviewID
Set viewAd = Server.CreateObject("ADODB
.Connectio
n")
ConnStr = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/mockup/pr
oviders.md
b")
viewAd.open(ConnStr)
SQL = "SELECT tblAdspace.strZipcode, tblAdspace.strCompanyname,
tblAdspace.strTown, tblAdspace.strOwner, tblAdspace.strAddress, tblAdspace.strPhone, tblAdspace.str2ndphone, tblAdspace.strMobile, tblAdspace.strPager, tblAdspace.strFax, tblAdspace.strEmail, tblAdspace.strWebsite, tblAdspace.strInbusiness_s
ince, tblAdspace.strLicense, tblAdspace.strInsured, tblAdspace.strBonded, tblAdspace.strHours, tblAdspace.str24houremerg,
tblAdspace.strServicesoffe
red, tblAdspace.strOtherservice
s, tblAdspace.strServicearea,
tblAdspace.strFreeestimate
, tblAdspace.strWorkguarante
ed, tblAdspace.strProvidertagl
ine, tblAdspace.strAd_size, tblAdspace.providerID, tblReviews.reviewID, tblAdspace.strProviderserv
ice FROM tblAdspace, tblReviews where tblAdspace.strZipcode = '" & request.form("strZipcode")
& "' OR tblAdspace.strTown = '" & request.form("strTown") & "' "
Set rs = viewAd.execute(SQL)
if not rs.eof then
strCompanyname = rs("strCompanyname")
strOwner = rs("strOwner")
strTown = rs("strTown")
strZipcode = rs("strZipcode")
strAddress = rs("strAddress")
strPhone = rs("strPhone")
str2ndphone = rs("str2ndphone")
strMobile = rs("strMobile")
strPager = rs("strPager")
strFax = rs("strFax")
strEmail = rs("strEmail")
strWebsite = rs("strWebsite")
strInbusiness_since = rs("strInbusiness_since")
strLicense = rs("strLicense")
strBonded = rs("strBonded")
strHours = rs("strHours")
str24houremerg = rs("str24houremerg")
strServicesoffered = rs("strServicesoffered")
strOtherservices = rs("strOtherservices")
strServicearea = rs("strServicearea")
strFreeestimate = rs("strFreeestimate")
strWorkguaranteed = rs("strWorkguaranteed")
strProvidertagline = rs("strProvidertagline")
strAd_size = rs("strAd_size")
strProviderservice = rs("strProviderservice")
providerID = rs("providerID")
reviewID = rs("reviewID")
end if
rs.close
%>
<div style="font: normal 15px verdana; color: #2c5fb2; text-align: center; margin-top: 20px; margin-bottom: 10px">
Search Results For <font color="#cd4141"><%= strZipcode %></font>
</div>
<table width="100%">
<tr><td width="400">
<%
Dim imageName, typeValue
typeValue = request.form("type")
' Check input here if needed
'response.Write(typeValue)
IF typeValue = "electrician" then
imageName = "/mockup/images/electricia
n_btn.png"
elseif typeValue = "painting" then
imageName = "/mockup/images/painting_b
tn.png"
elseif typeValue = "plumbing" then
imageName = "/mockup/images/plumbing_b
tn.png"
else
response.write "Nothing"
end if
%>
<div style="margin-left: 250px">
<img src="<%= imageName %>">
</div>
</td><td style="padding: 10px">
<table cellpadding="0" cellspacing="0" border="0" width="400" align="center" style="font-family:arial; font-size:13px; color: #4E4E4E">
<tr><td>
<img src="/mockup/images/how_to
p_left.png
" />
</td><td style="border-top:#98b2b6;
border-top-width:1px; border-top-style:solid;" bgcolor="#edf7fd">
</td><td>
<img src="/mockup/images/how_to
p_right.pn
g" />
</td></tr>
<tr><td style="border-left:#98b2b6
; border-left-width:1px; border-left-style:solid;" bgcolor="#edf7fd">
</td><td bgcolor="#edf7fd" valign="top">
<div style="margin-top:1px">
<b><span style="font-size: 14px">Find the right service provider without the worry in</span></b> <span style="font-size: 18px; color:#2e64eb">1</span><fo
nt size="4px">-</font><span style="font-size: 18px; color:#e0a901">2</span><fo
nt size="4px">-</font><span style="font-size: 18px; color:#4aaa42">3</span> <b><span style="font-size: 14px">easy steps.</span></b>
</div>
<ol>
<li value="3" class="color3_active" style="margin-top:10px; margin-left:-10px; margin-bottom:-5px; border: 2px solid #4aaa42; padding: 5px; -moz-border-radius: 10px"><span style="font-size:13px; color:#4E4E4E; font-weight: 300"><b>Contact</b></span>
<span style="font-size:13px; color:#4E4E4E; font-weight: 300">the <b>Provider</b> of your choice and remember to</span> <img src="/mockup/images/sublog
o.png" /> <span style="font-size:13px; color:#4E4E4E; font-weight: 300">about the provider's qualifications (see <a href="#" onmouseover="doTooltip(eve
nt, msgTips)" onmouseout="hideTip()"><st
rong>Smart
Tips</strong></a>). If you're satisfied with the answers received, then <u>confidently</u> hire that service.</span></li>
</ol>
</td><td style="border-right:#98b2b
6; border-right-width:1px; border-right-style:solid;"
bgcolor="#edf7fd">
</td></tr>
<tr><td>
<img src="/mockup/images/how_bo
ttom_left.
png" />
</td><td style="border-bottom:#98b2
b6; border-bottom-width:1px; border-bottom-style:solid;
" bgcolor="#edf7fd">
</td><td>
<img src="/mockup/images/how_bo
ttom_right
.png" />
</td></tr>
</table>
</td></tr></table>
</td></tr>
<tr><td colspan="5">
<div style="padding: 10px">
<%
Dim SQL_select
SQL_select = "SELECT tblAdspace.strZipcode, tblAdspace.strCompanyname,
tblAdspace.strTown, tblAdspace.strOwner, tblAdspace.strAddress, tblAdspace.strPhone, tblAdspace.str2ndphone, tblAdspace.strMobile, tblAdspace.strPager, tblAdspace.strFax, tblAdspace.strEmail, tblAdspace.strWebsite, tblAdspace.strInbusiness_s
ince, tblAdspace.strLicense, tblAdspace.strInsured, tblAdspace.strBonded, tblAdspace.strHours, tblAdspace.str24houremerg,
tblAdspace.strServicesoffe
red, tblAdspace.strOtherservice
s, tblAdspace.strServicearea,
tblAdspace.strFreeestimate
, tblAdspace.strWorkguarante
ed, tblAdspace.strProvidertagl
ine, tblAdspace.strAd_size, tblAdspace.providerID, tblAdspace.strProviderserv
ice, tblReviews.reviewID FROM tblAdspace, tblReviews WHERE tblAdspace.strProviderserv
ice = '" & strProviderservice & "' ORDER BY strProviderservice"
Set rs = viewAd.execute(SQL_select)
if not rs.eof then
strCompanyname = rs("strCompanyname")
strOwner = rs("strOwner")
strTown = rs("strTown")
strZipcode = rs("strZipcode")
strAddress = rs("strAddress")
strPhone = rs("strPhone")
str2ndphone = rs("str2ndphone")
strMobile = rs("strMobile")
strPager = rs("strPager")
strFax = rs("strFax")
strEmail = rs("strEmail")
strWebsite = rs("strWebsite")
strInbusiness_since = rs("strInbusiness_since")
strLicense = rs("strLicense")
strBonded = rs("strBonded")
strHours = rs("strHours")
str24houremerg = rs("str24houremerg")
strServicesoffered = rs("strServicesoffered")
strOtherservices = rs("strOtherservices")
strServicearea = rs("strServicearea")
strFreeestimate = rs("strFreeestimate")
strWorkguaranteed = rs("strWorkguaranteed")
strProvidertagline = rs("strProvidertagline")
strAd_size = rs("strAd_size")
strProviderservice = rs("strProviderservice")
providerID = rs("providerID")
reviewID = rs("reviewID")
end if
if strAd_size = "Premium" then
Dim rows
rows = 0
do while not rs.eof
%>
<table class="premium_border" align="center">
<tr><td colspan="5">
<table width="100%"><tr><td>
<img src="/mockup/images/ad_log
o.png">
</td><td id="premium_header">
<%= rs("strCompanyname") %>
<div style="margin-top: 5px; font-size: 13px">
<%= rs("strAddress") %><br />
<%= rs("strTown") %>, NC <%= rs("strZipcode") %><br />
Moore County
</div>
</td><form action="
http://maps.google.com/maps"
method="get">
<input type="hidden" name="saddr" value="<%= rs("strAddress")%>,<%= rs("strTown")%>,NC">
<input type="hidden" name="hl" value="en">
<td id="google_maps">
Find Business<br />via <input type="submit" value="Google Map" class="btn">
</td></form></tr></table>
</td></tr>
<tr><td>
<table id="premium_ad">
<tr><td>
<table id="premium_ad_td" border="0">
<tr><td align="center" width="250" colspan="4" id="premium_ad_title">CONT
ACT INFO</td></tr>
<tr><td align="right" width="60">OWNER: </t
d><td width="100" colspan="2"><%=rs("strOwne
r")%></td>
</tr>
<tr><td align="right">PHONE1: 
;</td><td>
<%= rs("strPhone")%></td>
<td align="right">PHONE2: 
;</td><td>
<%= rs("str2ndphone")%></td></
tr>
<tr><td align="right">MOBILE: 
;</td><td>
<%= rs("strMobile")%></td>
<td align="right">PAGER:
</td><td><
%= rs("strPager")%></td></tr>
<tr><td align="right">FAX: </
td><td><%=
rs("strFax")%></td>
<td align="right">E-MAIL: 
;</td><td>
<%= rs("strEmail")%></td></tr>
<tr><td height="36"> </td></t
r>
<tr><td align="center" colspan="4"><%= rs("strWebsite")%></td></t
r>
</table>
</td></tr>
<tr><td>
<table id="premium_ad_td" border="0">
<tr><td align="center" width="250" colspan="4" id="premium_ad_title">OTHE
R KEY INFO</td></tr>
<tr><td align="right" width="135">LICENSE #: </td><td width="50"><%= rs("strLicense")%></td>
<td align="right">INSURED:&nbs
p;</td><td
width="75"><%= rs("strInsured")%></td></t
r>
<tr><td align="right">BONDED: 
;</td><td>
<%= rs("strBonded")%></td>
<td align="right">FREE ESTIMATES: </td><td><
%= rs("strFreeestimate")%></t
d></tr>
<tr><td align="right">WORK GUARANTEED: </td><td colspan="2"><%= rs("strWorkguaranteed")%><
/td></tr>
</table>
</td></tr>
<tr><td>
<table id="premium_ad_td" border="0">
<tr><td align="center" width="250" colspan="2" id="premium_ad_title">SERV
ICES & HOURS OPEN</td></tr>
<tr><td align="right" width="110">HOURS OPEN: </td><td><%= rs("strHours")%></td></tr>
<tr><td align="right">24 HR. EMERG.: </td><td><%= rs("str24houremerg")%></td
></tr>
<tr><td align="right" valign="top">MAIN SERVICES: </td><td><%
= rs("strServicesoffered")%>
</td></tr>
<tr><td align="right" valign="top">SERVICE AREA: </td><td><%= rs("strServicearea")%></td
></tr>
<tr><td align="right" valign="top">OTHER SRVS: </td><td><%= rs("strOtherservices")%></
td></tr>
</table>
</td></tr>
<tr><td>
<table id="premium_ad_td" border="0" height="75">
<tr><td align="center" width="250" colspan="4" id="premium_ad_title">RATI
NG INFO</td></tr>
<tr><td align="center" colspan="4">
<%
if rs("reviewID") = "" and rs("strCompanyname") = "" then
response.write "SEE ALL REVIEWS"
elseif rs("reviewID") > 0 then
%>
<a href="/mockup/reviews.asp?
Company=<%
=strCompan
yname%>">S
EE ALL REVIEWS</a>
<%
end if
%>
</td></tr>
<tr><td align="right">OVERALL RATING: </td>
<td width="80">
<img src="/mockup/images/5_star
s.png">
</td>
<td align="right">RATING TREND: </td><td width="50"> </td></tr
>
<tr><td align="center" height="10px" colspan="2"><span style="font-size: 9px; font-family: verdana">*Covers all customer reviews</span></td>
<td align="center" height="10px" colspan="2"><span style="font-size: 9px; font-family: verdana">*Shows rating direction in last 90 days</span></td></tr>
</table>
</td></tr>
</table>
</td><td>
<img src="/mockup/images/electr
ician_prem
ium.jpg">
</td></tr>
</table>
<%
rows = rows +1
RS.MoveNext
Loop
end if
if strAd_size = "Basic" then
rows = 0
do while not rs.eof
%>
<div style="padding: 10px">
<table class="basic_border" align="center" border="0">
<tr><td colspan="2">
<table width="100%"><tr><td>
<img src="/mockup/images/ad_log
o.png">
</td><td id="basic_header">
<%= rs("strCompanyname")%>
<div style="margin-top: 5px; font-size: 13px">
<%= rs("strAddress") %><br />
<%= rs("strTown") %>, NC <%= rs("strZipcode") %><br />
Moore County
</div>
</td><form action="
http://maps.google.com/maps"
method="get">
<input type="hidden" name="saddr" value="<%= rs("strAddress") %>,<%= rs("strTown") %>,NC">
<input type="hidden" name="hl" value="en">
<td id="google_maps">
Find Business<br />via <input type="submit" value="Google Map" class="btn">
</td></form></tr></table>
</td></tr>
<tr><td>
<table id="basic_ad">
<tr><td>
<table id="basic_ad_td" border="0">
<tr><td align="center" width="250" colspan="4" id="premium_ad_title">CONT
ACT INFO</td></tr>
<tr><td align="right" width="60">OWNER: </t
d><td width="100" colspan="2"><%= rs("strOwner") %></td></tr>
<tr><td align="right">PHONE1: 
;</td><td>
<%= rs("strPhone") %></td>
<td align="right">PHONE2: 
;</td><td>
<%= rs("str2ndphone") %></td></tr>
<tr><td align="right">MOBILE: 
;</td><td>
<%= rs("strMobile") %></td>
<td align="right">PAGER:
</td><td><
%= rs("strPager") %></td></tr>
<tr><td align="right">FAX: </
td><td><%=
rs("strFax") %></td>
<td align="right">E-MAIL: 
;</td><td>
<%= rs("strEmail") %></td></tr>
<tr><td align="center" colspan="4"><%= rs("strWebsite") %></td></tr>
</table>
</td></tr>
<tr><td>
<table id="basic_ad_td" border="0">
<tr><td align="center" width="250" colspan="4" id="premium_ad_title">OTHE
R KEY INFO</td></tr>
<tr><td align="right" width="135">LICENSE #: </td><td width="50"><%= rs("strLicense")%></td>
<td align="right">INSURED:&nbs
p;</td><td
width="75"><%= rs("strInsured") %></td></tr>
<tr><td align="right">BONDED: 
;</td><td>
<%= rs("strBonded") %></td>
<td align="right">FREE ESTIMATES: </td><td><
%= rs("strFreeestimate") %></td></tr>
<tr><td align="right">WORK GUARANTEED: </td><td colspan="2"><%= rs("strWorkguaranteed") %></td></tr>
</table>
</td></tr>
<tr><td>
<table id="basic_ad_td" border="0">
<tr><td align="center" width="250" colspan="2" id="premium_ad_title">SERV
ICES & HOURS OPEN</td></tr>
<tr><td align="right" width="125">HOURS OPEN: </td><td><%= rs("strHours") %></td></tr>
<tr><td align="right">24 HR. EMERG.: </td><td><%= rs("str24houremerg") %></td></tr>
<tr><td align="right" valign="top">MAIN SERVICES: </td><td><%
= rs("strServicesoffered") %></td></tr>
<tr><td align="right" valign="top">SERVICE AREA: </td><td><%= rs("strServicearea") %></td></tr>
<tr><td align="right" valign="top">OTHER SRVS: </td><td><%= rs("strOtherservices") %></td></tr>
</table>
</td></tr>
<tr><td>
<table id="basic_ad_td" border="0" height="75">
<tr><td align="center" width="250" colspan="4" id="premium_ad_title">RATI
NG INFO</td></tr>
<tr><td align="center" colspan="4">
<%
if rs("reviewID") = "" and rs("strCompanyname") = "" then
response.write "SEE ALL REVIEWS"
elseif rs("reviewID") > 0 then
%>
<a href="/mockup/reviews.asp?
Company=<%
=strCompan
yname%>">S
EE ALL REVIEWS</a>
<%
end if
%>
</td></tr>
<tr><td align="right">OVERALL RATING: </td><td width="80"><img src="/mockup/images/5_star
s.png"></t
d>
<td align="right">RATING TREND: </td><td width="50"> </td></tr
>
<tr><td align="center" height="10px" colspan="2"><span style="font-size: 9px; font-family: verdana">*Covers all customer reviews</span></td>
<td align="center" height="10px" colspan="2"><span style="font-size: 9px; font-family: verdana">*Shows rating direction in last 90 days</span></td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
<%
rows = rows +1
RS.MoveNext
Loop
end if
%>
</td></tr>
</table>
</div>
</td></tr>
Start Free Trial