<% '列表显示产品大全 例示:照明行业目录 Sub WriteproductCatalog (id) if id="" then response.write "未指定类别" else sql = "Select * From tCoatCatalog where dTypeWay = " & id & " Order By CatalogID" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof If i <> 0 and i mod 5 = 0 Then Response.Write "" End If Response.write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "
" Response.Write "" Response.Write " " & objTemp ("tCatalogName") & "
" end if End Sub '获取大类别产品的总数 Sub GetCataloglamp (CatalogID) sql = "Select * From tcoatcatalog where catalogid=" & CatalogID & "" Set objTemp4 = objConn.Execute (sql) shengfen1=objtemp4("tcatalogname") response.write shengfen1 objTemp4.Close Set objTemp4 = Nothing End Sub Sub GetTypeNamelamp (strTypeway) if strtypeway="" then response.write "未选择类别" else sql = "Select * from Aclass where classid = " & strTypeway & "" Set objTemp1 = objConn.Execute (sql) response.write objtemp1("class") objTemp1.Close Set objTemp1 = Nothing end if End Sub ' 获得供求信息的类型 Function GettradeleadsType (intinfo) If intinfo = 1 Then GettradeleadsType = "【求购】" ElseIf intinfo = 0 Then GettradeleadsType = "【供应】" ElseIf intinfo = 2 Then GettradeleadsType = "【合作】" ElseIf intinfo = 3 Then GettradeleadsType = "【代理】" ElseIf intinfo = 5 Then GettradeleadsType = "调控设备类" end if End Function Sub total_count (id) sql="select Count (*) as total_count from tinfobank where aclassid= " & id & "" Set objTemp = objConn.Execute (sql) strtotal_count = objtemp(0) response.write strtotal_count objTemp.Close Set objTemp = Nothing End Sub '获取小类别的总数 Sub total_count1 (id) sql="select Count (*) as total_count from tinfobank where ancatalogid= " & id & "" Set objTemp = objConn.Execute (sql) strtotal_count1 = objtemp(0) response.write strtotal_count1 objTemp.Close Set objTemp = Nothing End Sub '获取公司ID Function GetCompanyID (ID) sql = "Select c.Companyid From tUser u, tCompany c where u.CompanyID = c.CompanyID and u.tUsername = '" & ID & "'" Set objUser = objConn.Execute (sql) If Not objUser.Eof Then GetCompanyID = objUser ("CompanyID") End If objUser.CLose Set objUser = Nothing End Function '格式化字符 Function GetLeftStrshop (str) If str = "" Then GetLeftStrshop = "" Else If Len (str) > 82 Then str = Left (str,80) & "..." End If GetLeftStrshop = str End If End Function Function ReplaceStr (str) If str = "" Then ReplaceStr = "" Else If Instr (str, "|" ) <> 0 Then arrStr = Split (str, "|") tmp = "" For i = 0 To Ubound (arrStr) If tmp = "" Then tmp = "产品名称" & (i+1) & ":  " & arrStr (i) & "    " Else tmp = tmp & " " & "产品名称" & (i+1) & ":  " & arrStr (i) & "    " End If Next Else tmp = str End If ReplaceStr = tmp End If End Function Function FormatStr (str) If str = "" Then FormatStr = "" Else FormatStr = Replace (str, "|", "
") End IF End Function ' ================================== ' 根据类别获得新闻列表 例示新闻中心:index.asp ' Sub ListNewsInfoByType (strType) sql = "Select Top 8 * from tUserNews n, tUserNewsType t where n.mPublish = 1 and n.mDel = 0 and t.tName = '" & strType & "'and t.ID = n.NewsTypeID and n.webtype=2 order by dCreatedate DESC" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" str = objTemp ("tTitle") If Len (str) > 18 Then str = Left (objTemp ("tTitle"), 15) End If if objtemp("fpath")<>"" and objtemp("fname")<>"" then Response.Write "" else Response.Write "" end if Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
  ·  " & str & " (" & FormatTime (objTemp ("dCreateDate")) &")  ·  " & str & " (" & FormatTime (objTemp ("dCreateDate")) &")
