<% ' ************************************************** ' © VWA Software Development 2011 ' Release: 1.01.0007 ' Changed: Jul 15, 2011 ' Author : Berco Wassink ' ************************************************** %> Sitemap <% if (session("Admin") <> "1") then%> <% end if%> <% ' Variabelen declareren dim rstLang, rst dim sSQL ' Database openen if not VWA_SQLConnect(cKey, true) then response.end%>

<%=session("SiteName" & iSiteID)%>: SiteMap

<% ' Recordset met talen openen sSQL = "SELECT TOP 1 L.LangCode, L.Name, L.ImgSite" sSQL = sSQL & " FROM tbllanguage AS L INNER JOIN tblsitelanguage AS A ON L.LangCode = A.LangCode" sSQL = sSQL & " WHERE A.SiteID=" & iSiteID & " AND A.Disabled=0" sSQL = sSQL & " ORDER BY " & VWA_SQLFuncIIf(cKey, "A.LangCode=" & VWA_SQLText(cKey, sLangCode), "0", "1") sSQL = sSQL & ", " & VWA_SQLFuncIIf(cKey, "A." & VWA_SQLFuncObjectName(cKey, "Default") & "<>0", "0", "1") sSQL = sSQL & ", L.Name" if VWA_SQLOpenRecordset(cKey, sSQL, rstLang, true) then do while not rstLang.eof%> <% ' Alle menuus van land plaatsen sSQL = "SELECT M.MenuID, M.Name, M.Disabled, M.SubMenuus" sSQL = sSQL & " FROM tblmenu AS M INNER JOIN tblbutton AS B ON M.SiteID=B.SiteID AND M.MenuID=B.MenuID" sSQL = sSQL & " WHERE M.SiteID=" & iSiteID sSQL = sSQL & " AND B.ProtectTypeID=0" ' Alleen onbeveiligde subknoppen sSQL = sSQL & " AND B.Recycle=0" sSQL = sSQL & GetSQLEnabled("M") ' Validatie houdbaarheid sSQL = sSQL & GetSQLEnabled("B") ' Validatie houdbaarheid sSQL = sSQL & " AND B.LangCode=" & VWA_SQLText(cKey, rstLang("LangCode")) sSQL = sSQL & " GROUP BY M.MenuID, M.Name, M.Disabled, M.SubMenuus, " & VWA_SQLFuncIIf(cKey, "M." & VWA_SQLFuncObjectName(cKey, "Default") & "<>0", "0", "1") sSQL = sSQL & " ORDER BY " & VWA_SQLFuncIIf(cKey, "M." & VWA_SQLFuncObjectName(cKey, "Default") & "<>0", "0", "1") & ", M.Name" if VWA_SQLOpenRecordset(cKey, sSQL, rst, true) then do while not rst.eof%> <% call LoadMenu(rstLang("LangCode"), rst("MenuID"), 0, 0, "", rst("SubMenuus")) rst.movenext loop rst.close end if set rst = nothing%> <% rstLang.movenext loop rstLang.close end if set rstLang = nothing %>
" alt="<%=rstLang("Name")%>" border="0" align="absmiddle"> <%=replace(rstLang("Name"), " ", " ")%>
<%=replace(rst("Name"), " ", " ")%>
<% ' Database sluiten call VWA_SQLDisconnect(cKey) ' Stoppen met verwerken (hieronder alleen procedures) response.end ' ********************************************************************************************* ' Menu laden function LoadMenu(byval sLangCode, byval iMenuID, byval iParentID, byval iLevel, byval sTDPrefix, byval iMaxLevel) dim rst dim sSQL, sSQL2, sURL sSQL2 = "BC.Recycle=0" sSQL2 = sSQL2 & GetSQLEnabled("BC") ' Validatie houdbaarheid sSQL2 = sSQL2 & " AND BC.ProtectTypeID=0" ' Alleen onbeveiligde subknoppen sSQL = "SELECT B.ButtonID, B.MenuID, B.Name, B.SortNr, B.DTChange, B.ButTypeID" sSQL = sSQL & ", M.ModuleID, M.FrontURL, BF.URL, BF.Code, BF.ConnectID" if (iLevel < iMaxLevel) or (iMaxLevel = 0) then sSQL = sSQL & ", SUM(" & VWA_SQLFuncIIf(cKey, sSQL2, "1", "0") & ") AS Children" else sSQL = sSQL & ", 0 AS Children" end if if (iParentID <= 0) then sSQL = sSQL & ", SUM(" & VWA_SQLFuncIIf(cKey, "BP.Recycle=0", "1", "0") & ") AS Parents" sSQL = sSQL & " FROM ((((tblbutton AS B INNER JOIN tblbuttonframe AS BF ON B.SiteID=BF.SiteID AND B.ButtonID=BF.ButtonID)" sSQL = sSQL & " INNER JOIN tblfsetframe AS F ON BF.Code=F.Code AND BF.SiteID=F.SiteID AND B.FrameSetID=F.FrameSetID AND B.SiteID=F.SiteID)" sSQL = sSQL & " INNER JOIN tblmodule AS M ON BF.ModuleID = M.ModuleID)" sSQL = sSQL & " LEFT JOIN tblbutton AS BP ON B.SiteID=BP.SiteID AND B.ParentID=BP.ButtonID)" sSQL = sSQL & " LEFT JOIN tblbutton AS BC ON B.SiteID=BC.SiteID AND B.ButtonID=BC.ParentID" sSQL = sSQL & " WHERE 1=1" else sSQL = sSQL & " FROM (((tblbutton AS B INNER JOIN tblbuttonframe AS BF ON B.SiteID=BF.SiteID AND B.ButtonID=BF.ButtonID)" sSQL = sSQL & " INNER JOIN tblfsetframe AS F ON BF.Code=F.Code AND BF.SiteID=F.SiteID AND B.FrameSetID=F.FrameSetID AND B.SiteID=F.SiteID)" sSQL = sSQL & " INNER JOIN tblmodule AS M ON BF.ModuleID = M.ModuleID)" sSQL = sSQL & " LEFT JOIN tblbutton AS BC ON B.SiteID=BC.SiteID AND B.ButtonID=BC.ParentID" sSQL = sSQL & " WHERE B.ParentID=" & iParentID end if sSQL = sSQL & " AND B.SiteID=" & iSiteID & " AND B.MenuID=" & iMenuID & " AND B.LangCode=" & VWA_SQLText(cKey, sLangCode) sSQL = sSQL & GetSQLEnabled("B") ' Validatie houdbaarheid sSQL = sSQL & " AND B.ProtectTypeID=0" ' Alleen onbeveiligde subknoppen sSQL = sSQL & " AND B.Recycle=0" sSQL = sSQL & " AND F.ExcludeSitemap=0" ' Alleen niet uitgesloten framesets sSQL = sSQL & " AND B.ButTypeID<>3" ' Alleen knoppen met inhoud sSQL = sSQL & " GROUP BY B.ButtonID, B.MenuID, B.Name, B.SortNr, B.DTChange, B.ButTypeID" sSQL = sSQL & ", M.ModuleID, M.FrontURL, BF.URL, BF.Code, BF.ConnectID" if (iParentID <= 0) then sSQL = sSQL & " HAVING SUM(" & VWA_SQLFuncIIf(cKey, "BP.Recycle=0", "1", "0") & ")=0" end if sSQL = sSQL & " UNION " sSQL = sSQL & "SELECT B.ButtonID, B.MenuID, B.Name, B.SortNr, B.DTChange, B.ButTypeID" sSQL = sSQL & ", 0 AS ModuleID, NULL AS FrontURL, NULL AS URL, NULL AS Code, NULL AS ConnectID" if (iLevel < iMaxLevel) or (iMaxLevel = 0) then sSQL = sSQL & ", SUM(" & VWA_SQLFuncIIf(cKey, sSQL2, "1", "0") & ") AS Children" else sSQL = sSQL & ", 0 AS Children" end if if (iParentID <= 0) then sSQL = sSQL & ", SUM(" & VWA_SQLFuncIIf(cKey, "BP.Recycle=0", "1", "0") & ") AS Parents" sSQL = sSQL & " FROM (tblbutton AS B LEFT JOIN tblbutton AS BP ON B.SiteID=BP.SiteID AND B.ParentID=BP.ButtonID)" sSQL = sSQL & " LEFT JOIN tblbutton AS BC ON B.SiteID=BC.SiteID AND B.ButtonID=BC.ParentID" sSQL = sSQL & " WHERE 1=1" else sSQL = sSQL & " FROM tblbutton AS B LEFT JOIN tblbutton AS BC ON B.SiteID=BC.SiteID AND B.ButtonID=BC.ParentID" sSQL = sSQL & " WHERE B.ParentID=" & iParentID end if sSQL = sSQL & " AND B.SiteID=" & iSiteID & " AND B.MenuID=" & iMenuID & " AND B.LangCode=" & VWA_SQLText(cKey, sLangCode) sSQL = sSQL & GetSQLEnabled("B") ' Validatie houdbaarheid sSQL = sSQL & " AND B.ProtectTypeID=0" ' Alleen onbeveiligde subknoppen sSQL = sSQL & " AND B.Recycle=0" sSQL = sSQL & " AND B.ButTypeID=3" ' Alleen knoppen met submenuus (zonder inhoud) sSQL = sSQL & " GROUP BY B.ButtonID, B.MenuID, B.Name, B.SortNr, B.DTChange, B.ButTypeID" if (iParentID <= 0) then sSQL = sSQL & " HAVING SUM(" & VWA_SQLFuncIIf(cKey, "BP.Recycle=0", "1", "0") & ")=0" end if ' Sortering sSQL = sSQL & " ORDER BY 4, 3" 'SortNr, Name if VWA_SQLOpenRecordset(cKey, sSQL, rst, true) then sTDPrefix = sTDPrefix & "  " do while not rst.eof select case rst("ButTypeID") case 3 ' Alleen subknoppen tonen%> <%=sTDPrefix%>
  <%=replace(rst("Name"), " ", " ")%>
