<% Response.Buffer = true catid=request("cat_id") if catid = "" or isnull(catid) = true or len(catid) = 0 then Response.Write "

Kindly wait, while you are redirected....

" Response.Redirect "http://easy2source.com/category.asp?key=Supplier" end if %> <% server.scripttimeout=1000 dim i ,temp, db, myDSN dim str,temp1,temp2 connection set rs1=server.createobject("adodb.recordset") set r1=server.createobject("adodb.recordset") s1="select * from category where Cat_id ="&Catid rs1.open s1, db, adopenstatic if rs1.eof then Response.Write "

Kindly wait, while you are redirected....

" Response.Redirect "http://www.easy2source.com/category.asp?key=Supplier" Response.End end if ind1 = rs1("index1") %> Businsess Directory of <%=rs1("category")%> " > "> <% up "supplier" %> <% Right_Advt_Patch ind1&"" if request.querystring("Lent") <> "" then Lent = int(request.querystring("Lent")) dim s2, catnam catnam=rs1("category") str=rs1("index1") dim s1, currpage, pages, start, finish, count, f, Alfabet, Name dim curpa, pag, sta, fin, cou Lent = Lent + 3 s1="select cat_id, category,index1 from category where index1 like '"&rs1("index1")&"%' and len(index1)="&Lent&" and cat_id in (Select cat_id from cat) order by category" rs1.close 'rs1.open s1, db, adopenstatic, 2 rs1.CursorType=3 rs1.CursorLocation=3 rs1.open s1, db, adopenstatic rs1.PageSize=25 rs1.CacheSize=25 pag=rs1.pagecount cou=rs1.recordcount if request.querystring("curpa")="" then curpa=1 else curpa=int(request.querystring("curpa")) end if if rs1.recordcount > 0 then rs1.AbsolutePage=curpa sta=rs1.AbsolutePosition end if if curpa=pag then fin=cou else fin=sta+rs1.pagesize-1 end if Dim Fl,TBL,HDR TBL=false Fl = false HDR = false if rs1.eof then med else response.write "
" response.write "Home >> " response.write "Directory Search " set r2=server.createobject("adodb.recordset") set r3=server.createobject("adodb.recordset") for i=0 to len(str) -1 step 3 temp=mid(str,1,i+3) s2="select category,cat_id from category where index1 like '"&temp&"'" r2.open s2, db, adopenstatic s3="select Cat_Id from category where index1 like '"&temp&"%' " r3.open s3, db, adopenstatic if not r2.eof then if i=len(str)-3 then response.write ">> "&r2("category")&" " session("Category") = r2("category") else response.write ">> " response.write r2("category")&" " session("Category") = r2("category") end if end if r2.close r3.close temp="" next response.write ":