" Response.Write " 更多" & strType & "...    
" End Sub ' ================================== ' 根据关键词显示订购关键词广告的企业 ' Sub Listkeyword (keyword) if keyword<>"" then sql = "Select Top 8 * from tcompany where musertype = 2 and mDel = 0 and (tcompany like '%" & keyword & "%' or keyword like '%" & keyword & "%') and webtype=2 order by companyid DESC" else sql = "Select * from tcompany where musertype = 2 and mDel = 0 and webtype=2 order by companyid DESC" end if Set objTemp = objConn.Execute (sql) i = 0 Do While not objTemp.Eof Response.Write "" Response.Write "" str = objTemp ("tcompany") strcompany = objTemp ("tcompanyintro") If Len (strcompany) > 100 Then strcompany = Left (objTemp ("tcompanyintro"), 100) End If Response.Write "" Response.Write "" Response.Write "" Response.Write "
  " & str & "
" Response.Write " " & strcompany & "...
" response.write "
" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing End Sub ' ================================== ' 根据类别获得新闻列表 例示首页新闻中心:index.asp ' Sub ListNewsInfoByType1 (strType) sql = "Select Top 6 * from tUserNews n, tUserNewsType t where n.mPublish = 1 and n.mDel = 0 and t.tName = '" & strType & "'and t.ID = n.NewsTypeID and n.webtype=2 order by dCreatedate DESC" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" str = objTemp ("tTitle") If Len (str) > 17 Then str = Left (objTemp ("tTitle"), 17) End If if objtemp("fpath")<>"" and objtemp("fname")<>"" then Response.Write "" else Response.Write "" end if Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
  ·  " & str & "   ·  " & str & " 
" Response.Write " 更多" & strType & "...    
" End Sub Sub ListNewsInfoByType2 (strType) sql = "Select Top 10 * from tUserNews n, tUserNewsType t where n.mPublish = 1 and n.mDel = 0 and t.tName = '" & strType & "'and t.ID = n.NewsTypeID and n.webtype=2 order by dCreatedate DESC" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" str = objTemp ("tTitle") If Len (str) > 17 Then str = Left (objTemp ("tTitle"), 17) End If if objtemp("fpath")<>"" and objtemp("fname")<>"" then Response.Write "" else Response.Write "" end if Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing 'Response.Write "" Response.Write "
  ·  " & str & "   ·  " & str & " 
" 'Response.Write " 更多" & strType & "...    
" End Sub ' ================================= ' 列出新闻信息内容 例示:前后页面 ' Sub ListNewsInfo () sql = "Select Top 7 * from tUserNews where mPublish = 1 and mDel = 0 and webtype=2 order by dCreatedate DESC" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" Response.write "" str = Left (objTemp ("tTitle"), 16) if objtemp("fpath")<>"" and objtemp("fname")<>"" then Response.Write "" else Response.Write "" end if Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
" Response.Write " " Response.Write "  ·  " & str & " (" & FormatTime (objTemp ("dCreateDate")) &")  ·  " & str & " (" & FormatTime (objTemp ("dCreateDate")) &")
 >>发布新闻...        " Response.Write "    >>更多新闻...
