<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% xstforbiz.Validation.Validation valid_1 = new xstforbiz.Validation.Validation (); xstforbiz.Validation.Validation valid_2 = new xstforbiz.Validation.Validation (); String reference = request.getParameter ("reference"); String result = new String (); if (reference == null || reference.length()==0) { request.getRequestDispatcher("/index.jsp?listing_not_found=true").forward(request, response); } xstforbiz.Components.DBConnection dbconn = new xstforbiz.Components.DBConnection (); dbconn.retrive_listing_by_reference (reference); xstforbiz.Components.Listing listing = dbconn.getListing(); if (listing == null) { dbconn.retrive_listing_by_4digit_reference(reference); listing = dbconn.getListing(); } String title = new String (); String fname = new String (); String sname = new String (); String telephone = new String (); String house_no = new String (); String town = new String (); String road = new String (); String postcode = new String (); String county = new String (); String email = new String (); String w_telephone = new String (); String fax = new String (); String f_name = new String (); String f_email = new String (); String y_email = new String (); if (listing == null) { request.getRequestDispatcher("/index.jsp?listing_not_found=true").forward(request, response); } reference = listing.getReference(); String str_price = listing.getAsking_price(); str_price = str_price.substring(0, str_price.indexOf(".")); while (str_price.startsWith("£")) str_price = str_price.replaceFirst("£", ""); char[] arr_price = str_price.toCharArray(); str_price = new String (); int 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; javax.servlet.http.Cookie cookies[] = request.getCookies(); /*for (int i=0; i <% xstforbiz.Components.SendEmail sendemail = new xstforbiz.Components.SendEmail (); title = request.getParameter("title"); fname = request.getParameter("fname"); sname = request.getParameter("sname"); email = request.getParameter ("email"); telephone = request.getParameter ("telephone"); house_no = request.getParameter ("house_no"); road = request.getParameter ("road"); town = request.getParameter ("town"); county = request.getParameter ("county"); postcode = request.getParameter ("postcode"); w_telephone = request.getParameter ("w_telephone"); fax = request.getParameter("fax"); valid_1.setIsvalid_fname (fname); valid_1.setIsvalid_sname (sname); valid_1.setIsvalid_email(email); valid_1.setIsvalid_telephone (telephone); valid_1.setIsvalid_road (road); valid_1.setIsvalid_town (town); valid_1.setIsvalid_house_no (house_no); if (county != null && county.equals("invalid")) valid_1.setAreerrors(true); if (postcode == null || postcode.length() == 0) valid_1.setAreerrors (true); if (!valid_1.getAreerrors ()) { javax.servlet.http.Cookie cookie1 = new javax.servlet.http.Cookie ("title", title); javax.servlet.http.Cookie cookie2 = new javax.servlet.http.Cookie ("telephone", telephone); javax.servlet.http.Cookie cookie3 = new javax.servlet.http.Cookie ("email", email); javax.servlet.http.Cookie cookie4 = new javax.servlet.http.Cookie ("house_no", house_no); javax.servlet.http.Cookie cookie5 = new javax.servlet.http.Cookie ("road", road); javax.servlet.http.Cookie cookie6 = new javax.servlet.http.Cookie ("town", town); javax.servlet.http.Cookie cookie7 = new javax.servlet.http.Cookie ("postcode", postcode); javax.servlet.http.Cookie cookie8 = new javax.servlet.http.Cookie ("county", county); javax.servlet.http.Cookie cookie9 = new javax.servlet.http.Cookie ("fname", fname); javax.servlet.http.Cookie cookie10 = new javax.servlet.http.Cookie ("sname", sname); javax.servlet.http.Cookie cookie13 = new javax.servlet.http.Cookie ("w_telephone", w_telephone); javax.servlet.http.Cookie cookie14 = new javax.servlet.http.Cookie ("fax", fax); cookie1.setMaxAge(365*24*60*60); cookie2.setMaxAge(365*24*60*60); cookie3.setMaxAge(365*24*60*60); cookie4.setMaxAge(365*24*60*60); cookie5.setMaxAge(365*24*60*60); cookie6.setMaxAge(365*24*60*60); cookie7.setMaxAge(365*24*60*60); cookie8.setMaxAge(365*24*60*60); cookie9.setMaxAge(365*24*60*60); cookie10.setMaxAge(365*24*60*60); cookie13.setMaxAge(365*24*60*60); cookie14.setMaxAge(365*24*60*60); response.addCookie(cookie1); response.addCookie(cookie2); response.addCookie(cookie3); response.addCookie(cookie4); response.addCookie(cookie5); response.addCookie(cookie6); response.addCookie(cookie7); response.addCookie(cookie8); response.addCookie(cookie9); response.addCookie(cookie10); response.addCookie(cookie13); response.addCookie(cookie14); java.util.Date date = new java.util.Date(); java.util.GregorianCalendar now = new java.util.GregorianCalendar(); now.setTime(date); String str_date = now.get(java.util.Calendar.YEAR) + "-" + (now.get (java.util.Calendar.MONTH) + 1) + "-" + now.get(java.util.Calendar.DAY_OF_MONTH); String subject = "More Information Requested for " + reference + " (at 1stforbiz.com) on "+ str_date; String message = " Date: " + str_date +"
" + " w_telephone: " + w_telephone +"
" + " fax: " + fax +"
" + " Ref: " + reference +"
" + "Contact Details
" + " Title: " + title + "
" + " FirstName: " + fname +"
" + " SurName: " + sname +"
" + " Email: " + email +"
" + " HomeTel: " + telephone +"
" + " Requested Date: "+ str_date +"
" + " Number: "+ house_no +"
" + " StreetName: "+ road +"
" + " Town: "+ town +"
" + " County: "+ county +"
" + " Postcode: "+ postcode +"
"; String new_name = title + " " + fname + " " + sname; xstforbiz.Components.Email_Marketing_Users u = new xstforbiz.Components.Email_Marketing_Users (new_name, email); dbconn.insert_marketing_users(u); result = sendemail.emailUser("mail@1stforbiz.com", subject, message); out.print (result); if (result == null) { result = "OK_Contact"; } } %>
<% f_name = request.getParameter ("f_name"); f_email = request.getParameter ("f_email"); y_email = request.getParameter ("y_email"); java.util.Date date = new java.util.Date(); java.util.GregorianCalendar now = new java.util.GregorianCalendar(); now.setTime(date); valid_2.setIsvalid_fname (f_name); valid_2.setIsvalid_email(f_email); valid_2.setIsvalid_email (y_email); if (!valid_2.getAreerrors ()) { javax.servlet.http.Cookie cookie11 = new javax.servlet.http.Cookie ("friends_email", f_email); javax.servlet.http.Cookie cookie12 = new javax.servlet.http.Cookie ("my_name", f_name); cookie11.setMaxAge(365*24*60*60); cookie12.setMaxAge(365*24*60*60); response.addCookie(cookie11); response.addCookie(cookie12); xstforbiz.Components.SendEmail sendemail = new xstforbiz.Components.SendEmail (); String str_date = now.get(java.util.Calendar.YEAR) + "-" + (now.get (java.util.Calendar.MONTH) + 1) + "-" + now.get(java.util.Calendar.DAY_OF_MONTH); String subject = "Business for Sale on http://www.1stforbiz.com"; String message = "" + "
Hi,
Check out this business for sale at " + "http://www.1stforbiz.com/listing.jsp?reference="+ reference +"

" + f_name +"
"; result = sendemail.emailUser("mail@1stforbiz.com", subject, message, y_email); out.print (result); xstforbiz.Components.Email_Marketing_Users u = new xstforbiz.Components.Email_Marketing_Users (f_name, f_email); dbconn.insert_marketing_users(u); if (result == null) { result = "OK_Tell"; } } %>
<% java.util.Vector my_list = (java.util.Vector) session.getAttribute("my_list"); if (my_list == null || my_list.size() == 0) { my_list = new java.util.Vector (); my_list.add (reference); session.setAttribute ("my_list", my_list); } else { if (!my_list.contains(reference)) { my_list.add (reference); session.setAttribute ("my_list", my_list); } } %> <% java.util.Vector pic_names = new java.util.Vector (); String pure_reference = listing.getReference(); pure_reference = pure_reference.substring(1, 5); java.io.File folder = new java.io.File ("/home/virtual/site109/fst/home/xstforbiz/mainwebsite_html/pictures/" + pure_reference); //out.print (pure_reference); if (!(folder.exists ())) { pure_reference = listing.getReference(); pure_reference = pure_reference.substring(2, 6); //out.print (pure_reference); folder = new java.io.File ("/home/virtual/site109/fst/home/xstforbiz/mainwebsite_html/pictures/" + pure_reference); } if (folder.exists()) { %> <% java.io.File[] files = folder.listFiles(); if (files.length > 0) { for (int i=0; i < files.length; i++) { pic_names.add (files[i].getName()); } } } else { %> <% } %> Pegasus Business Sales - <%=reference%>, <%=listing.getHeading()%>
 
Pegasus Business Sales, Listings.
Businesses For Sale Reference: <%=listing.getReference()%> (<%=listing.getCategory()%>) <% if (listing.getBusiness_status () != null && listing.getBusiness_status ().length() != 0) { dbconn.retrive_business_status (listing.getBusiness_status ()); String str_status = dbconn.getBusiness_status(); %> <% } %> <% java.io.File movie_folder = new java.io.File ("/home/virtual/site142/fst/home/xstforbiz/mainwebsite_html/movie/" + pure_reference); java.io.File[] movie_files = movie_folder.listFiles(); if (movie_folder.exists() && movie_files != null && movie_files.length > 0) { %> <% } %>
Business Sale Status: <%=str_status%>
<%=listing.getHeading ()%>(<%=listing.getCategory()%>)
Financing For this business: <%=listing.getFinancing()%>
<% if (pic_names.size() > 0) { %> <% } %>
<% for (int i=0; i     <% } %>
movie clip of the business
Business Description
Business Description

<%=listing.getSummery()%>

Business Summery
Business Summery
Reference: <%=reference%> (please quote this number when contacting us, by phone)
Price: <%=str_price%>
Contact & Request Information <%if (result != null && result.equals ("OK_Contact")) { %> Thank you for your inquiry, We will get in touch with you soon.
<% } %>
<% if (!valid_1.getIsvalid_fname () || !valid_1.getIsvalid_sname ()) { %> <% } %> <% if (!valid_1.getIsvalid_email ()) { %> <% } %> <% if (!valid_1.getIsvalid_telephone ()) { %> <% } %> <% if (!valid_1.getIsvalid_house_no ()) { %> <% } %> <% if (!valid_1.getIsvalid_road ()) { %> <% } %> <% if (!valid_1.getIsvalid_town ()) { %> <% } %> <% if (county.equals("invalid")) { %> <% } %> <% if (valid_1.getAreerrors() && (postcode == null || postcode.length() == 0)) { %> <% } %>
The name that you have entered is not valid.
Title*
First Name*
Surname*
Please enter a valid e-mail address.
E-mail*
Please enter a valid telephone number.
Telephone*
Work Telephone
Fax

Please specify a house number or a name.

House No/Name*

Please specify a road or a street name.

Road or Street name*

The town or the city was not given, please specify a town or a city.

Town*

Please tell us the name of your county, in UK.

County*

Please give us the postal code.

Postal code*
    
** Please only press the button once **
Please Note: You are able to request information for all the listings that you have added to viewed from the "My List" on the top right corner. Add listings using "add to My List" link.
Tell a Friend and Other Links <%if (result != null && result.equals ("OK_Tell")) { %> An email was sent your friend..
<% } %>
<% if (!valid_2.getIsvalid_fname ()) { %> <% } %> <% if (!valid_2.getIsvalid_email ()) { %> <% } %>
Please enter a valid name.
Your Name*
Please give us yours and your friend's e-mail addresses.
Your E-mail Address*
Friends E-mail Address*
    
** Please only press the button once **

| Contact Us| | Add to My List | | Search |