<% ' Overslaan case else sURL = Nz(rst("FrontURL"), "") if (len(sURL) = 0) then sURL = Nz(rst("URL"), "") ' Controleren of content-bestand ingesteld is if (len(sURL) > 0) and (replace(left(sURL, 1), "\", "/") <> "/") and (strcomp(left(sURL, 5), "http:", vbTextCompare) <> 0) then sURL = "../" & replace(session("ContentDir" & iSiteID), "\", "/") & sURL end if end if if (len(sURL) = 0) then sURL = "page.asp" ' Standaard directory voorvoegen if (instr(1, sURL, "\") = 0) and (instr(1, sURL, "/") = 0) then sURL = "../asp/" & sURL ' Codes aan link toevoegen if (instr(1, sURL, "&ButtonID=") = 0) and (instr(1, sURL, "?ButtonID=") = 0) then sURL = sURL & iif(instr(1, sURL, "?") > 0, "&", "?") & "ButtonID=" & rst("ButtonID") & "&FrameID=" & rst("Code")%> <%=sTDPrefix%>
  "><%=replace(rst("Name"), " ", " ")%>
<% ' Controleren of items uit module getoond moeten worden select case Nz(rst("ModuleID"), 0) case 11, 13 ' Webshop, Catalogus call LoadModule(sLangCode, Nz(rst("ModuleID"), 0), Nz(rst("ConnectID"), 0), Nz(rst("URL"), ""), sTDPrefix, sURL) end select end select ' Kinderen toevoegen indien level niet bereikt is if (Nz(rst("Children"), 0) > 0) then call LoadMenu(sLangCode, iMenuID, rst("ButtonID"), iLevel + 1, sTDPrefix, iMaxLevel) rst.movenext loop rst.close end if set rst = nothing end function sub LoadModule(byval sLangCode, byval iModuleID, byval iGroupID, byval sConnectURL, byval sTDPrefix, byval sBaseURL) dim rst, rst2 dim sSQL, sURL, sName, sWhere dim sTableName, sTableField, sTableKey dim iLanguageUse ' Controleren op ongeldig filter if (len(sConnectURL) > 0) and (strcomp(left(sConnectURL, 11), "PrdGroupID=", vbTextCompare) <> 0) then exit sub ' URL bijwerken 'sBaseURL = sBaseURL & "&ModuleID=" & iModuleID sBaseURL = sBaseURL & "&GroupID=" & iGroupID 'sBaseURL = sBaseURL & "&type=popup" ' test -> voorkomt laden in frame... ' Gegevens van module laden sSQL = "SELECT Name, TableName, TableKey, TableField, TableFilter, ArticleName, Icon, HelpID" sSQL = sSQL & " FROM tblmodule" sSQL = sSQL & " WHERE ModuleID=" & iModuleID if VWA_SQLOpenRecordset(cKey, sSQL, rst, true) then sTableName = Nz(rst("TableName"), "") sTableKey = Nz(rst("TableKey"), "") sTableField = Nz(rst("TableField"), "") rst.close end if set rst = nothing if (len(sTableKey) = 0) then sTableKey = "@.GroupID" if (len(sTableField) = 0) then sTableField = "Name" sWhere = "@.SiteID=" & iSiteID & " AND " & sTableKey & "=" & iGroupID ' Algemene gegevens van module iLanguageUse = 0 sSQL = "SELECT A.LanguageUse" sSQL = sSQL & " FROM " & sTableName & " AS A" sSQL = sSQL & " WHERE " & replace(sWhere, "@.", "A.") if VWA_SQLOpenRecordset(cKey, sSQL, rst, true) then iLanguageUse = Nz(rst("LanguageUse"), 0) rst.close end if set rst = nothing sSQL = "SELECT A.PrdGroupID, A.SortNr" sSQL = sSQL & ", MAX(" & VWA_SQLFuncIIf(cKey, "B.LangCode=" & VWA_SQLText(cKey, iif(iLanguageUse <= 0, "XX", sLangCode)), "B.Name", "NULL") & ") AS Name" sSQL = sSQL & ", MAX(" & VWA_SQLFuncIIf(cKey, "B.LangCode=" & VWA_SQLText(cKey, "XX"), "B.Name", "NULL") & ") AS NameXX" sSQL = sSQL & " FROM " & sTableName & "prdgroup AS A INNER JOIN " & sTableName & "prdgrouplang AS B ON A.SiteID=B.SiteID AND " & replace(sTableKey, "@.", "A.") & "=" & replace(sTableKey, "@.", "B.") & " AND A.PrdGroupID=B.PrdGroupID" sSQL = sSQL & " WHERE " & replace(sWhere, "@.", "A.") if (len(sConnectURL) > 0) then sSQL = sSQL & " AND A." & sConnectURL sSQL = sSQL & GetSQLEnabled("A") ' Validatie houdbaarheid sSQL = sSQL & " GROUP BY A.PrdGroupID, A.SortNr" sSQL = sSQL & " ORDER BY A.SortNr" if VWA_SQLOpenRecordset(cKey, sSQL, rst, true) then do while not rst.eof ' Codes aan link toevoegen sURL = sBaseURL & "&PrdGroupID=" & rst("PrdGroupID") sName = Nz(rst("Name"), rst("NameXX"))%> <%=sTDPrefix%>
     <%=replace(sName, " ", " ")%>
<% ' Items van categorie select case iModuleID case 13 ' Catalogus sSQL = "SELECT A.ProductID AS ItemID, A.DealerID, A.SortNr" sSQL = sSQL & ", A.Name, A.Name AS NameXX" sSQL = sSQL & " FROM " & sTableName & "product AS A" sSQL = sSQL & " WHERE " & replace(sWhere, "@.", "A.") sSQL = sSQL & " AND A.PrdGroupID=" & rst("PrdGroupID") sSQL = sSQL & GetSQLEnabled("A") ' Validatie houdbaarheid sSQL = sSQL & " ORDER BY A.DealerID, A.SortNr" case else sSQL = "SELECT A.ProductID AS ItemID, A.SortNr" sSQL = sSQL & ", MAX(" & VWA_SQLFuncIIf(cKey, "B.LangCode=" & VWA_SQLText(cKey, iif(iLanguageUse <= 0, "XX", sLangCode)), "B.Name", "NULL") & ") AS Name" sSQL = sSQL & ", MAX(" & VWA_SQLFuncIIf(cKey, "B.LangCode=" & VWA_SQLText(cKey, "XX"), "B.Name", "NULL") & ") AS NameXX" sSQL = sSQL & " FROM " & sTableName & "product AS A INNER JOIN " & sTableName & "productlang AS B ON A.SiteID=B.SiteID AND " & replace(sTableKey, "@.", "A.") & "=" & replace(sTableKey, "@.", "B.") & " AND A.ProductID=B.ProductID" sSQL = sSQL & " WHERE " & replace(sWhere, "@.", "A.") sSQL = sSQL & " AND A.PrdGroupID=" & rst("PrdGroupID") sSQL = sSQL & GetSQLEnabled("A") ' Validatie houdbaarheid sSQL = sSQL & " GROUP BY A.ProductID, A.SortNr" sSQL = sSQL & " ORDER BY A.SortNr" end select if VWA_SQLOpenRecordset(cKey, sSQL, rst2, true) then do while not rst2.eof ' Codes aan link toevoegen sURL = sBaseURL select case iModuleID case 13 ' Catalogus if (rst2("DealerID") > 0) then sURL = sURL & "&DealerID=" & rst2("DealerID") end select sURL = sURL & "&ItemID=" & rst2("ItemID") sName = Nz(rst2("Name"), rst2("NameXX"))%> <%=sTDPrefix%>
       <%=replace(sName, " ", " ")%>
<% rst2.movenext loop rst2.close end if set rst2 = nothing rst.movenext loop rst.close end if set rst = nothing end sub %>