" End Sub ' 显示最新供求信息 Sub ListnewbuyInfo (ID) If IsNumeric (ID) Then sql = "Select Top 10 * From tInfoBank where mDel = 0 and mPublish = 1 and dInfoUse = " & ID & " and webtype=2 order by dCreateDate DESC " Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" Response.Write "" strdate= formattime(objtemp("dcreatedate")) str2 = objTemp ("tinfotitle") str1=objtemp("tproductname") if str2<>"" then str=str2 else str=str1 end if If Len (str) > 8 Then str = Left (str, 8) End if Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "
" if id=0 then Response.Write "[供应]" end if if id=1 then Response.Write "[求购]" end if if id=2 then Response.Write "[合作]" end if if id=3 then Response.Write "[代理]" end if response.write "" if objTemp("dInfoUse")="0" then ' Response.write "[供]" Response.write "" & str & " " elseif ObjTemp("dinfouse")="1" Then 'Response.write "[求]" Response.write "" & str & " " elseif objtemp("dinfouse")="2" then Response.write "" & str & " " elseif objtemp("dinfouse")="3" then Response.write "" & str & " " end if Response.write "
" End If End Sub '最新展会信息 Sub MarqueeShowzh () sql = "Select Top 9 * From tCoatShow where mDel = 0 and webtype=2 order by ShowID DESC" Set objTemp = objConn.Execute (sql) ' i = 0 Response.Write "" Do While not objTemp.Eof str=left(objTemp ("tShowName"),16) Response.Write "" Response.write "" Response.Write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
" Response.Write "" Response.Write " " & str & "..
" Response.Write "    >>更多...
" End Sub '最新推荐展会信息 Sub MarqueeShowtjzh () sql = "Select Top 9 * From tCoatShow where mDel = 0 and mintro=1 and webtype=2 order by ShowID DESC" Set objTemp = objConn.Execute (sql) ' i = 0 Response.Write "" Do While not objTemp.Eof str=objTemp ("tShowName") Response.Write "" Response.write "" Response.Write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
" Response.Write "" Response.Write " " & str & "..
" Response.Write "    >>更多...
" End Sub '最新供求信息 Sub newsinfobank () sql = "Select Top 10 * From tinfobank where mDel = 0 order by infoID DESC" Set objTemp = objConn.Execute (sql) ' i = 0 Response.Write "" Do While not objTemp.Eof str=left(objTemp ("tproductname"),20) intinfotype= objtemp("dinfouse") Response.Write "" Response.write "" Response.Write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
" Response.Write "" Response.Write ""& GetinfobankType(intinfotype) & "  " & str & "..
" Response.Write "    >>更多...
" End Sub ' 获得信息类型 Function GetinfobankType (intinfotype) If intinfotype = 0 Then GetinfobankType = "国内供应" ElseIf intinfotype = 1 Then GetinfobankType = "国内采购" ElseIf intinfotype = 2 Then GetinfobankType = "合作信息" ElseIf intinfotype = 3 Then GetinfobankType = "代理信息" ElseIf intinfotype = 4 Then GetinfobankType = "国际采购" ElseIf intinfotype = 5 Then GetinfobankType = "国际供应" End If End Function ' 获得用户VIP等级 Function GetUservip (ID) If IsNumeric (ID) and ID >= 0 Then sql1 = "Select * From tUser where webtype=2 and UserID = " & CInt (ID) & "" 'Response.Write sql1 Set objUser = objConn.Execute (sql1) mvip = objUser ("mvip") if mvip=1 then GetUservip="准VIP" elseif mvip=0 then GetUservip="免费会员" elseif mvip=2 then GetUservip="VIP会员" end if objUser.Close Set objUser = Nothing End If End Function ' 获得用户公司ID Function GetUsercompanyid (ID) If IsNumeric (ID) and ID >= 0 Then sql1 = "Select * From tUser tu,tcompany tc where tu.companyid = tc.companyid and tu.UserID = " & CInt (ID) & "" 'Response.Write sql1 Set objUser = objConn.Execute (sql1) If not objUser.Eof Then GetUsercompanyid = objUser ("companyid") Else GetUsercompanyid = 0 End If objUser.Close Set objUser = Nothing End If End Function ' 原料助剂供应商 Sub listcompany () 'sql = "Select Distinct c.CompanyID, c.tCompany From tProduct p, tCompany c" 'sql = sql & " where c.CompanyID = p.CompanyID and p.mPublish = 1 and p.mDel = 0 order by c.CompanyID DESC" sql = "Select * From tCompany where mDel = 0 and musertype>0 and webtype=2 order by musertype desc,companyid desc" Set objTemp = Server.CreateObject ("ADODB.Recordset") objTemp.MaxRecords = 10 objTemp.Open sql, objConn, 1, 1 str = "" Response.Write "" Response.Write "" i=0 Do While not objTemp.Eof If i <> 0 and i mod 1 = 0 Then Response.Write "" End If Response.write "" str = objTemp ("tcompany") If Len (str) > 16 Then str = Left (objTemp ("tcompany"), 25) End If Response.Write "" 'Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Response.Write "" Set objTemp = Nothing 'Response.Write "" Response.Write "
" Response.Write "·" Response.Write " " & objTemp ("tCompany") & "  
" 'Response.Write "    >>更多...
" End Sub ' 推荐企业 Sub listtjcompany () 'sql = "Select Distinct c.CompanyID, c.tCompany From tProduct p, tCompany c" 'sql = sql & " where c.CompanyID = p.CompanyID and p.mPublish = 1 and p.mDel = 0 order by c.CompanyID DESC" sql = "Select * From ttjcompany where tjdel = 0 order by id desc" Set objTemp = Server.CreateObject ("ADODB.Recordset") objTemp.MaxRecords = 10 objTemp.Open sql, objConn, 1, 1 str = "" Response.Write "" Response.Write "" i=0 Do While not objTemp.Eof If i <> 0 and i mod 1 = 0 Then Response.Write "" End If Response.write "" Response.Write "" 'Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Response.Write "" Set objTemp = Nothing 'Response.Write "" Response.Write "
" Response.Write "·" Response.Write " " & objTemp ("tjCompany") & "  
" 'Response.Write "    >>更多...
" End Sub ' 原料助剂供应商 Sub listshop () 'sql = "Select Distinct c.CompanyID, c.tCompany From tProduct p, tCompany c" 'sql = sql & " where c.CompanyID = p.CompanyID and p.mPublish = 1 and p.mDel = 0 order by c.CompanyID DESC" sql = "Select top 4 * From tshop where mDel = 0 and mPublish = 1 and tj=1 and webtype =2 Order by dCreateDate DESC" Set objTemp = Server.CreateObject ("ADODB.Recordset") objTemp.MaxRecords = 6 objTemp.Open sql, objConn, 1, 1 str = "" Response.Write "" Response.Write "" i=0 Do While not objTemp.Eof If i <> 0 and i mod 2= 0 Then Response.Write "" End If shopsize=objtemp("shopsize") if shopsize=1 then img = objtemp("img") elseif shopsize=0 then img="/photo/shopmode.jpg" end if shopname=objtemp("tshopname") Response.Write "" 'Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Response.Write "" Set objTemp = Nothing 'Response.Write "" Response.Write "
" Response.write "
  
