<% Option Explicit If not Session("isLoggedIn") Then response.redirect("/ecommerce/default.asp?returnUrl=" & Server.URLEncode(Request.ServerVariables("SCRIPT_NAME"))) End If %> <% Dim strSortCat, strSortOrder, strOldSortOrder Dim rsItem, arrDBItemData, arrDBItemCatData, strSQL Dim iItemFirst, iItemLast, iItemCatFirst, iItemCatLast Dim I, J Dim intItemCategoryID arrDBItemData = null arrDBItemCatData = null strSortCat = "" strSortOrder = "" strOldSortOrder = "" If Request("sortCat") <> "" Then strSortCat = CStr(Request("sortCat")) If Request("sortOrder") <> "" Then strSortOrder = CStr(Request("sortOrder")) If strSortCat = "" Then strSortCat = "itemID" If strSortOrder = "" Then strSortOrder = "ASC" intItemCategoryID = 0 If Request.Form("itemCategoryID") <> "" Then intItemCategoryID = CInt(Request.Form("itemCategoryID")) If intItemCategoryID <> 0 Then strSQL = "EXEC stpItemSelectAll " & intItemCategoryID Else strSQL = "EXEC stpItemSelectAll" End If Set rsItem = Server.CreateObject("ADODB.Recordset") rsItem.CursorLocation = 3 rsItem.Open strSQL, dbconn, 3, 3 rsItem.Sort = strSortCat & " " & strSortOrder strOldSortOrder = strSortOrder If strSortOrder = "ASC" Then strSortOrder = "DESC" Else strSortOrder = "ASC" End If If rsItem.EOF Then strErrMsg = "
  • no items
  • " isErr = true Else arrDBItemData = rsItem.GetRows() iItemFirst = LBound(arrDBItemData, 2) iItemLast = UBound(arrDBItemData, 2) End If ' not EOF rsItem.Close Set rsItem = Nothing strSQL = "EXEC stpItemCategorySelectAll 1" Set rsItem = dbconn.Execute(strSQL) If rsItem.EOF Then strErrMsg = "
  • no items
  • " isErr = true Else arrDBItemCatData = rsItem.GetRows() iItemCatFirst = LBound(arrDBItemCatData, 2) iItemCatLast = UBound(arrDBItemCatData, 2) End If ' not EOF rsItem.Close Set rsItem = Nothing %> Galuku Cocopeat

    Item List

    Display:
    Sorted by <%= strSortCat %> in <%= LCase(strOldSortOrder) %>ending order

    <% If Session("intUserTypeID") = 1 Then %> <% End If %> <% if not isNull(arrDBItemData) Then For I = iItemFirst To iItemLast 'itemID, itemName, itemDesc, isActive, itemCategoryDesc %> <% Else %><%= "listAltItem" %><% End If %>"> <% If Session("intUserTypeID") = 1 Then %> <% End If %> <% Next end if %>
    Item ID Item name Item description Item category 
    <%= arrDBItemData(0,I) %> <%= arrDBItemData(1,I) %> <%= arrDBItemData(2,I) %> <%= arrDBItemData(4,I) %>edit | <% If arrDBItemData(3,I) = true Then %>de<% End If %>activate

     

    ^ back to top