<%'--------------------------------------------------------------- '**** Set SQL search string - dependant on URL query strings. ** '--------------------------------------------------------------- category = validatestring(Request("cat")) if category = "" then category = "All Products" if category = "All Products" then mysqlstring = "SELECT * FROM PRODUCTS order by title;" elseif category = "sculptures" or category = "murals" or category = "paintings" then mysqlstring = "SELECT * FROM PRODUCTS WHERE CATEGORY = """ & category & """ order by title;" else mysqlstring = "SELECT * FROM PRODUCTS WHERE CATEGORY like ""%" & category & "%"" " mysqlstring = mysqlstring&"or subcat like ""%" & category & "%"" " mysqlstring = mysqlstring&"or title like ""%" & category & "%"" " mysqlstring = mysqlstring&"or description like ""%" & category & "%"" " mysqlstring = mysqlstring&"or dimensions like ""%" & category & "%"" " mysqlstring = mysqlstring&"order by title;" end if ' ORDER BY TITLE Desc;" '------------------------------------------------ '**** Open DB connection and retrieve results. ** '------------------------------------------------ On Error Resume Next Set Conn=Server.CreateObject("ADODB.Connection") conn.cursorlocation=3 Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&ProductsDSN '** Check for errors and end page if error found If Err.number <> 0 then response.write Err.description %> <% Response.End End If '*** Execute Main DB search set rs = conn.execute(mysqlstring) totalproducts = rs.RecordCount 'response.write(category) '*** Initial text on page (based on query string) %> <%if category="sculptures" then%>
SCULPTURE

Since 1996 sculpture has become Janets main interest.

Janet Swiss believes garden sculpture should be elegant, relevant and affordable, so produces originals and limited editions in free or cast cement - particularly water features and fountains.

Commissions welcome. All 'green dots' are for sale as priced + postage & packing.
All are originals, with some cast limited editions.
<%elseif category="murals" then%>
MURALS

Janet Swiss has produced over fifty murals to date, mainly on garden and landscape subjects, for schools, businesses and private homes.
On average a mural takes 5 days and costs £125 per day.

'Portable windows' and floral fire screens are a speciality.
<%elseif category="paintings" then%>
PAINTINGS

As a graphic designer, line has always fascinated Janet. An enduring interest in plants and gardens has resulted in vivid line/wash floral studies.

Since 1996 she has been exploring philosophical and ecological themes.
<%elseif category="All Products" then%>
All Products

Listed below are examples of Janets work.

Commissions are welcome. All 'green dots' are for sale as priced + postage & packing.
All are originals, with some limited editions.
<%elseif totalproducts = 0 then%>
PRODUCT SEARCH

Your search for '<%response.write(category)%>' did not return any results.

If you cannot find what you are looking for you may like to browse the categories listed above.
<%else%>
PRODUCT SEARCH

Your search for '<%=category%>' returned <%=totalproducts%> results.
<% end if '*** Display search box %>



You can search through the products here:


<%if totalproducts = 0 then '*** Display a "NO RECORDS FOUND" table.%>

<% else '*** Display table of products '*** Settings for image resizing dim objFSO, objF, objFC dim f1, w, h, c, strType maxsize=150 imagepat="/products/images/thumbs/" '*** Settings for random bar between rows. insertcount=1 oldinsertchoice=3 x=0 rs.movefirst '*** Loop for each row of results table do while not rs.eof colcount=colcount+1 x=x+1 ' fcategory=rs("CATEGORY") ftitle=rs("TITLE") fdescription=rs("DESCRIPTION") fimage=rs("IMAGE1") fimage2=rs("IMAGE2") fimage3=rs("IMAGE3") fimage4=rs("IMAGE4") fimage5=rs("IMAGE5") fprice=rs("PRICE") fsold=rs("SOLD") fdimensions=rs("DIMENSIONS") ' fdepth=rs("DEPTH") ' fheight=rs("HEIGHT") ' fmaterial=rs("MATERIAL") if fsold=true then soldimage="sold.gif" soldalt="sold" else soldimage="notsold.gif" soldalt="not sold" end if if fdescription="" then fdescription="
" end if if fprice="0" then fprice="
" else fprice="£"&fprice end if if fdimensions=0 then fdimensions="
" end if if isnull(fimage2) then 'response.write("AA"&fimage2&"BB") else 'resizeimage(fimage2) end if if isnull(fimage2) then '*** if only 1 image for this product if x < totalproducts then '*** if not the last product rs.movenext colcount=colcount+1 x=x+1 ' fcategory=rs("CATEGORY") ftitleb=rs("TITLE") fdescriptionb=rs("DESCRIPTION") fimageb=rs("IMAGE1") fimageb2=rs("IMAGE2") fimageb3=rs("IMAGE3") fimageb4=rs("IMAGE4") fimageb5=rs("IMAGE5") fpriceb=rs("PRICE") fsoldb=rs("SOLD") fdimensionsb=rs("DIMENSIONS") ' fdepth=rs("DEPTH") ' fheight=rs("HEIGHT") ' fmaterial=rs("MATERIAL") if fsoldb=true then soldimageb="sold.gif" soldaltb="sold" else soldimageb="notsold.gif" soldaltb="not sold" end if if fdescriptionb="" then fdescriptionb="
" end if if fpriceb=0 then fpriceb="
" else fpriceb="£"&fpriceb end if if fdimensionsb="0" then fdimensionsb="
" end if if not isnull(fimageb2) then '*** If this product has multiple images, cancel showing it and move back 1 record. ftitleb=null fdescriptionb=null fimageb=null fpriceb=null fsoldb=null fdimensionsb=null x=x-1 rs.moveprevious end if else '** If this is the last product, clear second set of data ftitleb=null fdescriptionb=null fimageb=null fpriceb=null fsoldb=null fdimensionsb=null end if '*** Display 2 products side by side %> <%else '*** Multiple images - show different table%>


