HOME || LOGIN    
Search Criteria for URC Listings
Price From: Price To: City: Zip Code:    
United Realty Center Online: Listings
agentid; $first_name = $row_agent->first_name; $last_name = $row_agent->last_name; $mobile_number = $row_agent->mobile_number; $fax_number = $row_agent->fax_number; $office_number = $row_agent->office_number; $agent_email_address = $row_agent->email_address; $pic_on_file = $row_agent->pic_on_file; print "
$first_name $last_name
"; if ($pic_on_file == "YES" ) { print ""; } else { print ""; } print " Real Estate Agent: $first_name $last_name
$agent_email_address

Mobile Phone: $mobile_number
Office Phone: $office_number
Fax Number: $fax_number

:: View My Listings ::

"; // GATHER THE AGENTS LISTINGS $sql = mysql_query("SELECT * FROM office_listings WHERE listing_agent='$agentid' ORDER BY listing_price"); $total_rows = mysql_result(mysql_query("SELECT COUNT(mls_number) FROM office_listings WHERE listing_agent='$agentid'"),0); /************************************************ * use a fieldset for each individual listing * with a table within the fieldset for structure ************************************************/ print " "; $i = 1; $color1 = "#990000"; $color2 = "#333399"; $row_count = 0; while ($row = mysql_fetch_object($sql)) { $row_color = ($row_count % 2) ? $color1 : $color2; $mls_number = $row->mls_number; $mls_number = strtoupper($mls_number); $image_file = $mls_number."_000.jpg"; $main_image = ""; $map_address = strtoupper(str_replace(" ","+",$row->street_address)); $map_city = strtoupper(str_replace(" ","+",$row->city)); $title="$row->listing_title"; $open_house = $row->open_house; $listing_images = $row->listing_images; // IF NO IMAGES, SHOW THE PICTURES COMING SOON IMAGE if ($listing_images==0) { $main_image = ""; } // IF THE PROPERTY IS SOLD SHOW THE SOLD IMAGE SPASH, OTHER SHOW ALL DETAILS if ($row->status=="SOLD") { $description = "
"; } else { $description = $row->description; // PUT A MAX CHARACTERS ON THE DESCRIPTION SO IT WILL FIT PROPERLY $max_count = 210; $str_to_count = html_entity_decode($description); if (strlen($str_to_count) <= $max_count) { $description = $description; } else { $description = substr($str_to_count, 0, $max_count - 3); $description .= "..."; $description = htmlentities($description); } $description = strtoupper($description); } if ($open_house <> "") { $new_table = " "; $row_count++; $i++; } print " "; } elseif (isset($search)) { /************************************************************************************* * The search variable indicates a search has been conducted and now run a series of * criteria scripts to see how the listings will be queried. If no matches, display a * notice to the user, otherwise show all matches *************************************************************************************/ $search = @$_POST['search']; $criteria = ""; $c_count = 0; $zipcode = @$_POST['zipcode']; if ($zipcode=="") { $criteria .= ""; } else { $zipcode = $zipcode{0}.$zipcode{1}.$zipcode{2}.$zipcode{3}; $criteria .= "zip_code LIKE '$zipcode%'"; $c_count++; } $city = @$_POST['city']; if ($city=="") { $criteria .= ""; } else { if ($c_count>0) { $criteria .= " AND "; } $criteria .= "city = '$city'"; $c_count++; } $price_low = @$_POST['price_low']; $price_low = stripslashes($price_low); $price_low = str_replace(",","",$price_low); $price_low = str_replace("$","",$price_low); if ($price_low==0) { $criteria .= ""; } else { if ($c_count>0) {$criteria .= " AND ";} $criteria .= "listing_price >= '$price_low'"; $c_count++; } $price_high = @$_POST['price_high']; $price_high = stripslashes($price_high); $price_high = str_replace(",","",$price_high); $price_high = str_replace("$","",$price_high); if ($price_high>950000) { $criteria .= ""; } else { if ($c_count>0) {$criteria .= " AND ";} $criteria .= "listing_price <= '$price_high'"; $c_count++; } // MYSQL QUERY USING THE CRITERIA FROM SEARCH OPTION include 'db.php'; $sql = mysql_query("SELECT * FROM office_listings WHERE $criteria ORDER BY listing_price"); $total_rows = mysql_result(mysql_query("SELECT COUNT(mls_number) FROM office_listings WHERE $criteria"),0); /************************************************ * use a fieldset for each individual listing * with a table within the fieldset for structure ************************************************/ print "
Results Found: $total_rows total listings

    $row->street_address
    $row->city, CA $row->zip_code
    zip_code."\" target=\"_getmap\">Get Map
    MLS No.: $mls_number

Bedrooms: $row->bedrooms
Bathrooms: $row->bathrooms
Square Ft: $row->build_area
Year Built: $row->year_built
"; } // FORMAT THE PRICE $listing_price = $row->listing_price; $listing_price = number_format($listing_price); print "
$title
$row->city, CA : : MORE DETAILS : :      
$main_image "; if ($open_house <> "") { print "$new_table"; } else { print " "; } print "
     \$$listing_price $row->status     

    $row->street_address

Bedrooms: $row->bedrooms
    $row->city, CA $row->zip_code Bathrooms: $row->bathrooms
    zip_code."\" target=\"_getmap\">Get Map Square Ft: $row->build_area
    MLS No.: $mls_number Year Built: $row->year_built

