<% dim mmsg DIM currentarea,currentsubject,ts'The Script currentarea=rep(request.form("area")) IF not (request.querystring("area")="" or isnull(request.querystring("area"))) THEN currentarea=rep(request.querystring("area")) END IF currentsubject=rep(request.form("subject")) IF not (request.querystring("subject")="" or isnull(request.querystring("subject"))) THEN currentsubject=rep(request.querystring("subject")) END IF 'response.write "CURRENTAREA "¤tarea&"
" 'response.write "CURRENTSUBJECT "¤tsubject&"
" %> <%conn.open%> <%LoadVariables%>

ALARMTRON Supplies Catalogue

<%CatalogList currentarea,currentsubject%> <%IF (currentarea="" or isnull(currentarea)) THEN%>

 

pictures here.

 

To view our products first select a category then select a sub-category. The products in that sub-category will automatically be displayed. You can see the contents of your 'cart' anyotm by clicking 'view cart'. When you are finished, click the 'check out' button.

<%ELSE%> <%displayProduct currentarea,currentsubject%> <%END IF%>
<%conn.close%> <%'========== END OF PAGE ==================================%> <%'========= functions for this page =======================%> <%SUB CatalogList(areaid,subjectid)%>
<%=ts%>

Please Select:

<%set rs=conn.execute("select name,areaid from catalog where thelevel=1 and isactive order by displayorder")%> <%if currentarea<>"" then%> <%else%> <%end if%> <%if isUserLogin() then%> <%end if%>
<%END SUB%> <%SUB navigationbar(areaid,subjectid,PageCount)%>
<%END SUB%> <%SUB navigationbar2(areaid,subjectid,PageCount)%>
<%END SUB%> <%SUB displayProduct(areaid,subjectid)%> <% if request.QueryString("move")="next" then Session("CurrentPage")=Session("CurrentPage")+1 end if if request.QueryString("move")="prev" then Session("CurrentPage")=Session("CurrentPage")-1 end if if request.QueryString("move")="" and request.form("move")<>"STAY" then Session("CurrentPage")=1 end if if request.form("gotopage")<>"" and request.form("gotopage")<>"EMPTY" then Session("CurrentPage")=cint(request.form("gotopage")) end if if Session("CurrentPage")="" then Session("CurrentPage")=1 end if if request.querystring("currentpage")<>"" and isNumeric(request.querystring("currentpage")) then Session("CurrentPage")=cint(request.querystring("currentpage")) end if if request.form("Pagesize")<>"" and isNumeric(request.form("Pagesize")) then session("RecordsPerPage")=Round(cdbl(request.form("Pagesize"))) end if if session("RecordsPerPage")<1 or session("RecordsPerPage")>40 or session("RecordsPerPage")="" or isnull(session("RecordsPerPage")) then session("RecordsPerPage")=4 end if %> <% set rspage=Server.CreateObject("ADODB.RecordSet") sql="select * from product where areaid="&areaid&" and subjectid="&subjectid&" and isactive" 'response.write sql 'response.end rspage.open sql , conn, 1, 3 rspage.PageSize=session("RecordsPerPage") %> <%if rspage.eof then%> <%NoMessage%> <%rspage.close%> <%response.end%> <%end if%> <% if Session("CurrentPage")>rspage.PageCount then Session("CurrentPage")=rspage.PageCount end if if Session("CurrentPage")<1 then Session("CurrentPage")=1 end if rspage.AbsolutePage = Session("CurrentPage")%>
[There Are <%=getTotalProducts(areaid,subjectid)%>  Products in This Subcategory]
<%dim numRows,blnFlag numRows=0 blnFlag=true %> <%navigationbar2 areaid,subjectid,rspage.PageCount%> <%while not rspage.eof AND numRows
">
<%if isItemnoOn then%> <%end if%> <%if isItemnameOn then%> <%end if%> <%if isItemPriceOn then%> <%end if%> <%if isItemsdescriptionOn then%> <%end if%> <%if isItemdescriptionon then%> <%end if%>
Item Number: <% if len(rspage("itemno"))>0 then response.write(repb(rspage("itemno"))) end if %>
Product Name: <% if len(rspage("itemname"))>0 then response.write(repb(rspage("itemname"))) end if %>
Price: <% if len(rspage("itemprice"))>0 then response.write formatcurrency(rspage("itemprice")) else response.write formatcurrency(0) end if %>
Description: <% if len(rspage("itemname"))>0 then response.write(repb(rspage("itemname"))) end if %>
Product Detail:
<% mmsg=rspage("description") if len(mmsg)>0 then response.write(rrepb(mmsg)) end if %>
<%=getPicture(rspage("uniqueid"))%>
<%=getBrochure(rspage("uniqueid"))%>
 
<%rspage.movenext%> <%numRows=numRows+1%> <%blnFlag=Not blnFlag%> <%wend%> <%navigationbar2 areaid,subjectid,rspage.PageCount%> <%rspage.close%> <%END SUB%> <% function getTotalProducts(areaid,subjectid) set rs2=conn.execute("select count(itemno) from product where areaid="&areaid&" and subjectid="&subjectid) if rs2.eof then getTotalProducts=0 else getTotalProducts=rs2(0) end if rs2.close end function %> <%SUB NoMessage()%>
 
<%END SUB%> <% function getIsActive(variablename) set rs2=conn.execute("select isactive from variable where variablename='"&variablename&"'") getIsActive=rs2(0) rs2.close end function %> <% function getPicture(uniqueid) set rs3=conn.execute("select count(picid) from picture where picid="&uniqueid) IF rs3(0)>0 THEN rs3.close getPicture="
click on picture to enlarge" ELSE rs3.close getPicture="Picture not available." END IF end function %> <%'=========== To be delete================================%>