<%@Language="VBScript"%> <% Option Explicit %> <% Dim objTemplate Dim activeMenu, brand, f, sf Dim objConn, objRs, objRs2, strQuery, i, j Dim subFragmentMenu, subFragmentContent, banner Set objTemplate = New Template brand = "isuzu" If Len(Trim(Request.QueryString("b"))) > 0 Then brand = Trim(Request.QueryString("b")) End If f = "1" If Len(Trim(Request.QueryString("f"))) > 0 Then f = Trim(Request.QueryString("f")) End If sf = "0" If Len(Trim(Request.QueryString("sf"))) > 0 Then sf = Trim(Request.QueryString("sf")) End If Set objConn = Server.CreateObject("ADODB.Connection") Set objRs = Server.CreateObject("ADODB.Recordset") Set objRs2 = Server.CreateObject("ADODB.Recordset") objConn.Open strConnect objTemplate.LoadTemplate Server.MapPath("templates/header.htm") activeMenu = "||menu2||active||||" objTemplate.SetContent "activeMenu", activeMenu objTemplate.OutputPage banner = "shim.gif" strQuery = "SELECT pic FROM Banners WHERE id = 1" objRs.Open strQuery, objConn If Not objRs.BOF And Not objRs.EOF Then If Len(FromDB(objRs("pic"))) > 0 Then banner = FromDB(objRs("pic")) End If End If objRs.Close objTemplate.LoadTemplate Server.MapPath("templates/splash-default.htm") objTemplate.SetContent "banner", banner objTemplate.OutputPage objTemplate.LoadTemplate Server.MapPath("templates/lefter-" & brand & ".htm") objTemplate.OutputPage objTemplate.LoadTemplate Server.MapPath("templates/showrooms.htm") objTemplate.SetContent "activeFragment", f objTemplate.SetContent "activeSubFragment", sf 'No group strQuery = "SELECT * FROM Products WHERE brand = '" & toDB(brand) & "' AND (tab = '' OR tab IS NULL)" objRs.Open strQuery, objConn If Not objRs.BOF And Not objRs.EOF Then objTemplate.SetContent "brandName", FromDB(objRs("brand")) i = 1 While Not objRs.EOF objTemplate.SetContent "tabLinks", i & "||" & FromDB(objRs("title")) objTemplate.SetContent "tabContents", i & "||" & FromDB(objRs("title")) & "||" & FromDB(objRs("body")) & "||" & FromDB(objRs("pic")) i = i + 1 objRs.MoveNext Wend End If objRs.Close 'With group strQuery = "SELECT DISTINCT tab FROM Products WHERE brand = '" & toDB(brand) & "' AND (tab <> '' OR tab IS NOT NULL)" objRs.Open strQuery, objConn If Not objRs.BOF And not objRs.EOF then While Not objRs.EOF strQuery = "SELECT * FROM Products WHERE brand = '" & toDB(brand) & "' AND tab = '" & objRs("tab") & "'" objRs2.Open strQuery, objConn subFragmentMenu = "" subFragmentContent = "" If Not objRs2.BOF And Not objRs2.EOF Then subFragmentMenu = "" End If objRs2.Close objTemplate.SetContent "tabContentsGroup", i & "||" & subFragmentMenu & "||" & subFragmentContent objTemplate.SetContent "tabLinksGroup", i & "||" & FromDB(objRs("tab")) i = i + 1 objRs.Movenext Wend End If objRs.Close objTemplate.OutputPage objTemplate.LoadTemplate Server.MapPath("templates/footer.htm") Dim objFSO, objCountFile Dim strCountFileName Dim iCount strCountFileName = Server.MapPath("default.asp.cnt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(strCountFileName, 1, True) If Not objCountFile.AtEndOfStream Then iCount = CLng(objCountFile.ReadAll) Else iCount = 0 End If objCountFile.Close Set objCountFile = Nothing if(Session("counter")<>true) then iCount = iCount + 1 Session("counter")=true end if Set objCountFile = objFSO.CreateTextFile(strCountFileName, True) objCountFile.Write iCount objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing objTemplate.SetContent "iCount", iCount objTemplate.OutputPage objConn.Close Set objRs2 = Nothing Set objRs = Nothing Set objConn = Nothing Set objTemplate = Nothing %>