<%@ Language=VBScript %> <% option explicit response.buffer = true '********************************************************************************************** '*功能:特定首页显示程序 '*编码:许泽辉编写 '*日期:2005-03-10 '*更新记录 '* 增加按行业分类的典型用户显示 2007-04-17 陈泽军更新 '* 修改代码支持MsSQL 2010-08-11 陈泽军 '*功能说明 '* 此页面显示相应行业的产品种类入相应行业的解决方案 '********************************************************************************************** %> <% On error resume next const pModuleName="Site_Page" '模块名称 const IsUseUpLoad=1 '是否使用上载功能 Dim ProductsGroup ProductsGroup=trim(request.QueryString("Group")) If ProductsGroup="" Then Response.Write("非法进入,参数不正确或丢失!") Response.end End If Response.write ShowInfo(vSiteName,ProductsGroup) '调用ShowInfo函数显示内容 Function ShowInfo(vSiteName,vProductsGroup) ON error resume next vTemplatePath=mGetTemplePath(vSiteName) LoadTemplate server.mappath(vTemplatePath) & "/Default.htm", "All" setVar "TemplatePath",vTemplatePath mShowHeader vSiteName mShowNavigationTop vSiteName,"no" '显示当前位置(位于顶部) '显示产品信息 ShowTradeList vSiteName,"Main",vTemplatePath,vProductsGroup mShowNavigationBottom vSiteName,"no" '显示当前位置(位于底部) mShowFooter vSiteName parse "All",False ShowInfo=PrintVar("All") '返回页面的内容 UnloadTemplate if err then response.write "Show data error:" & err.description '显示数据时错误 response.end end if End Function Function ShowTradeList(vSiteName,vBlockName,vTemplatePath,vProductsGroup) LoadTemplate server.mappath(vTemplatePath) & "/Products/ProductsGroup.htm", vBlockName if err then UnloadTemplate response.write "Load the Products template to make a mistake:" & err.description'加载产品模板时发生错误: response.end end if '\\\\\\\\\\\\\\\\\\\\\左边栏目显示\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ LoadTemplate server.mappath(vTemplatePath) & "/Left_Body.htm","Left_Body" SetVar "Left_Body_TopTr","" ' If vProductsGroup<>"" Then ' Show_ProductGroup_List vSiteName,vProductsGroup ' Else Show_TradeClass_List vSiteName ' End If SetVar "Left_Body_Search","" mShowHot_Link vSiteName SetVar "Left_Body_White","" Parse "Left_Body",false '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ setVar "SiteName",vSiteName SetVar "InfoName","Products" Dim ObjPage_Permit_View set ObjPage_Permit_View=New clsPage_Permit_View With ObjPage_Permit_View If IsSqlDataBase = 1 Then .GetAllByAdvQuery "SELECT PageName,PageId,Title,TradeType FROM GB_Page_Permit_View Where cast(Comment as varchar)<>'' and TradeType<>'' And TradeType like '%"&vProductsGroup&"%' And Enabled>0 Order by Enabled,PageName" Else .GetAllByAdvQuery "SELECT PageName,PageId,Title,TradeType FROM GB_Page_Permit_View Where Comment<>'' and TradeType<>'' And TradeType like '%"&vProductsGroup&"%' And Enabled>0 Order by Enabled,PageName" End If If Not .Eof Then SetVar "PageName","(R)磁测量仪器,是"&replace(request.QueryString("MenuName"),"/","、")&"的选择" Dim Trade,i session("BodyList")=1 '用来换行之用 session("ProductsTradeList_1")="" session("ProductsTradeList_2")="" session("ProductsTradeList_3")="" session("ProductsTradeList_4")="" session("ProductsTradeList_5")="" session("ProductsTradeList_6")="" While not .Eof Trade=Split(.TradeType,"|",-1) If uBound(Trade)>-1 Then 'response.Write(uBound(Trade)) for i=0 to uBound(Trade) If Trade(i)<>"" And Trade(i)=vProductsGroup Then 'response.Write(Trade(i)&"
") '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\特殊情况处理开始\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ If .PageName="MPS系列充磁机和退磁机" Then If session("ProductsTradeList_1")="have" Then Exit For Else session("ProductsTradeList_1")="have" ShowTrade "PageName='"&.PageName&"'",vTemplatePath,vSiteName,vProductsGroup End If '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\第一种特殊情况处理完毕\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ElseIf .PageName="LZ系列磁测量仪器" Then If TakeGB2312Chr(.Title)="高斯计" Or TakeGB2312Chr(.Title)="特斯拉计" Then If session("ProductsTradeList_2")="have" Then Exit For Else session("ProductsTradeList_2")="have" ShowTrade "(Title like '%高斯计%' or Title like '%特斯拉计%')",vTemplatePath,vSiteName,vProductsGroup End If End If If TakeGB2312Chr(.Title)="磁通计" Then If session("ProductsTradeList_3")="have" Then Exit For Else session("ProductsTradeList_3")="have" ShowTrade "Title like '%磁通计%'",vTemplatePath,vSiteName,vProductsGroup End If End If '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\第二种特殊情况处理完毕\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ElseIf .PageName="ATS系列磁测量仪器" Then If TakeGB2312Chr(.Title)="硅钢片铁损测量仪" Then If session("ProductsTradeList_4")="have" Then Exit For Else session("ProductsTradeList_4")="have" ShowTrade "Title like '%硅钢片铁损测量仪%'",vTemplatePath,vSiteName,vProductsGroup End If End If If TakeGB2312Chr(.Title)="铁芯磁性参数测量仪" Then If session("ProductsTradeList_5")="have" Then Exit For Else session("ProductsTradeList_5")="have" ShowTrade "Title like '%铁芯磁性参数测量仪%'",vTemplatePath,vSiteName,vProductsGroup End If End If '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\第三种特殊情况处理完毕\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ElseIf .PageName="其它配套产品" Then If TakeGB2312Chr(.Title)="亥姆霍兹线圈" Then If session("ProductsTradeList_6")="have" Then Exit For Else session("ProductsTradeList_6")="have" ShowTrade "Title like '%亥姆霍兹线圈%'",vTemplatePath,vSiteName,vProductsGroup End If Else ShowTrade "Title='"&.Title&"'",vTemplatePath,vSiteName,vProductsGroup End If '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\第四种特殊情况处理完毕\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Else ShowTrade "Title='"&.Title&"'",vTemplatePath,vSiteName,vProductsGroup End If End If Next End If .MoveNext wend End If End With Set ObjPage_Permit_View=Nothing if int(session("BodyList")-1)/3<>int(session("BodyList")-1)\3 then Parse "ProductFormBody",true End If Parse "ProductList",False ShowTradeProject vSiteName,vProductsGroup ShowTradeCustomer vSiteName,vProductsGroup End Function Function ShowTrade(vQuery,vTemplatePath,vSiteName,vProductsGroup) '根据产品页面的类别显示此类别下Enabled最大的记录 Dim ObjPage_Permit_View,vPageId,TradeTypeItem,i,inrecordcount,TheRecordCount,vURL,vTitle set ObjPage_Permit_View=New ClsPage_Permit_View With ObjPage_Permit_View .GetAllByAdvQuery "SELECT PageId,TradeType,Title,PageName FROM GB_Page_Permit_View Where "&vQuery&" And TradeType<>'' And TradeType like '%"&vProductsGroup&"%' And Enabled>0 Order by Enabled" 'response.Write(.recordcount&"
") '测试用 inrecordcount=1 '统计此行业下符合的有多少条,以便此类代表图片的检索范围 TheRecordCount=.recordcount '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Do While Not .Eof vPageId=gCheckNullStr(GetUpInfoToId("Demo_"+pModuleName,.PageId)) 'response.Write(vQuery&"
") '测试用 if (vPageId="" or len(vPageId)<8) And inrecordcount<>TheRecordCount Then 'response.Write("Exit For
") '测试用 inrecordcount=inrecordcount+1 Else 'response.Write(TakeGB2312Chr(.Title)&vPageId&"
") '测试用 '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ If Trim(.PageName)="MPS系列充磁机和退磁机" Then vTitle="充磁机和退磁机" vURL="" ElseIf TakeGB2312Chr(.Title)="高斯计" or TakeGB2312Chr(.Title)="特斯拉计" Then vTitle="高斯计/特斯拉计" vURL="" ElseIf TakeGB2312Chr(.Title)="磁通计" Then vTitle=TakeGB2312Chr(gLimitTitle(.Title,14))&"(Fluxmeter)" vURL="" ElseIf Trim(.PageName)="ATS系列磁测量仪器" Then vTitle=TakeGB2312Chr(gLimitTitle(.Title,25)) vURL="" ElseIf Trim(.PageName)="其它配套产品" Then vTitle=TakeGB2312Chr(gLimitTitle(.Title,25)) vURL="" Else vTitle=TakeGB2312Chr(gLimitTitle(.Title,25)) vURL="" End If SetVar "Title",""&vTitle&"" '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ If vPageId="" Then SetVar "ProductImg",vURL&"" Else SetVar "ProductImg",vURL&""&vTitle&"" End If Parse "ProductFormList",true if int(session("BodyList"))/3=int(session("BodyList"))\3 then Parse "ProductFormBody",true End If if (int(session("BodyList"))-1)/3=(int(session("BodyList"))-1)\3 and int((session("BodyList")-1)/3)>0 then Parse "ProductFormList",false End If 'response.Write(session("BodyList")/3&"
") '测试用 session("BodyList")=session("BodyList")+1 Exit do End If .MoveNext Loop End With Set ObjPage_Permit_View=Nothing End Function Function ShowTradeProject(vSiteName,vProductsGroup) '显示此行业的解决方案 Dim ObjPage_Permit_View,vTitle,vPageId,k,vContentTemp set ObjPage_Permit_View=New ClsPage_Permit_View With ObjPage_Permit_View .GetAllByAdvQuery "SELECT PageId,Title FROM GB_Page_Permit_View Where Comment is null and (TradeType like '%"&vProductsGroup&"%') And Enabled>0 Order by Enabled Desc" if Not .Eof Then k=1 vContentTemp="" Do While Not .Eof vTitle=gCheckNullStr(.Title) vPageId=gCheckNullStr(.PageId) 'response.Write("K"&K&"
") If ((k-1) mod 2)=0 Then vContentTemp=vContentTemp&"" 'response.Write(K&"tr
") End If If instr(GbLimitTitle(vTitle,20),"...")>0 Then vContentTemp=vContentTemp&"    "&GbLimitTitle(vTitle,20)&"" Else vContentTemp=vContentTemp&"    "&vTitle&"" End If .MoveNext If (k mod 2)=0 and (Not .Eof) Then vContentTemp=vContentTemp&"" 'response.Write(K&"/tr
") End If K=K+1 Loop If (K mod 2)=0 Then 'response.Write(K&"td/td/tr
") vContentTemp=vContentTemp&" " End If SetVar "Title_List_Content",vContentTemp Parse "TradeProjectBody",True Else SetVar "TradeProjectBody","" End If End With Set ObjPage_Permit_View=Nothing End Function Function ShowTradeCustomer(vSiteName,vProductsGroup) '显示此行业的典型用户 dim objBase_Customer,k,vContentTemp set objBase_Customer=new clsBase_Customer With objBase_Customer .GetAllByQuery " and Address like '%"&vProductsGroup&"%' Order By JoinTime Desc" if .eof then SetVar "TradeCustomerBody","" else k=1 vContentTemp="" Do While Not .Eof If ((k-1) mod 2)=0 Then vContentTemp=vContentTemp&"" End If If gCheckNullStr(.CompanyWeb)<>"" and gCheckNullStr(.CompanyWeb)<>"http://" Then vContentTemp=vContentTemp&"    "&gCheckNullStr(.CompanyName)&"" Else vContentTemp=vContentTemp&"    "&gCheckNullStr(.CompanyName)&"" End If .MoveNext If (k mod 2)=0 and (Not .Eof) Then vContentTemp=vContentTemp&"" End If K=K+1 Loop If (K mod 2)=0 Then vContentTemp=vContentTemp&" " End If SetVar "Name_List_Content",vContentTemp Parse "TradeCustomerBody",True end if End With set objBase_Customer=nothing End Function %>