<% Set conn = Server.CreateObject("ADODB.Connection") conn.Open myDNS set rs = server.createobject("ADODB.recordset") sub ListSubMenu(myid) dim rs dim SQLs dim conn dim count_z dim rows_SubMenu dim rs_SubMenu Set conn = Server.CreateObject("ADODB.Connection") conn.Open myDNS set rs = server.createobject("ADODB.recordset") SQLs = "SELECT ID, ItemID, ItemName" & _ " FROM Item" & _ " WHERE ParentID = " & apIDStr(myid) & _ " AND [Type] = 'folder'" & _ " ORDER BY SortCode, ID" rs.Open SQLs, conn, 0, 1 if rs.EOF then rows_SubMenu = -1 else rs_SubMenu = rs.GetRows rows_SubMenu = UBound(rs_SubMenu,2) end if rs.close for k = 0 to rows_SubMenu response.write "" & vbCrLf response.write "" & vbCrLf response.write "
" & rs_SubMenu(2,k) & "
" & vbCrLf response.Write "" & vbCrLf response.write "
" & vbCrLf response.Write " " & vbCrLf response.Write " " & vbCrLf ' if myid+1 <= z then ' if StrComp(apIDStr(myid+1),rs_SubMenu(0,k)) = 0 then call ListSubMenu(myid+1) ' end if next k = -1 set rs_SubMenu = nothing end sub ParentID = Request("ParentID") if ParentID = empty then ParentID = "6" SQLs = "SELECT ID, ItemID, ItemName" & _ " FROM Item" & _ " WHERE ParentID = 0" & _ " AND [Type] = 'folder'" & _ " ORDER BY SortCode, ID" rs.Open SQLs, conn, 0, 1 if rs.EOF then rows_Menu = -1 else rs_Menu = rs.GetRows rows_Menu = UBound(rs_Menu,2) end if rs.Close 'if FindParentID(ParentID) = "0" then ' Response.Cookies(Session.SessionID)("rootid") = ParentID 'end if 'rootid = Request.Cookies(Session.SessionID)("rootid") if not(parentID = empty) then SQLs = "SELECT ID, ItemID, ItemName, ItemPic, [Type], ItemDesc" & _ " FROM Item" & _ " WHERE ParentID = " & ParentID & _ " ORDER BY SortCode, ID" rs.Open SQLs, conn, 0, 1 response.write sql if rs.EOF then rows_Item = -1 strFound = 0 else rs_Item = rs.GetRows rows_Item = UBound(rs_Item,2) '------------------------------------- Start Product per Page rows_item = rows_Item ThisPage = request("page") ppp = 500 if ThisPage = empty then ThisPage = 1 if rows_item >= 0 then ThisPage = CInt(ThisPage) rows_item = rows_item + 1 TotalPage = int(FormatNumber((rows_item/PpP)+0.49999,0)) if ThisPage < 1 then ThisPage = 1 elseif ThisPage > TotalPage then ThisPage = TotalPage end if sItem = ((ThisPage-1) * PpP) if ThisPage = TotalPage then eItem = rows_item - 1 else eItem = sItem + PpP - 1 end if if TotalPage > 1 then strPpP = "Page : " max_display = 5 current_position = 3 if TotalPage <= max_display then s_countpage = 1 e_countpage = TotalPage else if ThisPage > current_position then if ThisPage+(max_display-current_position) > TotalPage then s_countpage = TotalPage-(max_display-1) e_countpage = TotalPage else s_countpage = ThisPage-(current_position-1) e_countpage = ThisPage+(max_display-current_position) end if else s_countpage = 1 e_countpage = max_display end if end if 'page number if StrComp(ThisPage,1) <> 0 then LinkStr = "<< | " strPpP = strPpP & LinkStr else strPpP = strPpP & "<< | " end if if StrComp(s_countpage,ThisPage) <> 0 then LinkStr = "< | " strPpP = strPpP & LinkStr else strPpP = strPpP & "< | " end if for countpage = s_countpage to e_countpage if StrComp(countpage,ThisPage) <> 0 then LinkStr = "" & countpage & "" strPpP = strPpP & LinkStr else strPpP = strPpP & "" & countpage & "" end if strPpP = strPpP & " | " next if StrComp(e_countpage,ThisPage) <> 0 then LinkStr = "> | " strPpP = strPpP & LinkStr else strPpP = strPpP & "> | " end if if StrComp(ThisPage,TotalPage) <> 0 then LinkStr = ">>" strPpP = strPpP & LinkStr else strPpP = strPpP & ">>" end if end if strFound = sItem+1 & " - " & eItem+1 & " of " & rows_item end if '------------------------------------- End Product per Page end if rs.Close else rows_Item = -1 strFound = 0 end if z = -1 t_pID = ParentID pIDStr = t_pID NameStr = ThisCatName while (not(t_pID = "0") and z < 20) t_name = FindItem(t_pID, "itemname") t_pID = FindParentID(t_pID) pIDStr = t_pID & "," & pIDStr NameStr = t_name & "," & NameStr z = z+1 wend apIDStr = Split(pIDStr,",") aNameStr = Split(NameStr,",") z = UBound(apIDStr) dim images(5) images(1) = "line_ladies.gif" images(2) = "line_slippers.gif" images(3) = "line_menslippers.gif" images(4) = "line_menshoes.gif" images(5) = "arabic.gif" dim img(5) img(1) = "shoes01.gif" img(2) = "wedges02.gif" img(3) = "maxi03.gif" img(4) = "home04.gif" img(5) = "wooden05.gif" %> Un title page <%if parentid >= 6 Then%> <%else%> <%end if%>
        
 
<% if rows_Item >= 0 then for i = sItem to eItem step 4 %> <% for j = i to i+3 %> <% next %> <% next end if %>
<% if j <= eItem then ID = rs_Item(0,j) ItemID = rs_Item(1,j) ItemName = rs_Item(2,j) ItemPic = rs_Item(3,j) ItemType = rs_Item(4,j) if ItemPic = empty or IsNull(ItemPic) then ItemPic = "spacer.gif" if ItemType = "z" then %>
<%=ItemName%>

<% else %> <% end if end if %>