<%
cat=request.QueryString("catid")
subcat=request.QueryString("subcat")
if cat="" then
cat=1
end if
if subcat="" then
SQL="select min(catChildId) as lowersubcat from catChild where catId='"&cat&"'"
call getfromDatabase(SQL,rsSQL,"")
subcat=rsSQL("lowersubcat")
end if
if not subCat="" then
'---------Display Products
SQLProduct = "select * from product where status='Active' and catChildId='"
SQLProduct=SQLProduct&subCat&"' order by productid desc"
SQLViewCat="select catName from category where catId=(select catId from catchild where catChildId="
SQLViewCat=SQLViewCat&subCat&")"
SQLViewSubCat="select chCatName from catChild where catChildId="
SQLViewSubCat=SQLViewSubCat&subCat
Call getFromDatabase(SQLProduct,rsProduct,"products.asp")
Call getFromDatabase(SQLViewCat,rsViewCat,"products.asp")
Call getFromDatabase(SQLViewSubCat,rsViewSubCat,"products.asp")
if not rsProduct.EOF then
vProductId=rsProduct("productId")
vImageUrl=rsProduct("vImageUrl")
vName=rsProduct("productName")
vCode=rsProduct("productCode")
catName=rsViewCat("catName")
childCatName=rsViewSubCat("chCatName")
%>
<%
i=1
do until rsProduct.EOF
vProductId=rsProduct("productId")
vImageUrl=rsProduct("vImageUrl")
vName=rsProduct("productName")
vCode=rsProduct("productCode")
vhotdeal=rsProduct("hotdeal")
vhotprice=rsProduct("hotprice")
vdesc=rsProduct("Descr")
vproductprice=rsProduct("productprice")
productpath="product/small/"&vProductId&".jpg"
myURL12=checkimage(productpath)
if myURL12 <> "/images/noimage.jpg" then
call getSize(server.mappath(myURL12), width, height, depth, "JPG")
end if
%>
<%
rsProduct.MoveNext
i=i+1
Loop
%>
<%
end if
end if
%>