<%response.write(ftitle)%>

<%if not isnull(fimage) then%> " alt="<%response.write(ftitle)%>" border="1" style="border-color:#000000 ">
click for larger image
<%end if%>

<%response.write(ftitleb)%>

<%if not isnull(fimageb) then%> " alt="<%response.write(ftitleb)%>" border="1" style="border-color:#000000 ">
click for larger image
<%end if%>
<%=fdescription%> <%=fdescriptionb%>
<%=fdimensions%> <%=fdimensionsb%>
<%if fimage <> "" then response.write(" "& fprice)%> <%if fimageb <> "" then response.write(" "& fpriceb)%>
<%end if%>


<%response.write(ftitle)%>

<%if not isnull(fimage) and fimage <> "" then%> " alt="<%response.write(ftitle)%>" border="1" style="border-color:#000000 ">
click for larger image
<%end if%>

<%if not isnull(fimage2) and fimage2 <> "" then mypath =productthumbimagespath&"mini-"&fimage2 mypathb=productthumbimagespathfull&"mini-"&fimage2%> <%response.write(ftitle)%> border="1" style="border-color:#000000; margin-bottom:5" align="top"> <%end if%> <%if not isnull(fimage3) and fimage3 <> "" then mypath =productthumbimagespath&"mini-"&fimage3 mypathb=productthumbimagespathfull&"mini-"&fimage3%> <%response.write(ftitle)%> border="1" style="border-color:#000000; margin-bottom:5" align="top"> <%end if%> <%if not isnull(fimage4) and fimage4 <> "" then mypath =productthumbimagespath&"mini-"&fimage4 mypathb=productthumbimagespathfull&"mini-"&fimage4%> <%response.write(ftitle)%> border="1" style="border-color:#000000; margin-bottom:5" align="top"> <%end if%> <%if not isnull(fimage5) and fimage5 <> "" then mypath =productthumbimagespath&"mini-"&fimage5 mypathb=productthumbimagespathfull&"mini-"&fimage5%> <%response.write(ftitle)%> border="1" style="border-color:#000000; margin-bottom:5" align="top"> <%end if%>

<%=fdescription%>
<%=fdimensions%>
<%if fimage <> "" then response.write(" "& fprice)%>


<% '*** Add extra info row between products (every 3 rows) insertcount=insertcount+1 if insertcount mod 2 = 1 then insertchoice=Int(Rnd * 4)+1 do while insertchoice=oldinsertchoice insertchoice=Int(Rnd * 4)+1 loop oldinsertchoice = insertchoice %>

<% 'response.write(insertchoice) if insertchoice = 1 then %>If you would like to purchase an item or have questions regarding Janets work please visit the contact page.<% elseif insertchoice = 2 then %>If you would like to give some feedback please sign the guestbook.<% elseif insertchoice = 3 then %>click here to go to the top of the page<% elseif insertchoice = 4 then %>Items marked with a red dot This item is sold have been sold. Items with a green dot This item is sold are available for purchase.<% end if %>


<% end if '*** Repeat loop rs.movenext loop %>

<% '*** Reset imagesize data set objFC = nothing set objF = nothing set objFSO = nothing end if '------------------------------------------------ '*** Close and reset all connection strings *** '------------------------------------------------ rs.close set rs = nothing conn.close set conn = nothing %>