<% @Language=VBScript %> <% Response.Redirect "http://www.hkqaa.org" %> <% 'CodePage=950 Session.CodePage=950 dim pageIdx dim keyword dim nameIndex dim cate dim isAdvSrh dim orderFld dim orderfld2 dim rsCate dim tmp dim conn tmp=0 if(Request("ORDER_FLD")<>"") then orderFld=Request("ORDER_FLD") orderfld2=Request("ORDER_FLD") if request("ORDER_FLD")="INDUSTRY" then orderFld=orderFld & ", ENG_COMP" end if orderFld=orderFld & ",CERT_NO" else orderFld="CERT_NO" end if isAdvSrh="0" if(Request("ADVSRH")<>"") then isAdvSrh=Request("ADVSRH") end if cate="" if(Request("CATE")<>"") then cate=Request("CATE") end if nameIndex="" if(Request("NAMEINDEX")<>"") then nameIndex=Request("NAMEINDEX") end if keyword="" if(Request("KEYWORD")<>"") then keyword=Request("KEYWORD") end if pageIdx=1 if (Request("PAGE")<>"") then pageIdx=CInt(Request("PAGE")) end if set conn=MakeConnection %> Buyer Guide <% call AdvSrhHeader %> <% call AdvSrhContent() %> <%'Call ConnDB conditionStr="" if(IsAdvSrh="1") then if(Request("CERT_NO")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&"( Trans.CERT_NO like '% "&trim(Request("CERT_NO"))&"' OR Trans.CERT_NO like '% "&trim(Request("CERT_NO"))&"-P')" end if if(Request("CERT_STAND")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&" QUA_STAND = '"&trim(Request("CERT_STAND"))&"' " end if if(Request("CERT_SCHEME")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&" QUA_SCHEME = '"&trim(Request("CERT_SCHEME"))&"' " end if if(Request("ACCRED")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&" ACCRED like '%"&trim(Request("ACCRED"))&"%' " end if if(Request("COMP_NAME")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&"( ENG_COMP like '%"&trim(Request("COMP_NAME"))&"%' OR CHI_COMP like '%"&trim(Request("COMP_NAME"))&"%' )" end if if(Request("SITE")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&"( Trans.CERT_NO in ( select Site.CERT_NO from Site where Site.SEARCH_COUNTRY='"&Request("SITE")&"') ) " end if if(Request("SCOPE")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&"( ENG_SCOPE like '%"&trim(Request("SCOPE"))&"%' OR CHI_SCOPE like '%"&trim(Request("SCOPE"))&"%' )" end if if(Request("DATEFROM_YY")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if if(Request("DATEFROM_MM")<>"") then if(Request("DATEFROM_DD")<>"") then conditionStr=conditionStr&" CERT_DATE >= #"&Request("DATEFROM_DD")&"/"&Request("DATEFROM_MM")&"/"&Request("DATEFROM_YY")&"#" else conditionStr=conditionStr&" CERT_DATE >= #1/"&Request("DATEFROM_MM")&"/"&Request("DATEFROM_YY")&"#" end if else conditionStr=conditionStr&" CERT_DATE >= #1/1/"&Request("DATEFROM_YY")&"#" end if end if if(Request("DATETO_YY")<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if if(Request("DATETO_MM")<>"") then if(Request("DATETO_DD")<>"") then conditionStr=conditionStr&" CERT_DATE <= #"&Request("DATETO_DD")&"/"&Request("DATETO_MM")&"/"&Request("DATETO_YY")&"#" else conditionStr=conditionStr&" CERT_DATE <= #"&MonDay(CInt(Request("DATETO_MM")),CInt(Request("DATETO_YY")))&"/"&Request("DATETO_MM")&"/"&Request("DATETO_YY")&"#" end if else conditionStr=conditionStr&" CERT_DATE <= #31/12/"&Request("DATETO_YY")&"#" end if end if end if if(keyword<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if if(ucase(left(keyword,2))="CC") then conditionStr=conditionStr&" (Trans.CERT_NO like '% "&trim(mid(keyword,3))&"' or Trans.CERT_NO like '% "&trim(mid(keyword,3))&"-P')" else conditionStr=conditionStr&" (Trans.CERT_NO like '%"&keyword&"%' OR ENG_COMP like '%"&keyword&"%' OR CHI_COMP like '%"&keyword&"%' OR QUA_STAND like '%"&keyword&"%' OR QUA_SCHEME like '%"&keyword&"%' OR ACCRED like '%"&keyword&"%' OR ENG_SCOPE like '%"&keyword&"%' OR CHI_SCOPE like '%"&keyword&"%') " end if end if if(nameIndex<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&" ENG_COMP like '"&nameIndex&"%' " end if if(cate<>"") then if(conditionStr<>"") then conditionStr=conditionStr&" AND " end if conditionStr=conditionStr&"( INDUSTRY like '"&cate&"%' or INDUSTRY like '%, "&cate&"%')" end if if (Request("CERT_NO")<>"" or Request("COMP_NAME")<>"") then conditionStr=" WHERE "&conditionStr else if(conditionStr<>"") then conditionStr=" WHERE "&conditionStr 'conditionStr=conditionStr&" and Site.SITE_NO=1 " 'else ' conditionStr=" WHERE Site.SITE_NO=1 " end if end if 'response.write conditionStr 'response.end 'tableStr="Trans left join Site on Trans.CERT_NO=Site.CERT_NO " tableStr="Trans " sqlstr = "select DISTINCT Trans.CERT_NO" selectFld= "Trans.CERT_NO, QUA_STAND, QUA_SCHEME, STATUS, CERT_DATE, WITHDRAW_D, ENG_BRA, CHI_BRA, ENG_O_C1, CHI_O_C1, ENG_O_C2, CHI_O_C2, ENG_O_C3, CHI_O_C3, ENG_O_C4, CHI_O_C4, ENG_O_C5, CHI_O_C5, LOGO, ENG_COMP, CHI_COMP, INDUSTRY, ACCRED" ' , Site.SITE_NO" sqlstr= sqlstr & " from " & tableStr & " " & conditionStr orderbystr = " ORDER by Trans." & orderFld 'response.write orderFld 'response.write orderbystr sqlstr2= "select count(*) as TotalRec from (" & sqlstr & ") DERIVEDTBL" sqlstr = sqlstr 'response.write sqlstr2 'response.end set rsCount = conn.execute(sqlstr2) recCount=rsCount("TotalRec") set rsCount=nothing pageLen=10 noPage=Int((recCount+pageLen-1)/pageLen) sqlstr3 = "select "&selectFld&" from "&TableStr&" "&conditionStr&orderbystr&"" 'response.write sqlstr3 'response.end set rsTrans = conn.execute(sqlstr3) ' Seek to page counter=1 do until rsTrans.EOF or counter>(pageIdx-1)*pageLen if counter=1 then tmp1=rsTrans("CERT_NO") end if rsTrans.MoveNext if rsTrans("CERT_NO") <> tmp1 then counter=counter+1 tmp1=rsTrans("CERT_NO") end if loop %>
<%if pageIdx>1 then%> <%end if%> List of Certified Companies in Details
(order by )
Page: /<%=noPage%>
<%if pageIdx <%end if%>
<% counter=0 ' --------------------------------------------------- ' Get data from databse ' --------------------------------------------------- do until rsTrans.EOF or counter>=pageLen if counter >= pagelen then counter=0 end if ' Date format DD-MMM-YYYY e.g. 2-Feb-1997 'DateStr = rsTrans("CERT_DATE") DayStr = Day(rsTrans("CERT_DATE")) select case Month(rsTrans("CERT_DATE")) case 1 MonthStr = "Jan" case 2 MonthStr = "Feb" case 3 MonthStr = "Mar" case 4 MonthStr = "Apr" case 5 MonthStr = "May" case 6 MonthStr = "Jun" case 7 MonthStr = "Jul" case 8 MonthStr = "Aug" case 9 MonthStr = "Sep" case 10 MonthStr = "Oct" case 11 MonthStr = "Nov" case 12 MonthStr = "Dec" end select YearStr = Year(rsTrans("CERT_DATE")) CertDateStr = DayStr & "-" & MonthStr & "-" & YearStr ' withdrawn if (rsTrans("STATUS") = "C-WD") and (Request("CERT_NO")<>"") then if (cint(DateDiff("d", rsTrans("WITHDRAW_D"), now)) < 31) then if rsTrans("CERT_NO") <> tmp then %> <% tmp=rsTrans("CERT_NO") %>
<%if (trim(rsTrans("LOGO"))<> "") then %> <%end if%> <% cNo=rsTrans("CERT_NO") set rsScope=conn.Execute("Select ENG_SCOPE, CHI_SCOPE from Trans where CERT_NO like '%"&cNo&"%'") %> <% rsScope.Close set rsScope=nothing %>
CC <%=trim(rsTrans("CERT_NO"))%> <% if (cint(DateDiff("d", now, (rsTrans("CERT_DATE")))) > -31) then %>
New
<% end if %> <% if (rsTrans("STATUS") = "C-WD") then %> <% if (cint(DateDiff("d", now, (rsTrans("WITHDRAW_D")))) > -31) then %>
Withdrawn
<% end if %> <% end if %> <% if (rsTrans("STATUS") = "SUS") then %>
Suspended
<% end if %>
<%=rsTrans("ENG_COMP")%> <%if rsTrans("ENG_BRA")<>"" then %>
<%=rsTrans("ENG_BRA")%><%end if %> <% For i=1 to 5 %><%if rsTrans("ENG_O_C"&i)<>"" then %>
<%=rsTrans("ENG_O_C"&i)%><%end if%> <%next%>
  <%if(not IsNull(rsTrans("CHI_COMP"))) then response.write Server.HTMLEncode(rsTrans("CHI_COMP")) end if %> <%if rsTrans("CHI_BRA")<>"" and not IsNull(rsTrans("CHI_BRA")) then %>
<% if(not IsNull(rsTrans("CHI_BRA"))) then response.write Server.HTMLEncode(rsTrans("CHI_BRA")) end if%> <%end if %> <% For i=1 to 5%><%if rsTrans("CHI_O_C"&i)<>"" then %>
<%=rsTrans("CHI_O_C"&i)%><%end if%><%next%>
Certification Standard 認證標準: <%=rsTrans("QUA_STAND")%>" border="0" alt="">
Certification Scheme 認證計劃: <%=rsTrans("QUA_SCHEME")%>
Accreditation 認可: <%=rsTrans("ACCRED")%>
Certification Date 認證日期: <%=CertDateStr%>
Scope 認證範圍: <% ENG_SCOPE=rsScope("ENG_SCOPE") response.write replace(ENG_SCOPE,CHR(10),"
") %>
  <% CHI_SCOPE=rsScope("CHI_SCOPE") if(not IsNull(CHI_SCOPE)) then CHI_SCOPE=Server.HTMLEncode(CHI_SCOPE) response.write replace(CHI_SCOPE,CHR(10),"
") end if %>
<% counter=counter+1 %> <% end if %> <% else 'else for withdraw date is not within one month %>
Withdrawn on <%=rsTrans("WITHDRAW_D")%>!
<% end if else 'else for user doesn't input Cert_NO %> <% if rsTrans("CERT_NO") <> tmp then %> <% tmp=rsTrans("CERT_NO") %> <% if (rsTrans("STATUS") = "C-WD") then %> <% if (cint(DateDiff("d", now, (rsTrans("WITHDRAW_D")))) > -31) then %>
<%if rsTrans("LOGO") <> " " then %> <%end if%> <% cNo=rsTrans("CERT_NO") set rsScope=conn.Execute("Select ENG_SCOPE, CHI_SCOPE from Trans where CERT_NO like '%"&cNo&"%'") %> <% rsScope.Close set rsScope=nothing %>
CC <%=trim(rsTrans("CERT_NO"))%> <% if (cint(DateDiff("d", now, (rsTrans("CERT_DATE")))) > -31) then %>
New
<% end if %> <% if (rsTrans("STATUS") = "C-WD") then %> <% if (cint(DateDiff("d", now, (rsTrans("WITHDRAW_D")))) > -31) then %>
Withdrawn
<% end if %> <% end if %> <% if (rsTrans("STATUS") = "SUS") then %>
Suspended
<% end if %>
<%=rsTrans("ENG_COMP")%> <%if rsTrans("ENG_BRA")<>"" then %>
<%=rsTrans("ENG_BRA")%><%end if %> <% For i=1 to 5 %><%if rsTrans("ENG_O_C"&i)<>"" then %>
<%=rsTrans("ENG_O_C"&i)%><%end if%> <%next%>
  <%if(not IsNull(rsTrans("CHI_COMP"))) then response.write Server.HTMLEncode(rsTrans("CHI_COMP")) end if %> <%if rsTrans("CHI_BRA")<>"" and not IsNull(rsTrans("CHI_BRA")) then %>
<% if(not IsNull(rsTrans("CHI_BRA"))) then response.write Server.HTMLEncode(rsTrans("CHI_BRA")) end if%> <%end if %> <% For i=1 to 5%><%if rsTrans("CHI_O_C"&i)<>"" then %>
<%=rsTrans("CHI_O_C"&i)%><%end if%><%next%>
Certification Standard 認證標準: <%=rsTrans("QUA_STAND")%>" border="0" alt="">
Certification Scheme 認證計劃: <%=rsTrans("QUA_SCHEME")%>
Accreditation 認可: <%=rsTrans("ACCRED")%>
Certification Date 認證日期: <%=CertDateStr%>
Scope 認證範圍: <% ENG_SCOPE=rsScope("ENG_SCOPE") response.write replace(ENG_SCOPE,CHR(10),"
") %>
  <% CHI_SCOPE=rsScope("CHI_SCOPE") if(not IsNull(CHI_SCOPE)) then CHI_SCOPE=Server.HTMLEncode(CHI_SCOPE) response.write replace(CHI_SCOPE,CHR(10),"
") 'response.write CHI_SCOPE end if %>
<% counter=counter+1 %> <% end if 'end for withdraw within one month %> <% else %>
<%if trim(rsTrans("LOGO")) <> "" then %> <%end if%> <% cNo=rsTrans("CERT_NO") set rsScope=conn.Execute("Select ENG_SCOPE, CHI_SCOPE from Trans where CERT_NO = '"&cNo&"'") %> <% rsScope.Close set rsScope=nothing %>
CC <%=trim(rsTrans("CERT_NO"))%> <% if (cint(DateDiff("d", now, (rsTrans("CERT_DATE")))) > -31) then %>
New
<% end if %> <% if (rsTrans("STATUS") = "C-WD") then %> <% if (cint(DateDiff("d", now, (rsTrans("WITHDRAW_D")))) > -31) then %>
Withdrawn
<% end if %> <% end if %> <% if (rsTrans("STATUS") = "SUS") then %>
Suspended
<% end if %>
<%=rsTrans("ENG_COMP")%> <%if rsTrans("ENG_BRA")<>"" then %>
<%=rsTrans("ENG_BRA")%><%end if %> <% For i=1 to 5 %><%if rsTrans("ENG_O_C"&i)<>"" then %>
<%=rsTrans("ENG_O_C"&i)%><%end if%> <%next%>
  <%if(not IsNull(rsTrans("CHI_COMP"))) then response.write Server.HTMLEncode(rsTrans("CHI_COMP")) end if %> <%if rsTrans("CHI_BRA")<>"" and not IsNull(rsTrans("CHI_BRA")) then %>
<% if(not IsNull(rsTrans("CHI_BRA"))) then response.write Server.HTMLEncode(rsTrans("CHI_BRA")) end if%> <%end if %> <% For i=1 to 5%><%if rsTrans("CHI_O_C"&i)<>"" then %>
<%=rsTrans("CHI_O_C"&i)%><%end if%><%next%>
Certification Standard 認證標準: <%=rsTrans("QUA_STAND")%>" border="0" alt="">
Certification Scheme 認證計劃: <%=rsTrans("QUA_SCHEME")%>
Accreditation 認可: <%=rsTrans("ACCRED")%>
Certification Date 認證日期: <%=CertDateStr%>
Scope 認證範圍: <% ENG_SCOPE=rsScope("ENG_SCOPE") response.write replace(ENG_SCOPE,CHR(10),"
") %>
  <% CHI_SCOPE=rsScope("CHI_SCOPE") if(not IsNull(CHI_SCOPE)) then CHI_SCOPE=Server.HTMLEncode(CHI_SCOPE) response.write replace(CHI_SCOPE,CHR(10),"
") 'response.write Server.HTMLEncode(CHI_SCOPE) end if %>
<% counter=counter+1 %> <% end if %> <% else %> <% end if %> <% end if 'Cert No=WD, day >31 rsTrans.movenext loop %> <% if counter=0 then %>
<% if (Request("CERT_NO")<>"") then %> Sorry, cannot find the Certificate No.: <%=Request("CERT_NO") %> <% else %> Sorry, cannot find this record! <% end if %>
<% end if set rsTrans0=nothing set rsTrans=nothing %>
<%if pageIdx>1 then%> <%end if%>  
Page: /<%=noPage%>
<%if pageIdx <%end if%>
<% conn.close set conn=nothing %>