%
''response.write session("purchaseid")
''response.end
Response.CacheControl="no-cache"
Response.Buffer =true
dim msubcatId
dim mprimarycatId
dim mprodId
dim msubcategoryname
dim mMainCategoryName
dim cn
dim rsproduct
mprimarycatId=101
msubcatId =110
'response.write msubcatId
'response.end
mref="Mproducttype.asp?cgmain=" & mprimarycatId & "&cgsub=" & msubcatId
Function Str2ProperCase(sValue)
iPos = 1
Do While InStr(iPos, sValue, " ", 1) <> 0
iSpace = InStr(iPos, sValue, " ", 1)
sTemp = sTemp & UCase(Mid(sValue, iPos, 1))
sTemp = sTemp & LCase(Mid(sValue, iPos + 1,iSpace - iPos))
iPos = iSpace + 1
Loop
sTemp = sTemp & UCase(Mid(sValue, iPos, 1))
sTemp = sTemp & LCase(Mid(sValue, iPos + 1))
Str2ProperCase = sTemp
End Function
%>
Leather Vests, Mens vests, Mens Leather vests
css/style.css" type="text/css" rel="stylesheet">
<%
dim rssubcatid
set cn=server.CreateObject("Adodb.connection")
cn.Open application("LIConnstr")
set rssubCatId=server.CreateObject("Adodb.Recordset")
'''Framing the Query based on Primary Category
'prodstatus='A-Active-Being Selled'
'prodstatus='IA-InActive-Not being Selled'
sqlProduct="Select catid,subcatid,categoryname,subcategoryname,prod_id,productname,imagename,unitprice,listprice,onsale,hotprod, prodDescription"
sqlproduct=sqlproduct & " from ProductDetail_view where prodstatus='A' and "
'response.write mprimarycatid
'response.end
if (mprimarycatId=101 or mprimarycatId=102 or mprimarycatId=103 or mprimarycatId=104 or mprimarycatId=105 or mprimarycatId=112 or mprimarycatId=113 or mprimarycatId=114) then
''implies Products for Men=011 or women=102
if msubcatId="" then
sqlsubCatID="Select category_primary.description as MainCategory,category_sub.subcategoryname,subcatid"
sqlsubCatID=sqlsubcatid & " from category_primary,category_sub where category_primary.catid=" & mprimarycatId & " and "
sqlsubCatID=sqlsubCatID & "subcatid=(select top 1 subcatid from category_primarysub where catid=" & mprimarycatId & " and status='A' order by newid()) and category_sub.status='A'"
'Response.Write sqlsubCatID
'Response.End
rssubcatid.Open sqlsubCatid,cn
if rssubcatid.EOF =false then
msubcatId=rssubcatid("subcatid")
msubcategoryname=rssubcatid("subcategoryname")
mMainCategoryName=rssubcatid("MainCategory")
'' Response.Write sqlsubCatID
'' Response.Write msubcatId
'' Response.Write msubcategoryname
'' Response.Write mMainCategoryName
'' Response.End
end if
rssubcatid.Close
set rssubcatid=nothing
end if
elseif mprimarycatId=6 then
''implies Hot products
sqlCriteria=" hotprod='Y' order by catid desc"
elseif mprimarycatId=5 then
''implies products on Sale
sqlcriteria=" onsale='Y'"
end if
''For New Arrival products - 13/01/2006
if mprimarycatId=112 then
sqlCriteria=" completeproduct='C' and newarrival='Y' order by rating desc"
end if
''End New Arrival products - 13/01/2006
if msubcatid="" then
'''this would be the case if there is a main category without any sub category
''For New Arrival products - 13/01/2006
if cint(mprimarycatId)=cint(113) or cint(mprimarycatId)=cint(114) then
sqlProduct=sqlProduct & " completeproduct='C' and "
end if
''End New Arrival products - 13/01/2006
if (mprimarycatId <> 6 and mprimarycatId <> 5 and mprimarycatid <> 112) then
sqlproduct=sqlproduct & "catid=" & mprimarycatId
else
sqlproduct=sqlproduct & sqlcriteria
end if
else
if cint(msubcatid)=cint("129") or cint(msubcatid)=cint("132") or cint(msubcatid)=cint("133") or cint(msubcatid)=cint("138") or cint(msubcatid)=cint("139") then
sqlPRoduct = sqlProduct & " completeproduct='C' and "
end if
sqlproduct=sqlproduct & "catid=" & mprimarycatId & " and subcatid=" & msubcatId & " order by Rating Desc"
end if
'Response.Write sqlproduct
'Response.End
if msubcatid="120" then
''''condition for displaying all Hot items from all categories
sqlProduct="Select categoryname,catid,subcatid,subcategoryname,prod_id,productname,imagename,unitprice,listprice,onsale,hotprod, prodDescription"
sqlproduct=sqlproduct & " from ProductDetail_view where hotprod='Y' and prodstatus='A'"
end if
if msubcatid="119" then
''''condition for displaying all On Sale from all categories
sqlProduct="Select categoryname,catid,subcatid,subcategoryname,prod_id,productname,imagename,unitprice,listprice,onsale,hotprod, prodDescription"
sqlproduct=sqlproduct & " from ProductDetail_view where onsale='Y' and prodstatus='A'"
end if
set rsproduct=server.CreateObject("Adodb.Recordset")
rsproduct.Open sqlProduct,cn
if rsproduct.EOF =false then
if mprimarycatId=6 then
mMainCategoryName="Hot Items"
msubcategoryname=""
elseif (mprimarycatId=5) then
mMainCategoryName="On Sale"
msubcategoryname=""
elseif (mprimarycatId=112) then
mMainCategoryName="New Arrivals"
msubcategoryname=""
else
mMainCategoryName=rsproduct("categoryname")
msubcategoryname=rsproduct("subcategoryname")
end if
else
msubcategoryname=request("cgsubname")
end if
%>
<%
dim listprice
if rsproduct("listprice")<>0 then
%>
<%
mlistprice=FormatCurrency(rsproduct("listprice"),2)
Response.Write mlistprice
%>
<%
end if
%>
Now <%=formatcurrency(rsproduct("unitprice"),2)%>
<%
rsproduct.MoveNext
end if
next
%>
<%
wend
else
%>
No Products Currently present in Selected Criteria...
<%
end if ''end of rsproduct.eof
rsproduct.Close
''cn.Close
set rsproduct=nothing
''set cn=nothing
%>
<%
''Query for sub category list for selected category
if (mprimarycatId <>5 and mprimarycatId <>6 and cint(trim(mprimarycatId)) <> cint(trim("109")) and cint(trim(mprimarycatId)) <> cint(trim("112")) and cint(trim(mprimarycatId)) <> cint(trim("113")) )then ''#1
''sqlCategory="select distinct catid,subcatid,subcategoryname from category_sub"
''sqlCategory=sqlCategory & " where catid=" & mprimarycatId
sqlCategory="Select catid,category_primarySub.subcatid,subcategoryname "
sqlCategory=sqlCategory & "from category_primarysub Where status='A' and "
if (mprimarycatId=103 or mprimarycatId=104) then
sqlCategory=sqlCategory & " (catid=" & mprimarycatId & " or catid=107) and Comp_code='" & application("compcode") & "'"
elseif(mprimarycatId=108) then
sqlCategory=sqlCategory & " catid = 102 and Comp_code='" & application("compcode") & "'"
else
sqlCategory=sqlCategory & " catid=" & mprimarycatId & " and Comp_code='" & application("compcode") & "'"
end if
%>
<%
dim rssubCategory
set rssubCategory=server.CreateObject("Adodb.recordset")
rssubCategory.Open sqlCategory,cn
while rssubCategory.EOF =false
%>
<%
rssubCategory.MoveNext
wend
rssubCategory.Close
set rssubCategory=nothing
%>
<%
end if ''' end of if (mprimarycatId <>5 and mprimarycatId <>6)then #1
%>