$description
Results Found: $total_rows total listings
"; $i = 1; $color1 = "#990000"; $color2 = "#333399"; $row_count = 0; while ($row = mysql_fetch_object($sql)) { $row_color = ($row_count % 2) ? $color1 : $color2; $mls_number = $row->mls_number; $mls_number = strtoupper($mls_number); $image_file = $mls_number."_000.jpg"; $main_image = ""; $map_address = strtoupper(str_replace(" ","+",$row->street_address)); $map_city = strtoupper(str_replace(" ","+",$row->city)); $title="$row->listing_title"; $open_house = $row->open_house; $listing_images = $row->listing_images; // IF NO IMAGES, SHOW THE PICTURES COMING SOON IMAGE if ($listing_images==0) { $main_image = ""; } // IF THE PROPERTY IS SOLD SHOW THE SOLD IMAGE SPASH, OTHER SHOW ALL DETAILS if ($row->status=="SOLD") { $description = "
"; } else { $description = $row->description; // PUT A MAX CHARACTERS ON THE DESCRIPTION SO IT WILL FIT PROPERLY $max_count = 210; $str_to_count = html_entity_decode($description); if (strlen($str_to_count) <= $max_count) { $description = $description; } else { $description = substr($str_to_count, 0, $max_count - 3); $description .= "..."; $description = htmlentities($description); } $description = strtoupper($description); } if ($open_house <> "") { $new_table = " "; $row_count++; $i++; } print " "; } else { // NO SEARCH CONDUCTED /************************************************************************************** * Create a script to count how many total listing are in the office listings table and * separate the viewable results in groups of seven, with next and previous links using * a url variable (ref) to determine to start count of each and the start query for the * mysql query. Each mysql query will have a limit of 7. **************************************************************************************/ include 'db.php'; $total_rows = mysql_result(mysql_query("SELECT COUNT(mls_number) FROM office_listings"),0); $total_pages = $total_rows / 7; if ((@$ref < 7) || (!$ref)) { $start = 0; } else { $start = $ref; } $page_links = ""; if ($start > 0) { $previous_ref = $start - 7; $page_links = "Previous"; $next_ref = $start + 7; if ($next_ref < $total_rows) { $page_links .= " || Next"; } } else { $next_ref = $start + 7; $page_links .= "Next"; } /***************************************** * run query according to previous results *****************************************/ $sql = mysql_query("SELECT * FROM office_listings ORDER BY listing_price LIMIT $start, 7"); /************************************************ * use a fieldset for each individual listing * with a table within the fieldset for structure ************************************************/ print "
Results Found: $total_rows total listings

    $row->street_address
    $row->city, CA $row->zip_code
    zip_code."\" target=\"_getmap\">Get Map
    MLS No.: $mls_number

Bedrooms: $row->bedrooms
Bathrooms: $row->bathrooms
Square Ft: $row->build_area
Year Built: $row->year_built
"; } // FORMAT THE PRICE $listing_price = $row->listing_price; $listing_price = number_format($listing_price); print "
$title
$row->city, CA : : MORE DETAILS : :      
$main_image "; if ($open_house <> "") { print "$new_table"; } else { print " "; } print "
     \$$listing_price $row->status     

    $row->street_address

Bedrooms: $row->bedrooms
    $row->city, CA $row->zip_code Bathrooms: $row->bathrooms
    zip_code."\" target=\"_getmap\">Get Map Square Ft: $row->build_area
    MLS No.: $mls_number Year Built: $row->year_built

$description
Results Found: $total_rows total listings
"; $i = 1; $color1 = "#990000"; $color2 = "#333399"; $row_count = 0; while ($row = mysql_fetch_object($sql)) { $row_color = ($row_count % 2) ? $color1 : $color2; $mls_number = $row->mls_number; $mls_number = strtoupper($mls_number); $image_file = $mls_number."_000.jpg"; $main_image = ""; $map_address = strtoupper(str_replace(" ","+",$row->street_address)); $map_city = strtoupper(str_replace(" ","+",$row->city)); $title="$row->listing_title"; $open_house = $row->open_house; $listing_images = $row->listing_images; // IF NO IMAGES, SHOW THE PICTURES COMING SOON IMAGE if ($listing_images==0) { $main_image = ""; } // IF THE PROPERTY IS SOLD SHOW THE SOLD IMAGE SPASH, OTHER SHOW ALL DETAILS if ($row->status=="SOLD") { $description = "
"; } else { $description = $row->description; // PUT A MAX CHARACTERS ON THE DESCRIPTION SO IT WILL FIT PROPERLY $max_count = 210; $str_to_count = html_entity_decode($description); if (strlen($str_to_count) <= $max_count) { $description = $description; } else { $description = substr($str_to_count, 0, $max_count - 3); $description .= "..."; $description = htmlentities($description); } $description = strtoupper($description); } if ($open_house <> "") { $new_table = " "; $row_count++; $i++; } print " "; } // END ELSE FOR SEARCH OPTION ?>
$total_rows total listings | $page_links

    $row->street_address
    $row->city, CA $row->zip_code
    zip_code."\" target=\"_getmap\">Get Map
    MLS No.: $mls_number

Bedrooms: $row->bedrooms
Bathrooms: $row->bathrooms
Square Ft: $row->build_area
Year Built: $row->year_built
"; } // FORMAT THE PRICE $listing_price = $row->listing_price; $listing_price = number_format($listing_price); print "
$title
$row->city, CA : : MORE DETAILS : :      
$main_image "; if ($open_house <> "") { print "$new_table"; } else { print " "; } print "
     \$$listing_price $row->status     

    $row->street_address

Bedrooms: $row->bedrooms
    $row->city, CA $row->zip_code Bathrooms: $row->bathrooms
    zip_code."\" target=\"_getmap\">Get Map Square Ft: $row->build_area
    MLS No.: $mls_number Year Built: $row->year_built

$description
$total_rows total listings | $page_links
URC Home | Buying | Selling | Financing | Contact Us
General Contact: Info@UnitedRealtyCenter.com
United Realty Center, Inc. is an Equal Housing Lender