Exemplo n.º 1
0
    } else {
        $sql .= ' and garage_typeid=0';
    }
    if ($_POST['subdivsearch'] != 0) {
        $sql .= ' and subdivision=' . $_POST['subdivsearch'];
    }
    $price = breakup($_POST['pricesearch']);
    if ($price[0] == '') {
        $price[1] = $price[1] * 1000;
        $sql .= ' and listing_price>=' . $price[1];
    } else {
        $price[1] = $price[1] * 1000;
        $price[0] = $price[0] * 1000;
        $sql .= ' and listing_price between ' . $price[0] . ' and ' . $price[1];
    }
    $age = breakup($_POST['agesearch']);
    if ($age[0] == '') {
        $sql .= ' and building_age>=' . $age[1];
    } else {
        $sql .= ' and building_age between ' . $age[0] . ' and ' . $age[1];
    }
    if ($_POST['sizeone'] == '') {
        $sql .= ' and square_footage<=' . $_POST['sizetwo'];
    } else {
        $sql .= ' and square_footage between ' . $_POST['sizeone'] . ' and ' . $_POST['sizetwo'];
    }
    $sql .= ' and subdivision=ts.id';
    $res = mysql_query($sql);
}
?>
Exemplo n.º 2
0
} else {
    if ($listing_type == 'Residential') {
        $sqlend = appendSQL($sqlend, 'listing_typeid=1');
        if ($baths != 'any') {
            $sqlend = appendSQL($sqlend, ' (full_baths+half_baths)>=' . $baths);
        }
        if ($beds != 'any') {
            $sqlend = appendSQL($sqlend, ' (beds_up+beds_down)>=' . $beds);
        }
        if ($garage == 'yes') {
            $sqlend = appendSQL($sqlend, ' garage_typeid>0');
        } else {
            $sqlend = appendSQL($sqlend, 'garage_typeid=0');
        }
        if ($age != 'any') {
            $age = breakup($age);
            if ($age[0] == '') {
                $sqlend = appendSQL($sqlend, 'building_age>=' . $age[1]);
            } else {
                $sqlend = appendSQL($sqlend, 'building_age between ' . $age[0] . ' and ' . $age[1]);
            }
        }
        $pcompare = "listing_price";
        $pricef = $price_from * 1000;
        $pricet = $price_to * 1000;
    }
    if ($sdivision != '' && $sdivision != '0') {
        $div = explode('-', $sdivision);
        if (count($div) > 0) {
            $sqlend = appendSQL($sqlend, 'subdivision in (' . implode(',', $div) . ')');
        }