Advertisement
Advertisement
| 07.12.2008 at 09:33PM PDT, ID: 23560358 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: |
function expandCategory(IDCategory,tempStr)
dim mySQL, rsTemp, catArr, row
'Get Sub-Categories
mySQL = "SELECT idCategory, categoryDesc,categoryHTML," _
& " (SELECT COUNT(*) " _
& " FROM products, categories_products " _
& " WHERE products.idProduct = categories_products.idProduct " _
& " AND categories_products.idCategory = categories.idCategory " _
& " AND active = -1) " _
& " AS prodCount " _
& "FROM categories " _
& "WHERE idParentcategory = " & validSQL(idCategory,"I") & " " _
& "ORDER BY sortOrder, categoryDesc "
set rsTemp = openRSexecute(mySQL)
if not rsTemp.EOF then
'- catArr(0,row) = idCategory
'- catArr(1,row) = categoryDesc
'- catArr(2,row) = categoryHTML
'- catArr(3,row) = prodCount
catArr = rsTemp.getRows()
end if
call closeRS(rsTemp)
'Show Sub-Categories
dim intMaxRow
dim intRowCounter
dim colPerc
intMaxRow = 3 'NUMBER OF COLUMNS
intRowCounter = 0
colPerc = 100/intMaxRow 'This will set the width of the cell on the <TD> to show uniformity
if isArray(catArr) then
for row = 0 to UBound(catArr,2)
if intRowCounter = 0 then
tempStr = tempStr & "<tr>"
end if
intRowCounter = intRowCounter + 1
tempStr = tempStr & "<td width='" & colPerc & "%' align='center' valign='top'><b><a href= ""prodList.asp?idcategory=" & catArr(0,row) & """>" & catArr(2,row) & "<br>" & catArr(1,row) & "</a></b>"
If catArr(3,row) > 0 then
tempStr = tempStr & "<br>(" & catArr(3,row) & ")</span></td>" & vbCrLf
else
'ADDED BY CHRISTINA TO COUNT ALL PRODUCTS IN SUBCATEGORIES
DIM rsCount, catArr2, prodTotalCount, rec_count
rec_count = 0
'WORKING 1 LEVEL DEEP
mySQL = "SELECT products.idProduct " _
& " FROM products, categories_products, categories " _
& " WHERE products.idProduct = categories_products.idProduct " _
& " AND categories_products.idCategory = categories.idCategory " _
& " AND categories.idParentcategory = " & catArr(0,row) & " " _
& " AND active = -1 "
set rsCount = openRSexecute(mySQL)
do while not rsCount.eof
rsCount.MoveNext
rec_count = rec_count + 1
loop
call closeRS(rsCount)
tempStr = tempStr & "<br>(" & rec_count & ")</td>" & vbCrLf
end if
if intRowCounter = intMaxRow then
intRowCounter = 0
tempStr = tempStr & "</tr>" & vbCrLf
end if
next
end if
expandCategory = tempStr
end function
|