<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% java.util.Vector indexes = new java.util.Vector (); xstforbiz.Components.DBConnection dbconn = new xstforbiz.Components.DBConnection (); xstforbiz.Validation.Validation valid = new xstforbiz.Validation.Validation (); dbconn.retrive_categories (); dbconn.retrive_regions (); java.util.Vector categories = dbconn.getCategories(); java.util.Vector regions = dbconn.getRegions(); dbconn.retrive_references (); java.util.Vector references = dbconn.getReferences(); java.util.Random random = new java.util.Random (); for (int i =0; i<6; i++) { int index = random.nextInt(references.size()); if (indexes.contains(index)) { while (indexes.contains(index)) { index = random.nextInt(references.size()); } } indexes.add(index); } String price = new String (); String sector = new String (); String region = new String (); String word = new String (); java.io.File folder = null; char[] arr_price = null; int x = 0; /* java.util.Enumeration enum1 = request.getHeaderNames(); while (enum1.hasMoreElements()) { out.print (enum1.nextElement()+"
"); } out.print ("
"); */ //mozilla/4.0 browsers and anyother IE int map_height = 498; int map_width = 484; int cat_height = 138; String td_height = "440px"; if (request.getHeader("user-agent").indexOf ("Mozilla/5.0") != -1) { map_height = 480; map_width = 470; cat_height = 126; td_height = "458px"; } String reference = new String (); String description = new String (); String str_price = new String (); String pic_name = new String (); xstforbiz.Components.Listing listing = null; %> <% price = request.getParameter ("price"); sector = request.getParameter ("sector"); region = request.getParameter ("region"); word = request.getParameter ("word"); if (word != null && word.length()!=0) { word = word.replaceAll("&", "and"); word = word.replaceAll("=", ""); word = word.replaceAll ("and", " "); } valid.setIsvalid_searchprice (price); if (sector == null || sector.length() == 0) { sector = "any"; } if (sector.equals("any") && region.equals("any") && (word == null || word.length() == 0) && (price == null || price.length() == 0)) { valid.setAreerrors(true); } else if (!valid.getAreerrors()) { request.getRequestDispatcher("/listing_custom_results.jsp?price="+price+"§or="+sector+"®ion="+region+"&word="+word).forward(request, response); } %> Businesses for sale : Pegasus Business Sales - National Business Transfer Agents. Buy or sell businesses
 
<% for (int i = 3; i < 5; i++) { dbconn.retrive_listing_by_4digit_reference (references.elementAt(indexes.elementAt(i))); listing = dbconn.getListing (); reference = listing.getReference(); description = listing.getSummery(); if (description.length() > 350) description = description.substring (0, 350); description += "......."; str_price = listing.getAsking_price(); str_price = str_price.substring(0, str_price.indexOf(".")); while (str_price.startsWith("£")) str_price = str_price.replaceFirst("£", ""); arr_price = str_price.toCharArray(); str_price = new String (); x = 0; for (int j = (arr_price.length - 1); j >= 0 ;j--) { if (x%3 == 0 && x != 0) { str_price = "," + str_price; } str_price = arr_price[j] + str_price; x++; } str_price = "£" + str_price; pic_name = null; folder = new java.io.File ("/home/virtual/1stforbiz.com/home/xstforbiz/mainwebsite_html/pictures/" + references.elementAt(indexes.elementAt(i))); if (folder.exists()) { java.io.File[] files = folder.listFiles(); if (files.length > 0) { pic_name= new String (files[0].getName()); } else { pic_name = null; } } else { pic_name = null; } if (pic_name != null) pic_name = "http://www.1stforbiz.com/pictures/" + references.elementAt(indexes.elementAt(i)) +"/"+pic_name; %> <% } %>
Businesses and Vacant Commercial Properties For Sale
<% dbconn.retrive_listing_by_4digit_reference (references.elementAt(indexes.elementAt(5))); listing = dbconn.getListing (); reference = listing.getReference(); description = listing.getSummery(); if (description.length() > 500) description = description.substring (0, 500); description += "......."; str_price = listing.getAsking_price(); str_price = str_price.substring(0, str_price.indexOf(".")); while (str_price.startsWith("£")) str_price = str_price.replaceFirst("£", ""); arr_price = str_price.toCharArray(); str_price = new String (); x = 0; for (int j = (arr_price.length - 1); j >= 0 ;j--) { if (x%3 == 0 && x != 0) { str_price = "," + str_price; } str_price = arr_price[j] + str_price; x++; } str_price = "£" + str_price; pic_name = new String (); folder = new java.io.File ("/home/virtual/1stforbiz.com/home/xstforbiz/mainwebsite_html/pictures/" + references.elementAt(indexes.elementAt(5))); if (folder.exists()) { java.io.File[] files = folder.listFiles(); if (files.length > 0) { pic_name= new String (files[0].getName()); } else pic_name = null; } else { pic_name = null; } if (pic_name != null) pic_name = "http://www.1stforbiz.com/pictures/" + references.elementAt(indexes.elementAt(5)) +"/"+pic_name; %>
<%=listing.getHeading()%>

<%if (pic_name != null) {%> <%}%> Ref: <%=listing.getReference()%>

<%=description%>