" str="" set r2 = nothing set r3 = nothing if rs1.recordcount <> 0 then set r2 = server.createobject("adodb.recordset") 'set r3 = server.createobject("adodb.recordset") 'set r4 = server.createobject("adodb.recordset") 'r1.movefirst for i=1 to rs1.pagesize if rs1.eof then exit for if rs1("index1") <> "" then counter=0 s1 = "Directory_Display " & rs1("cat_id") r2.open s1, db, 3, 2 counter=r2(0) if counter <> 0 then prod=0 prod=r2(1) if TBL=false then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" TBL=true end if response.write "" response.write "" response.write "" response.write "" response.write "" Fl = true end if r2.close end if rs1.movenext if rs1.eof then exit for next HDR = true end if rs1.close response.write "" response.write "
" response.write "Search Result: "&request.querystring("Sup")&"Suppliers " response.write "and "&request.querystring("Prod")&" Products
Narrow your search by selecting a Subcategory
" response.write "  Categories "&sta&" " response.write " to "&fin&" of "&cou&"" response.write"
" response.write " " response.write "Subcategories" response.write "Suppliers" response.write "Products
" response.write "" response.write rs1("category")&"" response.write ""&counter&"" response.write ""&prod&"
" CatPages response.write "
" response.write "
" med set rs1=nothing set r2=nothing set r3=nothing set r4=nothing ' Bottom_Patch end if %> <% sub med if HDR = false then response.write "
" response.write "Home >> " response.write "Directory Search " set r2=server.createobject("adodb.recordset") set r3=server.createobject("adodb.recordset") for i=0 to len(str) -1 step 3 temp=mid(str,1,i+3) s2="select category, cat_id from category where index1 ='"&temp&"'" r2.open s2, db, adopenstatic s3="select Cat_Id from category where index1 like '"&temp&"%' " r3.open s3, db, adopenstatic if not r2.eof then if i=len(str)-3 then response.write ">> "&r2("category")&": " session("Category") = r2("category") else response.write ">> " response.write r2("category")& " " session("Category") = r2("category") end if end if r2.close temp="" r3.close next response.write "
" end if Alfabet = "A-Z" if request.querystring("Name") <> "" then Alfabet = request.querystring("Name") if Alfabet <> "A-Z" then s1="SELECT supplier_id,company_name,city,pin,state, address, tel1, tel2, fax, email ,website ,paid FROM supplier WHERE supplier_id in (select supplier_id from cat where cat_id ="& request.querystring("cat_id") & ") and company_name like '"& Alfabet &"%' ORDER BY paid DESC, Company_name, email desc" else s1="SELECT supplier_id, company_name, address,city,pin,state, tel1, tel2, fax, email,website,paid FROM supplier WHERE supplier_id in (select supplier_id from cat where cat_id ="&request.querystring("cat_id")&") ORDER BY paid DESC, Company_name,email desc" end if else s1="SELECT supplier_id,company_name, address, city,pin,state,tel1, tel2, fax, email,website,paid FROM supplier WHERE supplier_id in (select supplier_id from cat where cat_id ="&request.querystring("cat_id")&") ORDER BY paid DESC, Company_name, email desc" end if set r1=server.createobject("adodb.recordset") r1.CursorType=3 r1.CursorLocation=3 r1.open s1, db, adopenstatic r1.PageSize=25 r1.CacheSize=25 pages=r1.pagecount count=r1.recordcount if request.querystring("currpage")="" then currpage=1 else currpage=int(request.querystring("currpage")) end if if r1.recordcount > 0 then r1.AbsolutePage=currpage start=r1.AbsolutePosition end if if currpage=pages then finish=count else finish=start+r1.pagesize-1 end if if Alfabet = "A-Z" then response.write "
View A-Z | Jump to: " else response.write "
" response.write "View A-Z | Jump to: " end if if Alfabet = "A" then response.write "A " else response.write "A " end if if Alfabet = "B" then response.write "B " else response.write "B " end if if Alfabet = "C" then response.write "C " else response.write "C " end if if Alfabet = "D" then response.write "D " else response.write "D " end if if Alfabet = "E" then response.write "E " else response.write "E " end if if Alfabet = "F" then response.write "F " else response.write "F " end if if Alfabet = "G" then response.write "G " else response.write "G " end if if Alfabet = "H" then response.write "H " else response.write "H " end if if Alfabet = "I" then response.write "I " else response.write "I " end if if Alfabet = "J" then response.write "J " else response.write "J " end if if Alfabet = "K" then response.write "K " else response.write "K " end if if Alfabet = "L" then response.write "L " else response.write "L " end if if Alfabet = "M" then response.write "M " else response.write "M " end if if Alfabet = "N" then response.write "N " else response.write "N " end if if Alfabet = "O" then response.write "O " else response.write "O " end if if Alfabet = "P" then response.write "P " else response.write "P " end if if Alfabet = "Q" then response.write "Q " else response.write "Q " end if if Alfabet = "R" then response.write "R " else response.write "R " end if if Alfabet = "S" then response.write "S " else response.write "S " end if if Alfabet = "T" then response.write "T " else response.write "T " end if if Alfabet = "U" then response.write "U " else response.write "U " end if if Alfabet = "V" then response.write "V " else response.write "V " end if if Alfabet = "W" then response.write "W " else response.write "W " end if if Alfabet = "X" then response.write "X " else response.write "X " end if if Alfabet = "Y" then response.write "Y " else response.write "Y " end if if Alfabet = "Z" then response.write "Z" else response.write "Z
" end if response.write "
" if count=0 then response.write "