"&shopname&"
" 'Response.Write "    >>更多...
" End Sub ' 原料助剂供应商 Sub listshop1 () 'sql = "Select Distinct c.CompanyID, c.tCompany From tProduct p, tCompany c" 'sql = sql & " where c.CompanyID = p.CompanyID and p.mPublish = 1 and p.mDel = 0 order by c.CompanyID DESC" sql = "Select top 4 * From tshop where mDel = 0 and mPublish = 1 and tj=1 and webtype =2 Order by dCreateDate DESC" Set objTemp = Server.CreateObject ("ADODB.Recordset") objTemp.MaxRecords = 8 objTemp.Open sql, objConn, 1, 1 str = "" Response.Write "" Response.Write "" i=0 Do While not objTemp.Eof If i <> 0 and i mod 4= 0 Then Response.Write "" End If shopsize=objtemp("shopsize") if shopsize=1 then img = objtemp("img") elseif shopsize=0 then img="/photo/shopmode.jpg" end if shopname=objtemp("tshopname") Response.Write "" 'Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Response.Write "" Set objTemp = Nothing 'Response.Write "" Response.Write "
" Response.write "
  
"&shopname&"
" 'Response.Write "    >>更多...
" End Sub ' 列举技术资料类型信息 例示: Sub EnumtechTypeInfo () sql = "Select ID, tName From ttechType Order by ID" Response.Write "" & vbCrLF End Sub ' ================================== ' 根据类别获得技术资料列表 ' Sub ListtechInfoByType (strType) sql = "Select Top 6 * from ttech n, ttechType t where n.mPublish = 1 and n.mDel = 0 and t.tName = '" & strType & "'and t.ID = n.NewsTypeID order by dCreatedate DESC" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" str = objTemp ("tTitle") 'If Len (str) > 16 Then ' str = Left (objTemp ("tTitle"), 16) 'End If Response.Write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
  ·  " & str & " (" & FormatTime (objTemp ("dCreateDate")) &")
" Response.Write " 更多" & strType & "...    
" End Sub ' ================================== ' 根据类别获得技术资料列表 ' Sub ListtechInfoByType1 (strType) sql = "Select Top 9 * from ttech n, ttechType t where n.mPublish = 1 and n.mDel = 0 and t.tName = '" & strType & "'and t.ID = n.NewsTypeID order by dCreatedate DESC" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" str = objTemp ("tTitle") 'If Len (str) > 16 Then ' str = Left (objTemp ("tTitle"), 20) 'End If Response.Write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
  ·  " & str & "
