<!--#include file="Inc/Consts.inc" -->
<!--#include file="Inc/NoSQL.Asp" -->
<!--#include file="Inc/common.Asp" -->
<!--#include file="Inc/strfunc.Asp" -->
<!--#include file="Inc/sharefunc.Asp" -->
<!--#include file="Inc/profunc.Asp" -->
<!--#include file="Inc/aboutfunc.Asp" -->
<!--#include file="Inc/newsfunc.Asp" -->
<%
' 文件名称:ProductView.asp 2012
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
Call SiteInfo()
If ISHTML = 1 Then
    Response.expires = 0
    Response.expiresabsolute = Now() - 1
    Response.addHeader "pragma", "no-cache"
    Response.addHeader "cache-control", "private"
    Response.CacheControl = "no-cache"
End If
Dim ID,rs,sql,SeoKeywords,SeoDescription,SortID,SortPath
ID = trim(request.QueryString("ID"))
If ID <> "" and IsNumeric(ID) Then
    sql = "select Seokeywords,ProductName,SeoDescription,SortID,SortPath from ["&Datapre&"_Products] where ViewFlag and ID="&ID
    set rs=db(sql,3)
	if rs.eof then Call Alert("ID Error!","b-1"):response.End
    If rs("SeoKeywords") <> "" Then
        SeoKeywords = rs("SeoKeywords")
    Else
        SeoKeywords = rs("ProductName")
    End If
    If rs("SeoDescription") <> "" Then
        SeoDescription = rs("SeoDescription")
    Else
        SeoDescription = rs("ProductName")
    End If
    SeoTitle = rs("ProductName")
	SortID=rs("SortID")
	SortPath=rs("SortPath")
rs.Close:Set rs = Nothing
End If
Dim templateurl :templateurl=SysRootDir&templatepath
Dim HeaderString,FooterString,LeftString,ProductViewString
HeaderString=FileSetTemplate("Head.html")
HeaderString=Replace(HeaderString,"$SiteLogo$",SiteLogo,1,1)
HeaderString=Replace(HeaderString,"$bannerpic$",bannerpic(3),1,1)
HeaderString=Replace(HeaderString,"$MainMenu$",MainMenu(2),1,1)
HeaderString=Replace(HeaderString,"$ProMenu$",ProMenu(0),1,1)
HeaderString=Replace(HeaderString,"$aboutlist$",aboutlist(),1,1)
HeaderString=Replace(HeaderString,"$NewsMenu$",NewsMenu(0),1,1)
LeftString=FileSetTemplate("pLeft.html")
LeftString=Replace(LeftString,"$searcher$",searcher,1,1)
LeftString=Replace(LeftString,"$leftcontact$",replace(replace(leftcontact,"$Address$",Address),"$Email$",Email))
ProductViewString=FileSetTemplate("ProductView.html")
ProductViewString=Replace(ProductViewString,"$SeoTitle$",SeoTitle)
ProductViewString=Replace(ProductViewString,"$SiteTitle$",SiteTitle)
ProductViewString=Replace(ProductViewString,"$Keywords$",SeoKeywords)
ProductViewString=Replace(ProductViewString,"$Descriptions$",SeoDescription)
ProductViewString=Replace(ProductViewString,"$ProMenu$",ProMenu(0))
ProductViewString=Replace(ProductViewString,"$getlocation$",getlocation("ProductSort",SortID,SortPath,"ProductList",ProSortName),1,1)
ProductViewString=Replace(ProductViewString,"$copyright$",copyright)
ProductViewString=Replace(ProductViewString,"$Header$",HeaderString)
ProductViewString=Replace(ProductViewString,"$Left$",LeftString)
ProductViewString=Replace(ProductViewString,"$Productcontent$",ProductContent(ID))
ProductViewString=Replace(ProductViewString,"$HTMLName$",HTMLName)
ProductViewString=Replace(ProductViewString,"$templateurl$",templateurl)
Call PrintText(ProductViewString)
Function WebLocation()
    WebLocation = ""
    If request.QueryString("ID") = "" Then
        WebLocation = WebLocation
    ElseIf Not IsNumeric(request.QueryString("ID")) Then
        WebLocation = WebLocation&"读取错误"
    ElseIf conn.Execute("select * from "&Datapre&"_Products Where ViewFlag and  ID="&request.QueryString("ID")).EOF Then
        WebLocation = WebLocation&"读取错误"
    Else
        Dim rs, sql
        Set rs = server.CreateObject("adodb.recordset")
        sql = "select * from "&Datapre&"_Products where ViewFlag and ID="&request.QueryString("ID")
        rs.Open sql, conn, 1, 1
        WebLocation = WebLocation&SortPathTXT(""&Datapre&"_ProductSort", rs("SortID"))
        rs.Close
        Set rs = Nothing
    End If
End Function

Function SortPathTXT(DataFrom, ID)
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "Select * From "&DataFrom&" where ViewFlag and ID="&ID
    rs.Open sql, conn, 1, 1
    If Not rs.EOF Then
	Dim AutoLink
        If ISHTML = 1 Then
            AutoLink = ""&ProSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
        Else
            AutoLink = "ProductList.Asp?SortID="&rs("ID")&""
        End If
        SortPathTXT = SortPathTXT(DataFrom, rs("ParentID"))&" - <a href="""&AutoLink&"""><span style=""color:#EC0000"">"&rs("SortName")&"</span></a>"
    End If
    rs.Close
    Set rs = Nothing
End Function
' 文件名称:ProductView.asp 2012
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
%>