Sorry, no suppliers begining with this alphabet
" else display end if end sub%> <%sub display response.write "
" response.write "   Suppliers "&start&"" response.write " to "&finish&" of "&count&"" response.write"
" for i=1 to r1.pagesize set r2=server.createobject("adodb.recordset") if r1.eof then exit for s2 = "Directory_Display_Supplier "&r1("supplier_id") 's2="SELECT description FROM products WHERE supplier_id ="&r1("supplier_id") r2.open s2, db, 3 's3="SELECT profile FROM profile WHERE supplier_id ="&r1("supplier_id") 'set r3=server.createobject("adodb.recordset") 'r3.open s3, db, 3 response.write "
" response.write "" else response.write ""&ProperCase(r1("company_name"))&"" end if if len(r2(1))>1 then response.write "" if len(r2(0))>1 then 'if len(r2("description"))>1 then response.write "" end if response.write "" if len(r1("tel1"))>1 then response.write "" end if if len(r1("fax"))>1 then response.write "" if len(r1("email"))>1 then response.write "" 'r3.close 's3="SELECT prod_Id FROM product WHERE supplier_id ="&r1("supplier_id") 'set r3=server.createobject("adodb.recordset") 'r3.open s3, db, 3 if r2(2) > 0 then response.write "" response.write "
Company Name :" if len(r2(3)) <> "" then response.write ""&ProperCase(r1("company_name"))&"
Profile :
"&ProperCase(r2(1))&"
Products :
"&ProperCase(r2(0))&"
" response.write "Address :"&ProperCase(r1("address")) if len(r1("city"))>0 then response.write " "&ProperCase(r1("city")) if len(r1("pin"))>0 then response.write "-"&r1("pin") if len(r1("state"))>0 then response.write " "&ProperCase(r1("state"))&"
" response.write "Telephone :"&r1("tel1") if len(r1("tel2"))>1 then response.write " / "&r1("tel2") response.write "
Fax :"&r1("fax")&"
" response.write "Send :" response.write "" response.write "On-Line Trade Inquiry" else response.write "
" response.write "" response.write "Email is not available" end if ' if len(r1("website")) > 3 then ' response.write " Or Visit "&lcase(r1("website"))&"" ' end if response.write "
" response.write " Click here to view entire product range (Products : "&r2(2)&")" end if response.write "
" r2.close r1.movenext if r1.eof then exit for next pagewisedisplay%>
<% Bottom_Patch End Sub %> <% Sub pagewisedisplay dim i,s1,s2,dstart response.write "
" response.write "Result Page : " i=1 if request.querystring("dstart")="" then dstart=1 else dstart=request.querystring("dstart") end if if start>1 then response.write ""&"Previous " &"" end if if pages>10 then if currpage<=dstart+3 then if currpage-3>=dstart then s1=currpage+6 i=currpage-3 end if if currpage<=6 then s1=10 i=1 end if end if if currpage>=dstart+5 then if currpage+5<=pages then s1=currpage+5 i=currpage-4 else s1=pages i=pages-9 end if end if dstart=i for i=i to s1 if i=currpage then response.write " "&i&"" else response.write ""&" "&i&"" end if next else 'if pages<=10 then s1=pages 'else ' s1=10 'end if dstart=1 for i=1 to s1 if i=currpage then response.write " "&i else response.write ""&" "&i&"" end if next end if if currpage" & " Next "&"" end if response.write "
" End Sub %> <% Sub CatPages dim i,s1,s2,dst response.write "Result Page : " i=1 if request.querystring("dst")="" then dst=1 else dst=request.querystring("dst") end if if sta>1 then response.write ""&"Previous " &"" end if if pag>10 then if curpa<=dst+3 then if curpa-3>=dst then s1=curpa+6 i=curpa-3 end if if curpa<=6 then s1=10 i=1 end if end if if curpa>=dst+5 then if curpa+5<=pag then s1=curpa+5 i=curpa-4 else s1=pag i=pag-9 end if end if dst=i for i=i to s1 if i=curpa then response.write " "&i&"" else response.write ""&" "&i&"" end if next else 'if pages<=10 then s1=pag 'else ' s1=10 'end if dst=1 for i=1 to s1 if i=curpa then response.write " "&i else response.write ""&" "&i&"" end if next end if if curpa" & " Next "&"" end if End Sub %> <% function ProperCase(txt) on error resume next if txt<>"" then txt=trim(txt) varTxt=split(txt," ") putSpace="" for h=0 to ubound(varTxt) if varTxt(h)<>"" then txtVal=txtVal & putSpace & ucase(left(varTxt(h),1)) & lcase(right(varTxt(h),len(varTxt(h))-1)) end if putSpace=" " next ProperCase=txtVal end if End function Function MakeFirstLetterCapital(Txt) If Trim(Txt) = "" Then Exit Function Txt = LCase(Txt) lFlag = True For h = 1 To Len(Txt) If lFlag = True And Mid(Txt, h, 1) <> " " And Mid(Txt, h, 1) <> "" Then tempTxt = tempTxt & UCase(Mid(Txt, h, 1)) lFlag = False Else tempTxt = tempTxt & Mid(Txt, h, 1) End If If Mid(Txt, h, 1) = "." Then lFlag = True End If Next MakeFirstLetterCapital = tempTxt End Function %> <% Sub Bottom_Patch %>
<% End Sub %>