<% Set conn = Server.CreateObject("ADODB.Connection") conn.Open myDNS set rs = server.createobject("ADODB.recordset") Const ThisTableName = "news" Const ThisFile = "promotion.asp" Const ThisFileDetail = "promotion_detail.asp" Const MainFile = "promotion.asp" ppp = 10 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, ItemNameth" & _ " FROM " & ThisTableName & _ " WHERE ParentID = " & myid & _ " AND [Type] = 'folder'" & _ " AND Enable = 1" & _ " 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 if rows_SubMenu >= 0 then for k = 0 to rows_SubMenu SubID = rs_SubMenu(0, k) SubItemID = rs_SubMenu(1, k) SubItemName = rs_SubMenu(2, k) response.write" "&vbCrLf response.write""&vbCrLf response.write""&vbCrLf response.write" "&vbCrLf response.write""&vbCrLf response.write""&vbCrLf response.write""&vbCrLf response.write""&vbCrLf response.write" "&vbCrLf response.write""&vbCrLf response.write""&vbCrLf response.write"
 "&vbCrLf response.write"-"&vbCrLf response.write""&vbCrLf response.write"" & SubItemName & "
"&vbCrLf response.write""&vbCrLf response.write""&vbCrLf next end if ' if myid+1 <= z then ' if StrComp(apIDStr(myid+1),rs_SubMenu(0,k)) = 0 then call ListSubMenu(myid+1,1) ' end if set rs_SubMenu = nothing end sub '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - Start Request Data - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ParentID = Request("ParentID") if ParentID = empty then ParentID = "0" pType = Request("pType") ThisParameter = "parentid=" & ParentId & "&ptype=" & PType '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - End Request Data - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - Start Category Menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SQLs = "SELECT ID, ItemID, ItemName" & _ " FROM " & ThisTableName & _ " WHERE ParentID = 0" & _ " AND WBType = 'folder'" & _ " AND Enable = 1" & _ " 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 '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - End Category Menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '- - - - - - - - - - - - - - - - - - - - - Start Checking Sub Category - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '- - - - - if there is no Sub Category. z will be -1 '- - - - - use aNamestr(z-1) for ItemName of ParentID (Show Head Topic useful) z = -1 '- - - - Initial z for checking sub category available t_pID = ParentID '- - - - Assign ParentID pIDStr = t_pID '- - - - Add ParentID into variable NameStr = empty '- - - - Initial NameStr while (not(t_pID = "0") and z < 20) '- - - - if Parentid <> 0 & sub category < 20 t_name = FindItem(t_pID, "itemnameth", "ID", "news") '- - - - Get ItemName t_pID = FindItem(t_pID, "ParentID", "ID", "news") '- - - - Get ParentID of this Product pIDStr = t_pID & "," & pIDStr '- - - - Add ParentID into variable (First one is ParentID = 0, not use) NameStr = t_name & "," & NameStr '- - - - Add ItemName into variable (Last one is empty, not use) z = z+1 wend apIDStr = Split(pIDStr,",") aNameStr = Split(NameStr,",") z = UBound(apIDStr) '- - - - z = total of ParentID since current parentid to parentid=0 NavigatorBar = "" if z = 0 then NavigatorBar = NavigatorBar & "หน้าแรก > สินค้า" elseif z = 1 then NavigatorBar = NavigatorBar & "หน้าแรก " NavigatorBar = NavigatorBar & "> สินค้า " NavigatorBar = NavigatorBar & "> " & aNamestr(z-1) & "" elseif z = 2 then NavigatorBar = NavigatorBar & "หน้าแรก " NavigatorBar = NavigatorBar & "> สินค้า " NavigatorBar = NavigatorBar & "> " & aNamestr(z-2) & " " NavigatorBar = NavigatorBar & "> " & aNamestr(z-1) & "" elseif z = 3 then NavigatorBar = NavigatorBar & "หน้าแรก " NavigatorBar = NavigatorBar & "> สินค้า " NavigatorBar = NavigatorBar & "> " & aNamestr(z-3) & " " NavigatorBar = NavigatorBar & "> " & aNamestr(z-2) & " " NavigatorBar = NavigatorBar & "> " & aNamestr(z-1) & "" else NavigatorBar = NavigatorBar & "home > สินค้า" end if '- - - - - - - - - - - - - - - - - - - - - End Checking Sub Category - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - Start Initial Assign - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - strWhere = empty 'if pType = empty or IsNull(pType) then ' strWhere = " AND ParentID = " & ParentID '- - - Default ' HeadPic = "head_products.gif" '- - - Head Products 'else ' if strComp(pType, "newproduct", 1) = 0 then ' strWhere = " AND NewProduct = 1 " '- - - Select New Product only ' HeadPic = "head_n_product.gif" '- - - Head New Products ' elseif strComp(pType, "promotion", 1) = 0 then ' strWhere = " AND Promotion = 1 " '- - - Select Promotion only ' HeadPic = "head_promotion.gif" '- - - Head Promotion ' end if 'end if '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - End Initial Assign - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '- - - - - - - - - - - - - - - - - - - - - Start Category / Product show - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if not(parentID = empty) then SQLs = "SELECT ID, ItemID, ItemName, ItemPic7,WBType, ItemDesc,ItemDesc2,ItemDate" & _ " FROM " & ThisTableName & _ " WHERE Enable = 1 " & _ " AND ParentID = " & ParentId & _ " AND ItemType = 'N' or ItemType = 'NN' or ItemType = 'NE'" & _ " ORDER BY ID desc" 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_page = rows_Item ThisPage = request("page") %> <% end if rs.Close else rows_Item = -1 strFound = 0 end if '- - - - - - - - - - - - - - - - - - - - - End Category / Product show - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %> The Phulin Resort Karon Phuket thailand , phuket Hotels karon beach :three stars life style hotels in Phuket

 

 

 

 

 

 
<% IF Request("nno") = "" Then pageno = 1 Else pageno = CInt(Request("nno")) End IF set rs=Server.CreateObject("ADODB.Recordset") sql="select * from news where itemtype = 'P' and enable = 1 ORDER BY SortCode, ID Desc " rs.open sql,Conn ,1,1 rs.PageSize = 5 IF Not rs.EoF Then rs.AbsolutePage=PageNo Total = rs.RecordCount PTotal = rs.PageCount P = 1 Col = 1 Do while Not rs.EoF and P <= rs.PageSize P = P + 1 ItemPic = rs("ItemPic") if Col = 1 then al = "left" Col = 2 else al = "right" Col = 1 end if %>
<%if rs("ItemPic") <> "" then%> <%end if%> <%=rs("ItemName")%>
<%=rs("ItemDesc")%>
<%if rs("ItemPic2") <> "" then%> " border="0" width="125" height="180" class="imgbg" hspace="5" align="right" vspace="5"> <%end if%> <%=rs("ItemDesc2")%>
<%if rs("ItemPic3") <> "" then%> " border="0" width="125" height="180" class="imgbg" hspace="5" align="left" vspace="5"> <%end if%> <%=rs("ItemDesc3")%>
<% rs.MoveNext Loop end if rs.close %>
Page : <% For b = 1 to PTotal%> <%IF b = pageno Then%> <%=b%> <%Else%> <%=b%> <%End IF%> | <%Next%>
 
The Phulin Resort
e-mail:info@thephulin.com
website : www.thephulin.com