// If no search criteria, display search options
$search = $_POST['search'];
$region = $_GET['region'];
$regioncity = $_GET['regioncity'];
if ($search == "" && $region == "" && $regioncity == "") {
?>Search for British Columbia Bed & BreakfastsBritish Columbia is an immense and beautiful Canadian province, full of wildlife adventure, and spectacular sights! You can find the accommodation that’s right for you by either browsing the region of B.C. you are going to explore, or by specifying search criteria to get very specific results. Our GIS-enhanced search engine will ensure you find the right accommodation, fast! | Search for British Columbia B&B accommodation destinations, with online maps and a robust searchable database. Listings updated weekly.
Accommodation Quick Pick
// Print B&B of the hour
bb_of_hour();
?>
Check it out!
Hundreds of B&B Accommodations online NOW! Bookmark us!
| // Close display search options, search results
} else if ($search == "1") {
?> // Query Database and get search results
// Get Form Values
$bbtype = $_POST['bbtype'];
$search_radius = intval($_POST['searchRadius']);
$city = $_POST['city'];
$smoking = $_POST['smoking'];
$wheelchair = $_POST['wheelchair'];
$creditcards = $_POST['creditcard'];
$bathroom = $_POST['bathroom'];
$bbpets = $_POST['bbpets'];
$guestpets = $_POST['guestpets'];
$guestkids = $_POST['guestkids'];
$keywords = prepToSQL($_POST['keywords']);
$keywordlogic = $_POST['keywordlogic'];
if ($keywords != "") {
$keywords = preg_replace("/( and | or )/", " ", $keywords);
$keyquery = "%' ".$keywordlogic." CONCAT(bbname,hosts,address,email,url,caption1,caption2,caption3,writeup,ratedetail) like '%";
$keywords = preg_replace("/ /", $keyquery, $keywords);
$keywords = " (CONCAT(bbname,hosts,address,email,url,caption1,caption2,caption3,writeup,ratedetail) like '%".$keywords."%')";
}
// Search the entire province if looking for "For Sale" B&Bs.
if ($bbtype == "3") { $search_radius = 68000; }
// Get Latitude and Longitude for selected city
$query = "SELECT latitude, longitude from BCBBO_latlong WHERE city='".prepToSQL($city)."'";
dbconnect();
$resultLL = mysql_query($query);
echo mysql_error();
$sqldata = mysql_fetch_array($resultLL);
$bblat = $sqldata[latitude];
$bblong = $sqldata[longitude];
mysql_free_result($resultLL);
$bblat_sec = dms_to_seconds($bblat);
$bblong_sec = dms_to_seconds($bblong);
$lat_min = seconds_to_dms( $bblat_sec - $search_radius );
$lat_max = seconds_to_dms( $bblat_sec + $search_radius );
$long_min = seconds_to_dms( $bblong_sec - $search_radius );
$long_max = seconds_to_dms( $bblong_sec + $search_radius );
$query = "SELECT account, options, bbtype, bbname, postalcode, bblat, bblong, city, phone, fax, tollfree, email, url, ratefrom, rateto, availability, certified FROM BCBBO_listings WHERE ";
$query .= ("((bblat >= ".$lat_min." and bblat <= ".$lat_max." and bblong >= ".$long_min." and bblong <= ".$long_max.") or ");
$query .= "account like '7%' or LEFT(account,1) = LEFT(certified,1)) and ";
if ($keywords != "") {
$query .= ($keywords." and ");
}
if ($bbtype == "3") {
$query .= ("bbtype like '%3%' and ");
} else {
$query .= ("(bbtype like '%1%' or bbtype like '%2%') and ");
}
if ($smoking == "a") {
$query .= ("(smoking like '%n%' or smoking like '%i%' or smoking like '%o%') and ");
} else {
$query .= ("smoking like '%".$smoking."%' and ");
}
if ($wheelchair == "b") {
$query .= ("(wheelchair like '%n%' or wheelchair like '%y%') and ");
} else {
$query .= ("wheelchair like '%".$wheelchair."%' and ");
}
if ($creditcards == "b") {
$query .= ("(creditcards like '%n%' or creditcards like '%y%') and ");
} else {
$query .= ("creditcards like '%".$creditcards."%' and ");
}
if ($bathroom == "b") {
$query .= ("(bathroom like '%p%' or bathroom like '%s%') and ");
} else {
$query .= ("bathroom like '%".$bathroom."%' and ");
}
if ($bbpets== "b") {
$query .= ("(bbpets like '%n%' or bbpets like '%y%') and ");
} else {
$query .= ("bbpets like '%".$bbpets."%' and ");
}
if ($guestpets== "b") {
$query .= ("(guestpets like '%n%' or guestpets like '%y%') and ");
} else {
$query .= ("guestpets like '%".$guestpets."%' and ");
}
if ($guestkids== "b") {
$query .= ("(guestkids like '%n%' or guestkids like '%y%' or guestkids like '%a%') and ");
} else {
$query .= ("(guestkids like '%".$guestkids."%' or guestkids like '%a%') and ");
}
$query .= "active = '1'";
$query .= " ORDER BY SQRT(POW((LEFT(bblat, LENGTH(bblat) - 4) * 3600) + (SUBSTRING(bblat, LENGTH(bblat) - 3, 2) * 60) + (RIGHT(bblat, 2)) - ".$bblat_sec.",2) + POW((LEFT(bblong, LENGTH(bblong) - 4) * 3600) + (SUBSTRING(bblong, LENGTH(bblong) - 3, 2) * 60) + (RIGHT(bblong,2)) - ".$bblong_sec.",2)) ASC, (if(options like '%a%',30,0) + if(options like '%b1%',40,0) + if(options like '%b2%',72,0) + if(options like '%b3%',125,0) + if(options like '%c%',45,0)) DESC, city ASC, (if(LOWER(bbname) regexp '^(a |aa |aaa |an |at |the )',(right(bbname,character_length(bbname) - locate(' ',bbname))),bbname)) ASC";
dbconnect();
$result = mysql_query($query);
echo mysql_error();
?>
Search for British Columbia Bed & BreakfastsThere were // number of results
$total = mysql_num_rows($result)-1;
echo "".$total." matches";
?> to your search criteria. // only first 200
if ($total > 200) {
echo "Only the first 200 results are listed. Please refine your search criteria and search again. ";
}
?>The approximate distance (as the crow flies) to // Town name
echo "".$city.", B.C.,";
?> from other populated areas within your search proximity are shown after each city name in the search results. If your search city has been included in the search results, it is emphasized for your convenience. Search again. // If one or more results, print table
if (mysql_num_rows($result) != 0) {
?> Bed & Breakfast Name | City | Phone Number | Price Range | // Query the database and print results.
$x = 0;
$x_sub = 0;
$x_free = 0;
$bbassoc_city = $city;
$bbassoc_lat = $bblat;
$bbassoc_long = $bblong;
$subscriber_results = "";
$free_results = "";
$bbarea = "0";
// Link Icons
$a1 = "";
$a0 = "";
$d1 = "";
$d0 = "";
$e1 = "";
$e0 = "";
$w1 = "";
$w0 = "";
$bb1 = "";
$bb0 = "";
$es1 = "";
$es0 = "";
while ( (list($account, $options, $bbtype, $bbname, $postalcode, $bblat2, $bblong2, $city, $phone, $fax, $tollfree, $email, $url, $ratefrom, $rateto, $availability, $certified) = mysql_fetch_array($result)) && $x < 200) {
// Get B&B area
if ($bbarea == "0" && substr($account,0,1) != "7" && !strstr($certified, "bbassoc")) { $bbarea = substr($account,0,1); }
// check to see if it is a B&B association page within the right area. If not, skip this loop.
if (strstr($certified, "bbassoc") && substr($certified,0,1) != $bbarea && substr($account,0,1) != "7") { continue; }
// if it's an association, change the city.
if (substr($account,0,1) == "7" || (substr($certified,0,1) == $bbarea && strstr($certified, "bbassoc"))) {
$city = $bbassoc_city;
$bblat2 = $bbassoc_lat;
$bblong2 = $bbassoc_long;
}
$data = "";
$no_phone_data = "";
// Display Ad icon
if (strstr($options, "c")) {
$data .= ("".$d1."");
$no_phone_data .= ("".$d1."");
} else {
$data .= $d0;
$no_phone_data .= $d0;
}
// availability icon
// Commented out by Lee, Feb 25/05 - Force Availability on even if no data.
// $today = getdate();
// $current_month = $today['year']."-".str_pad($today['mon'], 2, "0", STR_PAD_LEFT)."-01";
// $query_avail = "SELECT account FROM BCBBO_availability WHERE (date >= '".$current_month."' and account = '".$account."') LIMIT 0,5";
// dbconnect();
// $result_avail = mysql_query($query_avail);
// echo mysql_error();
// if availability info exists and account active, print link to availability
// if (mysql_num_rows($result_avail) > 0 && $availability == '1' && substr($account, 0, 1) != "7") {
if ($availability == '1' && substr($account, 0, 1) != "7") {
$data .= ("".$a1."");
} else {
$data .= $a0;
}
// Email icon
if ($email != "" && (strstr($options, "a") || strstr($options, "b") || strstr($options, "c"))) {
$data .= "".$e1."";
$no_phone_data .= "".$e1."";
} else {
$data .= $e0;
$no_phone_data .= $e0;
}
// Website Icon
if ($url != "" && (strstr($options, "a") || strstr($options, "b") || strstr($options, "c"))) {
$data .= "".$w1."";
$no_phone_data .= "".$w1."";
} else {
$data .= $w0;
$no_phone_data .= $w0;
}
// B&B Facilities icon
if (strstr($bbtype, "1")) {
$data .= $bb1;
} else {
$data .= $bb0;
}
// Extended Stay Facilities icon
if (strstr($bbtype, "2")) {
$data .= $es1;
} else {
$data .= $es0;
}
// Display Ad / Website Link
if (strstr($options, "c")) {
$data .= (" ".$bbname."");
} else if ((strstr($options, "a") || strstr($options, "b")) && $url != "") {
$data .= " ".$bbname."";
} else {
$data .= $bbname;
}
// print B&B, which is first item in row
if (strstr($options, "a") || strstr($options, "b") || strstr($options, "c")) {
$subscriber_results .= ("".print_result_cell(45,255,255,(235 + (20 * ($x_sub % 2))),$data));
} else {
$free_results .= (" ".print_result_cell(45,255,255,(235 + (20 * ($x_free % 2))),$data));
}
// print city
$seconds = intval(sqrt(pow(abs(dms_to_seconds($bblat2)-dms_to_seconds($bblat)),2) + pow(abs(dms_to_seconds($bblong2)-dms_to_seconds($bblong)),2)));
$dist = sec_to_dist($seconds);
// Remove mapquest
// $tempcode = preg_replace("/ /", "+", $postalcode);
// $tempcity = preg_replace("/ /", "+", $city);
$tempcity = preg_replace("/'/", "~", $city);
$tempcode = $postalcode;
if (substr($account,0,1) == "7" || $options == "") { $tempcode = ""; }
// if ($tempcode != "") { $tempcity = ""; }
$data = " ";
if ($dist == 0) {
$data .= "".$city.", B.C. (".$dist."km)";
} else {
$data .= $city.", B.C. (".$dist."km)";
}
if (strstr($options, "a") || strstr($options, "b") || strstr($options, "c")) {
$subscriber_results .= print_result_cell(26,255,255,(235 + (20 * ($x_sub % 2))),$data);
} else {
$free_results .= print_result_cell(26,255,255,(235 + (20 * ($x_free % 2))),$data);
}
// print phone. print the toll free number if it exists. Otherwise print the phone number.
if (strstr($options, "a") || strstr($options, "b") || strstr($options, "c")) {
if ($tollfree != "") { $phone = $tollfree; }
if ($phone != "") {
$subscriber_results .= print_result_cell(15,255,255,(235 + (20 * ($x_sub % 2))),$phone);
} else {
$subscriber_results .= print_result_cell(15,255,255,(235 + (20 * ($x_sub % 2))),$no_phone_data);
}
} else {
$free_results .= print_result_cell(15,255,255,(235 + (20 * ($x_free % 2))),$phone);
}
// print rates, which is last item in row
if ($ratefrom == "" || empty($options)) {
$data = "Call for Rates";
} else if ($ratefrom == "0") {
$data = "Special Rates";
} else {
$data = "$".$ratefrom;
if ($rateto != "0") {
$data .= (" - $".$rateto);
}
}
if (strstr($options, "a") || strstr($options, "b") || strstr($options, "c")) {
$subscriber_results .= (print_result_cell(13,255,255,(235 + (20 * ($x_sub % 2))),$data)." ");
$x_sub++;
} else {
$free_results .= (print_result_cell(13,255,255,(235 + (20 * ($x_free % 2))),$data)."");
$x_free++;
}
$x++;
} // endwhile
mysql_free_result($result);
// print subscriber results, then free results
echo $subscriber_results;
echo print_google_cell();
echo $free_results;
?> // Close If one or more results, print table
}
?> | // Close search results, region results
} else if ($region != "") {
?>Search for British Columbia Bed & BreakfastsBelow you will find the cities that fall within the // print region
if ($region == "the-islands" ) {
echo "The Islands";
} elseif ($region == "southwestern-bc-sunshine-coast" ) {
echo "Southwestern BC Sunshine Coast";
} elseif ($region == "thompson-okanagan" ) {
echo "Thompson Okanagan";
} elseif ($region == "bc-rockies" ) {
echo "BC Rockies";
} elseif ($region == "cariboo-country" ) {
echo "Cariboo Country";
} elseif ($region == "northern-bc" ) {
echo "Northern BC";
}
?> region of British Columbia. The icon ‘’ denotes confirmed B&Bs with enhanced detail listings in the area. If this icon is ghosted, B&Bs may still exist in the area, but with limited data. Search again. // Print out relevant cities
$x = 0;
$unique = ":";
$d1 = "";
$d0 = "";
if ($region == "the-islands" ) {
$query = "SELECT city, postalcode FROM BCBBO_listings WHERE ((account regexp '^(1|X1)' or (bblat >= 480000 and bblat <= 510000 and bblong >= 1230000 and bblong <= 1283000)) and active = '1' and account not regexp '^(2|3|4|5|6|7|X2|X3|X4|X5|X6)') ORDER BY city ASC";
} elseif ($region == "southwestern-bc-sunshine-coast" ) {
$query = "SELECT city, postalcode FROM BCBBO_listings WHERE ((account regexp '^(2|X2)' or (bblat >= 480000 and bblat <= 510000 and bblong >= 1200000 and bblong <= 1253000)) and active = '1' and account not regexp '^(1|3|4|5|6|7|X1|X3|X4|X5|X6)') ORDER BY city ASC";
} elseif ($region == "thompson-okanagan" ) {
$query = "SELECT city, postalcode FROM BCBBO_listings WHERE ((account regexp '^(3|X3)' or (bblat >= 490000 and bblat <= 540000 and bblong >= 1170000 and bblong <= 1220000)) and active = '1' and account not regexp '^(1|2|4|5|6|7|X1|X2|X4|X5|X6)') ORDER BY city ASC";
} elseif ($region == "bc-rockies" ) {
$query = "SELECT city, postalcode FROM BCBBO_listings WHERE ((account regexp '^(4|X4)' or (bblat >= 490000 and bblat <= 530000 and bblong >= 1140000 and bblong <= 1190000)) and active = '1' and account not regexp '^(1|2|3|5|6|7|X1|X2|X3|X5|X6)') ORDER BY city ASC";
} elseif ($region == "cariboo-country" ) {
$query = "SELECT city, postalcode FROM BCBBO_listings WHERE ((account regexp '^(5|X5)' or (bblat >= 503000 and bblat <= 534000 and bblong >= 1200000 and bblong <= 1313000)) and active = '1' and account not regexp '^(1|2|3|4|6|7|X1|X2|X3|X4|X6)') ORDER BY city ASC";
} elseif ($region == "northern-bc" ) {
$query = "SELECT city, postalcode FROM BCBBO_listings WHERE ((account regexp '^(6|X6)' or (bblat >= 520000 and bblat <= 600000 and bblong >= 1190000 and bblong <= 1370000)) and active = '1' and account not regexp '^(1|2|3|4|5|7|X1|X2|X3|X4|X5)') ORDER BY city ASC";
}
dbconnect();
$result = mysql_query($query);
echo mysql_error();
while (list($city, $postalcode) = mysql_fetch_array($result)) {
if (!strstr($unique, (":".$city.":")) && $city != "Zippy") {
if ($x % 4 == 0) { echo ""; }
// Remove MapQuest
// $tempcode = preg_replace("/ /", "+", $postalcode);
// $tempcity = preg_replace("/ /", "+", $city);
$tempcity = preg_replace("/'/", "~", $city);
// $tempcode = $postalcode;
// if ($tempcode != "") {
// $tempcity = "";
$data = $d1." ";
// } else {
// $data = $d0." ";
// }
$data .= "".$city."";
echo print_result_cell("25", 255, 255, 204, $data);
$x++;
$unique .= ($city.":");
if ($x % 4 == 0) { echo " "; }
}
}
mysql_free_result($result);
?> | | | | | // Close region results, city region results
} else if ($regioncity != "") {
?> // Query Database and get search results
// Get city, and strip off the "-BC" at the end (if it exists), then change remaining "-" to " "
$city = preg_replace("/-BC/", "", $regioncity);
$city = preg_replace("/-/", " ", $city);
// Get Latitude and Longitude for selected city
$query = "SELECT latitude, longitude from BCBBO_latlong WHERE city='".prepToSQL($city)."'";
dbconnect();
$resultLL = mysql_query($query);
echo mysql_error();
$sqldata = mysql_fetch_array($resultLL);
$bblat = $sqldata[latitude];
$bblong = $sqldata[longitude];
mysql_free_result($resultLL);
// For city searches, set search radius to 40km
$search_radius = 1296;
$bblat_sec = dms_to_seconds($bblat);
$bblong_sec = dms_to_seconds($bblong);
$lat_min = seconds_to_dms( $bblat_sec - $search_radius );
$lat_max = seconds_to_dms( $bblat_sec + $search_radius );
$long_min = seconds_to_dms( $bblong_sec - $search_radius );
$long_max = seconds_to_dms( $bblong_sec + $search_radius );
$query = "SELECT account, options, bbtype, bbname, postalcode, bblat, bblong, city, phone, fax, tollfree, email, url, ratefrom, rateto, availability, certified FROM BCBBO_listings WHERE ";
$query .= ("((bblat >= ".$lat_min." and bblat <= ".$lat_max." and bblong >= ".$long_min." and bblong <= ".$long_max.") or ");
$query .= "account like '7%' or LEFT(account,1) = LEFT(certified,1)) and active = '1'";
$query .= " ORDER BY SQRT(POW((LEFT(bblat, LENGTH(bblat) - 4) * 3600) + (SUBSTRING(bblat, LENGTH(bblat) - 3, 2) * 60) + (RIGHT(bblat, 2)) - ".$bblat_sec.",2) + POW((LEFT(bblong, LENGTH(bblong) - 4) * 3600) + (SUBSTRING(bblong, LENGTH(bblong) - 3, 2) * 60) + (RIGHT(bblong,2)) - ".$bblong_sec.",2)) ASC, (if(options like '%a%',30,0) + if(options like '%b1%',40,0) + if(options like '%b2%',72,0) + if(options like '%b3%',125,0) + if(options like '%c%',45,0)) DESC, city ASC, (if(LOWER(bbname) regexp '^(a |aa |aaa |an |at |the )',(right(bbname,character_length(bbname) - locate(' ',bbname))),bbname)) ASC";
dbconnect();
$result = mysql_query($query);
echo mysql_error();
?>
Search for British Columbia Bed & BreakfastsThere were // number of results
$total = mysql_num_rows($result)-1;
echo "".$total." matches";
?> to your selected city. // only first 200
if ($total > 200) {
echo "Only the first 200 results are listed. Please refine your search criteria and search again. ";
}
?>The approximate distance (as the crow flies) to // Town name
echo "".$city.", B.C.,";
?> from other populated areas within your search proximity are shown after each city name in the search results. If your search city has been included in the search results, it is emphasized for your convenience. Search again. // If one or more results, print table
if (mysql_num_rows($result) != 0) {
?> Bed & Breakfast Name | City | Phone Number | Price Range | // Query the database and print results.
$x = 0;
$x_sub = 0;
$x_free = 0;
$bbassoc_city = $city;
$bbassoc_lat = $bblat;
$bbassoc_long = $bblong;
$subscriber_results = "";
$free_results = "";
$bbarea = "0";
// Link Icons
$a1 = "";
$a0 = "";
$d1 = "";
$d0 = "";
$e1 = "";
$e0 = "";
$w1 = "";
$w0 = "";
$bb1 = "";
$bb0 = "";
$es1 = "";
$es0 = "";
while ( (list($account, $options, $bbtype, $bbname, $postalcode, $bblat2, $bblong2, $city, $phone, $fax, $tollfree, $email, $url, $ratefrom, $rateto, $availability, $certified) = mysql_fetch_array($result)) && $x < 200) {
// Get B&B area
if ($bbarea == "0" && substr($account,0,1) != "7" && !strstr($certified, "bbassoc")) { $bbarea = substr($account,0,1); }
// check to see if it is a B&B association page within the right area. If not, skip this loop.
if (strstr($certified, "bbassoc") && substr($certified,0,1) != $bbarea && substr($account,0,1) != "7") { continue; }
// if it's an association, change the city.
if (substr($account,0,1) == "7" || (substr($certified,0,1) == $bbarea && strstr($certified, "bbassoc"))) {
$city = $bbassoc_city;
$bblat2 = $bbassoc_lat;
$bblong2 = $bbassoc_long;
}
$data = "";
$no_phone_data = "";
// Display Ad icon
if (strstr($options, "c")) {
$data .= ("".$d1."");
$no_phone_data .= ("".$d1."");
} else {
$data .= $d0;
$no_phone_data .= $d0;
}
// availability icon
// Commented out by Lee, Feb 25/05 - Force Availability on even if no data.
// $today = getdate();
// $current_month = $today['year']."-".str_pad($today['mon'], 2, "0", STR_PAD_LEFT)."-01";
// $query_avail = "SELECT account FROM BCBBO_availability WHERE (date >= '".$current_month."' and account = '".$account."') LIMIT 0,5";
// dbconnect();
// $result_avail = mysql_query($query_avail);
// echo mysql_error();
// if availability info exists and account active, print link to availability
// if (mysql_num_rows($result_avail) > 0 && $availability == '1' && substr($account, 0, 1) != "7") {
if ($availability == '1' && substr($account, 0, 1) != "7") {
$data .= ("".$a1."");
} else {
$data .= $a0;
}
// Email icon
if ($email != "" && (strstr($options, "a") || strstr($options, "b") || strstr($options, "c"))) {
$data .= "".$e1."";
$no_phone_data .= "".$e1."";
} else {
$data .= $e0;
$no_phone_data .= $e0;
}
// Website Icon
if ($url != "" && (strstr($options, "a") || strstr($options, "b") || strstr($options, "c"))) {
$data .= "".$w1."";
$no_phone_data .= "".$w1."";
} else {
$data .= $w0;
$no_phone_data .= $w0;
}
// B&B Facilities icon
if (strstr($bbtype, "1")) {
$data .= $bb1;
} else {
$data .= $bb0;
}
// Extended Stay Facilities icon
if (strstr($bbtype, "2")) {
$data .= $es1;
} else {
$data .= $es0;
}
// Display Ad / Website Link
if (strstr($options, "c")) {
$data .= (" ".$bbname."");
} else if ((strstr($options, "a") || strstr($options, "b")) && $url != "") {
$data .= " ".$bbname."";
} else {
$data .= $bbname;
}
// print B&B, which is first item in row
if (strstr($options, "a") || strstr($options, "b") || strstr($options, "c")) {
$subscriber_results .= ("".print_result_cell(45,255,255,(235 + (20 * ($x_sub % 2))),$data));
} else {
$free_results .= (" ".print_result_cell(45,255,255,(235 + (20 * ($x_free % 2))),$data));
}
// print city
$seconds = intval(sqrt(pow(abs(dms_to_seconds($bblat2)-dms_to_seconds($bblat)),2) + pow(abs(dms_to_seconds($bblong2)-dms_to_seconds($bblong)),2)));
$dist = sec_to_dist($seconds);
// Remove mapquest
// $tempcode = preg_replace("/ /", "+", $postalcode);
// $tempcity = preg_replace("/ /", "+", $city);
$tempcity = preg_replace("/'/", "~", $city);
$tempcode = $postalcode;
if (substr($account,0,1) == "7" || $options == "") { $tempcode = ""; }
// if ($tempcode != "") { $tempcity = ""; }
$data = " ";
if ($dist == 0) {
$data .= "".$city.", B.C. (".$dist."km)";
} else {
$data .= $city.", B.C. (".$dist."km)";
}
if (strstr($options, "a") || strstr($options, "b") || strstr($options, "c")) {
$subscriber_results .= print_result_cell(26,255,255,(235 + (20 * ($x_sub % 2))),$data);
} else {
$free_results .= print_result_cell(26,255,255,(235 + (20 * ($x_free % 2))),$data);
}
// print phone. print the toll free number if it exists. Otherwise print the phone number.
if (strstr($options, "a") || strstr($options, "b") || strstr($options, "c")) {
if ($tollfree != "") { $phone = $tollfree; }
if ($phone != "") {
$subscriber_results .= print_result_cell(15,255,255,(235 + (20 * ($x_sub % 2))),$phone);
} else {
$subscriber_results .= print_result_cell(15,255,255,(235 + (20 * ($x_sub % 2))),$no_phone_data);
}
} else {
$free_results .= print_result_cell(15,255,255,(235 + (20 * ($x_free % 2))),$phone);
}
// print rates, which is last item in row
if ($ratefrom == "" || empty($options)) {
$data = "Call for Rates";
} else if ($ratefrom == "0") {
$data = "Special Rates";
} else {
$data = "$".$ratefrom;
if ($rateto != "0") {
$data .= (" - $".$rateto);
}
}
if (strstr($options, "a") || strstr($options, "b") || strstr($options, "c")) {
$subscriber_results .= (print_result_cell(13,255,255,(235 + (20 * ($x_sub % 2))),$data)." ");
$x_sub++;
} else {
$free_results .= (print_result_cell(13,255,255,(235 + (20 * ($x_free % 2))),$data)."");
$x_free++;
}
$x++;
} // endwhile
mysql_free_result($result);
// print subscriber results, then free results
echo $subscriber_results;
echo print_google_cell();
echo $free_results;
?>
// Close If one or more results, print table
}
?> | // Close city region results
}
?> |