user_exists) { $page = "error"; $smarty->assign('error_header', 639); $smarty->assign('error_message', 656); $smarty->assign('error_submit', 641); include "footer.php"; } function general(){ global $user, $database1, $database; if(isset($_POST['zip'])) { $zip = $_POST['zip']; } elseif(isset($_GET['zip'])) { $zip = $_GET['zip']; } else { $zip = ""; } if(isset($_POST['country'])) { $country = $_POST['country']; } elseif(isset($_GET['country'])) { $country = $_GET['country']; } else { $country = ""; } if(isset($_POST['region'])) { $region = $_POST['region']; } elseif(isset($_GET['region'])) { $region = $_GET['region']; } else { $region = ""; } if(isset($_POST['state'])) { $state = $_POST['state']; } elseif(isset($_GET['state'])) { $state = $_GET['state']; } else { $state = "-1"; } if(isset($_POST['city'])) { $city = $_POST['city']; } elseif(isset($_GET['city'])) { $city = $_GET['city']; } else { $city = ""; } if(isset($_POST['province'])) { $province = $_POST['province']; } elseif(isset($_GET['province'])) { $province = $_GET['province']; } else { $province = "-1"; } if(isset($_POST['ukregion'])) { $ukregion = $_POST['ukregion']; } elseif(isset($_GET['ukregion'])) { $ukregion = $_GET['ukregion']; } else { $ukregion = "-1"; } if($country!="236"){$state="-1";$_POST['state']="";} if($country!="235"){$ukregion="-1";$_POST['ukregion']="";} if($country!="40"){$province="-1";$_POST['province']="";} if(isset($_POST['distance'])) { $distance = $_POST['distance']; } elseif(isset($_GET['distance'])) { $distance = $_GET['distance']; } else { $distance = "150"; } ?>
database_query("SELECT COUNT(*) as cnt, bateworldcom_zips.countries.name, bateworldcom_zips.countries.id FROM airbnbate, bateworldcom_zips.countries WHERE bateworldcom_zips.countries.id=airbnbate.country GROUP BY country"); while($row=$database->database_fetch_array($query)) { ?> "> rooms
database_query("SELECT latitude, longitude FROM bateworldcom_zips.zipcodes1, bateworldcom_zips.countries WHERE bateworldcom_zips.zipcodes1.postal_code='".$database->database_real_escape_string($zip)."' AND bateworldcom_zips.countries.id='".$database->database_real_escape_string($country)."' AND bateworldcom_zips.zipcodes1.admin_name1='".$database->database_real_escape_string($region)."' AND bateworldcom_zips.countries.alpha_2=bateworldcom_zips.zipcodes1.country_code LIMIT 1"); } elseif($country!="-1"&&$country!=""){ $query=$database->database_query("SELECT latitude, longitude FROM bateworldcom_zips.zipcodes1, bateworldcom_zips.countries WHERE bateworldcom_zips.zipcodes1.postal_code='".$database->database_real_escape_string($zip)."' AND bateworldcom_zips.countries.id='".$database->database_real_escape_string($country)."' AND bateworldcom_zips.countries.alpha_2=bateworldcom_zips.zipcodes1.country_code LIMIT 1"); } else{ $query=$database->database_query("SELECT latitude, longitude FROM bateworldcom_zips.zipcodes1 WHERE postal_code='".$database->database_real_escape_string($zip)."' LIMIT 1"); } $row=$database->database_fetch_array($query); if($row["latitude"]!=""){ $coslat=cos(deg2rad($row["latitude"])); $sinlat=sin( deg2rad($row["latitude"]) ); $radlon=deg2rad($row["longitude"]); $sql1="SELECT country_code, place_name, admin_name1, admin_code1, postal_code, ( 3959 * acos( ".$coslat." * cos( radianslat ) * cos( radianslon - ".$radlon." ) + ".$sinlat." * sin( radianslat ) ) ) AS distance FROM bateworldcom_zips.zipcodes1 WHERE (latitude<=".($row["latitude"]+3)." AND latitude>=".($row["latitude"]-3).") AND (longitude<=".($row["longitude"]+3)." AND longitude>=".($row["longitude"]-3).") HAVING distance <= ".$database->database_real_escape_string($distance)." ORDER BY distance ASC LIMIT 0 , 10000"; $url_string1 .="field_27=".urlencode($zip)."&"; $query1=$database->database_query($sql1); $o=1; while($row1=$database->database_fetch_array($query1)) { if($o==1){ $zips="airbnbate.zip='".$row1["postal_code"]."'"; } else{ $zips.=" OR airbnbate.zip='".$row1["postal_code"]."' OR airbnbate.zip='".$zip."'"; } $o++; } } else{$total_users=0;} } else { if($city!=""){ $citysql='bateworldcom_zips.zipcodes1.place_name="'.$database->database_real_escape_string($city).'" AND '; } if($country!=""&&$country!="-1"&&$region!=""){ $query=$database->database_query("SELECT latitude, longitude FROM bateworldcom_zips.zipcodes1, bateworldcom_zips.countries, bateworldcom_zips.provinces WHERE ".$citysql." bateworldcom_zips.countries.id='".$database->database_real_escape_string($country)."' AND bateworldcom_zips.provinces.id='".$database->database_real_escape_string($region)."' AND bateworldcom_zips.provinces.abbr=admin_code1 AND bateworldcom_zips.countries.alpha_2=bateworldcom_zips.zipcodes1.country_code LIMIT 1"); } elseif($country!="-1"&&$city!=""){ $query=$database->database_query("SELECT latitude, longitude FROM bateworldcom_zips.zipcodes1, bateworldcom_zips.countries WHERE ".$citysql." bateworldcom_zips.countries.id='".$database->database_real_escape_string($country)."' LIMIT 1"); } else{ //$query=$database->database_query("SELECT latitude, longitude FROM bateworldcom_zips.zipcodes1 WHERE place_name='".$database->database_real_escape_string($city)."' LIMIT 1"); } $row=$database->database_fetch_array($query); if($row["latitude"]!=""){ $coslat=cos(deg2rad($row["latitude"])); $sinlat=sin( deg2rad($row["latitude"]) ); $radlon=deg2rad($row["longitude"]); $sql1="SELECT country_code, place_name, admin_name1, admin_code1, postal_code, ( 3959 * acos( ".$coslat." * cos( radianslat ) * cos( radianslon - ".$radlon." ) + ".$sinlat." * sin( radianslat ) ) ) AS distance FROM bateworldcom_zips.zipcodes1 WHERE (latitude<=".($row["latitude"]+3)." AND latitude>=".($row["latitude"]-3).") AND (longitude<=".($row["longitude"]+3)." AND longitude>=".($row["longitude"]-3).") HAVING distance <= ".$database->database_real_escape_string($distance)." ORDER BY distance ASC LIMIT 0 , 10000"; $url_string1 .="field_27=".urlencode($zip)."&"; $query1=$database->database_query($sql1); $o=1; while($row1=$database->database_fetch_array($query1)) { if($o==1){ $zips=" airbnbate.zip='".$database->database_real_escape_string($row1["postal_code"])."'"; } else{ $zips.=" OR airbnbate.zip='".$database->database_real_escape_string($row1["postal_code"])."'"; } $o++; } } else{$total_users=0;} } $cnt=0; if($zip!=""||$country!=""){ $sql="SELECT se_users.*, airbnbate.* FROM airbnbate, se_users WHERE se_users.user_id=airbnbate.userid AND se_users.user_enabled=1"; if($zips!="") { $sql=$sql." AND (".$zips.")"; } if($country!="-1"){ $countryadd=" AND airbnbate.country='".$database->database_real_escape_string($country)."'"; } if($region!=""){ $regionadd=" AND airbnbate.state='".$database->database_real_escape_string($region)."'"; } if($city!=""){ $cityadd=" AND airbnbate.city='".$database->database_real_escape_string($city)."'"; } $sql=$sql. " ".$countryadd." ".$cityadd." ".$regionadd; $sql=$sql." ORDER BY airbnbate.city"; $query=$database->database_query($sql) or die($database->database_error()); }else{$cnt=1;} while($row=$database->database_fetch_array($query)) {$cnt++; ?>

Hosting in: database_query("SELECT * FROM bateworldcom_zips.tbl_state WHERE state_id='".$database->database_real_escape_string($row["state"])."'"); $rowcountry=$database->database_fetch_array($querycountry); $echostate=$rowcountry["statename"]; } if($row["country"]=="235"){$querycountry=$database->database_query("SELECT * FROM bateworldcom_zips.english_regions WHERE id='".$database->database_real_escape_string($row["state"])."'"); $rowcountry=$database->database_fetch_array($querycountry); $echostate=$rowcountry["region"]; } if($row["country"]=="40"){$querycountry=$database->database_query("SELECT * FROM bateworldcom_zips.provinces WHERE id='".$database->database_real_escape_string($row["state"])."'"); $rowcountry=$database->database_fetch_array($querycountry); $echostate=$rowcountry["province"]; } echo $echostate." ";} if(trim($row["zip"])!=""){echo "".$row["zip"]." ";} if(trim($row["country"])!=""){ $querycountry=$database->database_query("SELECT * FROM bateworldcom_zips.countries WHERE id='".$database->database_real_escape_string($country)."'"); $rowcountry=$database->database_fetch_array($querycountry); echo $rowcountry["name"]." ";} echo "

".$row["title"]."
".$row["description"]."

"; if(trim($row["airurl"])!=""){echo " Air BnB URL
";} if(trim($row["misterurl"])!=""){echo "Mister BnB URL
";} ?>
"> " height="60" width="60" />
See Full Profile

No rooms currently available at this location.
Country
City
" class="form-control" />
Postal Code
" class="form-control" />

assign('forumcats', $forumcat_array); $smarty->assign('forum_is_moderator', $forum_is_moderator); include "footer.php"; ?>