<% 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 "
-
" response.Write " " & rs_SubMenu(2,k) & "" & 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 = "0" 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 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 = 8 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) %> // Kulawat Inter Corporation Limited //
   
 
 
<% if rows_Menu >= 0 then for i = 0 to rows_Menu ID = rs_Menu(0,i) ItemID = rs_Menu(1,i) ItemName = rs_Menu(2,i) %> <% if z >= 1 then if StrComp(apIDStr(1),ID,1) = 0 then call ListSubMenu(1) end if end if next end if %>
4
<%=ItemName%>
   
 
Touch the latest modern technologies and innovations in processing machines to make your industry progress & succeed
 
 
 
<% if rows_Item >= 0 then %> <% for i = sItem to eItem step 2 %> <% for j = i to i+1 %> <% 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) ItemDesc = sFText(rs_Item(5,j)) if (ItemName = empty or IsNull(ItemName)) then ItemName = ItemID ItemID = empty end if if not(ItemID = empty or IsNull(ItemID)) then ItemID = "
" & ItemID end if if ItemPic = empty or IsNull(ItemPic) then ItemPic = "spacer.gif" if ItemType = "z" then 'ถ้า item เป็น product จะแสดงในรูปแบบที่เป็น product %>
<%=ItemName%>
 
 
 
<% else 'ถ้า item เป็น category จะแสดงในรูปแบบที่เป็น category %>
<%=ItemName%>
<% end if else 'ถ้ามี item ไม่พอจนครบแถว จะใส่ช่องว่างลงไปแทน %>   <% end if %>
Found : <%=strFound%> item(s) <%=strPpP%>