include_once("utils.php");
include_once("instance/global.php");
$city = $_GET['city'];
$city_encoded = urldecode($city);
$hwy = $_GET['hwy'];
$hwy = str_replace("-", " ", $hwy );
$state = $_GET['state'];
if(strlen($state) > 2) {
$state_name = $state;
$state = getStateCode($state);
} else {
$state_name = getStateName($state);
}
$state_code = $state;
if(isset($city)) {
$mywhere = "WHERE city='$city'";
$title = "$city Hotels, $city Motels - $domain";
$content = "$city Hotels, $city Motels, $city Hotels $state, $city $state Motels, $city $state_name Hotels, $city $state_name Motels, Hotels in $city , Motels in $city , Hotels in $city $state, Motels in $city $state, Hotels in $city $state_name, Motels in $city $state_name, Hotels $city , Motels $city , Hotels $city $state, Motels $city $state, Hotels $city $state_name, Motels $city $state_name";
} else if(isset($hwy)) {
$mywhere = "WHERE propertydescription like '%$hwy%'";
$title = "Motels & Hotels close to $hwy $state_name - $domain";
$content = "$hwy Hotels, $hwy Motels, $hwy Hotels $state, $hwy $state Motels, $hwy $state_name Hotels, $hwy $state_name Motels, Hotels along $hwy , Motels along $hwy , Hotels along $hwy $state, Motels along $hwy $state, Hotels along $hwy $state_name, Motels along $hwy $state_name, Hotels $hwy , Motels $hwy , Hotels $hwy $state, Motels $hwy $state, Hotels $hwy $state_name, Motels $hwy $state_name, Hotels close to $hwy $state, Motels close to $hwy $state, Hotels close to $hwy $state_name, Motels close to $hwy $state_name";
}
$s = $_GET['start'];
if($s) {
if(isset($city)) {
$sql_str = "SELECT HotelID, Name, Address1, City, StateProvince, PostalCode, Rating, Latitude, Longitude, LowRate FROM `hotel_netrate_active` " . $mywhere . " and trim(stateprovince)='$state' AND `lowrate`!='' ORDER BY lowrate ASC LIMIT $s, 15";
} else {
$sql_str = "SELECT HotelID, Name, Address1, City, StateProvince, PostalCode, Latitude, Longitude, LowRate FROM `hotel_all_active` " . $mywhere . " and trim(stateprovince)='$state' AND `lowrate`!='' ORDER BY lowrate ASC LIMIT $s, 15";
}
$sql = mysql_query($sql_str, $conn);
}
else {
if(isset($city))
$sql_str = "SELECT HotelID, Name, Address1, City, StateProvince, PostalCode, Rating, Latitude, Longitude, LowRate FROM `hotel_netrate_active` " . $mywhere . " and trim(stateprovince)='$state' AND `lowrate`!='' ORDER BY lowrate ASC LIMIT 15";
else
$sql_str = "SELECT HotelID, Name, Address1, City, StateProvince, PostalCode, Latitude, Longitude, LowRate FROM `hotel_all_active` " . $mywhere . " and trim(stateprovince)='$state' AND `lowrate`!='' ORDER BY lowrate ASC LIMIT 15";
$sql = mysql_query($sql_str, $conn);
}
//echo $sql_str;
if(isset($city))
$sql_str = "SELECT HotelID, Name, Address1, City, StateProvince, PostalCode, Rating, Latitude, Longitude, LowRate FROM `hotel_netrate_active` " . $mywhere . " and trim(stateprovince)='$state' AND `lowrate`!=''";
else
$sql_str = "SELECT HotelID, Name, Address1, City, StateProvince, PostalCode, Latitude, Longitude, LowRate FROM `hotel_all_active` " . $mywhere . " and trim(stateprovince)='$state' AND `lowrate`!=''";
$sql1 = mysql_query($sql_str, $conn);
//echo $sql_str;
$num = mysql_num_rows($sql1);
$url_1 = "hotels_city.php?city=$city_encoded&state=$state_code";
$url_page = "hotels_city.php?state=$state_code";
if(isset($city))
$sql_page = "SELECT HotelID, Name, Address1, City, StateProvince, PostalCode, Rating, Latitude, Longitude, LowRate FROM `hotel_netrate_active` " . $mywhere . " and trim(stateprovince)='$state' AND `lowrate`!='' ORDER BY lowrate ASC LIMIT ";
else
$sql_page = "SELECT HotelID, Name, Address1, City, StateProvince, PostalCode, Latitude, Longitude, LowRate FROM `hotel_all_active` " . $mywhere . " and trim(stateprovince)='$state' AND `lowrate`!='' ORDER BY lowrate ASC LIMIT ";
$page_title = $title;
$top_text = " $city hotels $city motels $city hotels $city motels Interstate $NUM $iname I$NUM I $NUM $city hotels $city motels";
$top_text = strtolower(substr($top_text,0,175));
?>
echo $title;?>
echo $top_text;?>
include("header_796.php");?>
include("lsb.php");?>
echo $page_title;?>
if($hwy != false) {
$target = "Hotels close to $hwy";
print "*Note: you may find more hotels/motels close to $iname by browsing hotels/motels around $iname exits ";
} else
$target = "$city Hotels";
print " $num results found in $target, $state_name