<% up " " 'keywordform "Supplier" dim cat_id Dim Db connection if request.querystring("cat_id")="" then cat_id=int(request.form("cat_id")) else cat_id=int(request.querystring("cat_id")) end if if cat_id="" then cat_id=session("cat_id") if (trim(cat_id)="" or cat_id=0) and Request.QueryString("supplier_id")<>"" then set rsTemp=server.createobject("adodb.recordset") sql1="select * from cat where supplier_id=" & Request.QueryString("supplier_id") rsTemp.Open sql1,db,3,2 if rsTemp.RecordCount> 0 then cat_id=rsTemp("cat_id") end if end if set rs3=server.createobject("adodb.recordset") sql="select category from category where cat_id="&cat_id rs3.open sql, db, 3 %>
<% response.write "
" response.write "
" if request.querystring("supplier_id") = "" then Response.Write "No records found." response.end end if supplier_id=int(request.querystring("supplier_id")) set rs1=server.createobject("adodb.recordset") sql="select company_name, website from supplier where supplier_id="&supplier_id rs1.open sql, db, 3 if rs1.EOF = true then Response.Write "

No records found.

" response.end end if dim count,start,currpage,pages count=rs1.recordcount response.write "" response.write "
"&ProperCase(rs1("company_name"))&"
Company Profile" response.write "      Product Catalogue
" response.write "
" response.write "" response.write "" response.Write "
" %> <% response.write "" response.write "
View inquiry basket : " H = 0 set rsinquiry=server.createobject("adodb.recordset") rsinquiry.open "select * from inquiry_details where session_id='"&session.sessionid&"'",db,3 if not rsinquiry.eof then H=rsinquiry.recordcount rsinquiry.close response.write " "&H&" Unsent Inquiry
" if count=0 then response.write "

Sorry, no suppliers for this one" else Productdisplay end if rs1.close set rs1=nothing db.close set db=nothing%> <%Right_patch1%> <% response.write "

" response.write "
" response.write "" %> <% Sub Productdisplay dim recordsdisplayed recordsdisplayed=0 sql="select * from product where supplier_id="&Supplier_id set rs=server.createobject("adodb.recordset") rs.cursortype=3 rs.cursorlocation=3 rs.open sql, db, adopenstatic if rs.recordcount=0 then response.write "

" response.write "Sorry, no products to display
" exit sub end if rs.pagesize=20 rs.cachesize=20 pages=rs.pagecount count=rs.recordcount if request.querystring("currpage")="" then currpage=1 else currpage = int(request.querystring("currpage")) end if if count>0 then rs.absolutepage=currpage start=rs.absoluteposition if currpage=pages then finish=count else finish = start + rs.pagesize - 1 end if response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" for i=start to finish response.write "" response.write "" else response.write "" end if rsinquiry.close response.write "" rs.movenext next response.write "" response.write "" response.write "
" response.write "Search Result : Products "&start&" to "&finish&" of "&count&"
" response.write "Select products below and click " response.write "   OR   " response.write "
" response.write "Thumbnail" response.write "Product Name / Description " response.write "Select All  Clear All
" supFolder=cdbl(rs("supplier_id")) response.write "" response.write "
" if len(rs("img_no")) > 3 then response.write "" 'imgSrc="http://www.easy2source.com\supplier\"&cstr(supFolder) & "\" & cstr(rs("supplier_id")) & "\_" & rs("img_no")&".jpg" 'imgSrc="http://www.easy2source.com\thumbnails\_"& rs("img_no")&".jpg" supFolder=int(SupFolder/500)+1 imgSrc="http://supplier.easy2source.com/thumb90.asp?VFilePath=\images\" & rs("img_no")&".jpg" response.write ""&rs("product_name")&"" else response.write "" response.write ""&rs("product_name")&"" end if response.write "
" response.write"
" response.write "
" response.write "" response.write " "&propercase(rs("product_name"))&"" if date-rs("date_added")<=30 then response.write "    New" end if if len(rs("description"))>150 then response.write "
" response.write ""&MakeFirstLetterCapital(left(rs("description"),150)&".....)") elseif len(rs("description"))>0 then response.write "
" response.write MakeFirstLetterCapital(rs("description")) end if response.write "
" dim ADD ADD = true rsinquiry.open "select * from inquiry_details where session_id='"&session.sessionid&"' and prod_id="&rs("prod_id"),db,3 if not rsinquiry.eof then response.write "Added To Inquiry Basket
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "Select products below and click " response.write "   OR   " response.write "
" pagewisedisplay 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+6 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 < pages then response.write " Next " end if response.write "
" response.write "" End Sub %> <% function ProperCase(txt) txt=trim(txt) if txt<>"" then varTxt=split(txt," ") putSpace="" for i=0 to ubound(varTxt) if varTxt(i)<>"" then txtVal=txtVal & putSpace & ucase(left(varTxt(i),1)) & lcase(right(varTxt(i),len(varTxt(i))-1)) end if putSpace=" " next ProperCase=txtVal end if End function Public Function MakeFirstLetterCapital(Txt) If Trim(Txt) = "" Then Exit Function Txt = LCase(Txt) lFlag = True For i = 1 To Len(Txt) If lFlag = True And Mid(Txt, i, 1) <> " " And Mid(Txt, i, 1) <> "" Then tempTxt = tempTxt & UCase(Mid(Txt, i, 1)) lFlag = False Else tempTxt = tempTxt & Mid(Txt, i, 1) End If If Mid(Txt, i, 1) = "." Then lFlag = True End If Next MakeFirstLetterCapital = tempTxt End Function %> <% Sub Bottom_Patch %>
<% End Sub %>