%@ page import="java.util.*, java.util.Random, java.io.*,java.lang.*,java.sql.*,java.text.*" %> <%@ page import="javax.servlet.*, javax.servlet.http.*" %> <%@ page language="java" import="com.blueworld.pac.*" %> <% try{ String HEADER_X_FORWARDED_FOR ="X-FORWARDED-FOR"; String remoteAddr = request.getRemoteAddr(); String x; if ((x = request.getHeader(HEADER_X_FORWARDED_FOR)) != null) { remoteAddr = x; int idx = remoteAddr.indexOf(','); if (idx > -1) { remoteAddr = remoteAddr.substring(0, idx); } } String ip = remoteAddr; System.out.println("Visiting IP Address in mRental Query Page at "+new java.util.Date()+" is "+ip); IPAccessControl ip_con=new IPAccessControl(); if (ip_con.IsBlocked("mRental Query page", ip)) return; String userAgent = request.getHeader("user-agent"); boolean isMobile=false; if (userAgent.matches(".*Android.*") || userAgent.matches(".*iPhone.*")) { isMobile=true; } else { isMobile=false; response.sendRedirect(request.getContextPath() + "/rental_query_reso.jsp?" + request.getQueryString()); return; } Utility u = new Utility(); u.ReadProps(); String jspURL=u.jspPath; String RetsImageDir=u.RetsImageDir; String RetsMiscImageDir=u.RetsMiscImageDir; String RetsImageRelativeDir=u.RetsImageRelativeDir; String RetsMiscImageRelativeDir=u.RetsMiscImageRelativeDir; String RetsOptionsDir=u.RetsOptionsDir; String RetsOptionFileName=u.RetsOptionFileName; String USLocationsMOFileName=u.USLocationsMOFileName; boolean hasRecords=true; boolean multipleSelection=true; boolean haveTags=true; int allValuesCount=0; boolean isAddress=false; String the_address=null; String CityStateValue=null; String CountyStateValue=null; String ZipValue=null; String AllOneValue=null; String city_state_zip_req1=null; String CityStateValue_new=null; String CountyStateValue_new=null; String ZipValue_new=null; //System.out.println("Okay."); String title=""; String city_state_zip_req=null; String city_req=null; String state_req=null; String zip_req=null; String remain_str=null; String openhouse_req=null; String sort_by_req=null; String status_req=null; String price_min_req=null; String price_max_req=null; String num_beds_req=null; String num_baths_req=null; String property_types_req=null; String action_type=request.getParameter("action_type"); String query_id=request.getParameter("query_id"); String email_type=null; String email_addr=null; String from_when=null; String to_when=null; String msg=""; String buy_or_rental=null; String the_id=null; String MLS_req=null; String address_req=null; String show_map=null; String pet_allowed=null; String isMapAction=null; String MapActionType=null; int polygonsize=0; ArrayList pointList=new ArrayList(); double minLat=0.0, maxLat=0.0,minLng=0.0,maxLng=0.0; double minRLat=0.0, maxRLat=0.0,minRLng=0.0,maxRLng=0.0; double cirLat=0.0, cirLng=0.0, cirRadius=0.0; int latlng_size=30; boolean is_address=false; boolean is_distance=false; double myLat=0.0; double myLong=0.0; double distance=0.0; //System.out.println(query_id+", "+action_type+", "+query_id.indexOf("-")+", "+query_id.substring(query_id.indexOf("-")+1)); if (action_type!=null && action_type.equalsIgnoreCase("go") && query_id!=null && !query_id.trim().equalsIgnoreCase("") && query_id.indexOf("-")!=-1 && u.isDigit(query_id.substring(query_id.indexOf("-")+1))){ QueryData qdata0=new QueryData(); ResultSet go_rs=qdata0.SelectUsersSetting(query_id); int go_count=0; while (go_rs.next()){ title=go_rs.getString(1); if (title==null) title=""; buy_or_rental=go_rs.getString(3); city_state_zip_req=go_rs.getString(4); if ((city_state_zip_req!=null && !city_state_zip_req.equalsIgnoreCase(""))){ while (city_state_zip_req.indexOf("%3A")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%3A", ":"); while (city_state_zip_req.indexOf("%7C")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%7C", "|"); while (city_state_zip_req.indexOf("+")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"+", " "); while (city_state_zip_req.indexOf("%2C")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%2C", ","); while (city_state_zip_req.indexOf("%3F")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%3F", "?"); while (city_state_zip_req.indexOf("%27")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%27", "'"); } city_state_zip_req=u.ReplaceStr1(city_state_zip_req, " ", " "); city_state_zip_req=u.ReplaceStr1(city_state_zip_req, ", ", ","); openhouse_req=go_rs.getString(5); sort_by_req=go_rs.getString(6); price_min_req=go_rs.getString(7); if (price_min_req==null) price_min_req="Any"; price_max_req=go_rs.getString(8); if (price_max_req==null) price_max_req="Any"; num_beds_req=go_rs.getString(9); if (num_beds_req==null) num_beds_req="Any"; num_baths_req=go_rs.getString(10); if (num_baths_req==null) num_baths_req="Any"; property_types_req=go_rs.getString(11); if (property_types_req==null) property_types_req="Any"; query_id=go_rs.getString(2); email_type=go_rs.getString(12); //System.out.println("email_type="+email_type); if (email_type==null) email_type="no_email"; email_addr=go_rs.getString(13); if (email_addr==null) email_addr=""; String from_when_str=go_rs.getString(14); if (from_when_str==null ) from_when=""; else from_when=u.ConvertTimeFormatBack(from_when_str); String to_when_str=go_rs.getString(15); if (to_when_str==null) to_when=""; else to_when=u.ConvertTimeFormatBack(to_when_str); the_id=go_rs.getString(16); query_id=query_id+"-"+the_id; MLS_req=go_rs.getString(18); if (MLS_req!=null) MLS_req=MLS_req.trim(); address_req=go_rs.getString(19); if (address_req!=null) address_req=address_req.trim(); CityStateValue=go_rs.getString(26); CountyStateValue=go_rs.getString(27); ZipValue=go_rs.getString(28); AllOneValue=go_rs.getString(29); show_map=go_rs.getString(30); isMapAction=go_rs.getString(31); MapActionType=go_rs.getString(32); polygonsize=go_rs.getInt(33); ArrayList one_lat_list=new ArrayList(); ArrayList one_lng_list=new ArrayList(); if (isMapAction!=null && isMapAction.equalsIgnoreCase("on")){ if (MapActionType!=null && MapActionType.equalsIgnoreCase("polygon")){ int one_list_count=0; for (int i=34; imaxLat) maxLat=lat; if (lngmaxLng) maxLng=lng; } } } else if (MapActionType.equalsIgnoreCase("rectangle")){ minRLat=Double.parseDouble(request.getParameter("minRLat")); minRLng=Double.parseDouble(request.getParameter("minRLng")); maxRLat=Double.parseDouble(request.getParameter("maxRLat")); maxRLng=Double.parseDouble(request.getParameter("maxRLng")); minLat=minRLat; maxLat=maxRLat; minLng=minRLng; maxLng=maxRLng; } else if (MapActionType.equalsIgnoreCase("circle")){ cirLat=Double.parseDouble(request.getParameter("cirLat")); cirLng=Double.parseDouble(request.getParameter("cirLng")); cirRadius=Double.parseDouble(request.getParameter("cirRadius")); minLat=cirLat-cirRadius; maxLat=cirLat+cirRadius; minLng=cirLng-cirRadius; maxLng=cirLng+cirRadius; } } String req_type=null; the_address=request.getParameter("one_addr"); if (the_address!=null && !the_address.trim().equalsIgnoreCase("") && !the_address.trim().equalsIgnoreCase("null")){ isAddress=true; city_state_zip_req=null; } if (is_address==true){ the_address=city_state_zip_req; city_state_zip_req=""; } if (the_address!=null && !the_address.trim().equalsIgnoreCase("") && !the_address.trim().equalsIgnoreCase("null")){ isAddress=true; city_state_zip_req=null; } address_req=request.getParameter("full_address"); if (address_req!=null) address_req=address_req.trim(); if (address_req!=null && !address_req.trim().equalsIgnoreCase("")) isAddress=true; else { if (isAddress==true) address_req=the_address; } if (is_address==false) address_req=null; System.out.println("city_state_zip_req."+city_state_zip_req+", address_req="+address_req); String input_options=request.getParameter("input_options"); if (input_options !=null && input_options.equalsIgnoreCase("addr")) isAddress=true; else isAddress=false; if (city_state_zip_req!=null && !city_state_zip_req.trim().equalsIgnoreCase("")){ req_type=u.isAddr(city_state_zip_req); } //----------------------------------------------------------- AllOneValue=request.getParameter("AllOneValue"); //System.out.println(".........."+AllOneValue); if (city_state_zip_req!=null && !city_state_zip_req.trim().equalsIgnoreCase("") && !city_state_zip_req.startsWith("Multiple selections are made") && !city_state_zip_req.equalsIgnoreCase("undefined")) AllOneValue="City:|County:|Zip:|"; CookieHandler ch=new CookieHandler(); int cookieOkay=0; if (AllOneValue!=null && !AllOneValue.equalsIgnoreCase("") && !AllOneValue.equalsIgnoreCase("City:|County:|Zip:|") && !AllOneValue.equalsIgnoreCase("City:N.A.|County:N.A.|Zip:N.A.|") && !AllOneValue.equalsIgnoreCase("City:N.A.|County:|Zip:|") && !AllOneValue.equalsIgnoreCase("City:N.A.|County:N.A.|Zip:|") && !AllOneValue.equalsIgnoreCase("City:|County:N.A.|Zip:|") && !AllOneValue.equalsIgnoreCase("City:|County:N.A.|Zip:N.A.|") && !AllOneValue.equalsIgnoreCase("City:|County:|Zip:N.A.|") ) cookieOkay=ch.UpdateCookie(request, response,AllOneValue); else if (city_state_zip_req!=null && !city_state_zip_req.equalsIgnoreCase("")){ cookieOkay=ch.UpdateCookie(request, response,city_state_zip_req); city_state_zip_req1=city_state_zip_req; } else cookieOkay=ch.UpdateCookie(request, response,null); if ((city_state_zip_req!=null && !city_state_zip_req.equalsIgnoreCase(""))){ while (city_state_zip_req.indexOf("%3A")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%3A", ":"); while (city_state_zip_req.indexOf("%7C")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%7C", "|"); while (city_state_zip_req.indexOf("+")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"+", " "); while (city_state_zip_req.indexOf("%2C")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%2C", ","); while (city_state_zip_req.indexOf("%3F")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%3F", "?"); while (city_state_zip_req.indexOf("%27")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%27", "'"); } CityStateValue=u.ReplaceStr1(u.ReplaceStr1(request.getParameter("CityStateValue"), " ", " "), ", ", ","); CountyStateValue=u.ReplaceStr1(u.ReplaceStr1(request.getParameter("CountyStateValue"), " ", " "), ", ", ","); ZipValue=u.ReplaceStr1(u.ReplaceStr1(request.getParameter("ZipValue"), " ", " "), ", ", ","); //System.out.println("AllOneValue="+AllOneValue); //System.out.println("Okay here...."); if (AllOneValue!=null && !AllOneValue.equalsIgnoreCase("") && !AllOneValue.equalsIgnoreCase("null")){ CityStateValue=AllOneValue.substring(5, AllOneValue.indexOf("|County:")+1); CountyStateValue=AllOneValue.substring(AllOneValue.indexOf("|County:")+8, AllOneValue.indexOf("|Zip:")+1); ZipValue=AllOneValue.substring(AllOneValue.indexOf("|Zip:")+5); if ( (CityStateValue.equalsIgnoreCase("|") || CityStateValue.equalsIgnoreCase("N.A.|")) && (CountyStateValue.equalsIgnoreCase("|") || CountyStateValue.equalsIgnoreCase("N.A.|")) && (ZipValue.equalsIgnoreCase("|") || ZipValue.equalsIgnoreCase("N.A.|"))) {; //System.out.println("I am here,"); } else { //System.out.println("I am about to update Cookies,"); cookieOkay=ch.UpdateCookie(request, response,AllOneValue); city_state_zip_req=""; } } //System.out.println("Okay here, too...."); //int cookieOkay=ch.UpdateCookie(request, response,city_state_zip_req, CityStateValue, CountyStateValue, ZipValue); String bwr_tags=ch.bwr_tags; //System.out.println("bwr_tags="+bwr_tags); String bwr_city=ch.bwr_city; String bwr_county=ch.bwr_county; String bwr_zip=ch.bwr_zip; if ( (city_state_zip_req==null || city_state_zip_req.equalsIgnoreCase("")) && (CityStateValue==null || CityStateValue.equalsIgnoreCase("")) && (CountyStateValue==null || CountyStateValue.equalsIgnoreCase("")) && (ZipValue==null || ZipValue.equalsIgnoreCase(""))){ if (AllOneValue==null || AllOneValue.equalsIgnoreCase("") ){ if (bwr_tags==null) city_state_zip_req=""; else { if (city_state_zip_req==null) city_state_zip_req=""; else if ( city_state_zip_req.equalsIgnoreCase("")) city_state_zip_req=""; //System.out.println("I am checking..."+city_state_zip_req); if ((city_state_zip_req!=null && !city_state_zip_req.equalsIgnoreCase(""))){ while (city_state_zip_req.indexOf("%3A")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%3A", ":"); while (city_state_zip_req.indexOf("%7C")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%7C", "|"); while (city_state_zip_req.indexOf("+")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"+", " "); while (city_state_zip_req.indexOf("%2C")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%2C", ","); while (city_state_zip_req.indexOf("%3F")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%3F", "?"); while (city_state_zip_req.indexOf("%27")!=-1) city_state_zip_req=u.ReplaceStr1(city_state_zip_req,"%27", "'"); } city_state_zip_req=u.ReplaceStr1(city_state_zip_req, " ", " "); city_state_zip_req=u.ReplaceStr1(city_state_zip_req, ", ", ","); //System.out.println("I am checking..."+city_state_zip_req); if (city_state_zip_req.startsWith("County:")) { city_state_zip_req1=city_state_zip_req; CountyStateValue_new=city_state_zip_req.substring(city_state_zip_req.indexOf("County:")+7); } else if (city_state_zip_req.startsWith("City:") && city_state_zip_req.indexOf("County:")!=-1 && city_state_zip_req.indexOf("Zip:")!=-1){ AllOneValue=city_state_zip_req; CityStateValue=AllOneValue.substring(5, AllOneValue.indexOf("|County:")+1); CountyStateValue=AllOneValue.substring(AllOneValue.indexOf("|County:")+8, AllOneValue.indexOf("|Zip:")+1); ZipValue=AllOneValue.substring(AllOneValue.indexOf("|Zip:")+5); if ( (CityStateValue.equalsIgnoreCase("|") || CityStateValue.equalsIgnoreCase("N.A.|")) && (CountyStateValue.equalsIgnoreCase("|") || CountyStateValue.equalsIgnoreCase("N.A.|")) && (ZipValue.equalsIgnoreCase("|") || ZipValue.equalsIgnoreCase("N.A.|"))) {; //System.out.println("I am here,"); } else if (city_state_zip_req.startsWith("City:")){ city_state_zip_req1=city_state_zip_req.substring(city_state_zip_req.indexOf("City:")+5); CityStateValue_new=city_state_zip_req1; } else if (city_state_zip_req.startsWith("Zip:")){ city_state_zip_req1=city_state_zip_req.substring(city_state_zip_req.indexOf("Zip:")+4); ZipValue_new=city_state_zip_req1; } else { //System.out.println("I am about to update Cookies,"); cookieOkay=ch.UpdateCookie(request, response,AllOneValue); city_state_zip_req=""; } } } } else { //System.out.println("Update cookies for AllOneValue..."); cookieOkay=ch.UpdateCookie(request, response,AllOneValue); //CityStateValue=AllOneValue.substring(5, AllOneValue.indexOf("|County:")+1); //CountyStateValue=AllOneValue.substring(AllOneValue.indexOf("|County:")+8, AllOneValue.indexOf("|Zip:")+1); //ZipValue=AllOneValue.substring(AllOneValue.indexOf("|Zip:")+5); } } //System.out.println("city_state_zip_req="+city_state_zip_req); String allValues="City:"+CityStateValue+"County:"+CountyStateValue+"Zip:"+ZipValue; //System.out.println(allValues); while (allValues.indexOf("N.A.|")!=-1 ){ allValues=allValues.substring(0, allValues.indexOf("N.A.|"))+allValues.substring(allValues.indexOf("N.A.|")+5); //allValues=allValues.substring(0, allValues.indexOf(":|"))+allValues.substring(allValues.indexOf(":|")+2); } while ( allValues.indexOf(":|")!=-1){ //allValues=allValues.substring(0, allValues.indexOf("N.A.|"))+allValues.substring(allValues.indexOf("N.A.|")+5); allValues=allValues.substring(0, allValues.indexOf(":|"))+allValues.substring(allValues.indexOf(":|")+2); } //allValues=allValues.replaceAll("N.A.|", ""); //System.out.println("allValues="+allValues); String theAllValues=allValues; //System.out.println("Okay 3."); while (theAllValues.indexOf("|")!=-1){ theAllValues=theAllValues.substring(theAllValues.indexOf("|")+1); allValuesCount++; } //System.out.println("Okay 3."+allValuesCount); //System.out.println("CityStateValue="+CityStateValue); //System.out.println("CountyStateValue="+CountyStateValue); //System.out.println("ZipValue="+ZipValue); //System.out.println("++++++++++"+CityStateValue+", "+CountyStateValue+", "+ZipValue); if ((CityStateValue==null || CityStateValue.equalsIgnoreCase("") || CityStateValue.equalsIgnoreCase("|") || CityStateValue.equalsIgnoreCase("N.A.|")) && (CountyStateValue==null || CountyStateValue.equalsIgnoreCase("") || CountyStateValue.equalsIgnoreCase("|") || CountyStateValue.equalsIgnoreCase("N.A.|")) && (ZipValue==null || ZipValue.equalsIgnoreCase("") || ZipValue.equalsIgnoreCase("|") || ZipValue.equalsIgnoreCase("N.A.|"))) multipleSelection=false; else multipleSelection=true; //System.out.println("multipleSelection="+multipleSelection+", city_state_zip_req1="+city_state_zip_req1); if (multipleSelection==false){ haveTags=true; if ((city_state_zip_req==null || city_state_zip_req.trim().equalsIgnoreCase("") || city_state_zip_req.trim().equalsIgnoreCase("undefined")) && bwr_tags==null) city_state_zip_req=""; if ((city_state_zip_req==null || city_state_zip_req.trim().equalsIgnoreCase("") || city_state_zip_req.trim().equalsIgnoreCase("undefined") ) && bwr_tags!=null) { //city_state_zip_req=ch.bwr_tags; city_state_zip_req=null; haveTags=false; } city_state_zip_req1=city_state_zip_req; } else { //System.out.println("...CountyStateValue="+CountyStateValue); if (allValuesCount==1) { if (!CityStateValue.equalsIgnoreCase("|") && !CityStateValue.equalsIgnoreCase("N.A.|")) city_state_zip_req1=CityStateValue.substring(0, CityStateValue.length()-1); else if (!CountyStateValue.equalsIgnoreCase("|") && !CountyStateValue.equalsIgnoreCase("N.A.|")) city_state_zip_req1="County:"+CountyStateValue.substring(0, CountyStateValue.length()-1); else if (!ZipValue.equalsIgnoreCase("|") && !ZipValue.equalsIgnoreCase("N.A.|")) city_state_zip_req1=ZipValue.substring(0, ZipValue.length()-1); } else city_state_zip_req1="Multiple selections are made."; } //System.out.println("city_state_zip_req1="+city_state_zip_req1); city_state_zip_req=u.ReplaceStr1(city_state_zip_req, " ", " "); city_state_zip_req=u.ReplaceStr1(city_state_zip_req, ", ", ","); city_state_zip_req=u.getZip(city_state_zip_req); if (city_state_zip_req!=null && !city_state_zip_req.equalsIgnoreCase("")){ if (city_state_zip_req.indexOf(",")==-1){ if (u.isDigit(city_state_zip_req)) { //System.out.println("isDigit:"); zip_req=city_state_zip_req; } else { city_req=city_state_zip_req; if (city_req.indexOf(" ")!=-1){ String inStr=city_req; while ( inStr.indexOf(" ") != -1){ inStr=inStr.substring(inStr.indexOf(" ")+" ".length()); //comma_count++; } if (inStr.trim().equalsIgnoreCase("MO") || inStr.trim().equalsIgnoreCase("IL")){ city_req=city_req.substring(0, city_req.length()-2).trim(); state_req=inStr.trim().toUpperCase(); } /*if (inStr.trim().equalsIgnoreCase("missouri") ){ city_req=city_req.substring(0, city_req.length()-8).trim(); state_req="MO"; } if ( inStr.trim().equalsIgnoreCase("illinois")){ city_req=city_req.substring(0, city_req.length()-8).trim(); state_req="IL"; }*/ if (u.isDigit(inStr.trim())){ //System.out.println("the zip code="+inStr.trim()); zip_req=inStr; city_req=city_req.substring(0, city_req.length()-zip_req.length()).trim(); String inStr1=city_req; //System.out.println("Okay 1: the zip code="+inStr.trim()); while ( inStr1.indexOf(" ") != -1){ inStr1=inStr1.substring(inStr1.indexOf(" ")+" ".length()); //comma_count++; } if (inStr1.trim().equalsIgnoreCase("MO") || inStr1.trim().equalsIgnoreCase("IL")){ city_req=city_req.substring(0, city_req.length()-2).trim(); state_req=inStr1.trim().toUpperCase(); } /*if (inStr1.trim().equalsIgnoreCase("missouri") ){ city_req=city_req.substring(0, city_req.length()-8).trim(); state_req="MO"; } if ( inStr1.trim().equalsIgnoreCase("illinois")){ city_req=city_req.substring(0, city_req.length()-8).trim(); state_req="IL"; }*/ //System.out.println("Okay 2: the zip code="+inStr.trim()); } } //state_req="MO"; } } else { city_req=city_state_zip_req.substring(0, city_state_zip_req.indexOf(",")).trim(); remain_str=city_state_zip_req.substring(city_state_zip_req.indexOf(",")+1).trim(); if (remain_str.indexOf(" ")!=-1){ state_req=remain_str.substring(0,remain_str.indexOf(" ")).trim(); zip_req=remain_str.substring(remain_str.indexOf(" ")+1).trim(); } else { state_req=remain_str; } } if (req_type!=null && req_type.startsWith("Zip=")) zip_req=req_type.substring(4); //System.out.println(remain_str+", "+city_req+", "+state_req+", "+zip_req); if (zip_req==null || zip_req.trim().equalsIgnoreCase("")) zip_req=u.ContainsZip(city_state_zip_req); } if (haveTags==true && multipleSelection==false){ if (city_req!=null && !city_req.trim().equalsIgnoreCase("") && !city_req.trim().equalsIgnoreCase("null") && city_req.trim().startsWith("County:")){ CountyStateValue=city_req.substring(city_req.indexOf("County:")+7)+","+state_req; //System.out.println("...CountyStateValue="+CountyStateValue); } else if (city_req!=null && !city_req.trim().equalsIgnoreCase("") && !city_req.trim().equalsIgnoreCase("null") && !city_req.trim().startsWith("County:")){ CityStateValue=city_req+","+state_req+"|"; //System.out.println("..."+CityStateValue); } if (zip_req!=null && !zip_req.trim().equalsIgnoreCase("") && !zip_req.trim().equalsIgnoreCase("null")){ CityStateValue=""; CountyStateValue=""; ZipValue=zip_req+"|"; //System.out.println("..."+CityStateValue+", "+ZipValue); } } //if (CityStateValue_new!=null) CityStateValue=CityStateValue_new; if (CountyStateValue_new!=null) CountyStateValue=CountyStateValue_new; //System.out.println("........CountyStateValue="+CountyStateValue); //if (ZipValue_new!=null) ZipValue=ZipValue_new; //---------------------------------------------------- //System.out.println("CityStateValue="+CityStateValue); //System.out.println("CountyStateValue="+CountyStateValue); //System.out.println("ZipValue="+ZipValue); openhouse_req=request.getParameter("openhouse"); sort_by_req=request.getParameter("sort_by"); status_req=request.getParameter("Status"); if (status_req==null) status_req="Active"; price_min_req=request.getParameter("price_min"); price_max_req=request.getParameter("price_max"); num_beds_req=request.getParameter("num_beds"); num_baths_req=request.getParameter("num_baths"); property_types_req=request.getParameter("property_types"); MLS_req=request.getParameter("MLS_Number"); if (MLS_req!=null) MLS_req=MLS_req.trim(); //System.out.println("???????????"+address_req); if (title==null) title=""; buy_or_rental="rental"; if (price_min_req==null) price_min_req="Any"; if (price_max_req==null) price_max_req="Any"; if (num_beds_req==null) num_beds_req="Any"; if (num_baths_req==null) num_baths_req="Any"; if (property_types_req==null) property_types_req="Any"; if (email_type==null) email_type="no_email"; if (email_addr==null) email_addr=""; if (from_when==null ) from_when=""; if (to_when==null) to_when=""; } System.out.println("******************Rent Page at "+new java.util.Date()+"******************"); System.out.println(city_state_zip_req); //---------------------------------------------- File f1=new File(RetsOptionsDir, USLocationsMOFileName); BufferedReader in1 = new BufferedReader(new FileReader(f1)); int location_count=0; if (f1.exists()){ String s; while ((s=in1.readLine())!=null){ location_count++; } } in1.close(); if (query_id==null) query_id=""; boolean openhouseOnly=false; //System.out.println("openhouseOnly_req="+openhouse_req); if (openhouse_req==null ) openhouse_req="Any"; //else if (openhouseOnly_req.equalsIgnoreCase("on")) openhouseOnly=true; if (property_types_req==null) property_types_req="Any"; else if (property_types_req.equalsIgnoreCase("Residential")) property_types_req="Residential"; else if (property_types_req.startsWith("Commercial")) property_types_req="Commercial Indr."; else if (property_types_req.startsWith("Multi-Family")) property_types_req="Multi-Family"; else if (property_types_req.startsWith("Condo")) property_types_req="Condo/Coop/Villa"; else if (property_types_req.indexOf("Acreage")!=-1) property_types_req="Acreage Farms"; else if (property_types_req.indexOf("Lots")!=-1) property_types_req="Residential Lots"; else if (property_types_req.startsWith("New")) property_types_req="New Construction"; if (sort_by_req==null) sort_by_req="Relevance"; if (MLS_req==null) MLS_req=""; //System.out.println(sort_by_req+", "+price_min_req+", "+price_max_req); File f=new File(RetsOptionsDir, RetsOptionFileName); BufferedReader in = new BufferedReader(new FileReader(f)); ArrayList all_options=new ArrayList(); ArrayList openhouse=new ArrayList(); ArrayList sort_by=new ArrayList(); ArrayList price_range=new ArrayList(); ArrayList num_beds=new ArrayList(); ArrayList num_baths=new ArrayList(); ArrayList property_types=new ArrayList(); ArrayList status=new ArrayList(); if (f.exists()){ String s; while ((s=in.readLine())!=null){ StringTokenizer t0=new StringTokenizer(s, "|"); all_options.add(new OptionObj(t0.nextToken(),t0.nextToken(),t0.nextToken())); } } for (int i=0; i St. Louis Apartments for Rent | Clayton Homes for Sale | St. Charles Homes for Sale - Blue World Realty Blue World Realty, L.C. Home Buy Rent Find A Loan Officer Find A Realtor Home Improvement FAQ Contact Us About Us City, State/Zip value="<%=city_state_zip_req1%>" <% } else { %> value="Multiple selections are made." <% }} else { if (haveTags==true && isAddress==false) { //System.out.println("+++I am here 2."); %> value="<%=city_state_zip_req1%>" <% } else { //System.out.println("+++I am here 3."); %> value="<%=city_state_zip_req1%>" placeholder="Enter city or zip or address" <%}} %> > City: <% // System.out.println("Okay XXXXXXXXXXX"+CityStateValue); ArrayList thecity_list=u.GetCityCountyZip(CityStateValue); boolean city_selected=false; for (int i=0; i <%=citystate_item%> <% city_selected=true; break; } } if (city_selected==false) { %> <%=citystate_item%> <% } }%> County: <% ArrayList thecounty_list=u.GetCityCountyZip(CountyStateValue); boolean county_selected=false; for (int i=0; i <%=countystate_item%> <% county_selected=true; //break; } } if (county_selected==false) { %> <%=countystate_item%> <% } }%> Zip Code: <% ArrayList thezip_list=u.GetCityCountyZip(ZipValue); boolean zip_selected=false; for (int i=0; i <%=zip_item%> <% zip_selected=true; //break; } } if (zip_selected==false) { %> <%=zip_item%> <% } }%> <% if (polygonsize<=latlng_size){ for (int i=0; i <%} for (int i=polygonsize; i <%} } %> value="" <% } else { %> value="" <%} %> > Or: <% if (is_distance==false || distance==0.0) { %> Not Selected 1000 ft 0.5 mi 1 mi 5 mi 10 mi 20 mi <% } else if (distance==0.003469) { %> Not Selected 1000 ft 0.5 mi 1 mi 5 mi 10 mi 20 mi <% } else if (distance==0.009158) { %> Not Selected 1000 ft 0.5 mi 1 mi 5 mi 10 mi 20 mi <% } else if (distance==0.018135) { %> Not Selected 1000 ft 0.5 mi 1 mi 5 mi 10 mi 20 mi <% } else if (distance==0.091575) { %> Not Selected 1000 ft 0.5 mi 1 mi 5 mi 10 mi 20 mi <% } else if (distance==0.18315) { %> Not Selected 1000 ft 0.5 mi 1 mi 5 mi 10 mi 20 mi <% } else if (distance==0.3663) { %> Not Selected 1000 ft 0.5 mi 1 mi 5 mi 10 mi 20 mi <%} %> Distance Show Map value="on" checked="checked"> <%} else { %> value="off"> <%} %> Minimum Rent: <% for (int i=0; i <%=price_range_result._text %> <%} else { %> <%=price_range_result._text %> <% }} else { if ( price_range_result._value.equalsIgnoreCase(price_min_req)){ %> <%=price_range_result._text %> <% } else { %> <%=price_range_result._text %> <%}}} %> Maximum Rent: <% for (int i=0; i <%=price_range_result._text %> <%} else { %> <%=price_range_result._text %> <% }} else { if ( price_range_result._value.equalsIgnoreCase(price_max_req)){ %> <%=price_range_result._text %> <% } else { %> <%=price_range_result._text %> <%}}} %> Number of Bedrooms: <% for (int i=0; i <%=num_beds_result._text %> <%} else { %> <%=num_beds_result._text %> <% }} else { if ( num_beds_result._value.equalsIgnoreCase(num_beds_req)){ %> <%=num_beds_result._text %> <% } else { %> <%=num_beds_result._text %> <%}}} %> Number of Bathrooms: <% for (int i=0; i <%=num_baths_result._text %> <%} else { %> <%=num_baths_result._text %> <% }} else { if ( num_baths_result._value.equalsIgnoreCase(num_baths_req)){ %> <%=num_baths_result._text %> <% } else { %> <%=num_baths_result._text %> <%}}} %> Show More Filter MLS#: value="<%=MLS_req%>" <% } else { %> value="" <%} %> > Pet Allowed value="on" checked> <%} else { %> value="off"> <%} %> Open house: <% for (int i=0; i <%=openhouse_result._text %> <%} else { %> <%=openhouse_result._text %> <% }} else { if ( openhouse_result._value.equalsIgnoreCase(openhouse_req)){ %> <%=openhouse_result._text %> <% } else { %> <%=openhouse_result._text %> <%}}} %> Sort By: <% for (int i=0; i <%=sort_by_result._text %> <%} else { %> <%=sort_by_result._text %> <% }} else { if ( sort_by_result._value.equalsIgnoreCase(sort_by_req)){ %> <%=sort_by_result._text %> <% } else { %> <%=sort_by_result._text %> <%}}} %> Property Type: <% for (int i=0; i <%=property_types_result._text %> <%} else { %> <%=property_types_result._text %> <% }} else { if ( property_types_result._value.equalsIgnoreCase(property_types_req)){ %> <%=property_types_result._text %> <% } else { %> <%=property_types_result._text %> <%}}} %> Status: <% for (int i=0; i <%=status_result._text %> <%} else { %> <%=status_result._text %> <% }} else { if ( status_result._value.equalsIgnoreCase(status_req)){ %> <%=status_result._text %> <% } else { %> <%=status_result._text %> <%}}} %> <% if (!msg.trim().equalsIgnoreCase("")) { %> <%=msg %> <%} %> <%if (AddrMsg!=null){ %> <%=AddrMsg %> <%} %> <% if (qdata!=null) qdata.closeDB(); %> <% } catch (Exception e){e.printStackTrace();} %>
<%} %> <% if (qdata!=null) qdata.closeDB(); %>