Price: <%=str_price%>
| view more Info | | view more <%=listing.getCategory()%> |
<% dbconn.retrive_listing_by_4digit_reference (references.elementAt(indexes.elementAt(0))); listing = dbconn.getListing (); reference = listing.getReference(); description = listing.getSummery(); if (description.length() > 500) description = description.substring (0, 500); description += "......."; str_price = listing.getAsking_price(); str_price = str_price.substring(0, str_price.indexOf(".")); while (str_price.startsWith("£")) str_price = str_price.replaceFirst("£", ""); arr_price = str_price.toCharArray(); str_price = new String (); x = 0; for (int j = (arr_price.length - 1); j >= 0 ;j--) { if (x%3 == 0 && x != 0) { str_price = "," + str_price; } str_price = arr_price[j] + str_price; x++; } str_price = "£" + str_price; pic_name = new String (); folder = new java.io.File ("/home/virtual/1stforbiz.com/home/xstforbiz/mainwebsite_html/pictures/" + references.elementAt(indexes.elementAt(0))); if (folder.exists()) { java.io.File[] files = folder.listFiles(); if (files.length > 0) { pic_name= new String (files[0].getName()); } else pic_name = null; } else { pic_name = null; } if (pic_name != null) pic_name = "http://www.1stforbiz.com/pictures/" + references.elementAt(indexes.elementAt(0)) +"/"+pic_name; %>
<%=listing.getHeading()%>

<%if (pic_name != null) {%> <%}%> Ref: <%=listing.getReference()%>

<%=description%>

Price: <%=str_price%>
| view more Info | | view more <%=listing.getCategory()%> |
<% dbconn.retrive_listing_by_4digit_reference (references.elementAt(indexes.elementAt(1))); listing = dbconn.getListing (); reference = listing.getReference(); description = listing.getSummery(); if (description.length() > 500) description = description.substring (0, 500); description += "......."; str_price = listing.getAsking_price(); str_price = str_price.substring(0, str_price.indexOf(".")); while (str_price.startsWith("£")) str_price = str_price.replaceFirst("£", ""); arr_price = str_price.toCharArray(); str_price = new String (); x = 0; for (int j = (arr_price.length - 1); j >= 0 ;j--) { if (x%3 == 0 && x != 0) { str_price = "," + str_price; } str_price = arr_price[j] + str_price; x++; } str_price = "£" + str_price; pic_name = new String (); folder = new java.io.File ("/home/virtual/1stforbiz.com/home/xstforbiz/mainwebsite_html/pictures/" + references.elementAt(indexes.elementAt(1))); if (folder.exists()) { java.io.File[] files = folder.listFiles(); if (files.length > 0) { pic_name= new String (files[0].getName()); } else pic_name = null; } else { pic_name = null; } if (pic_name != null) pic_name = "http://www.1stforbiz.com/pictures/" + references.elementAt(indexes.elementAt(1)) +"/"+pic_name; %>
<%=listing.getHeading()%>

<%if (pic_name != null) { %> <%}%> Ref: <%=listing.getReference()%>

<%=description%>

Price: <%=str_price%>
| view more Info | | view more <%=listing.getCategory()%> |
<% dbconn.retrive_listing_by_4digit_reference (references.elementAt(indexes.elementAt(2))); listing = dbconn.getListing (); reference = listing.getReference(); description = listing.getSummery(); if (description.length() > 500) description = description.substring (0, 500); description += "......."; str_price = listing.getAsking_price(); str_price = str_price.substring(0, str_price.indexOf(".")); while (str_price.startsWith("£")) str_price = str_price.replaceFirst("£", ""); arr_price = str_price.toCharArray(); str_price = new String (); x = 0; for (int j = (arr_price.length - 1); j >= 0 ;j--) { if (x%3 == 0 && x != 0) { str_price = "," + str_price; } str_price = arr_price[j] + str_price; x++; } str_price = "£" + str_price; pic_name = new String (); folder = new java.io.File ("/home/virtual/1stforbiz.com/home/xstforbiz/mainwebsite_html/pictures/" + references.elementAt(indexes.elementAt(2))); if (folder.exists()) { java.io.File[] files = folder.listFiles(); if (files.length > 0) { pic_name= new String (files[0].getName()); } else pic_name = null; } else { pic_name = null; } if (pic_name != null) pic_name = "http://www.1stforbiz.com/pictures/" + references.elementAt(indexes.elementAt(2)) +"/"+pic_name; %>
<%=listing.getHeading()%>

<%if (pic_name != null) { %> <%}%> Ref: <%=listing.getReference()%>

<%=description%>

Price: <%=str_price%>
| view more Info | | view more <%=listing.getCategory()%> |
Find a Listing:
 
<% if (!valid.getIsvalid_searchprice()) { %> <% } if (sector.equals("any") && region.equals("any") && (word == null || word.length() == 0) && (price == null || price.length() == 0)) { %> <% } %>
price is invalid, please refer to help for help.
You have not provided sufficent information to search.
Max Price:
Sector:
Region:
help
Search Listings by Category:


 

<%=listing.getHeading()%>

<%if (pic_name != null) { %> <%}%> Ref:    <%=listing.getReference()%>

<%=description%>

| view more Info | | view more <%=listing.getCategory()%> |
Copyright © 2008 Pegasus Business Sales All rights reserved.