<%@ Language=VBScript %> <% option explicit response.buffer = true '********************************************************************************************** '*功能:特定首页显示程序 '*编码:许泽辉编写 '*日期:2005-03-10 '*功能说明 '* 此页面显示不同的行业所需的仪器 '********************************************************************************************** %> <% On error resume next const pModuleName="Site_Page" '模块名称 const IsUseUpLoad=1 '是否使用上载功能 Response.write ShowInfo(vSiteName) '调用ShowInfo函数显示内容 Function ShowInfo(vSiteName) ON error resume next vTemplatePath=mGetTemplePath(vSiteName) LoadTemplate server.mappath(vTemplatePath) & "/Default.htm", "All" setVar "TemplatePath",vTemplatePath mShowHeader vSiteName mShowNavigationTop vSiteName,"no" '显示当前位置(位于顶部) '显示产品信息 ShowProductsList vSiteName,"Main",vTemplatePath mShowNavigationBottom vSiteName,"no" '显示当前位置(位于底部) mShowFooter vSiteName parse "All",False ShowInfo=PrintVar("All") '返回页面的内容 UnloadTemplate if err then response.write " '显示数据时错误:" & err.description response.end end if End Function Function ShowProductsList(vSiteName,vBlockName,vTemplatePath) LoadTemplate server.mappath(vTemplatePath) & "/Products/ProductsClass.htm", vBlockName if err then UnloadTemplate response.write "'加载行业产品类别模板时发生错误::" & err.description response.end end if '\\\\\\\\\\\\\\\\\\\\\左边栏目显示\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ LoadTemplate server.mappath(vTemplatePath) & "/Left_Body.htm","Left_Body" SetVar "Left_Body_TopTr","" '---------------------------------------------------------------------------- setVar "SiteName",vSiteName SetVar "InfoName","Products" Dim ProductsSort,ProductsGroup,QueryStr,nType QueryStr="TradeType<>''" ProductsGroup=request.QueryString("Group") ProductsSort=request.QueryString("Type") nType=trim(request.QueryString("nType")) If (ProductsGroup<>"") and (ProductsSort<>"") Then If nType="高斯计/特斯拉计" Then QueryStr="(Title like '%高斯计%' or Title like '%特斯拉计%' or Title like '%磁强计%')" 'response.Write(QueryStr) Else QueryStr="Title like '%"&nType&"%'" 'response.Write("b"&QueryStr) End If Show_ProductGroup_List vSiteName,ProductsGroup ShowProductsList1 vSiteName,vTemplatePath,ProductsSort,ProductsGroup,QueryStr ElseIf ProductsSort<>"" Then Show_ProductClass_List vSiteName,ProductsSort ShowProductsList2 vSiteName,vTemplatePath,ProductsSort '显示本类别的每个产品 End If '---------------------------------------------------------------------------- SetVar "Left_Body_Search","" mShowHot_Link vSiteName SetVar "Left_Body_White","" Parse "Left_Body",false '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 'response.Write(ProductsSort)'测试用 'response.Write(ProductsGroup)'测试用 End Function Function ShowProductsList1(vSiteName,vTemplatePath,vProductsSort,vProductsGroup,vQuery) '根据产品页面的类别显示此类别下Enabled最大的记录 Dim ObjPage_Permit_View,vTitle,vPageId,vComment,vURL set ObjPage_Permit_View=New ClsPage_Permit_View With ObjPage_Permit_View .GetAllByAdvQuery "SELECT PageId,Title,TradeType,Comment FROM GB_Page_Permit_View Where PageName='"&vProductsSort&"' And TradeType<>'' And TradeType like '%"&vProductsGroup&"%' And "&vQuery&" And Enabled>0 Order by Enabled" 'response.Write(vProductsGroup)'测试用 While Not .Eof 'response.Write(ObjPage_Permit_View.Title&"
") '测试用 vTitle=gCheckNullStr(.Title) vPageId=gCheckNullStr(GetUpInfoToId("Demo_"+pModuleName,.PageId)) vComment=gmyStrDisp(gLimitTitle(gCheckNullStr(.Comment),300)) 'response.Write(TradeTypeItem(i))'测试用 vURL="Site_PageTplSee.asp?PkValue="&.PageId&"&Group="&vProductsGroup&"&MenuName="&vTitle&"&SiteName="&vSiteName If vPageId="" Then SetVar "ProductsListImg","" Else SetVar "ProductsListImg",""&vTitle&"" End If SetVar "ProductsListTitle",vTitle SetVar "ProductsListInfo",vComment Parse "Products_List",true .MoveNext Wend If .RecordCount=1 Then Set ObjPage_Permit_View=Nothing UnloadTemplate response.redirect vURL End If If .RecordCount>1 Then Dim vTrade If vProductsGroup="1" Then vTrade="原料厂、永磁材料厂" End If If vProductsGroup="2" Then vTrade="软磁铁氧体、非晶行业" End If If vProductsGroup="3" Then vTrade="硅钢、钢铁冶金行业" End If If vProductsGroup="4" Then vTrade="微特电机、电机行业" End If If vProductsGroup="5" Then vTrade="大专院校、科研机构" End If If vProductsGroup="6" Then vTrade="电声行业、变压器行业" End If If vProductsGroup="7" Then vTrade="仪器仪表、电子行业" End If SetVar "PageName","(R)"&vProductsSort&",是"&vTrade&"的选择" End If End With Set ObjPage_Permit_View=Nothing End Function Function ShowProductsList2(vSiteName,vTemplatePath,vProductsSort) 'response.Write(vProductsSort)'测试用 Dim ObjPage_Permit_View,vTitle,vPageId,vComment,vURL set ObjPage_Permit_View=New ClsPage_Permit_View With ObjPage_Permit_View .GetAllByAdvQuery "SELECT PageId,Title,TradeType,Comment FROM GB_Page_Permit_View Where PageName='"&vProductsSort&"' And Enabled>0 Order by Enabled" While Not .Eof 'response.Write(ObjPage_Permit_View.Title&"
") '测试用 vTitle=gCheckNullStr(.Title) vPageId=gCheckNullStr(GetUpInfoToId("Demo_"+pModuleName,.PageId)) vComment=gmyStrDisp(gLimitTitle(gCheckNullStr(.Comment),200)) 'response.Write(TradeTypeItem(i))'测试用 vURL="Site_PageTplSee.asp?PkValue="&.PageId&"&MenuName="&server.URLEncode(vTitle)&"&SiteName="&vSiteName If vPageId="" Then SetVar "ProductsListImg","" Else SetVar "ProductsListImg",""&vTitle&"" End If SetVar "ProductsListTitle",vTitle SetVar "ProductsListInfo",vComment Parse "Products_List",true .MoveNext Wend If .RecordCount=1 Then Set ObjPage_Permit_View=Nothing UnloadTemplate response.redirect vURL End If If .RecordCount>1 Then SetVar "PageName","(R)"&vProductsSort&",满足不同用户的需求" End If End With Set ObjPage_Permit_View=Nothing End Function %>