" Response.Write " 更多" & strType & "...    
" End Sub Sub ListtechInfoByType2 (strType) sql = "Select Top 9 * from ttech n, ttechType t where n.mPublish = 1 and n.mDel = 0 and t.tName = '" & strType & "'and t.ID = n.NewsTypeID order by dCreatedate DESC" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" str = objTemp ("tTitle") 'If Len (str) > 16 Then ' str = Left (objTemp ("tTitle"), 20) 'End If Response.Write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
" & str & "
" Response.Write " 更多" & strType & "...    
" End Sub '环球照明网 function now_date() '日期函数 now_date=year(now()) & "-" & right("0" & month(now()),2) & "-" & right("0" & day(now()),2) end function function now_time() '时间函数 now_time=year(now()) & "-" & right("0" & month(now()),2)& "-" & right("0" & day(now()),2) & " " & right("0" & hour(now()),2) & ":" & right("0" & minute(now()),2) end function Function strRnd(intLen) '生成随机字符串 dim num,yourpass yourpass="" Randomize Do While Len(yourpass)0 then dist=trim(str) dist=replace(dist,"'","''") else dist="" end if save=dist end function function view(str) '过滤Html函数(不换行) dim dist if len(str)>0 then dist=trim(str) dist=replace(dist,"<","<") dist=replace(dist,">",">") dist=replace(dist,chr(10)," ") dist=replace(dist,chr(13)," ") dist=replace(dist,vbcrlf," ") else dist="" end if view=dist end function function list(str) '过滤Html函数(换行) dim dist if len(str)>0 then dist=trim(str) dist=replace(dist,"<","<") dist=replace(dist,">",">") dist=replace(dist,chr(13) & chr(10),"
") dist=replace(dist,vbcrlf,"
") else dist="" end if list=dist end function function viewjs(str) '当用javascript显示时过滤'<>等特殊字符 不换行 dim dist if len(str)>0 then dist=trim(str) dist=replace(dist,"<","<") dist=replace(dist,">",">") dist=replace(dist,"\","\\") dist=replace(dist,"'","\'") dist=replace(dist,chr(10)," ") dist=replace(dist,chr(13)," ") dist=replace(dist,vbcrlf," ") else dist="" end if viewjs=dist end function function viewjslist(str) '当用javascript显示时过滤'<>等特殊字符 并换行 dim dist if len(str)>0 then dist=trim(str) dist=replace(dist,"<","<") dist=replace(dist,">",">") dist=replace(dist,chr(13) & chr(10),"
") dist=replace(dist,vbcrlf,"
") dist=replace(dist,"\","\\") dist=replace(dist,"'","\'") dist=replace(dist,vbcrlf," ") else dist="" end if viewjslist=dist end function function mylist(str) '不过滤Html函数(换行) dim dist if len(str)>0 then dist=trim(str) if instr(dist,"")<1 then dist=replace(dist,chr(13) & chr(10),"
") dist=replace(dist,vbcrlf,"
") end if else dist="" end if mylist=dist end function Function leftlm(strString,pos) '判断字符串长度函数 dim iLen,j,i,strone iLen = Len(strString) j=0 For i = 1 To iLen strOne = Mid(strString, i, 1) If Asc(strOne) < 0 Then j=j+2 else j=j+1 end if if cint(j)=cint(pos) then leftlm=left(strString,i) exit function end if if cint(j)>cint(pos) then leftlm=left(strString,i-1) exit function end if next if j<=pos then leftlm=strString end if End function Function length(strString) '判断字符串长度 dim iLen,j,i iLen = Len(strString) j=0 For i = 1 To iLen strOne = Mid(strString, i, 1) If Asc(strOne) < 0 Then j=j+2 else j=j+1 end if next Length=j End function function isnum(curpage) '判断是否数字 dim strtest dim i dim isRight strtest="0123456789" isRight=true if curpage<>"" then for i=1 to len(curpage) if instr(strtest,mid(curpage,i,1))<1 then isRight=false end if next else isRight=false end if isnum=isright end function ' 获得公司的类型 Function GetMainType (intjingyin) If strtjingyin = 1 Then GetMainType = "电光源类" ElseIf strtjingyin = 2 Then GetMainType = "灯具/灯饰类" ElseIf strtjingyin = 3 Then GetMainType = "零配件类" ElseIf strtjingyin = 4 Then GetMainType = "专用材料类" ElseIf strtjingyin = 5 Then GetMainType = "调控设备类" ElseIf strtjingyin = 6 Then GetMainType = "其它类" End If End Function Sub Getbigcatalog (BigCatalogID) sql = "Select * From aclass where classid=" & BigCatalogID & "" Set objTemp3 = objConn.Execute (sql) If not objTemp3.Eof Then shengfen=objtemp3("class") else shengfen="nothing" end if response.write shengfen objTemp3.Close Set objTemp3 = Nothing Response.Write "" End Sub Sub GetCatalog (CatalogID) sql = "Select * From tcoatcatalog where catalogid=" & CatalogID & "" Set objTemp4 = objConn.Execute (sql) shengfen1=objtemp4("tcatalogname") response.write shengfen1 objTemp4.Close Set objTemp4 = Nothing End Sub '显示省份信息 Sub GetProvinceid (intprovinceid) sql = "Select * From tprovince where id=" & intprovinceid & "" Set objTemp3 = objConn.Execute (sql) If not objTemp3.Eof Then shengfen=objtemp3("tname") else shengfen="nothing" end if response.write shengfen objTemp3.Close Set objTemp3 = Nothing Response.Write "" End Sub Sub EnumCountryselect (strprovinceid) Response.Write "" End Sub Function GetUserIDByName (str) sql = "Select * from tUser where sUserName = '" & Replace (str, "'", "''") & "'" Set objUser = objConn.Execute (sql) If not objUser.Eof Then GetUserIDByName = objUser ("UserID") Else GetUserIDByName = 0 End If objUser.close () Set objUser = Nothing End Function ' 根据小类别获得大类别 例示: managerindex/catalog.asp ' Sub GetbmTypeName (strTypeway) sql = "Select * from Aclassjc where classid = " & strTypeway & "" Set objTemp1 = objConn.Execute (sql) response.write objtemp1("class") objTemp1.Close Set objTemp1 = Nothing End Sub Sub GetTypeName (strTypeway) sql = "Select * from Aclass where classid = " & strTypeway & "" Set objTemp1 = objConn.Execute (sql) response.write objtemp1("class") objTemp1.Close Set objTemp1 = Nothing End Sub ' 列出小类别目录 例示: managerindex/addcatalog.asp Sub EnumCatalog () sql = "Select classid, class from Aclass order by classid" Set objTemp = objConn.Execute (sql) Response.Write "" objTemp.Close Set objTemp = Nothing End Sub ' 列出小类别目录 例示: managerindex/addcatalog.asp Sub EnumbmCatalog () sql = "Select classid, class from Aclassjc order by classid" Set objTemp = objConn.Execute (sql) Response.Write "" objTemp.Close Set objTemp = Nothing End Sub '列出被选择的大类 例示:modcatalog.asp Sub SelCatalogmod (id) Response.Write "" End Sub '列出被选择的大类 例示:modcatalog.asp Sub SelbmCatalogmod (id) Response.Write "" End Sub ' 增加产品 例示:modPorduct.asp Sub InsertProduct (sql) If Len (sql) > 0 Then Response.Write sql 'Resposne.End objConn.Execute (sql) If Err.number <> 0 Then Response.Write "数据库正忙, 请稍候再试!" Response.End End IF End If End Sub '后台函数 '列表显示产品大全 例示:首页产品大全 Sub WritenewCatalog (id) sql = "Select * From tCoatCatalog where dTypeWay = " & id & " Order By CatalogID" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof If i <> 0 and i mod 3 = 0 Then Response.Write "" End If Response.write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "
" Response.Write "" Response.Write " " & objTemp ("tCatalogName") & "
" End Sub ' ================================= ' 列出商务中心的新闻 例示:User/index.asp ' Sub ListuserNewsInfo () sql = "Select Top 10 * from tUserNews where mPublish = 1 and mDel = 0 order by dCreatedate DESC" Set objTemp = objConn.Execute (sql) Response.Write "" i = 0 Do While not objTemp.Eof Response.Write "" Response.write "" str = Left (objTemp ("tTitle"), 16) Response.Write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
" Response.Write " " Response.Write "  " & str & "(" & FormatTime (objTemp ("dCreateDate")) &")
 >>发布新闻...        " Response.Write "    >>更多新闻...
" End Sub ' ===================================================================== ' 以下是省份信息的管理部分 ' 显示省份信息 ' Sub EnumProvince () Response.Write "" End Sub ' ================================== ' 根据UserName 获得用户ID 例示:user/man_info.asp Function GetUserIDByName (str) sql = "Select * from tUser where tUserName = '" & Replace (str, "'", "''") & "'" Set objUser = objConn.Execute (sql) If not objUser.Eof Then GetUserIDByName = objUser ("UserID") Else GetUserIDByName = 0 End If objUser.close () Set objUser = Nothing End Function ' ================================================ ' 检验用户操作权限 例示:user/add_info.asp ' Sub CheckLoginUser (str) If str = "" Then Response.Write "您没有继续操作的权限,请重新登录" Response.End End If End Sub ' 列举所有的类型信息 时间:4-10 例示程序:user/addinfocorp.asp Sub EnumTypeInfo (TableName) sql = "Select ID, tName From " & TableName & " Order by ID" Response.Write "" & vbCrLF End Sub ' ============================ ' 获得供求信息的发布公司名称 ' Function GetCompanyNameEx2 (userID) If IsNumeric (userID) Then Dim i_strCompanyNameTmp i_strCompanyNameTmp = "" i_sql_2 = "" i_sql_2 = "Select UserID From tinfobank where userID = " & userID & "" Set objInfo = objConn.Execute (i_sql_2) If not objInfo.Eof Then i_intUserID = objInfo ("UserID") 'i_intSysID = objInfo ("SysID") 'If i_intSysID = 1 Then 'i_strCompanyNameTmp = "中华涂料商务网" 'ElseIf IsNumeric (i_intUserID) and i_intUserID > 0 Then 'i_strCompanyNameTmp = GetCompanyName (i_intUserID) & "(会员单位!)" 'Else 'i_strCompanyNameTmp = objInfo ("TCompanyName") i_strCompanyNameTmp = GetCompanyName (i_intUserID) 'End If End If objInfo.Close Set objInfo = Nothing GetCompanyNameEx2 = i_strCompanyNameTmp End If End Function Function GetCompanyNameEx3 (userID) If IsNumeric (userID) Then Dim i_strCompanyNameTmp i_strCompanyNameTmp = "" i_sql_2 = "" i_sql_2 = "Select c.tcompany From tcompany c,tuser u where c.companyid=u.companyid and userID = " & userID & "" Set objInfo = objConn.Execute (i_sql_2) If not objInfo.Eof Then i_intUserID = objInfo ("tcompany") End If objInfo.Close Set objInfo = Nothing GetCompanyNameEx3 = i_intuserid End If End Function ' 获得公司名称 Function GetCompanyName (ID) If ID = 0 Then GetCompanyName = "环球照明网" Else sql = "Select c.TCompany From tUser u, tCompany c where u.CompanyID = c.CompanyID and u.UserID = " & ID & "" Set objUser = objConn.Execute (sql) If Not objUser.Eof Then GetCompanyName = objUser ("TCompany") End If objUser.CLose Set objUser = Nothing End If End Function Function GetCompanyNameEx4 (companyID) If IsNumeric (companyID) Then Dim i_strCompanyNameTmp i_strCompanyNameTmp = "" i_sql_2 = "" i_sql_2 = "Select tcompany From tcompany where companyid=" & companyID & "" Set objInfo = objConn.Execute (i_sql_2) If not objInfo.Eof Then i_intUserID = objInfo ("tcompany") End If objInfo.Close Set objInfo = Nothing GetCompanyNameEx4 = i_intuserid End If End Function ' ================================== ' 获得反馈信息标题 ' Function GetInfoAgainTitle (InfoID, InfoType) If IsNumeric (InfoType) Then Select Case Cint (InfoType) Case 0 sql1 = "select tproductname from tInfoBank where webtype=2 and InfoID = " & Clng (InfoID) & "" Case 1 sql1 = "select tproductname from tInfoBank where webtype=2 and InfoID = " & Clng (InfoID) & "" Case 2 sql1 = "select tproductname from tInfoBank where webtype=2 and InfoID = " & Clng (InfoID) & "" Case 3 sql1 = "select tproductname from tInfoBank where webtype=2 and InfoID = " & Clng (InfoID) & "" Case 4 sql1 = "Select tproductname From tproduct where webtype=2 and productID = " & CLng (InfoID) & "" Case 5 sql1 = "Select ttitle from tusernews where webtype=2 and usernewsID = " & Clng (InfoID) & "" Case 6 sql1 = "Select tshopname from tshop where webtype=2 and shopID = " & Clng (InfoID) & "" Case 7 sql1 = "Select ttitle from ttech where webtype=2 and usernewsID = " & Clng (InfoID) & "" Case 8 sql1 = "Select tshowname from tcoatshow where webtype=2 and showID = " & Clng (InfoID) & "" End Select 'Response.Write sql1 'Response.End If sql1 <> "" Then Set objTitle = objConn.Execute (sql1) If not objTitle.Eof Then 'Response.Write objTitle (0) 'Response.End GetInfoAgainTitle = objTitle(0) Else GetInfoAgainTitle = "" End If objTitle.Close () Set objTitle = Nothing End If Else GetInfoAgainTitle = "" End If End Function ' 列举新闻类型信息 例示:新闻中心index.asp Sub EnumNewsTypeInfo () sql = "Select ID, tName From tUserNewsType Order by ID" Response.Write "" & vbCrLF End Sub Function FormatSQL (str) FormatSQL = Replace (Trim (str), "'", "''") End Function ' 原料助剂供应商 Sub ListProvider () sql = "Select Distinct c.CompanyID, c.tCompany From tProduct p, tCompany c" sql = sql & " where c.CompanyID = p.CompanyID and p.mPublish = 1 and p.mDel = 0 order by c.CompanyID DESC" Set objTemp = Server.CreateObject ("ADODB.Recordset") objTemp.MaxRecords = 6 objTemp.Open sql, objConn, 1, 1 str = "" Response.Write "" Do While not objTemp.Eof Response.Write "" Response.write "" str = objTemp ("tcompany") If Len (str) > 16 Then str = Left (objTemp ("tcompany"), 16) End If Response.Write "" Response.Write "" i = i + 1 objTemp.MoveNext Loop objTemp.Close Set objTemp = Nothing Response.Write "" Response.Write "
" Response.Write "" Response.Write " " & objTemp ("tCompany") & "
" Response.Write "    >>更多...
" End Sub '21lightings函数 ' 列表框的类型信息选择 时间:4-10 Sub SelTypeInfo (tableName, ID) sql = "Select ID, tName From " & TableName & " Order by ID" Response.Write "" & vbCrLF End Sub '获取配方类型 Function GetConType (ID) If IsNumeric (ID) And Clng (ID) > 0 Then If ID = 0 Then GetConType = "其他" Else sql = "Select tName From tCoatingConType where ID = " & ID & "" Set objTemp1 = objConn.Execute (sql) If not objTemp1.Eof Then GetConType = objTemp1 (0) Else GetConType = "其他" End If objTemp1.Close Set objTemp1 = Nothing End If End If End Function '获得配方表 Sub GetConTable (ID) If IsNumeric (ID) And ID > 0 Then sql = "Select * from tCoatingConTable where ConID = " & ID & "" Set objTemp1 = objConn.Execute (sql) If Not objTemp1.Eof Then Do while Not objTemp1.Eof Response.Write "质量:" & objTemp1("tMateria") & "-" & "比例" & objTemp1("tQuality") & "
" objTemp1.MoveNext Loop Else Response.Write " " End If objTemp1.Close Set objTemp1 = Nothing Else Response.Write " " End If End Sub ' 一级目录管理 Sub SelCatalog (ID) If IsNumeric (ID) And ID >=1 Then sql = "Select CatalogID, tCatalogName from tCoatCatalog order by dTypeway" Set objTemp = objConn.Execute (sql) Response.Write "" i_str = i_str + "